8265783: Create a separate library for x86 Intel SVML assembly intrinsics

Co-authored-by: Sandhya Viswanathan <sviswanathan@openjdk.org>
Co-authored-by: Rahul Kandu <rkandu@openjdk.org>
Co-authored-by: Razvan Lupusoru <rlupusoru@openjdk.org>
Co-authored-by: Magnus Ihse Bursie <ihse@openjdk.org>
Co-authored-by: Jie Fu <jiefu@openjdk.org>
Co-authored-by: Ahmet Akkas <ahmet.akkas@intel.com>
Co-authored-by: Marius Cornea <marius.cornea@intel.com>
Reviewed-by: erikj, kvn, psandoz
This commit is contained in:
Sandhya Viswanathan 2021-06-03 20:03:36 +00:00
parent e27c4d463d
commit 9f05c411e6
119 changed files with 415947 additions and 185 deletions

View file

@ -0,0 +1,38 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* 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 file is used to provide some global declarations related to building
// VM with Vector API support. Also, the reason the file is separated is because
// the intent of this file to provide a header that can be included in .s files.
#ifndef OS_CPU_LINUX_X86_GLOBALS_VECTORAPISUPPORT_LINUX_HPP
#define OS_CPU_LINUX_X86_GLOBALS_VECTORAPISUPPORT_LINUX_HPP
// GCC 4.9+ can build all .s files for Linux
#if defined(_LP64) && (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9))))
#define __VECTOR_API_MATH_INTRINSICS_LINUX
#endif
#endif //OS_CPU_LINUX_X86_GLOBALS_VECTORAPISUPPORT_LINUX_HPP

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -535,37 +535,6 @@ public abstract class DoubleVector extends AbstractVector<Double> {
if (op == ZOMO) {
return blend(broadcast(-1), compare(NE, 0));
}
if (op == SIN) {
return uOp((i, a) -> (double) Math.sin(a));
} else if (op == COS) {
return uOp((i, a) -> (double) Math.cos(a));
} else if (op == TAN) {
return uOp((i, a) -> (double) Math.tan(a));
} else if (op == ASIN) {
return uOp((i, a) -> (double) Math.asin(a));
} else if (op == ACOS) {
return uOp((i, a) -> (double) Math.acos(a));
} else if (op == ATAN) {
return uOp((i, a) -> (double) Math.atan(a));
} else if (op == EXP) {
return uOp((i, a) -> (double) Math.exp(a));
} else if (op == LOG) {
return uOp((i, a) -> (double) Math.log(a));
} else if (op == LOG10) {
return uOp((i, a) -> (double) Math.log10(a));
} else if (op == CBRT) {
return uOp((i, a) -> (double) Math.cbrt(a));
} else if (op == SINH) {
return uOp((i, a) -> (double) Math.sinh(a));
} else if (op == COSH) {
return uOp((i, a) -> (double) Math.cosh(a));
} else if (op == TANH) {
return uOp((i, a) -> (double) Math.tanh(a));
} else if (op == EXPM1) {
return uOp((i, a) -> (double) Math.expm1(a));
} else if (op == LOG1P) {
return uOp((i, a) -> (double) Math.log1p(a));
}
}
int opc = opCode(op);
return VectorSupport.unaryOp(
@ -577,8 +546,38 @@ public abstract class DoubleVector extends AbstractVector<Double> {
v0.uOp((i, a) -> (double) -a);
case VECTOR_OP_ABS: return v0 ->
v0.uOp((i, a) -> (double) Math.abs(a));
case VECTOR_OP_SIN: return v0 ->
v0.uOp((i, a) -> (double) Math.sin(a));
case VECTOR_OP_COS: return v0 ->
v0.uOp((i, a) -> (double) Math.cos(a));
case VECTOR_OP_TAN: return v0 ->
v0.uOp((i, a) -> (double) Math.tan(a));
case VECTOR_OP_ASIN: return v0 ->
v0.uOp((i, a) -> (double) Math.asin(a));
case VECTOR_OP_ACOS: return v0 ->
v0.uOp((i, a) -> (double) Math.acos(a));
case VECTOR_OP_ATAN: return v0 ->
v0.uOp((i, a) -> (double) Math.atan(a));
case VECTOR_OP_EXP: return v0 ->
v0.uOp((i, a) -> (double) Math.exp(a));
case VECTOR_OP_LOG: return v0 ->
v0.uOp((i, a) -> (double) Math.log(a));
case VECTOR_OP_LOG10: return v0 ->
v0.uOp((i, a) -> (double) Math.log10(a));
case VECTOR_OP_SQRT: return v0 ->
v0.uOp((i, a) -> (double) Math.sqrt(a));
case VECTOR_OP_CBRT: return v0 ->
v0.uOp((i, a) -> (double) Math.cbrt(a));
case VECTOR_OP_SINH: return v0 ->
v0.uOp((i, a) -> (double) Math.sinh(a));
case VECTOR_OP_COSH: return v0 ->
v0.uOp((i, a) -> (double) Math.cosh(a));
case VECTOR_OP_TANH: return v0 ->
v0.uOp((i, a) -> (double) Math.tanh(a));
case VECTOR_OP_EXPM1: return v0 ->
v0.uOp((i, a) -> (double) Math.expm1(a));
case VECTOR_OP_LOG1P: return v0 ->
v0.uOp((i, a) -> (double) Math.log1p(a));
default: return null;
}}));
}
@ -625,13 +624,6 @@ public abstract class DoubleVector extends AbstractVector<Double> {
.lanewise(op, that.viewAsIntegralLanes())
.viewAsFloatingLanes();
}
if (op == ATAN2) {
return bOp(that, (i, a, b) -> (double) Math.atan2(a, b));
} else if (op == POW) {
return bOp(that, (i, a, b) -> (double) Math.pow(a, b));
} else if (op == HYPOT) {
return bOp(that, (i, a, b) -> (double) Math.hypot(a, b));
}
}
int opc = opCode(op);
return VectorSupport.binaryOp(
@ -651,6 +643,12 @@ public abstract class DoubleVector extends AbstractVector<Double> {
v0.bOp(v1, (i, a, b) -> (double)Math.max(a, b));
case VECTOR_OP_MIN: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (double)Math.min(a, b));
case VECTOR_OP_ATAN2: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (double) Math.atan2(a, b));
case VECTOR_OP_POW: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (double) Math.pow(a, b));
case VECTOR_OP_HYPOT: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (double) Math.hypot(a, b));
default: return null;
}}));
}

View file

@ -535,37 +535,6 @@ public abstract class FloatVector extends AbstractVector<Float> {
if (op == ZOMO) {
return blend(broadcast(-1), compare(NE, 0));
}
if (op == SIN) {
return uOp((i, a) -> (float) Math.sin(a));
} else if (op == COS) {
return uOp((i, a) -> (float) Math.cos(a));
} else if (op == TAN) {
return uOp((i, a) -> (float) Math.tan(a));
} else if (op == ASIN) {
return uOp((i, a) -> (float) Math.asin(a));
} else if (op == ACOS) {
return uOp((i, a) -> (float) Math.acos(a));
} else if (op == ATAN) {
return uOp((i, a) -> (float) Math.atan(a));
} else if (op == EXP) {
return uOp((i, a) -> (float) Math.exp(a));
} else if (op == LOG) {
return uOp((i, a) -> (float) Math.log(a));
} else if (op == LOG10) {
return uOp((i, a) -> (float) Math.log10(a));
} else if (op == CBRT) {
return uOp((i, a) -> (float) Math.cbrt(a));
} else if (op == SINH) {
return uOp((i, a) -> (float) Math.sinh(a));
} else if (op == COSH) {
return uOp((i, a) -> (float) Math.cosh(a));
} else if (op == TANH) {
return uOp((i, a) -> (float) Math.tanh(a));
} else if (op == EXPM1) {
return uOp((i, a) -> (float) Math.expm1(a));
} else if (op == LOG1P) {
return uOp((i, a) -> (float) Math.log1p(a));
}
}
int opc = opCode(op);
return VectorSupport.unaryOp(
@ -577,8 +546,38 @@ public abstract class FloatVector extends AbstractVector<Float> {
v0.uOp((i, a) -> (float) -a);
case VECTOR_OP_ABS: return v0 ->
v0.uOp((i, a) -> (float) Math.abs(a));
case VECTOR_OP_SIN: return v0 ->
v0.uOp((i, a) -> (float) Math.sin(a));
case VECTOR_OP_COS: return v0 ->
v0.uOp((i, a) -> (float) Math.cos(a));
case VECTOR_OP_TAN: return v0 ->
v0.uOp((i, a) -> (float) Math.tan(a));
case VECTOR_OP_ASIN: return v0 ->
v0.uOp((i, a) -> (float) Math.asin(a));
case VECTOR_OP_ACOS: return v0 ->
v0.uOp((i, a) -> (float) Math.acos(a));
case VECTOR_OP_ATAN: return v0 ->
v0.uOp((i, a) -> (float) Math.atan(a));
case VECTOR_OP_EXP: return v0 ->
v0.uOp((i, a) -> (float) Math.exp(a));
case VECTOR_OP_LOG: return v0 ->
v0.uOp((i, a) -> (float) Math.log(a));
case VECTOR_OP_LOG10: return v0 ->
v0.uOp((i, a) -> (float) Math.log10(a));
case VECTOR_OP_SQRT: return v0 ->
v0.uOp((i, a) -> (float) Math.sqrt(a));
case VECTOR_OP_CBRT: return v0 ->
v0.uOp((i, a) -> (float) Math.cbrt(a));
case VECTOR_OP_SINH: return v0 ->
v0.uOp((i, a) -> (float) Math.sinh(a));
case VECTOR_OP_COSH: return v0 ->
v0.uOp((i, a) -> (float) Math.cosh(a));
case VECTOR_OP_TANH: return v0 ->
v0.uOp((i, a) -> (float) Math.tanh(a));
case VECTOR_OP_EXPM1: return v0 ->
v0.uOp((i, a) -> (float) Math.expm1(a));
case VECTOR_OP_LOG1P: return v0 ->
v0.uOp((i, a) -> (float) Math.log1p(a));
default: return null;
}}));
}
@ -625,13 +624,6 @@ public abstract class FloatVector extends AbstractVector<Float> {
.lanewise(op, that.viewAsIntegralLanes())
.viewAsFloatingLanes();
}
if (op == ATAN2) {
return bOp(that, (i, a, b) -> (float) Math.atan2(a, b));
} else if (op == POW) {
return bOp(that, (i, a, b) -> (float) Math.pow(a, b));
} else if (op == HYPOT) {
return bOp(that, (i, a, b) -> (float) Math.hypot(a, b));
}
}
int opc = opCode(op);
return VectorSupport.binaryOp(
@ -651,6 +643,12 @@ public abstract class FloatVector extends AbstractVector<Float> {
v0.bOp(v1, (i, a, b) -> (float)Math.max(a, b));
case VECTOR_OP_MIN: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float)Math.min(a, b));
case VECTOR_OP_ATAN2: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float) Math.atan2(a, b));
case VECTOR_OP_POW: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float) Math.pow(a, b));
case VECTOR_OP_HYPOT: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float) Math.hypot(a, b));
default: return null;
}}));
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -76,7 +76,7 @@ import jdk.internal.vm.vector.VectorSupport;
* <ul>
* <li>Lane-wise vector operations that apply to floating point vectors
* follow the accuracy and monotonicity specifications of the equivalent
* Java operation or method mentioned in its documentation.
* Java operation or method mentioned in its documentation unless specified otherwise.
* If the vector element type is {@code float} and the Java operation or
* method only accepts and returns {@code double} values, then the scalar operation
* on each lane is adapted to cast operands and the result, specifically widening
@ -451,40 +451,70 @@ public abstract class VectorOperators {
/** Produce {@code -a}. */
public static final Unary NEG = unary("NEG", "-a", VectorSupport.VECTOR_OP_NEG, VO_ALL|VO_SPECIAL);
/** Produce {@code sin(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary SIN = unary("SIN", "sin", -1 /*VectorSupport.VECTOR_OP_SIN*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code cos(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary COS = unary("COS", "cos", -1 /*VectorSupport.VECTOR_OP_COS*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code tan(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary TAN = unary("TAN", "tan", -1 /*VectorSupport.VECTOR_OP_TAN*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code asin(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary ASIN = unary("ASIN", "asin", -1 /*VectorSupport.VECTOR_OP_ASIN*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code acos(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary ACOS = unary("ACOS", "acos", -1 /*VectorSupport.VECTOR_OP_ACOS*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code atan(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary ATAN = unary("ATAN", "atan", -1 /*VectorSupport.VECTOR_OP_ATAN*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code sin(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary SIN = unary("SIN", "sin", VectorSupport.VECTOR_OP_SIN, VO_ONLYFP);
/** Produce {@code cos(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary COS = unary("COS", "cos", VectorSupport.VECTOR_OP_COS, VO_ONLYFP);
/** Produce {@code tan(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary TAN = unary("TAN", "tan", VectorSupport.VECTOR_OP_TAN, VO_ONLYFP);
/** Produce {@code asin(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary ASIN = unary("ASIN", "asin", VectorSupport.VECTOR_OP_ASIN, VO_ONLYFP);
/** Produce {@code acos(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary ACOS = unary("ACOS", "acos", VectorSupport.VECTOR_OP_ACOS, VO_ONLYFP);
/** Produce {@code atan(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary ATAN = unary("ATAN", "atan", VectorSupport.VECTOR_OP_ATAN, VO_ONLYFP);
/** Produce {@code exp(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary EXP = unary("EXP", "exp", -1 /*VectorSupport.VECTOR_OP_EXP*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code log(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary LOG = unary("LOG", "log", -1 /*VectorSupport.VECTOR_OP_LOG*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code log10(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary LOG10 = unary("LOG10", "log10", -1 /*VectorSupport.VECTOR_OP_LOG10*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code exp(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary EXP = unary("EXP", "exp", VectorSupport.VECTOR_OP_EXP, VO_ONLYFP);
/** Produce {@code log(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary LOG = unary("LOG", "log", VectorSupport.VECTOR_OP_LOG, VO_ONLYFP);
/** Produce {@code log10(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary LOG10 = unary("LOG10", "log10", VectorSupport.VECTOR_OP_LOG10, VO_ONLYFP);
/** Produce {@code sqrt(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary SQRT = unary("SQRT", "sqrt", VectorSupport.VECTOR_OP_SQRT, VO_ONLYFP);
/** Produce {@code cbrt(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary CBRT = unary("CBRT", "cbrt", -1 /*VectorSupport.VECTOR_OP_CBRT*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code cbrt(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary CBRT = unary("CBRT", "cbrt", VectorSupport.VECTOR_OP_CBRT, VO_ONLYFP);
/** Produce {@code sinh(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary SINH = unary("SINH", "sinh", -1 /*VectorSupport.VECTOR_OP_SINH*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code cosh(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary COSH = unary("COSH", "cosh", -1 /*VectorSupport.VECTOR_OP_COSH*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code tanh(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary TANH = unary("TANH", "tanh", -1 /*VectorSupport.VECTOR_OP_TANH*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code expm1(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary EXPM1 = unary("EXPM1", "expm1", -1 /*VectorSupport.VECTOR_OP_EXPM1*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code log1p(a)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Unary LOG1P = unary("LOG1P", "log1p", -1 /*VectorSupport.VECTOR_OP_LOG1P*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code sinh(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary SINH = unary("SINH", "sinh", VectorSupport.VECTOR_OP_SINH, VO_ONLYFP);
/** Produce {@code cosh(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary COSH = unary("COSH", "cosh", VectorSupport.VECTOR_OP_COSH, VO_ONLYFP);
/** Produce {@code tanh(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary TANH = unary("TANH", "tanh", VectorSupport.VECTOR_OP_TANH, VO_ONLYFP);
/** Produce {@code expm1(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary EXPM1 = unary("EXPM1", "expm1", VectorSupport.VECTOR_OP_EXPM1, VO_ONLYFP);
/** Produce {@code log1p(a)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Unary LOG1P = unary("LOG1P", "log1p", VectorSupport.VECTOR_OP_LOG1P, VO_ONLYFP);
// Binary operators
@ -525,12 +555,18 @@ public abstract class VectorOperators {
/** Produce {@code rotateRight(a,n)}. Integral only. */
public static final /*bitwise*/ Binary ROR = binary("ROR", "rotateRight", -1 /*VectorSupport.VECTOR_OP_RROTATE*/, VO_SHIFT | VO_SPECIAL);
/** Produce {@code atan2(a,b)}. See Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Binary ATAN2 = binary("ATAN2", "atan2", -1 /*VectorSupport.VECTOR_OP_ATAN2*/ , VO_ONLYFP | VO_SPECIAL);
/** Produce {@code pow(a,b)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Binary POW = binary("POW", "pow", -1 /*VectorSupport.VECTOR_OP_POW*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code hypot(a,b)}. Floating only. See section "Operations on floating point vectors" above */
public static final /*float*/ Binary HYPOT = binary("HYPOT", "hypot", -1 /*VectorSupport.VECTOR_OP_HYPOT*/, VO_ONLYFP | VO_SPECIAL);
/** Produce {@code atan2(a,b)}. See Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Binary ATAN2 = binary("ATAN2", "atan2", VectorSupport.VECTOR_OP_ATAN2, VO_ONLYFP);
/** Produce {@code pow(a,b)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Binary POW = binary("POW", "pow", VectorSupport.VECTOR_OP_POW, VO_ONLYFP);
/** Produce {@code hypot(a,b)}. Floating only.
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
*/
public static final /*float*/ Binary HYPOT = binary("HYPOT", "hypot", VectorSupport.VECTOR_OP_HYPOT, VO_ONLYFP);
// Ternary operators
@ -1251,11 +1287,7 @@ public abstract class VectorOperators {
op == ROR ||
op == IS_DEFAULT || op == IS_NEGATIVE ||
op == IS_FINITE || op == IS_NAN || op == IS_INFINITE ||
op == BITWISE_BLEND ||
op == SIN || op == COS || op == TAN || op == ASIN || op == ACOS || op == ATAN || op == EXP ||
op == LOG || op == LOG10 || op == SQRT || op == CBRT || op == SINH || op == COSH || op == TANH ||
op == EXPM1 || op == LOG1P || op == ATAN2 || op == POW || op == HYPOT
) : op;
op == BITWISE_BLEND) : op;
}
}
return true;

View file

@ -555,39 +555,6 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
return broadcast(0).lanewiseTemplate(SUB, this);
}
#end[BITWISE]
#if[FP]
if (op == SIN) {
return uOp((i, a) -> ($type$) Math.sin(a));
} else if (op == COS) {
return uOp((i, a) -> ($type$) Math.cos(a));
} else if (op == TAN) {
return uOp((i, a) -> ($type$) Math.tan(a));
} else if (op == ASIN) {
return uOp((i, a) -> ($type$) Math.asin(a));
} else if (op == ACOS) {
return uOp((i, a) -> ($type$) Math.acos(a));
} else if (op == ATAN) {
return uOp((i, a) -> ($type$) Math.atan(a));
} else if (op == EXP) {
return uOp((i, a) -> ($type$) Math.exp(a));
} else if (op == LOG) {
return uOp((i, a) -> ($type$) Math.log(a));
} else if (op == LOG10) {
return uOp((i, a) -> ($type$) Math.log10(a));
} else if (op == CBRT) {
return uOp((i, a) -> ($type$) Math.cbrt(a));
} else if (op == SINH) {
return uOp((i, a) -> ($type$) Math.sinh(a));
} else if (op == COSH) {
return uOp((i, a) -> ($type$) Math.cosh(a));
} else if (op == TANH) {
return uOp((i, a) -> ($type$) Math.tanh(a));
} else if (op == EXPM1) {
return uOp((i, a) -> ($type$) Math.expm1(a));
} else if (op == LOG1P) {
return uOp((i, a) -> ($type$) Math.log1p(a));
}
#end[FP]
}
int opc = opCode(op);
return VectorSupport.unaryOp(
@ -600,8 +567,38 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
case VECTOR_OP_ABS: return v0 ->
v0.uOp((i, a) -> ($type$) Math.abs(a));
#if[FP]
case VECTOR_OP_SIN: return v0 ->
v0.uOp((i, a) -> ($type$) Math.sin(a));
case VECTOR_OP_COS: return v0 ->
v0.uOp((i, a) -> ($type$) Math.cos(a));
case VECTOR_OP_TAN: return v0 ->
v0.uOp((i, a) -> ($type$) Math.tan(a));
case VECTOR_OP_ASIN: return v0 ->
v0.uOp((i, a) -> ($type$) Math.asin(a));
case VECTOR_OP_ACOS: return v0 ->
v0.uOp((i, a) -> ($type$) Math.acos(a));
case VECTOR_OP_ATAN: return v0 ->
v0.uOp((i, a) -> ($type$) Math.atan(a));
case VECTOR_OP_EXP: return v0 ->
v0.uOp((i, a) -> ($type$) Math.exp(a));
case VECTOR_OP_LOG: return v0 ->
v0.uOp((i, a) -> ($type$) Math.log(a));
case VECTOR_OP_LOG10: return v0 ->
v0.uOp((i, a) -> ($type$) Math.log10(a));
case VECTOR_OP_SQRT: return v0 ->
v0.uOp((i, a) -> ($type$) Math.sqrt(a));
case VECTOR_OP_CBRT: return v0 ->
v0.uOp((i, a) -> ($type$) Math.cbrt(a));
case VECTOR_OP_SINH: return v0 ->
v0.uOp((i, a) -> ($type$) Math.sinh(a));
case VECTOR_OP_COSH: return v0 ->
v0.uOp((i, a) -> ($type$) Math.cosh(a));
case VECTOR_OP_TANH: return v0 ->
v0.uOp((i, a) -> ($type$) Math.tanh(a));
case VECTOR_OP_EXPM1: return v0 ->
v0.uOp((i, a) -> ($type$) Math.expm1(a));
case VECTOR_OP_LOG1P: return v0 ->
v0.uOp((i, a) -> ($type$) Math.log1p(a));
#end[FP]
default: return null;
}}));
@ -675,15 +672,6 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
}
}
#end[BITWISE]
#if[FP]
if (op == ATAN2) {
return bOp(that, (i, a, b) -> ($type$) Math.atan2(a, b));
} else if (op == POW) {
return bOp(that, (i, a, b) -> ($type$) Math.pow(a, b));
} else if (op == HYPOT) {
return bOp(that, (i, a, b) -> ($type$) Math.hypot(a, b));
}
#end[FP]
}
int opc = opCode(op);
return VectorSupport.binaryOp(
@ -717,6 +705,14 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
case VECTOR_OP_URSHIFT: return (v0, v1) ->
v0.bOp(v1, (i, a, n) -> ($type$)((a & LSHR_SETUP_MASK) >>> n));
#end[BITWISE]
#if[FP]
case VECTOR_OP_ATAN2: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> ($type$) Math.atan2(a, b));
case VECTOR_OP_POW: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> ($type$) Math.pow(a, b));
case VECTOR_OP_HYPOT: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> ($type$) Math.hypot(a, b));
#end[FP]
default: return null;
}}));
}

View file

@ -0,0 +1,37 @@
; Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
; 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 file contains duplicate entries as globalDefinitions_vecApi.hpp
; It is intended for inclusion in .s files compiled with masm
; Used to check whether building on x86_64 architecture. Equivalent to checking in regular hpp file for #ifdef _WIN64
IFDEF RAX
; @Version is defined by MASM to determine the Visual Studio version. 1410 is the version for VS17
IF @Version GE 1410
__VECTOR_API_MATH_INTRINSICS_WINDOWS TEXTEQU <"vector_api">
ELSE
__VECTOR_API_MATH_INTRINSICS_WINDOWS TEXTEQU <>
ENDIF
ELSE
__VECTOR_API_MATH_INTRINSICS_WINDOWS TEXTEQU <>
ENDIF

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff