From 0765917dea9376586697012b60605099750d8d42 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Thu, 12 Sep 2024 15:08:11 +0000 Subject: [PATCH 001/307] 8340011: Simplify jdk.internal.classfile.impl.EntryMap Reviewed-by: liach --- .../jdk/internal/classfile/impl/EntryMap.java | 12 +--- .../classfile/impl/SplitConstantPool.java | 71 ++++++++----------- 2 files changed, 34 insertions(+), 49 deletions(-) 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/SplitConstantPool.java b/src/java.base/share/classes/jdk/internal/classfile/impl/SplitConstantPool.java index 4f48c8b731db0..49c2d51e4dc4a 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 @@ -63,8 +63,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 +178,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 +216,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 +276,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 +293,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 +310,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 +328,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 +347,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,10 +365,10 @@ 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 @@ -392,9 +383,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)) @@ -513,9 +504,9 @@ public MethodHandleEntry methodHandleEntry(int refKind, MemberRefEntry 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) @@ -539,9 +530,9 @@ public InvokeDynamicEntry invokeDynamicEntry(BootstrapMethodEntry bootstrapMetho nameAndType = nameAndTypeEntry(nameAndType.name(), nameAndType.type()); 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) @@ -570,9 +561,9 @@ public ConstantDynamicEntry constantDynamicEntry(BootstrapMethodEntry bootstrapM nameAndType = nameAndTypeEntry(nameAndType.name(), nameAndType.type()); 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) @@ -640,9 +631,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; } From 4d65c3efcaa5f855f9e0fbdd8e9d4f4ed2b44d3b Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Thu, 12 Sep 2024 15:16:38 +0000 Subject: [PATCH 002/307] 8339876: Move constant symbol caches to Utf8EntryImpl Reviewed-by: redestad --- .../java/lang/classfile/Annotation.java | 8 ++- .../java/lang/classfile/AnnotationValue.java | 10 +-- .../java/lang/classfile/ClassBuilder.java | 4 +- .../java/lang/classfile/CodeBuilder.java | 2 +- .../java/lang/classfile/FieldModel.java | 3 +- .../java/lang/classfile/MethodModel.java | 3 +- .../attribute/LocalVariableInfo.java | 3 +- .../attribute/RecordComponentInfo.java | 5 +- .../constantpool/ConstantPoolBuilder.java | 8 +-- .../classfile/instruction/LocalVariable.java | 5 +- .../classfile/impl/AbstractPoolEntry.java | 64 ++++++++----------- .../classfile/impl/BoundLocalVariable.java | 2 +- .../classfile/impl/BufferedMethodBuilder.java | 10 +-- .../classfile/impl/ChainedClassBuilder.java | 9 --- .../classfile/impl/DirectClassBuilder.java | 15 ----- .../classfile/impl/DirectMethodBuilder.java | 10 +-- .../internal/classfile/impl/MethodImpl.java | 6 +- .../classfile/impl/SplitConstantPool.java | 20 ++++-- .../jdk/internal/classfile/impl/Util.java | 13 +++- 19 files changed, 87 insertions(+), 113 deletions(-) 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/CodeBuilder.java b/src/java.base/share/classes/java/lang/classfile/CodeBuilder.java index be0778d198458..5f4e5b72a1919 100644 --- a/src/java.base/share/classes/java/lang/classfile/CodeBuilder.java +++ b/src/java.base/share/classes/java/lang/classfile/CodeBuilder.java @@ -769,7 +769,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/jdk/internal/classfile/impl/AbstractPoolEntry.java b/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java index 450f6ae1c8c90..7f14560fd1854 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 @@ -54,6 +54,7 @@ import jdk.internal.access.JavaLangAccess; import jdk.internal.access.SharedSecrets; import jdk.internal.util.ArraysSupport; +import jdk.internal.vm.annotation.Stable; public abstract sealed class AbstractPoolEntry { /* @@ -146,12 +147,14 @@ 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 hash; + 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) { @@ -187,6 +190,7 @@ enum State { RAW, BYTE, CHAR, STRING } this.charLen = u.charLen; this.chars = u.chars; this.stringValue = u.stringValue; + this.typeSym = u.typeSym; } /** @@ -419,6 +423,22 @@ void writeTo(BufWriterImpl pool) { pool.writeUTF(stringValue); } } + + public ClassDesc fieldTypeSymbol() { + if (typeSym instanceof ClassDesc cd) + return cd; + var ret = ClassDesc.ofDescriptor(stringValue()); + typeSym = ret; + return ret; + } + + public MethodTypeDesc methodTypeSymbol() { + if (typeSym instanceof MethodTypeDesc mtd) + return mtd; + var ret = MethodTypeDesc.ofDescriptor(stringValue()); + typeSym = ret; + return ret; + } } abstract static sealed class AbstractRefEntry extends AbstractPoolEntry { @@ -585,8 +605,6 @@ public boolean equals(Object o) { public static final class NameAndTypeEntryImpl extends AbstractRefsEntry implements NameAndTypeEntry { - public TypeDescriptor typeSym = null; - NameAndTypeEntryImpl(ConstantPool cpm, int index, Utf8EntryImpl name, Utf8EntryImpl type) { super(cpm, ClassFile.TAG_NAMEANDTYPE, index, name, type); } @@ -601,31 +619,12 @@ 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 @@ -897,8 +896,6 @@ 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); } @@ -912,20 +909,13 @@ public Utf8Entry descriptor() { 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 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/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 49c2d51e4dc4a..0b5d64023b962 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; @@ -398,6 +398,20 @@ private AbstractPoolEntry.Utf8EntryImpl tryFindUtf8(int hash, AbstractPoolEntry. return null; } + @Override + public Utf8Entry utf8Entry(ClassDesc desc) { + var utf8 = utf8Entry(desc.descriptorString()); + utf8.typeSym = desc; + return utf8; + } + + @Override + public Utf8Entry utf8Entry(MethodTypeDesc desc) { + var utf8 = utf8Entry(desc.descriptorString()); + utf8.typeSym = desc; + return utf8; + } + @Override public AbstractPoolEntry.Utf8EntryImpl utf8Entry(String s) { int hash = AbstractPoolEntry.hashString(s.hashCode()); @@ -480,9 +494,7 @@ public InterfaceMethodRefEntry interfaceMethodRefEntry(ClassEntry owner, NameAnd @Override public MethodTypeEntry methodTypeEntry(MethodTypeDesc descriptor) { - var ret = (AbstractPoolEntry.MethodTypeEntryImpl)methodTypeEntry(utf8Entry(descriptor.descriptorString())); - ret.sym = descriptor; - return ret; + return methodTypeEntry(utf8Entry(descriptor)); } @Override 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..7f3dd914e7f8c 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; @@ -220,12 +221,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") From 7f1dae12e5e24d204a70cf610a8c482996556931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirik=20Bj=C3=B8rsn=C3=B8s?= Date: Thu, 12 Sep 2024 15:24:22 +0000 Subject: [PATCH 003/307] 8339874: Avoid duplicate checking of trailing slash in ZipFile.getZipEntry Reviewed-by: lancea, redestad --- .../share/classes/java/util/zip/ZipCoder.java | 27 +------ .../share/classes/java/util/zip/ZipFile.java | 70 +++++++++---------- 2 files changed, 34 insertions(+), 63 deletions(-) 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/ZipFile.java b/src/java.base/share/classes/java/util/zip/ZipFile.java index 6ab70d4bdb81d..80126bc79734d 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; @@ -540,7 +548,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); } } @@ -612,7 +621,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 +664,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 +674,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 +689,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 +1170,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 +1845,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 +1873,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 +1888,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) { From ab9b72c50a5f324e53b8c6535f401cc185b98c75 Mon Sep 17 00:00:00 2001 From: Steve Dohrmann Date: Thu, 12 Sep 2024 16:06:16 +0000 Subject: [PATCH 004/307] 8329035: New Data Destination instructions support Reviewed-by: kvn, sviswanathan, jbhateja --- src/hotspot/cpu/x86/assembler_x86.cpp | 1379 ++++++++++++++++++++++++- src/hotspot/cpu/x86/assembler_x86.hpp | 175 +++- 2 files changed, 1533 insertions(+), 21 deletions(-) diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index 345b779e8094e..90c2fad1f5d57 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) { @@ -11378,6 +12084,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 +12528,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 +12554,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 +12579,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 +12627,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 +12636,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 +12692,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 +12704,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 +13560,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,28 +14190,67 @@ 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::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)) { @@ -13480,6 +14267,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 +14288,80 @@ void Assembler::adoxq(Register dst, Register src) { (0xC0 | encode)); } } -void Assembler::andq(Address dst, int32_t imm32) { + +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 +14495,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 +14508,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 +14618,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 +14631,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 +14644,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 +14686,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 +14745,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 +14771,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 +14789,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 +14813,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 +14829,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 +14844,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 +14922,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 +14938,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 +15070,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 +15102,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 +15170,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 +15250,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 +15267,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 +15492,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 +15513,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 +15575,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 +15617,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 +15653,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 +15695,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 +15749,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 +15782,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 +15834,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 +15987,68 @@ 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::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..9e7126417b06f 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. @@ -1031,6 +1050,7 @@ class Assembler : public AbstractAssembler { #endif void vzeroupper_uncached(); void decq(Register dst); + void edecq(Register dst, Register src, bool no_flags); void pusha(); void popa(); @@ -1072,23 +1092,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 +1154,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 +1223,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 +1533,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 +1626,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 +1850,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 +1871,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 +1897,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 +2113,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 +2124,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 +2226,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 +2243,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 +2272,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 +2338,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 +2398,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 +2448,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 +2487,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) From 81ff91ef27a6a856ae2c453a9a9b8333b91da3ab Mon Sep 17 00:00:00 2001 From: Per Minborg Date: Thu, 12 Sep 2024 18:31:08 +0000 Subject: [PATCH 005/307] 8339531: Improve performance of MemorySegment::mismatch Reviewed-by: mcimadamore --- .../java/lang/foreign/MemorySegment.java | 8 +- .../foreign/AbstractMemorySegmentImpl.java | 178 +--------- .../foreign/SegmentBulkOperations.java | 316 ++++++++++++++++++ test/jdk/java/foreign/TestMismatch.java | 64 ++++ .../{CopyTest.java => SegmentBulkCopy.java} | 36 +- .../{TestFill.java => SegmentBulkFill.java} | 38 ++- .../lang/foreign/SegmentBulkMismatch.java | 112 +++++++ 7 files changed, 550 insertions(+), 202 deletions(-) create mode 100644 src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java rename test/micro/org/openjdk/bench/java/lang/foreign/{CopyTest.java => SegmentBulkCopy.java} (76%) rename test/micro/org/openjdk/bench/java/lang/foreign/{TestFill.java => SegmentBulkFill.java} (69%) create mode 100644 test/micro/org/openjdk/bench/java/lang/foreign/SegmentBulkMismatch.java 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..cb1f3707db68c 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; @@ -1571,7 +1572,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 +2636,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/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/SegmentBulkOperations.java b/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java new file mode 100644 index 0000000000000..74953f077e418 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java @@ -0,0 +1,316 @@ +/* + * 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 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...XXX000 + for (; remaining >= 8; remaining -= 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); + } + offset += 8; + } + + // 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 = Integer.getInteger(PROPERTY_PATH + name, defaultPower); + return 1 << Math.clamp(power, 0, Integer.SIZE - 2); + } + +} 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/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); + } + +} + From 5e5942a282e14846404b68c65d43594d6b9226d9 Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Thu, 12 Sep 2024 23:05:15 +0000 Subject: [PATCH 006/307] 8339794: Open source closed choice tests #1 Reviewed-by: jdv, prr --- .../jdk/java/awt/Choice/ChoiceInsertTest.java | 89 ++++++++++ .../java/awt/Choice/ChoiceMouseDragTest.java | 138 ++++++++++++++++ .../java/awt/Choice/WheelEventsConsumed.java | 156 ++++++++++++++++++ 3 files changed, 383 insertions(+) create mode 100644 test/jdk/java/awt/Choice/ChoiceInsertTest.java create mode 100644 test/jdk/java/awt/Choice/ChoiceMouseDragTest.java create mode 100644 test/jdk/java/awt/Choice/WheelEventsConsumed.java 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/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; + } +} From ae75ca05e450da577e712eb7ed9dd9203616b80b Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Fri, 13 Sep 2024 05:47:44 +0000 Subject: [PATCH 007/307] 8314842: zgc/genzgc tests ignore vm flags Reviewed-by: tschatzl, lmesnik --- test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java | 2 +- test/hotspot/jtreg/gc/x/TestPageCacheFlush.java | 2 +- test/hotspot/jtreg/gc/x/TestSmallHeap.java | 2 +- test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java | 2 +- test/hotspot/jtreg/gc/z/TestPageCacheFlush.java | 2 +- test/hotspot/jtreg/gc/z/TestSmallHeap.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java b/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java index 3bf83d9076864..bacd7a2078e97 100644 --- a/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java +++ b/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java @@ -41,7 +41,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..28d2ebd6aea01 100644 --- a/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java +++ b/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java @@ -41,7 +41,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", From b88ff9c986bfe5e14e2ba5803a464fbf6e131df8 Mon Sep 17 00:00:00 2001 From: Andrew Dinn Date: Fri, 13 Sep 2024 06:43:38 +0000 Subject: [PATCH 008/307] 8339849: Enumerate opto and C1 stubs, generate enums, names, fields and generator calls Reviewed-by: kvn --- .../cpu/aarch64/c1_CodeStubs_aarch64.cpp | 46 ++--- .../cpu/aarch64/c1_LIRAssembler_aarch64.cpp | 34 ++-- .../cpu/aarch64/c1_LIRGenerator_aarch64.cpp | 6 +- .../cpu/aarch64/c1_MacroAssembler_aarch64.cpp | 4 +- .../cpu/aarch64/c1_Runtime1_aarch64.cpp | 104 +++++------ src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp | 52 +++--- src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp | 22 +-- src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp | 8 +- src/hotspot/cpu/arm/c1_Runtime1_arm.cpp | 92 +++++----- src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp | 44 ++--- src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp | 18 +- src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp | 6 +- src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp | 6 +- src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp | 110 ++++++------ src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp | 46 ++--- .../riscv/c1_LIRAssembler_arraycopy_riscv.cpp | 4 +- .../cpu/riscv/c1_LIRAssembler_riscv.cpp | 24 +-- .../cpu/riscv/c1_LIRGenerator_riscv.cpp | 8 +- .../cpu/riscv/c1_MacroAssembler_riscv.cpp | 4 +- src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp | 104 +++++------ src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp | 52 +++--- src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp | 16 +- src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp | 6 +- .../cpu/s390/c1_MacroAssembler_s390.cpp | 4 +- src/hotspot/cpu/s390/c1_Runtime1_s390.cpp | 112 ++++++------ src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp | 54 +++--- src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp | 20 +-- src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp | 6 +- src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp | 4 +- src/hotspot/cpu/x86/c1_Runtime1_x86.cpp | 110 ++++++------ src/hotspot/share/c1/c1_CodeStubs.hpp | 12 +- src/hotspot/share/c1/c1_LIRGenerator.cpp | 6 +- src/hotspot/share/c1/c1_Runtime1.cpp | 112 ++++++------ src/hotspot/share/c1/c1_Runtime1.hpp | 80 +++------ src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp | 6 +- .../shenandoah/c1/shenandoahBarrierSetC1.cpp | 12 +- src/hotspot/share/gc/x/c1/xBarrierSetC1.cpp | 4 +- src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp | 6 +- src/hotspot/share/opto/escape.cpp | 4 +- src/hotspot/share/opto/runtime.cpp | 161 +++++++++++------- src/hotspot/share/opto/runtime.hpp | 80 +++++---- .../share/runtime/stubDeclarations.hpp | 101 ++++++++++- .../compiler/lib/ir_framework/IRNode.java | 8 +- .../ir_framework/tests/TestIRMatching.java | 6 +- 44 files changed, 928 insertions(+), 796 deletions(-) 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/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/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..c05e97a4e9aa3 100644 --- a/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp @@ -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/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/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..f3fa19ddb31e0 100644 --- a/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp @@ -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/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..ff237d16d2216 100644 --- a/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp @@ -1430,7 +1430,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 +1463,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/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_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index 7b519804bfecd..4e63736503fe0 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); diff --git a/src/hotspot/share/c1/c1_Runtime1.cpp b/src/hotspot/share/c1/c1_Runtime1.cpp index 8524f37177b45..5b44d5c0f1983 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) \ @@ -425,8 +431,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 +531,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 +928,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 +965,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 +1050,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 +1134,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 +1150,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 +1176,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 +1188,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 +1207,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 +1215,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 +1244,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 +1284,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 +1315,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 +1370,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 +1387,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 +1404,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 +1431,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/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/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/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/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/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/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/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/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java index 162f384dc07b2..24fbe7e64afa0 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); } 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), From 5709c379408d8919b86bbad6635b97756461ab27 Mon Sep 17 00:00:00 2001 From: Per Minborg Date: Fri, 13 Sep 2024 06:48:44 +0000 Subject: [PATCH 009/307] 8340081: Test java/foreign/TestLinker.java failed failed: missing permission java.lang.foreign.native.threshold.power.fill Reviewed-by: dholmes --- .../jdk/internal/foreign/SegmentBulkOperations.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java b/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java index 74953f077e418..9d7b9e120b514 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java +++ b/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java @@ -29,6 +29,7 @@ import jdk.internal.util.Architecture; import jdk.internal.util.ArraysSupport; import jdk.internal.vm.annotation.ForceInline; +import sun.security.action.GetPropertyAction; import java.lang.foreign.MemorySegment; @@ -309,8 +310,15 @@ private static long vectorizedMismatchLargeForBytes(MemorySessionImpl aSession, // The returned value is in the interval [0, 2^30] static int powerOfPropertyOr(String name, int defaultPower) { - final int power = Integer.getInteger(PROPERTY_PATH + name, defaultPower); - return 1 << Math.clamp(power, 0, Integer.SIZE - 2); + final String property = GetPropertyAction.privilegedGetProperty(PROPERTY_PATH + name); + if (property != null) { + try { + return 1 << Math.clamp(Integer.parseInt(property), 0, Integer.SIZE - 2); + } catch (NumberFormatException _) { + // ignore + } + } + return defaultPower; } } From bacd046062bffb4c95ec7a508a1080ad651a94a4 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Fri, 13 Sep 2024 08:05:19 +0000 Subject: [PATCH 010/307] 8321010: RISC-V: C2 RoundVF 8321011: RISC-V: C2 RoundVD Reviewed-by: rehn, luhenry --- src/hotspot/cpu/riscv/assembler_riscv.hpp | 1 + .../cpu/riscv/c2_MacroAssembler_riscv.cpp | 68 ++++++ .../cpu/riscv/c2_MacroAssembler_riscv.hpp | 3 + src/hotspot/cpu/riscv/riscv.ad | 12 + src/hotspot/cpu/riscv/riscv_v.ad | 28 +++ .../floatingpoint/TestRoundFloatAll.java | 84 +++++++ .../compiler/lib/golden/GoldenRound.java | 95 ++++++++ .../vectorization/TestRoundVectRiscv64.java | 94 +++++++ .../TestRoundVectorDoubleRandom.java | 229 ++++++++++++++++++ .../TestRoundVectorFloatAll.java | 95 ++++++++ .../TestRoundVectorFloatRandom.java | 212 ++++++++++++++++ 11 files changed, 921 insertions(+) create mode 100644 test/hotspot/jtreg/compiler/floatingpoint/TestRoundFloatAll.java create mode 100644 test/hotspot/jtreg/compiler/lib/golden/GoldenRound.java create mode 100644 test/hotspot/jtreg/compiler/vectorization/TestRoundVectRiscv64.java create mode 100644 test/hotspot/jtreg/compiler/vectorization/TestRoundVectorDoubleRandom.java create mode 100644 test/hotspot/jtreg/compiler/vectorization/TestRoundVectorFloatAll.java create mode 100644 test/hotspot/jtreg/compiler/vectorization/TestRoundVectorFloatRandom.java 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/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/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..54947f6bf9a19 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) %{ 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/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!"); + } + } +} From 0c36177fead8b64a4cee9da3c895e3799f8ba231 Mon Sep 17 00:00:00 2001 From: Per Minborg Date: Fri, 13 Sep 2024 08:43:38 +0000 Subject: [PATCH 011/307] 8340089: Simplify SegmentBulkOperations::powerOfProperty Reviewed-by: jpai --- .../jdk/internal/foreign/SegmentBulkOperations.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java b/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java index 9d7b9e120b514..41ae247293d3f 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java +++ b/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java @@ -29,7 +29,7 @@ import jdk.internal.util.Architecture; import jdk.internal.util.ArraysSupport; import jdk.internal.vm.annotation.ForceInline; -import sun.security.action.GetPropertyAction; +import sun.security.action.GetIntegerAction; import java.lang.foreign.MemorySegment; @@ -310,15 +310,8 @@ private static long vectorizedMismatchLargeForBytes(MemorySessionImpl aSession, // The returned value is in the interval [0, 2^30] static int powerOfPropertyOr(String name, int defaultPower) { - final String property = GetPropertyAction.privilegedGetProperty(PROPERTY_PATH + name); - if (property != null) { - try { - return 1 << Math.clamp(Integer.parseInt(property), 0, Integer.SIZE - 2); - } catch (NumberFormatException _) { - // ignore - } - } - return defaultPower; + final int power = GetIntegerAction.privilegedGetProperty(PROPERTY_PATH + name, defaultPower); + return 1 << Math.clamp(power, 0, Integer.SIZE - 2); } } From 358ff196336407484b1b892f08936e9378701959 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Fri, 13 Sep 2024 11:22:39 +0000 Subject: [PATCH 012/307] 8339727: Open source several AWT focus tests - series 1 Reviewed-by: honkar --- test/jdk/ProblemList.txt | 3 + .../Focus/ActivateOnProperAppContextTest.java | 245 ++++++++++++++++++ test/jdk/java/awt/Focus/KillFocusTest.java | 80 ++++++ .../awt/Focus/TestDisabledAutoTransfer.java | 156 +++++++++++ .../Focus/TestDisabledAutoTransferSwing.java | 165 ++++++++++++ 5 files changed, 649 insertions(+) create mode 100644 test/jdk/java/awt/Focus/ActivateOnProperAppContextTest.java create mode 100644 test/jdk/java/awt/Focus/KillFocusTest.java create mode 100644 test/jdk/java/awt/Focus/TestDisabledAutoTransfer.java create mode 100644 test/jdk/java/awt/Focus/TestDisabledAutoTransferSwing.java diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 47a2e13b460cf..58949cf728256 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -133,6 +133,9 @@ 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/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 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/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/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"); + } + } + +} From 8a4ea09fa220f74f2236fc85e197eadf83b65875 Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Fri, 13 Sep 2024 12:04:31 +0000 Subject: [PATCH 013/307] 8336492: Regression in lambda serialization Reviewed-by: vromero --- .../com/sun/tools/javac/code/Flags.java | 7 +- .../com/sun/tools/javac/comp/Attr.java | 61 +- .../sun/tools/javac/comp/CaptureScanner.java | 99 ++ .../sun/tools/javac/comp/LambdaToMethod.java | 1549 ++++++----------- .../com/sun/tools/javac/comp/Lower.java | 135 +- .../com/sun/tools/javac/comp/TransTypes.java | 1 + .../com/sun/tools/javac/jvm/ClassWriter.java | 2 +- .../com/sun/tools/javac/tree/JCTree.java | 2 + .../com/sun/tools/javac/tree/TreeScanner.java | 2 +- .../jdk/internal/vm/Continuation/Scoped.java | 22 +- .../javac/MethodParameters/LambdaTest.out | 4 +- .../javac/MethodParameters/LocalClassTest.out | 2 +- .../javac/T8019486/WrongLNTForLambdaTest.java | 6 +- .../EnclosingMethod/EnclosingMethodTest.java | 5 - .../tools/javac/lambda/CaptureVarOrder.java | 47 + .../lambda/SerializedLambdaInLocalClass.java | 95 + 16 files changed, 837 insertions(+), 1202 deletions(-) create mode 100644 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/CaptureScanner.java create mode 100644 test/langtools/tools/javac/lambda/CaptureVarOrder.java create mode 100644 test/langtools/tools/javac/lambda/SerializedLambdaInLocalClass.java 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/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/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/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/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; + } +} From bd44cf8ab709d08a4d015868bececabd0c97525b Mon Sep 17 00:00:00 2001 From: David Holmes Date: Fri, 13 Sep 2024 12:10:11 +0000 Subject: [PATCH 014/307] 8330302: strace004 can still fail Reviewed-by: alanb, shade --- .../vmTestbase/nsk/monitoring/share/ThreadController.java | 5 ++++- .../nsk/monitoring/share/thread/SleepingThread.java | 5 ++++- .../vmTestbase/nsk/monitoring/stress/thread/strace001.java | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.java index ea15f3d0d35bc..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,6 +663,9 @@ 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(SleepingThread.class.getName() + ".run"); 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 ed2a1a60c5088..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,6 +41,9 @@ 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.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 03d2066cf3289..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,6 +150,8 @@ 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.isEnabled" }; From 4d011785717c34fa5a245735968c60142fc14af4 Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Fri, 13 Sep 2024 13:05:37 +0000 Subject: [PATCH 015/307] 8339927: Man page update for deprecating jhsdb debugd for removal Reviewed-by: sspitsyn, cjplummer --- src/jdk.hotspot.agent/share/man/jhsdb.1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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]] From 3c4d15bdceaf94698af99d6b6fb12b3a28e13fdf Mon Sep 17 00:00:00 2001 From: Alexey Semenyuk Date: Fri, 13 Sep 2024 14:13:47 +0000 Subject: [PATCH 016/307] 8334301: Errors in jpackage man page Reviewed-by: almatvee --- src/jdk.jpackage/share/man/jpackage.1 | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) 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 From 3e0da58ee6553fc0ed841db4a8800d50bc444517 Mon Sep 17 00:00:00 2001 From: Per Minborg Date: Fri, 13 Sep 2024 14:38:24 +0000 Subject: [PATCH 017/307] 8333843: Provide guidelines on MemorySegment to read strings with known lengths Reviewed-by: mcimadamore --- .../share/classes/java/lang/foreign/MemorySegment.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 cb1f3707db68c..9fadc2f0f56d1 100644 --- a/src/java.base/share/classes/java/lang/foreign/MemorySegment.java +++ b/src/java.base/share/classes/java/lang/foreign/MemorySegment.java @@ -1285,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 From 89ca89cb26270a405226415c296dc45d3535e74d Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Fri, 13 Sep 2024 14:59:35 +0000 Subject: [PATCH 018/307] 8338626: ClassLoaderExt::process_jar_manifest() should allow / separator on Windows Reviewed-by: iklam, dholmes, matsaave --- .../share/classfile/classLoaderExt.cpp | 9 +++ .../runtime/cds/appcds/ClassPathAttr.java | 73 ++++++++++++++++++- 2 files changed, 81 insertions(+), 1 deletion(-) 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/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java b/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java index f0d797c09aedf..560f42d0467da 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 @@ -30,6 +30,7 @@ * @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; @@ -82,6 +83,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 From 1a0a53883f7c6f523b5fefb722e137258d527362 Mon Sep 17 00:00:00 2001 From: Per Minborg Date: Fri, 13 Sep 2024 15:27:50 +0000 Subject: [PATCH 019/307] 8340120: Remove redundant code in SegmentBulkOperations::mismatch Reviewed-by: mcimadamore --- .../jdk/internal/foreign/SegmentBulkOperations.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java b/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java index 41ae247293d3f..30e146a82f49b 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java +++ b/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java @@ -207,15 +207,6 @@ private static long mismatch(AbstractMemorySegmentImpl src, long srcFromOffset, } } int remaining = length - offset; - // 0...XXX000 - for (; remaining >= 8; remaining -= 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); - } - offset += 8; - } // 0...0X00 if (remaining >= 4) { From 89c172ac47a9cc238739338417015bf912ad5424 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Fri, 13 Sep 2024 16:49:28 +0000 Subject: [PATCH 020/307] 8340082: Use inline return tag in java.base Reviewed-by: iris, prappo, lancea, djelinski, naoto, liach --- .../share/classes/java/io/ObjectInputFilter.java | 5 ++--- .../share/classes/java/io/ObjectInputStream.java | 3 +-- .../classes/java/lang/annotation/Retention.java | 5 ++--- .../java/nio/charset/MalformedInputException.java | 8 +++----- .../nio/charset/UnmappableCharacterException.java | 8 +++----- .../share/classes/java/time/format/TextStyle.java | 5 ++--- .../java/util/concurrent/SynchronousQueue.java | 3 +-- .../java/util/concurrent/atomic/AtomicBoolean.java | 3 +-- .../java/util/concurrent/atomic/AtomicInteger.java | 3 +-- .../util/concurrent/atomic/AtomicIntegerArray.java | 3 +-- .../java/util/concurrent/atomic/AtomicLong.java | 3 +-- .../java/util/concurrent/atomic/AtomicLongArray.java | 3 +-- .../java/util/concurrent/atomic/AtomicReference.java | 3 +-- .../util/concurrent/atomic/AtomicReferenceArray.java | 3 +-- .../util/concurrent/atomic/DoubleAccumulator.java | 3 +-- .../java/util/concurrent/atomic/LongAccumulator.java | 3 +-- .../share/classes/java/util/jar/Manifest.java | 3 +-- .../share/classes/java/util/zip/Deflater.java | 3 +-- .../share/classes/java/util/zip/Inflater.java | 12 ++++-------- .../share/classes/java/util/zip/ZipEntry.java | 3 +-- .../share/classes/java/util/zip/ZipFile.java | 6 ++---- 21 files changed, 32 insertions(+), 59 deletions(-) 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/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/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/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/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/atomic/AtomicBoolean.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java index d8cb9869afecd..c6671deaa2eb5 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 @@ -176,8 +176,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/AtomicReference.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java index b2c692df5e7c7..da445da61badc 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 @@ -269,8 +269,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/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/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/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/ZipEntry.java b/src/java.base/share/classes/java/util/zip/ZipEntry.java index d97760d950ab3..8c8bfeb322960 100644 --- a/src/java.base/share/classes/java/util/zip/ZipEntry.java +++ b/src/java.base/share/classes/java/util/zip/ZipEntry.java @@ -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 80126bc79734d..333e3d0184976 100644 --- a/src/java.base/share/classes/java/util/zip/ZipFile.java +++ b/src/java.base/share/classes/java/util/zip/ZipFile.java @@ -498,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; @@ -560,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() { From 37bf589ec087c80851abb9d35910f09850cea9f6 Mon Sep 17 00:00:00 2001 From: Nizar Benalla Date: Fri, 13 Sep 2024 16:56:01 +0000 Subject: [PATCH 021/307] 8339847: Broken link to the dieharder distribution website in SplittableRandom Reviewed-by: iris, liach --- src/java.base/share/classes/java/util/SplittableRandom.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 3aa8338f4e7d88967e77dfb0bace1c4b5add72f1 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Fri, 13 Sep 2024 18:31:46 +0000 Subject: [PATCH 022/307] 8340075: Autoconf bundle cannot run on read-only filesystem Reviewed-by: mikael --- make/devkit/createAutoconfBundle.sh | 80 +++++++++++++++++------------ 1 file changed, 46 insertions(+), 34 deletions(-) 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 * From fdfe503d016086cf78b5a8c27dbe45f0261c68ab Mon Sep 17 00:00:00 2001 From: Valerie Peng Date: Fri, 13 Sep 2024 21:13:54 +0000 Subject: [PATCH 023/307] 8335288: SunPKCS11 initialization will call C_GetMechanismInfo on unsupported mechanisms Reviewed-by: mbalao, weijun, hchao --- .../sun/security/pkcs11/SunPKCS11.java | 32 +++-- .../pkcs11/Provider/RequiredMechCheck.cfg | 14 +++ .../pkcs11/Provider/RequiredMechCheck.java | 116 ++++++++++++++++++ 3 files changed, 150 insertions(+), 12 deletions(-) create mode 100644 test/jdk/sun/security/pkcs11/Provider/RequiredMechCheck.cfg create mode 100644 test/jdk/sun/security/pkcs11/Provider/RequiredMechCheck.java 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/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); + } + } + } + } +} From fa502ecd2d1040ee2fe26d0ac5dd547379a0ade7 Mon Sep 17 00:00:00 2001 From: Manukumar V S Date: Sat, 14 Sep 2024 05:08:57 +0000 Subject: [PATCH 024/307] 8339943: Frame not disposed in java/awt/dnd/DropActionChangeTest.java Reviewed-by: prr, azvegint --- .../java/awt/dnd/DropActionChangeTest.java | 91 ++++++++++++------- 1 file changed, 57 insertions(+), 34 deletions(-) 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 From c91fa278fe17ab204beef0fcef1ada6dd0bc37bb Mon Sep 17 00:00:00 2001 From: Liang Mao Date: Sat, 14 Sep 2024 05:36:47 +0000 Subject: [PATCH 025/307] 8339725: Concurrent GC crashed due to GetMethodDeclaringClass Reviewed-by: lmesnik, coleenp, eosterlund, stefank --- make/test/JtregNativeHotspot.gmk | 3 +- src/hotspot/share/prims/jvmtiEnv.cpp | 8 +- src/hotspot/share/prims/jvmtiEnvBase.cpp | 1 + .../TestUnloadedClass.java | 106 ++++++++++++++ .../libTestUnloadedClass.cpp | 129 ++++++++++++++++++ 5 files changed, 244 insertions(+), 3 deletions(-) create mode 100644 test/hotspot/jtreg/serviceability/jvmti/GetMethodDeclaringClass/TestUnloadedClass.java create mode 100644 test/hotspot/jtreg/serviceability/jvmti/GetMethodDeclaringClass/libTestUnloadedClass.cpp 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/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/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; +} From a8f143c6abe7669c232cabda3a4e8df726de036e Mon Sep 17 00:00:00 2001 From: Serguei Spitsyn Date: Sat, 14 Sep 2024 22:50:50 +0000 Subject: [PATCH 026/307] 8306679: com/sun/jdi/InterruptHangTest.java asserts with -Xcomp -Dmain.wrapper=Virtual options Reviewed-by: lmesnik, cjplummer --- src/hotspot/share/runtime/continuationFreezeThaw.cpp | 2 +- test/jdk/ProblemList-Xcomp.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/runtime/continuationFreezeThaw.cpp b/src/hotspot/share/runtime/continuationFreezeThaw.cpp index 5d578fa741ec8..e36b252362b78 100644 --- a/src/hotspot/share/runtime/continuationFreezeThaw.cpp +++ b/src/hotspot/share/runtime/continuationFreezeThaw.cpp @@ -2062,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/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 From a0794e0a054c5e7ed051efa6362726cdd7598255 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Mon, 16 Sep 2024 03:48:55 +0000 Subject: [PATCH 027/307] 8339639: Opensource few AWT PopupMenu tests Reviewed-by: azvegint, prr --- test/jdk/ProblemList.txt | 1 + .../jdk/java/awt/PopupMenu/PopupHangTest.java | 258 ++++++++++++++++++ .../java/awt/PopupMenu/PopupMenuVisuals.java | 101 +++++++ 3 files changed, 360 insertions(+) create mode 100644 test/jdk/java/awt/PopupMenu/PopupHangTest.java create mode 100644 test/jdk/java/awt/PopupMenu/PopupMenuVisuals.java diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 58949cf728256..dbf09a89c53ed 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -787,3 +787,4 @@ 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 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; + } + +} From 0e0f10f95217b5caaed02744a0a341350e4f2bc7 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 16 Sep 2024 05:31:46 +0000 Subject: [PATCH 028/307] 8340102: Move assert-only loop in OopMapSort::sort under debug macro Reviewed-by: stuefe, fyang, kvn --- src/hotspot/share/compiler/oopMap.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { From 74add0e2e071a8c8e9547e5a1757b5950b780539 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 16 Sep 2024 05:32:03 +0000 Subject: [PATCH 029/307] 8340105: Expose BitMap::print_on in release builds Reviewed-by: stuefe, stefank --- src/hotspot/share/utilities/bitMap.cpp | 4 ---- src/hotspot/share/utilities/bitMap.hpp | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/hotspot/share/utilities/bitMap.cpp b/src/hotspot/share/utilities/bitMap.cpp index a07807070918f..6ea473dda48f4 100644 --- a/src/hotspot/share/utilities/bitMap.cpp +++ b/src/hotspot/share/utilities/bitMap.cpp @@ -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..3363653648557 100644 --- a/src/hotspot/share/utilities/bitMap.hpp +++ b/src/hotspot/share/utilities/bitMap.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 From dc00eb87bc28ed5bf499af6835c3df474c454a41 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 16 Sep 2024 05:33:40 +0000 Subject: [PATCH 030/307] 8338912: CDS: Segmented roots array Reviewed-by: ccheung, iklam --- src/hotspot/share/cds/archiveBuilder.cpp | 19 +-- src/hotspot/share/cds/archiveHeapLoader.cpp | 14 +- src/hotspot/share/cds/archiveHeapWriter.cpp | 136 ++++++++++++-------- src/hotspot/share/cds/archiveHeapWriter.hpp | 22 +--- src/hotspot/share/cds/archiveUtils.cpp | 21 +++ src/hotspot/share/cds/archiveUtils.hpp | 41 ++++++ src/hotspot/share/cds/filemap.cpp | 8 +- src/hotspot/share/cds/filemap.hpp | 10 +- src/hotspot/share/cds/heapShared.cpp | 44 +++++-- src/hotspot/share/cds/heapShared.hpp | 9 +- 10 files changed, 221 insertions(+), 103 deletions(-) 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..d8ee7155452ff 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; @@ -164,10 +164,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,47 +182,71 @@ 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); - } +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)); - maybe_fill_gc_region_gap(byte_size); - - 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; } static int oop_sorting_rank(oop o) { @@ -282,6 +302,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 +319,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); } @@ -455,7 +477,7 @@ void ArchiveHeapWriter::set_requested_address(ArchiveHeapInfo* info) { 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 +565,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 +616,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..961d2b52133f8 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 @@ -130,9 +129,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 +191,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 +219,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 +233,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..b86118c686886 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); @@ -1647,7 +1651,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; } diff --git a/src/hotspot/share/cds/filemap.hpp b/src/hotspot/share/cds/filemap.hpp index 7b10c16920b8f..aa728b9d4949f 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(); } diff --git a/src/hotspot/share/cds/heapShared.cpp b/src/hotspot/share/cds/heapShared.cpp index abfc0f9d64be1..68be14a46fe74 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); } } @@ -764,11 +774,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) { diff --git a/src/hotspot/share/cds/heapShared.hpp b/src/hotspot/share/cds/heapShared.hpp index 0ba20f1e313b7..9bb85db0fe9d2 100644 --- a/src/hotspot/share/cds/heapShared.hpp +++ b/src/hotspot/share/cds/heapShared.hpp @@ -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 From 4b7906375b4bd11a480665110561180825c2dd9c Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Mon, 16 Sep 2024 05:41:58 +0000 Subject: [PATCH 031/307] 8339842: Open source several AWT focus tests - series 2 Reviewed-by: prr --- .../awt/Focus/FocusChangeOnResizeTest.java | 122 ++++++++ .../awt/Focus/LightweightFocusLostTest.java | 261 ++++++++++++++++++ test/jdk/java/awt/Focus/MixedWeightFocus.java | 207 ++++++++++++++ .../java/awt/Focus/NextFocusHelperTest.java | 111 ++++++++ 4 files changed, 701 insertions(+) create mode 100644 test/jdk/java/awt/Focus/FocusChangeOnResizeTest.java create mode 100644 test/jdk/java/awt/Focus/LightweightFocusLostTest.java create mode 100644 test/jdk/java/awt/Focus/MixedWeightFocus.java create mode 100644 test/jdk/java/awt/Focus/NextFocusHelperTest.java 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/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/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); + } +} + From 6be15c3d0bf0bb3625f2ecd43d7aa10e81f6edd8 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Mon, 16 Sep 2024 08:15:48 +0000 Subject: [PATCH 032/307] 8340012: [C2] assert(KlassEncodingMetaspaceMax > pd) failed: change encoding max if new encoding after 8338526 Reviewed-by: kvn, coleenp --- src/hotspot/share/ci/ciKlass.hpp | 7 +++++++ src/hotspot/share/oops/compressedKlass.inline.hpp | 2 +- src/hotspot/share/opto/compile.cpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/ci/ciKlass.hpp b/src/hotspot/share/ci/ciKlass.hpp index 58a62b248a4e8..de2d3701f3ebd 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_in_encoding_range(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/oops/compressedKlass.inline.hpp b/src/hotspot/share/oops/compressedKlass.inline.hpp index 87ef2102b3890..9cfef964f1866 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"); diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 58a716abd216c..143189d7eba84 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -3324,7 +3324,7 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f bool is_klass = t->isa_klassptr() != nullptr; if ((is_oop && Matcher::const_oop_prefer_decode() ) || - (is_klass && Matcher::const_klass_prefer_decode())) { + (is_klass && 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; From a4eb9a063fb9e4a87923d464fe2c50ed5466acff Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Mon, 16 Sep 2024 08:34:54 +0000 Subject: [PATCH 033/307] 8339918: Remove checks for outdated -t -tm -Xfuture -checksource -cs -noasyncgc options from the launcher Reviewed-by: dholmes, alanb --- .../sun/launcher/resources/launcher.properties | 3 --- src/java.base/share/man/java.1 | 16 ++++++++++------ src/java.base/share/native/libjli/java.c | 14 +------------- .../com/sun/tools/example/debug/tty/TTY.java | 8 ++------ 4 files changed, 13 insertions(+), 28 deletions(-) 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/man/java.1 b/src/java.base/share/man/java.1 index 58e4faf17c348..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: diff --git a/src/java.base/share/native/libjli/java.c b/src/java.base/share/native/libjli/java.c index 1b4ece834d6e5..79bd0c4e2337f 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 @@ -1464,17 +1464,10 @@ ParseArguments(int *pargc, char ***pargv, return JNI_FALSE; } else if (JLI_StrCmp(arg, "-verbosegc") == 0) { 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) { 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) { AddOption("-Xverify:all", NULL); } else if (JLI_StrCmp(arg, "-verifyremote") == 0) { @@ -1493,11 +1486,6 @@ ParseArguments(int *pargc, char ***pargv, 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 */ } else if (JLI_StrCmp(arg, "--disable-@files") == 0) { 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")) { From 545951889c1ea68646be600decaf2bf4c049600b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Sj=C3=B6len?= Date: Mon, 16 Sep 2024 09:13:37 +0000 Subject: [PATCH 034/307] 8339627: Cleanup Unsafe.setMemory intrinsic code Reviewed-by: tschatzl, fbredberg --- src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp | 3 --- src/hotspot/share/runtime/stubRoutines.hpp | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) 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/share/runtime/stubRoutines.hpp b/src/hotspot/share/runtime/stubRoutines.hpp index 206a5ec2e992c..f5b932569be81 100644 --- a/src/hotspot/share/runtime/stubRoutines.hpp +++ b/src/hotspot/share/runtime/stubRoutines.hpp @@ -404,7 +404,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; } From 05b9d47905a0dd6dd7a042f940fe120d3a8338d1 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Mon, 16 Sep 2024 14:06:02 +0000 Subject: [PATCH 035/307] 8340194: Replace usage of -ms with -Xms in LauncherCommon.gmk make file Reviewed-by: ihse, jwaters --- make/common/modules/LauncherCommon.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From e1ebeef0405ac6e48564a035767ee256291b9ca9 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Mon, 16 Sep 2024 14:08:08 +0000 Subject: [PATCH 036/307] 8340131: Refactor internal makeHiddenClassDefiner to take option mask instead of Set Reviewed-by: liach, jvernee --- .../invoke/InnerClassLambdaMetafactory.java | 4 +- .../lang/invoke/InvokerBytecodeGenerator.java | 3 +- .../java/lang/invoke/MethodHandleImpl.java | 3 +- .../java/lang/invoke/MethodHandleProxies.java | 2 +- .../java/lang/invoke/MethodHandles.java | 54 ++++++++++++------- .../java/lang/invoke/StringConcatFactory.java | 3 +- 6 files changed, 44 insertions(+), 25 deletions(-) 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..6031b55a107b2 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); } 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..f17bbd17c9467 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; @@ -1111,7 +1112,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; 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/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) { From 996790c70f902d7840d0649a6b0867bed47c6537 Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Mon, 16 Sep 2024 14:55:53 +0000 Subject: [PATCH 037/307] 8339954: Print JVMCI names with the Compiler.{perfmap,codelist,CodeHeap_Analytics} diagnostic commands Reviewed-by: phh, dnsimon --- src/hotspot/share/code/codeCache.cpp | 26 +++++++++++++++++------- src/hotspot/share/code/codeHeapState.cpp | 17 +++++++++++++++- 2 files changed, 35 insertions(+), 8 deletions(-) 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); } From 1640bd2676d8d183f02b4f5386ce42c47950e356 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 16 Sep 2024 16:22:38 +0000 Subject: [PATCH 038/307] 8340186: Shenandoah: Missing load_reference_barrier_phantom_narrow match in is_shenandoah_lrb_call Reviewed-by: kvn --- src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp index d2820f3aa267f..368d76696058c 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp @@ -281,7 +281,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) { From 65b9abaa29eb9fe801b650ce787d98c31770a5dc Mon Sep 17 00:00:00 2001 From: Justin Lu Date: Mon, 16 Sep 2024 17:26:47 +0000 Subject: [PATCH 039/307] 8339769: Incorrect error message during startup if working directory does not exist Reviewed-by: naoto, dholmes, alanb --- src/java.base/unix/native/libjava/java_props_md.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 = "/"; From 89759c8b02ec73de0d734d10b16382109c7a8b45 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Mon, 16 Sep 2024 18:08:09 +0000 Subject: [PATCH 040/307] 8321935: Define the term 'standard doclet' Reviewed-by: hannesw --- .../share/classes/jdk/javadoc/doclet/StandardDoclet.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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

    * From 59407faf7b6861d142dbc3700a6fa9615567a275 Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Mon, 16 Sep 2024 18:24:47 +0000 Subject: [PATCH 041/307] 8310525: DynamicLauncher for JDP test needs to try harder to find a free port Reviewed-by: lmesnik, cjplummer --- test/jdk/sun/management/jdp/DynamicLauncher.java | 6 ++++-- .../jmxremote/bootstrap/JMXInterfaceBindingTest.java | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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(); From 858b4f127ad873666f51f4c54c37fa2d7801c32c Mon Sep 17 00:00:00 2001 From: Kelvin Nilsen Date: Mon, 16 Sep 2024 19:15:30 +0000 Subject: [PATCH 042/307] 8339960: GenShen: Fix inconsistencies in generational Shenandoah behavior Reviewed-by: wkemper, rkennke --- src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)); From b26645f64bb6dd3efafaceb92bedeaf8f93906e3 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Mon, 16 Sep 2024 19:28:20 +0000 Subject: [PATCH 043/307] 8339883: Open source several AWT/2D related tests Reviewed-by: psadhukhan, honkar --- .../GraphicsConfiguration/NonDefaultGC.java | 124 ++++++++++++++++++ .../awt/GraphicsConfiguration/Position.java | 94 +++++++++++++ test/jdk/sun/java2d/pipe/DrawImageBgTest.java | 97 ++++++++++++++ test/jdk/sun/java2d/pipe/duke.gif | Bin 0 -> 1929 bytes 4 files changed, 315 insertions(+) create mode 100644 test/jdk/java/awt/GraphicsConfiguration/NonDefaultGC.java create mode 100644 test/jdk/java/awt/GraphicsConfiguration/Position.java create mode 100644 test/jdk/sun/java2d/pipe/DrawImageBgTest.java create mode 100644 test/jdk/sun/java2d/pipe/duke.gif 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/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 0000000000000000000000000000000000000000..ed32e0ff79b05c07b82863ce6fb07fa9898adaa2 GIT binary patch literal 1929 zcmWlYe^AtB8pi`HvM4_?{J2I$8$dLc1#@!R2zwgXMWdj^k;9xr+bDW&4{JlE8WpDj z7F-cwwK{H<)?L&#SJz$!;hJ{%BY2FYf)Wp^xl?aq!5Xcdi$c#hV~>m9_n-Hl=Xsy+ z=li^?*Q~;pZ+R1N1J40KRkeWM7ew3~jLM24A{CM-A}~TzqzYpq&od0GC=z71!w_=b z-==B0rt2t*nA}((5YSLs6a*Z@X__WqiSjTW6oLo{5km&|K1mGAimYjhs#wwZtvV8SV~7LCFpgub+-TTAk%UQb0dE_cj+pc?!+0o?qG$?% zVFD)%!w7Z;g)ndE8Uk6Aky=+kLaUQ{UW`XS?Nn*s@SQ{VmFgGdkV{&&98EcEQ5hjc@H$`e)fX zj@&GdchxpMUo|-A^M4iBP3(#Ib53Ap?5{nGT7SBA_V!o!TTzL5R~FUWe)4X?@iTd8 z1;TcF^rQLj?4p0uy?@ikb2eUSXdHVa_jIn=@W%a<6~57D>am6&Z!{lzc=@ZbuGB8` zpU38H8d~@82Da!+qdYG5ls&Cx?~|oPMnbqTHMw%I*KlV~?fc{rSwe29?Om}fsknG# z@n5IwY=4Mx>>0WJLG>=yJX^WbHA30iQ$H!X)3<4K zBe1|sf3NKKTS;)mg{$k(2eDJG^u5=&x{@M!V>EWgzRA((>}?o{WQBehp1mIHU!BGG zYz5_6B(+KIVdCVoum2ItM&gXZd+SB^vQTN=a zeYbbah=i-xCho2{4Pazv_i%2mH`EkM{r8XYDLbdY@(a7Ud}$%!$QrTN_DqwNXA9~g zTGKxKyfto7NDp;5A3O5zgb(hyxjN@OAG!(zy^*Ug4!yjF=Y*8aHA@ovB1({&a4;sR zTf1CVC{>Pgy`m$lG;P1$pC_6F7u%iP+qz0q4{lXT`i9g-ThiYgO^GXC`f?JNo*|@p zr{b%U-tSKw99q0|YJa9{Va?`H{IaNICo>p5lGEY*+IDR4bfIUwq~CTRuC_mGWA%~W zea{@eKJ(Iq^7MvdsPsR%&vt$@4i&s?bPptz#y#!FcRZEaMS0WFTyXMCUEfsNxnJ_9 zPwpt`Er4O>``2G{7=4r1GCSTO8#0xw+{<^L4X(K8y1wKj72KLrYD}Y7SJuY7y==wf z;UkI5?(v?h+4r;vR{P*U`ul~=D@U7K5$eV8c!%rX-38vE>azU80UrhFXCv#d`(ylZS4+i2a^vI91MTIxCx%9gd2&N&D9RC&xcpx8#f=GZv%9;F z#?CEVT%UV$nk;L%RJA+d=f8ZB@U*Xz-TZbG?HKKT(VJZMBH!)$#qRuwbFc%Aljqha zoNBs8od~V$_^vux0ZSk!iP!hI($t35SxY8`FV{pxCjpU}Ova2VIg1&>V)CvvMb_ Date: Mon, 16 Sep 2024 20:03:00 +0000 Subject: [PATCH 044/307] 8340073: Support "%z" time zone abbreviation format in TZ files Reviewed-by: jlu, joehw, coffeys --- .../build/tools/cldrconverter/CLDRConverter.java | 16 ++++++++++------ .../util/cldr/CLDRTimeZoneNameProviderImpl.java | 10 +++++++--- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java index 0ca2a226a960c..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); } @@ -1490,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/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"); From 99d7185071a5daa695adc6255d37ce382285a9b3 Mon Sep 17 00:00:00 2001 From: Denghui Dong Date: Tue, 17 Sep 2024 00:13:47 +0000 Subject: [PATCH 045/307] 8340144: C1: remove unused Compilation::_max_spills Reviewed-by: thartmann, shade --- src/hotspot/share/c1/c1_Compilation.cpp | 5 +---- src/hotspot/share/c1/c1_Compilation.hpp | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) 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; } From 3e03e6673acfea543d0dbbc64b7a4f52e3292c2b Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Tue, 17 Sep 2024 00:56:31 +0000 Subject: [PATCH 046/307] 8340176: Replace usage of -noclassgc with -Xnoclassgc in test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.java Reviewed-by: kevinw, lmesnik --- .../java/lang/management/MemoryMXBean/LowMemoryTest2.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 */ From a4cf1918c963cbe0b0eee6db580f0769c0cbdbcc Mon Sep 17 00:00:00 2001 From: Jatin Bhateja Date: Tue, 17 Sep 2024 01:41:53 +0000 Subject: [PATCH 047/307] 8339793: Fix incorrect APX feature enabling with -XX:-UseAPX Reviewed-by: kvn, thartmann, sviswanathan --- src/hotspot/cpu/x86/vm_version_x86.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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; From 7849f252937dc774a1935cc4c68f2a46649f180b Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Tue, 17 Sep 2024 05:22:59 +0000 Subject: [PATCH 048/307] 8340184: Bug in CompressedKlassPointers::is_in_encodable_range Reviewed-by: coleenp, rkennke, jsjolen --- .../cpu/aarch64/compressedKlass_aarch64.cpp | 4 +- .../cpu/aarch64/macroAssembler_aarch64.cpp | 4 +- src/hotspot/share/ci/ciKlass.hpp | 2 +- .../types/traceid/jfrTraceIdKlassQueue.cpp | 2 +- src/hotspot/share/oops/compressedKlass.cpp | 27 ++++-- src/hotspot/share/oops/compressedKlass.hpp | 90 +++++++++++++++---- .../share/oops/compressedKlass.inline.hpp | 5 ++ .../share/utilities/globalDefinitions.hpp | 5 ++ .../gtest/oops/test_compressedKlass.cpp | 79 ++++++++++++++++ .../jtreg/gtest/CompressedKlassGtest.java | 39 ++++++++ 10 files changed, 230 insertions(+), 27 deletions(-) create mode 100644 test/hotspot/gtest/oops/test_compressedKlass.cpp create mode 100644 test/hotspot/jtreg/gtest/CompressedKlassGtest.java 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/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index d09ef26cef995..08b69b34a9462 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -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/share/ci/ciKlass.hpp b/src/hotspot/share/ci/ciKlass.hpp index de2d3701f3ebd..10d8395ed7fb9 100644 --- a/src/hotspot/share/ci/ciKlass.hpp +++ b/src/hotspot/share/ci/ciKlass.hpp @@ -109,7 +109,7 @@ class ciKlass : public ciType { bool is_in_encoding_range() { Klass* k = get_Klass(); - bool is_in_encoding_range = CompressedKlassPointers::is_in_encoding_range(k); + 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; } 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/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 9cfef964f1866..c9c9af24ad8a8 100644 --- a/src/hotspot/share/oops/compressedKlass.inline.hpp +++ b/src/hotspot/share/oops/compressedKlass.inline.hpp @@ -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/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/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/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 + */ From 10050a723954926926650af65417d5b828cba387 Mon Sep 17 00:00:00 2001 From: Kangcheng Xu Date: Tue, 17 Sep 2024 07:19:02 +0000 Subject: [PATCH 049/307] 8332442: C2: refactor Mod cases in Compile::final_graph_reshaping_main_switch() Reviewed-by: roland, chagedorn, jkarthikeyan --- src/hotspot/share/opto/compile.cpp | 96 +++------- src/hotspot/share/opto/compile.hpp | 1 + src/hotspot/share/opto/divnode.cpp | 18 ++ src/hotspot/share/opto/divnode.hpp | 2 + src/hotspot/share/opto/node.hpp | 32 ++++ .../jtreg/compiler/c2/TestDivModNodes.java | 178 ++++++++++++++++++ .../compiler/lib/ir_framework/IRNode.java | 25 +++ 7 files changed, 284 insertions(+), 68 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/TestDivModNodes.java diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 143189d7eba84..f4cf9e7e4029b 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -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 @@ -3609,83 +3633,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/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/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/lib/ir_framework/IRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java index 24fbe7e64afa0..16f56012d3dd9 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java @@ -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)"); From 7834662ca35aeb202d177fde1044add611240ecd Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Tue, 17 Sep 2024 08:11:22 +0000 Subject: [PATCH 050/307] 8340119: Remove oopDesc::size_might_change() Reviewed-by: stefank, iwalulya --- src/hotspot/share/oops/oop.cpp | 11 ----------- src/hotspot/share/oops/oop.hpp | 2 -- src/hotspot/share/oops/oop.inline.hpp | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) 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); From c6721a0fa2582c3ddf1ef0a6e16a09234432939c Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Tue, 17 Sep 2024 09:18:54 +0000 Subject: [PATCH 051/307] 8340009: Improve the output from assert_different_registers Reviewed-by: aboldtch, dholmes, shade, mli --- src/hotspot/share/asm/register.hpp | 10 +++++++--- src/hotspot/share/utilities/debug.hpp | 15 +++++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) 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/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") From 8b6e2770a53002fcc9e07d38b954e6854a644f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lund=C3=A9n?= Date: Tue, 17 Sep 2024 09:53:55 +0000 Subject: [PATCH 052/307] 8340273: Remove CounterHalfLifeTime Reviewed-by: chagedorn, dholmes --- src/hotspot/share/runtime/globals.hpp | 3 --- 1 file changed, 3 deletions(-) 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") \ From 269cd38b55391364db0f92291eb29c3b6803db94 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Tue, 17 Sep 2024 10:39:31 +0000 Subject: [PATCH 053/307] 8338566: Lazy creation of exception instances is not thread safe Reviewed-by: shade, kvn, dlong --- src/hotspot/share/cds/heapShared.cpp | 3 ++ src/hotspot/share/ci/ciEnv.cpp | 64 ++++----------------------- src/hotspot/share/ci/ciEnv.hpp | 23 +++++----- src/hotspot/share/memory/universe.cpp | 21 ++++++++- src/hotspot/share/memory/universe.hpp | 3 ++ src/hotspot/share/runtime/threads.cpp | 1 + 6 files changed, 47 insertions(+), 68 deletions(-) diff --git a/src/hotspot/share/cds/heapShared.cpp b/src/hotspot/share/cds/heapShared.cpp index 68be14a46fe74..2bf75a5ba6512 100644 --- a/src/hotspot/share/cds/heapShared.cpp +++ b/src/hotspot/share/cds/heapShared.cpp @@ -1322,6 +1322,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/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/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/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); From 80db6e71b092867212147bd369a9fda65dbd4b70 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 17 Sep 2024 11:58:58 +0000 Subject: [PATCH 054/307] 8339648: ZGC: Division by zero in rule_major_allocation_rate Reviewed-by: aboldtch, lucy, tschatzl --- src/hotspot/share/gc/z/zDirector.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/z/zDirector.cpp b/src/hotspot/share/gc/z/zDirector.cpp index 3ba8698bd8e22..8901a9fbc6500 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. From b39e6a84ef947661b5c878d02213da3a79bc026c Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Tue, 17 Sep 2024 12:58:36 +0000 Subject: [PATCH 055/307] 8329816: Add SLEEF version 3.6.1 Reviewed-by: erikj, mli, luhenry --- make/Main.gmk | 4 + make/UpdateSleefSource.gmk | 153 + make/autoconf/basic_tools.m4 | 1 + make/autoconf/spec.gmk.template | 1 + src/jdk.incubator.vector/linux/legal/sleef.md | 439 + .../linux/native/libsleef/README.md | 54 + .../linux/native/libsleef/generated/misc.h | 332 + .../libsleef/generated/sleefinline_advsimd.h | 6907 ++++++++ .../libsleef/generated/sleefinline_rvvm1.h | 7073 ++++++++ .../libsleef/generated/sleefinline_sve.h | 6945 ++++++++ .../native/libsleef/upstream/CHANGELOG.md | 255 + .../native/libsleef/upstream/CMakeLists.txt | 339 + .../native/libsleef/upstream/CONTRIBUTORS.md | 27 + .../native/libsleef/upstream/Configure.cmake | 860 + .../native/libsleef/upstream/LICENSE.txt | 23 + .../linux/native/libsleef/upstream/README.md | 221 + .../libsleef/upstream/include/sleefdft.h | 71 + .../libsleef/upstream/sleef-config.h.in | 11 + .../libsleef/upstream/sleefConfig.cmake | 1 + .../libsleef/upstream/src/CMakeLists.txt | 22 + .../upstream/src/arch/helperadvsimd.h | 837 + .../libsleef/upstream/src/arch/helperavx.h | 638 + .../libsleef/upstream/src/arch/helperavx2.h | 485 + .../upstream/src/arch/helperavx2_128.h | 463 + .../upstream/src/arch/helperavx512f.h | 600 + .../libsleef/upstream/src/arch/helperneon32.h | 297 + .../upstream/src/arch/helperpower_128.h | 873 + .../libsleef/upstream/src/arch/helperpurec.h | 561 + .../upstream/src/arch/helperpurec_scalar.h | 487 + .../libsleef/upstream/src/arch/helperrvv.h | 1412 ++ .../upstream/src/arch/helpers390x_128.h | 462 + .../libsleef/upstream/src/arch/helpersse2.h | 517 + .../libsleef/upstream/src/arch/helpersve.h | 1115 ++ .../libsleef/upstream/src/arch/helpervecext.h | 871 + .../upstream/src/common/CMakeLists.txt | 25 + .../libsleef/upstream/src/common/addSuffix.c | 234 + .../libsleef/upstream/src/common/arraymap.c | 347 + .../libsleef/upstream/src/common/arraymap.h | 21 + .../libsleef/upstream/src/common/common.c | 98 + .../libsleef/upstream/src/common/common.h | 9 + .../upstream/src/common/commonfuncs.h | 438 + .../native/libsleef/upstream/src/common/dd.h | 324 + .../native/libsleef/upstream/src/common/df.h | 369 + .../libsleef/upstream/src/common/estrin.h | 40 + .../libsleef/upstream/src/common/f128util.h | 92 + .../libsleef/upstream/src/common/keywords.txt | 683 + .../upstream/src/common/main_checkfeature.c | 50 + .../libsleef/upstream/src/common/misc.h | 332 + .../libsleef/upstream/src/common/quaddef.h | 99 + .../upstream/src/dft-tester/CMakeLists.txt | 201 + .../upstream/src/dft-tester/bench1d.c | 116 + .../upstream/src/dft-tester/fftwtest1d.c | 230 + .../upstream/src/dft-tester/fftwtest2d.c | 143 + .../upstream/src/dft-tester/measuredft.c | 175 + .../upstream/src/dft-tester/naivetest.c | 484 + .../upstream/src/dft-tester/roundtriptest1d.c | 174 + .../upstream/src/dft-tester/roundtriptest2d.c | 118 + .../upstream/src/dft-tester/tutorial.c | 80 + .../libsleef/upstream/src/dft/CMakeLists.txt | 425 + .../native/libsleef/upstream/src/dft/dft.c | 1441 ++ .../libsleef/upstream/src/dft/dftcommon.c | 423 + .../libsleef/upstream/src/dft/dftcommon.h | 69 + .../libsleef/upstream/src/dft/mkdispatch.c | 193 + .../libsleef/upstream/src/dft/mkunroll.c | 104 + .../libsleef/upstream/src/dft/unroll0.org | 14169 ++++++++++++++++ .../libsleef/upstream/src/dft/vectortype.h | 145 + .../libsleef/upstream/src/gencoef/Makefile | 16 + .../native/libsleef/upstream/src/gencoef/dp.h | 196 + .../libsleef/upstream/src/gencoef/gencoef.c | 375 + .../libsleef/upstream/src/gencoef/gencoef.txt | 43 + .../native/libsleef/upstream/src/gencoef/ld.h | 178 + .../upstream/src/gencoef/mkrempitab.c | 121 + .../upstream/src/gencoef/mkrempitabqp.c | 63 + .../native/libsleef/upstream/src/gencoef/qp.h | 161 + .../libsleef/upstream/src/gencoef/simplexfr.c | 459 + .../native/libsleef/upstream/src/gencoef/sp.h | 159 + .../upstream/src/libm-benchmarks/Makefile | 153 + .../src/libm-benchmarks/ProcessData.java | 193 + .../upstream/src/libm-benchmarks/bench.h | 58 + .../upstream/src/libm-benchmarks/benchsleef.c | 144 + .../src/libm-benchmarks/benchsleef128.c | 195 + .../src/libm-benchmarks/benchsleef256.c | 181 + .../src/libm-benchmarks/benchsleef512.c | 180 + .../upstream/src/libm-benchmarks/benchsvml.c | 153 + .../src/libm-benchmarks/benchsvml128.c | 144 + .../src/libm-benchmarks/benchsvml256.c | 147 + .../src/libm-benchmarks/benchsvml512.c | 144 + .../upstream/src/libm-benchmarks/measure.sh | 17 + .../upstream/src/libm-tester/CMakeLists.txt | 517 + .../upstream/src/libm-tester/autovec.c | 651 + .../src/libm-tester/gnuabi_compatibility.c | 714 + .../upstream/src/libm-tester/hash_cinz.txt | 129 + .../upstream/src/libm-tester/hash_finz.txt | 129 + .../libsleef/upstream/src/libm-tester/iut.c | 777 + .../upstream/src/libm-tester/iutcuda.cu | 546 + .../upstream/src/libm-tester/iutsimd.c | 859 + .../upstream/src/libm-tester/mveclibtest.c | 92 + .../upstream/src/libm-tester/tester.c | 5147 ++++++ .../upstream/src/libm-tester/tester2dp.c | 991 ++ .../upstream/src/libm-tester/tester2ld.c | 241 + .../upstream/src/libm-tester/tester2qp.c | 624 + .../upstream/src/libm-tester/tester2simddp.c | 1298 ++ .../upstream/src/libm-tester/tester2simdsp.c | 1298 ++ .../upstream/src/libm-tester/tester2sp.c | 1037 ++ .../upstream/src/libm-tester/tester3.c | 524 + .../upstream/src/libm-tester/testerutil.c | 324 + .../upstream/src/libm-tester/testerutil.h | 100 + .../upstream/src/libm-tester/testervecabi.c | 850 + .../libsleef/upstream/src/libm/CMakeLists.txt | 1065 ++ .../libsleef/upstream/src/libm/dispatcher.h | 172 + .../libsleef/upstream/src/libm/dispavx.c.org | 72 + .../upstream/src/libm/disppower_128.c.org | 30 + .../upstream/src/libm/disps390x_128.c.org | 27 + .../upstream/src/libm/dispscalar.c.org | 24 + .../upstream/src/libm/dispscalar_footer.c.org | 183 + .../libsleef/upstream/src/libm/dispsse.c.org | 65 + .../libsleef/upstream/src/libm/funcproto.h | 126 + .../libsleef/upstream/src/libm/mkalias.c | 160 + .../libsleef/upstream/src/libm/mkdisp.c | 201 + .../upstream/src/libm/mkmasked_gnuabi.c | 176 + .../libsleef/upstream/src/libm/mkrename.c | 617 + .../upstream/src/libm/mkrename_gnuabi.c | 100 + .../libsleef/upstream/src/libm/norename.h | 203 + .../libsleef/upstream/src/libm/rempitab.c | 1092 ++ .../libsleef/upstream/src/libm/rename.h | 181 + .../libsleef/upstream/src/libm/sleef.pc.in | 9 + .../libsleef/upstream/src/libm/sleefdp.c | 2724 +++ .../src/libm/sleefinline_cuda_header.h.org | 1094 ++ .../src/libm/sleefinline_header.h.org | 1120 ++ .../libsleef/upstream/src/libm/sleefld.c | 419 + .../upstream/src/libm/sleeflibm_footer.h.org | 8 + .../src/libm/sleeflibm_header.h.org.in | 364 + .../libsleef/upstream/src/libm/sleefqp.c | 472 + .../libsleef/upstream/src/libm/sleefsimddp.c | 3741 ++++ .../libsleef/upstream/src/libm/sleefsimdsp.c | 3709 ++++ .../libsleef/upstream/src/libm/sleefsp.c | 2436 +++ .../libsleef/upstream/src/libm/tryvsx3.c | 8 + .../libsleef/upstream/src/libm/tryvxe2.c | 8 + .../upstream/src/quad-tester/CMakeLists.txt | 253 + .../upstream/src/quad-tester/hash_printf.txt | 4 + .../upstream/src/quad-tester/qiutcuda.cu | 472 + .../upstream/src/quad-tester/qiutsimd.c | 804 + .../upstream/src/quad-tester/qtester.c | 1580 ++ .../upstream/src/quad-tester/qtesterutil.c | 638 + .../upstream/src/quad-tester/qtesterutil.h | 66 + .../libsleef/upstream/src/quad-tester/qutil.c | 41 + .../upstream/src/quad-tester/tester2printf.c | 283 + .../upstream/src/quad-tester/tester2simdqp.c | 1098 ++ .../upstream/src/quad-tester/tester3printf.c | 265 + .../libsleef/upstream/src/quad/CMakeLists.txt | 504 + .../libsleef/upstream/src/quad/qdispatcher.h | 154 + .../upstream/src/quad/qdispscalar.c.org | 23 + .../libsleef/upstream/src/quad/qdispx2.c.org | 39 + .../libsleef/upstream/src/quad/qfuncproto.h | 130 + .../libsleef/upstream/src/quad/qmkdisp.c | 206 + .../libsleef/upstream/src/quad/qmkrename.c | 340 + .../libsleef/upstream/src/quad/rempitabqp.c | 4176 +++++ .../upstream/src/quad/sleefquad_footer.h.org | 112 + .../src/quad/sleefquad_header.h.org.in | 247 + .../quad/sleefquadinline_cuda_header.h.org | 4196 +++++ .../src/quad/sleefquadinline_footer.h.org | 78 + .../src/quad/sleefquadinline_header.h.org | 4216 +++++ .../libsleef/upstream/src/quad/sleefsimdqp.c | 4521 +++++ .../upstream/toolchains/aarch64-gcc.cmake | 11 + .../upstream/toolchains/aarch64-llvm.cmake | 12 + .../upstream/toolchains/armhf-gcc.cmake | 11 + .../upstream/toolchains/armhf-llvm.cmake | 12 + .../upstream/toolchains/native-gcc.cmake | 1 + .../upstream/toolchains/native-llvm.cmake | 1 + .../upstream/toolchains/ppc64el-gcc.cmake | 13 + .../upstream/toolchains/ppc64el-llvm.cmake | 14 + .../upstream/toolchains/riscv64-gcc.cmake | 11 + .../upstream/toolchains/riscv64-llvm.cmake | 12 + .../upstream/toolchains/s390x-gcc.cmake | 11 + .../upstream/toolchains/s390x-llvm.cmake | 12 + 175 files changed, 120709 insertions(+) create mode 100644 make/UpdateSleefSource.gmk create mode 100644 src/jdk.incubator.vector/linux/legal/sleef.md create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/README.md create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/generated/misc.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_advsimd.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_rvvm1.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_sve.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/CHANGELOG.md create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/CMakeLists.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/CONTRIBUTORS.md create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/Configure.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/LICENSE.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/README.md create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/include/sleefdft.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/sleef-config.h.in create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/sleefConfig.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/CMakeLists.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperadvsimd.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx2.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx2_128.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx512f.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperneon32.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperpower_128.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperpurec.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperpurec_scalar.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperrvv.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpers390x_128.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpersse2.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpersve.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpervecext.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/CMakeLists.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/addSuffix.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/arraymap.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/arraymap.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/common.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/common.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/commonfuncs.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/dd.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/df.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/estrin.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/f128util.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/keywords.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/main_checkfeature.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/misc.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/quaddef.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/CMakeLists.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/bench1d.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/fftwtest1d.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/fftwtest2d.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/measuredft.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/naivetest.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/roundtriptest1d.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/roundtriptest2d.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/tutorial.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/CMakeLists.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dft.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dftcommon.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dftcommon.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/mkdispatch.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/mkunroll.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/unroll0.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/vectortype.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/Makefile create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/dp.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/gencoef.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/gencoef.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/ld.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/mkrempitab.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/mkrempitabqp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/qp.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/simplexfr.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/sp.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/Makefile create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/ProcessData.java create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/bench.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef128.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef256.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef512.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml128.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml256.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml512.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/measure.sh create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/CMakeLists.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/autovec.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/gnuabi_compatibility.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/hash_cinz.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/hash_finz.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iut.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iutcuda.cu create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iutsimd.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/mveclibtest.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2dp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2ld.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2qp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2simddp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2simdsp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2sp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester3.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/testerutil.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/testerutil.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/testervecabi.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/CMakeLists.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispatcher.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispavx.c.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/disppower_128.c.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/disps390x_128.c.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispscalar.c.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispscalar_footer.c.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispsse.c.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/funcproto.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkalias.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkdisp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkmasked_gnuabi.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkrename.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkrename_gnuabi.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/norename.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/rempitab.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/rename.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleef.pc.in create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefdp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefinline_cuda_header.h.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefinline_header.h.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefld.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleeflibm_footer.h.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleeflibm_header.h.org.in create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefqp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsimddp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsimdsp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/tryvsx3.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/tryvxe2.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/CMakeLists.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/hash_printf.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qiutcuda.cu create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qiutsimd.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qtester.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qtesterutil.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qtesterutil.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qutil.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester2printf.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester2simdqp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester3printf.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/CMakeLists.txt create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispatcher.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispscalar.c.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispx2.c.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qfuncproto.h create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qmkdisp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qmkrename.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/rempitabqp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquad_footer.h.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquad_header.h.org.in create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_cuda_header.h.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_footer.h.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_header.h.org create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefsimdqp.c create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/aarch64-gcc.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/aarch64-llvm.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/armhf-gcc.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/armhf-llvm.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/native-gcc.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/native-llvm.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/ppc64el-gcc.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/ppc64el-llvm.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/riscv64-gcc.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/riscv64-llvm.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/s390x-gcc.cmake create mode 100644 src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/s390x-llvm.cmake 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/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) From f87701635f82895fc10586e588f25e9c508e6979 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Tue, 17 Sep 2024 15:50:16 +0000 Subject: [PATCH 056/307] 8315273: (fs) Path.toRealPath(LinkOption.NOFOLLOW_LINKS) fails when "../../" follows a link (win) Reviewed-by: djelinski --- .../share/classes/java/nio/file/Path.java | 4 ++-- test/jdk/ProblemList.txt | 2 -- test/jdk/java/nio/file/Path/ToRealPath.java | 24 +++++++++++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) 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/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index dbf09a89c53ed..e8344ae6dd393 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -569,8 +569,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 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); } } From 64e3a9ee91a6ae939e479a10cfc597e628c571e5 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Tue, 17 Sep 2024 15:50:32 +0000 Subject: [PATCH 057/307] 8339574: Behavior of File.is{Directory,File,Hidden} is not documented with respect to symlinks Reviewed-by: djelinski, alanb --- src/java.base/share/classes/java/io/File.java | 25 +++++++++++--- .../classes/java/io/FileInputStream.java | 6 +++- .../classes/java/io/FileOutputStream.java | 33 +++++++++++++------ .../classes/java/io/RandomAccessFile.java | 19 ++++++++--- 4 files changed, 63 insertions(+), 20 deletions(-) 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/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 From 3e14fb9c16e4ac3ad3c565059c534cfeacb45c7b Mon Sep 17 00:00:00 2001 From: "David M. Lloyd" Date: Tue, 17 Sep 2024 16:24:38 +0000 Subject: [PATCH 058/307] 8340200: Misspelled constant `AttributesProcessingOption.DROP_UNSTABLE_ATRIBUTES` Reviewed-by: liach --- src/java.base/share/classes/java/lang/classfile/ClassFile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } /** From 28d009ce0ecd4369351de859c491831b7f7bbb28 Mon Sep 17 00:00:00 2001 From: Raffaello Giulietti Date: Tue, 17 Sep 2024 17:11:32 +0000 Subject: [PATCH 059/307] 8339934: Simplify Math.scalb(double) method Reviewed-by: darcy --- .../share/classes/java/lang/Math.java | 84 +++++++------------ 1 file changed, 30 insertions(+), 54 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Math.java b/src/java.base/share/classes/java/lang/Math.java index 61b59784e0e63..044982a588af8 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, @@ -3283,6 +3285,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 +3319,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 +3396,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); } /** From 90e92f98a6685b196b979853436668cf2b9f2117 Mon Sep 17 00:00:00 2001 From: Jatin Bhateja Date: Tue, 17 Sep 2024 17:46:36 +0000 Subject: [PATCH 060/307] 8339790: Support Intel APX setzucc instruction Reviewed-by: sviswanathan, jkarthikeyan, kvn --- src/hotspot/cpu/x86/assembler_x86.cpp | 9 ++++ src/hotspot/cpu/x86/assembler_x86.hpp | 5 +- src/hotspot/cpu/x86/gc/x/x_x86_64.ad | 6 +-- src/hotspot/cpu/x86/gc/z/z_x86_64.ad | 6 +-- src/hotspot/cpu/x86/macroAssembler_x86.cpp | 9 ++++ src/hotspot/cpu/x86/macroAssembler_x86.hpp | 1 + src/hotspot/cpu/x86/x86_64.ad | 63 ++++++++-------------- 7 files changed, 48 insertions(+), 51 deletions(-) diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index 90c2fad1f5d57..352cfc0018848 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -16040,6 +16040,15 @@ void Assembler::xorq(Address dst, Register src) { 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); diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index 9e7126417b06f..7f4790e05665e 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -1039,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); @@ -1047,6 +1047,9 @@ 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); 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/z_x86_64.ad b/src/hotspot/cpu/x86/gc/z/z_x86_64.ad index 1a4499c3d447d..30220c0629e5e 100644 --- a/src/hotspot/cpu/x86/gc/z/z_x86_64.ad +++ b/src/hotspot/cpu/x86/gc/z/z_x86_64.ad @@ -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..d634c1e575799 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -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/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); From 5dc9723c8172e288872f744bac5fd2342475767a Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Tue, 17 Sep 2024 18:13:54 +0000 Subject: [PATCH 061/307] 8340323: Test jdk/classfile/OptionsTest.java fails after JDK-8340200 Reviewed-by: alanb --- test/jdk/jdk/classfile/OptionsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)))); } From d5881825ef442cac7076d551f0182f16b17b0b53 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Tue, 17 Sep 2024 18:58:46 +0000 Subject: [PATCH 062/307] 8338686: App classpath mismatch if a jar from the Class-Path attribute is on the classpath Reviewed-by: dholmes, iklam --- src/hotspot/share/classfile/classLoader.cpp | 3 +- .../runtime/cds/appcds/ClassPathAttr.java | 58 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) 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/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java b/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java index 560f42d0467da..fe618256f652f 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java @@ -27,6 +27,7 @@ * @summary Class-Path: attribute in MANIFEST file * @requires vm.cds * @library /test/lib + * @compile test-classes/Hello.java * @run driver/timeout=240 ClassPathAttr */ @@ -45,6 +46,7 @@ public class ClassPathAttr { public static void main(String[] args) throws Exception { testNormalOps(); testNonExistentJars(); + testClassPathAttrJarOnCP(); } static void testNormalOps() throws Exception { @@ -197,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) { } From eabfc6e4d901c53b93a78da740ca376607d9576d Mon Sep 17 00:00:00 2001 From: Gerard Ziemski Date: Tue, 17 Sep 2024 19:59:06 +0000 Subject: [PATCH 063/307] 8337563: NMT: rename MEMFLAGS to MemTag Reviewed-by: dholmes, coleenp, jsjolen --- src/hotspot/os/linux/os_linux.cpp | 2 +- src/hotspot/os/posix/os_posix.cpp | 8 +- src/hotspot/os/windows/os_windows.cpp | 14 +- src/hotspot/share/cds/filemap.cpp | 6 +- src/hotspot/share/cds/metaspaceShared.cpp | 6 +- src/hotspot/share/gc/g1/g1BatchedTask.hpp | 4 +- src/hotspot/share/gc/g1/g1MonotonicArena.cpp | 16 +- src/hotspot/share/gc/g1/g1MonotonicArena.hpp | 16 +- .../share/gc/g1/g1RegionToSpaceMapper.cpp | 26 +- .../share/gc/g1/g1RegionToSpaceMapper.hpp | 8 +- .../share/gc/parallel/objectStartArray.cpp | 2 +- .../share/gc/parallel/parMarkBitMap.cpp | 2 +- .../share/gc/parallel/psParallelCompact.cpp | 2 +- .../gc/serial/serialBlockOffsetTable.cpp | 2 +- src/hotspot/share/gc/shared/cardTable.cpp | 2 +- src/hotspot/share/gc/shared/oopStorage.cpp | 20 +- src/hotspot/share/gc/shared/oopStorage.hpp | 14 +- .../share/gc/shared/oopStorage.inline.hpp | 4 +- src/hotspot/share/gc/shared/oopStorageSet.cpp | 10 +- src/hotspot/share/gc/shared/oopStorageSet.hpp | 6 +- .../share/gc/shared/partialArrayState.cpp | 2 +- .../stringdedup/stringDedupProcessor.cpp | 2 +- src/hotspot/share/gc/shared/taskqueue.hpp | 78 ++--- .../share/gc/shared/taskqueue.inline.hpp | 82 ++--- .../gc/shenandoah/shenandoahCollectionSet.cpp | 3 +- .../share/gc/shenandoah/shenandoahHeap.cpp | 8 +- .../gc/shenandoah/shenandoahTaskqueue.hpp | 25 +- .../shenandoah/shenandoahTaskqueue.inline.hpp | 13 +- src/hotspot/share/gc/x/xVirtualMemory.cpp | 4 +- src/hotspot/share/gc/z/zNMT.cpp | 2 +- .../jfr/leakprofiler/chains/jfrbitset.hpp | 2 +- src/hotspot/share/jfr/metadata/metadata.xml | 2 +- .../jfr/periodic/jfrNativeMemoryEvent.cpp | 14 +- .../jfr/periodic/jfrNativeMemoryEvent.hpp | 4 +- .../jfr/recorder/checkpoint/types/jfrType.cpp | 10 +- .../jfr/recorder/storage/jfrVirtualMemory.cpp | 4 +- src/hotspot/share/memory/allocation.cpp | 20 +- src/hotspot/share/memory/allocation.hpp | 116 +++---- .../share/memory/allocation.inline.hpp | 18 +- src/hotspot/share/memory/arena.cpp | 14 +- src/hotspot/share/memory/arena.hpp | 4 +- src/hotspot/share/memory/guardedMemory.cpp | 2 +- src/hotspot/share/memory/heap.cpp | 4 +- src/hotspot/share/memory/memRegion.cpp | 6 +- src/hotspot/share/memory/memRegion.hpp | 4 +- src/hotspot/share/memory/metaspace.cpp | 2 +- .../memory/metaspace/virtualSpaceNode.cpp | 2 +- src/hotspot/share/memory/padded.hpp | 8 +- src/hotspot/share/memory/padded.inline.hpp | 24 +- src/hotspot/share/memory/resourceArea.hpp | 8 +- src/hotspot/share/memory/virtualspace.cpp | 4 +- src/hotspot/share/nmt/allocationSite.hpp | 8 +- src/hotspot/share/nmt/arrayWithFreeList.hpp | 4 +- src/hotspot/share/nmt/mallocHeader.cpp | 6 +- src/hotspot/share/nmt/mallocHeader.hpp | 14 +- src/hotspot/share/nmt/mallocHeader.inline.hpp | 6 +- src/hotspot/share/nmt/mallocLimit.cpp | 28 +- src/hotspot/share/nmt/mallocLimit.hpp | 12 +- src/hotspot/share/nmt/mallocSiteTable.cpp | 16 +- src/hotspot/share/nmt/mallocSiteTable.hpp | 18 +- src/hotspot/share/nmt/mallocTracker.cpp | 24 +- src/hotspot/share/nmt/mallocTracker.hpp | 54 +-- .../share/nmt/mallocTracker.inline.hpp | 12 +- src/hotspot/share/nmt/memBaseline.cpp | 6 +- src/hotspot/share/nmt/memBaseline.hpp | 14 +- src/hotspot/share/nmt/memMapPrinter.cpp | 54 +-- src/hotspot/share/nmt/memMapPrinter.hpp | 2 +- src/hotspot/share/nmt/memReporter.cpp | 134 ++++---- src/hotspot/share/nmt/memReporter.hpp | 16 +- .../share/nmt/{memflags.hpp => memTag.hpp} | 32 +- .../{memFlagBitmap.hpp => memTagBitmap.hpp} | 24 +- src/hotspot/share/nmt/memTracker.cpp | 2 +- src/hotspot/share/nmt/memTracker.hpp | 42 +-- src/hotspot/share/nmt/memTracker.inline.hpp | 6 +- src/hotspot/share/nmt/memoryFileTracker.cpp | 34 +- src/hotspot/share/nmt/memoryFileTracker.hpp | 4 +- .../share/nmt/nativeCallStackPrinter.hpp | 2 +- src/hotspot/share/nmt/nmtCommon.cpp | 12 +- src/hotspot/share/nmt/nmtCommon.hpp | 50 +-- src/hotspot/share/nmt/nmtPreInit.cpp | 6 +- src/hotspot/share/nmt/nmtPreInit.hpp | 8 +- src/hotspot/share/nmt/nmtUsage.cpp | 24 +- src/hotspot/share/nmt/nmtUsage.hpp | 10 +- .../share/nmt/virtualMemoryTracker.cpp | 114 +++---- .../share/nmt/virtualMemoryTracker.hpp | 74 ++--- src/hotspot/share/nmt/vmatree.cpp | 14 +- src/hotspot/share/nmt/vmatree.hpp | 30 +- src/hotspot/share/prims/jni.cpp | 2 +- src/hotspot/share/prims/jvmtiAgentList.hpp | 2 +- src/hotspot/share/prims/whitebox.cpp | 14 +- src/hotspot/share/runtime/handles.hpp | 2 +- src/hotspot/share/runtime/javaThread.cpp | 6 +- src/hotspot/share/runtime/javaThread.hpp | 4 +- .../share/runtime/lightweightSynchronizer.cpp | 6 +- src/hotspot/share/runtime/os.cpp | 56 ++-- src/hotspot/share/runtime/os.hpp | 24 +- .../share/runtime/safepointMechanism.cpp | 4 +- src/hotspot/share/runtime/thread.cpp | 6 +- src/hotspot/share/runtime/thread.hpp | 2 +- src/hotspot/share/services/threadService.cpp | 2 +- src/hotspot/share/utilities/bitMap.cpp | 8 +- src/hotspot/share/utilities/bitMap.hpp | 10 +- src/hotspot/share/utilities/chunkedList.hpp | 16 +- .../share/utilities/concurrentHashTable.hpp | 20 +- .../utilities/concurrentHashTable.inline.hpp | 310 +++++++++--------- .../concurrentHashTableTasks.inline.hpp | 30 +- src/hotspot/share/utilities/debug.cpp | 2 +- src/hotspot/share/utilities/growableArray.cpp | 10 +- src/hotspot/share/utilities/growableArray.hpp | 62 ++-- src/hotspot/share/utilities/linkedlist.hpp | 18 +- src/hotspot/share/utilities/objectBitSet.hpp | 12 +- .../share/utilities/objectBitSet.inline.hpp | 32 +- .../utilities/resizeableResourceHash.hpp | 16 +- src/hotspot/share/utilities/resourceHash.hpp | 18 +- src/hotspot/share/utilities/stack.hpp | 20 +- src/hotspot/share/utilities/stack.inline.hpp | 90 ++--- .../gtest/nmt/test_arrayWithFreeList.cpp | 2 +- .../gtest/nmt/test_nmt_cornercases.cpp | 6 +- .../gtest/nmt/test_nmt_malloclimit.cpp | 26 +- .../gtest/nmt/test_nmt_reserved_region.cpp | 9 +- test/hotspot/gtest/nmt/test_nmt_totals.cpp | 6 +- test/hotspot/gtest/nmt/test_vmatree.cpp | 117 +++---- .../gtest/utilities/test_growableArray.cpp | 6 +- .../gtest/utilities/test_resourceHash.cpp | 9 +- test/hotspot/gtest/utilities/test_utf8.cpp | 2 +- 125 files changed, 1285 insertions(+), 1279 deletions(-) rename src/hotspot/share/nmt/{memflags.hpp => memTag.hpp} (84%) rename src/hotspot/share/nmt/{memFlagBitmap.hpp => memTagBitmap.hpp} (75%) 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/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index a1e0a78837f74..1acce2540a855 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -3428,7 +3428,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 +3441,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 +3458,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 +3473,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) { diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index b86118c686886..7bbb9688015e7 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -1716,10 +1716,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); } @@ -2178,7 +2178,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/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/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/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..6c5e57c947952 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 diff --git a/src/hotspot/share/gc/shared/oopStorage.hpp b/src/hotspot/share/gc/shared/oopStorage.hpp index dfc0f83fc1912..f78746fc14a27 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, @@ -273,14 +273,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..ce78e507efc12 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); diff --git a/src/hotspot/share/gc/shared/oopStorageSet.cpp b/src/hotspot/share/gc/shared/oopStorageSet.cpp index e119e570759a4..d061fc7763868 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; } diff --git a/src/hotspot/share/gc/shared/oopStorageSet.hpp b/src/hotspot/share/gc/shared/oopStorageSet.hpp index 26e0e9f5a7775..273a769dd59d4 100644 --- a/src/hotspot/share/gc/shared/oopStorageSet.hpp +++ b/src/hotspot/share/gc/shared/oopStorageSet.hpp @@ -25,7 +25,7 @@ #ifndef SHARE_GC_SHARED_OOPSTORAGESET_HPP #define SHARE_GC_SHARED_OOPSTORAGESET_HPP -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/debug.hpp" #include "utilities/enumIterator.hpp" #include "utilities/globalDefinitions.hpp" @@ -79,8 +79,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; 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/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/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/shenandoahTaskqueue.hpp b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp index 50f18a8c73f92..2b160a2938794 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; } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.inline.hpp index fa77002174285..9fa4fabc1c7b2 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.inline.hpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2016, 2019, 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 @@ -30,8 +31,8 @@ #include "gc/shared/taskqueue.inline.hpp" #include "utilities/stack.inline.hpp" -template -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/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/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/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/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/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 d1f3f3de7b2ab..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; } 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/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..9d84121a452c2 100644 --- a/src/hotspot/share/nmt/memMapPrinter.cpp +++ b/src/hotspot/share/nmt/memMapPrinter.cpp @@ -32,8 +32,8 @@ #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..533fa75210483 100644 --- a/src/hotspot/share/nmt/memMapPrinter.hpp +++ b/src/hotspot/share/nmt/memMapPrinter.hpp @@ -27,7 +27,7 @@ #define SHARE_SERVICES_MEMMAPPRINTER_HPP #include "memory/allStatic.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/globalDefinitions.hpp" #ifdef LINUX 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/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/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index 87f4a751e809a..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)) 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..9c9dfbc62306d 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -600,16 +600,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 +629,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 +651,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 +667,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 +679,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 +715,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 +742,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"); @@ -1871,10 +1871,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 +1882,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 +2235,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/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/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 6ea473dda48f4..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 diff --git a/src/hotspot/share/utilities/bitMap.hpp b/src/hotspot/share/utilities/bitMap.hpp index 3363653648557..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" @@ -638,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/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/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/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" From f0ae90f30c346544e87217ef1832d6a350fe1985 Mon Sep 17 00:00:00 2001 From: Harshitha Onkar Date: Tue, 17 Sep 2024 20:05:46 +0000 Subject: [PATCH 064/307] 8340210: Add positionTestUI() to PassFailJFrame.Builder Co-authored-by: Alexey Ivanov Reviewed-by: aivanov, azvegint --- .../awt/regtesthelpers/PassFailJFrame.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index dd94081c35421..594e97152a55c 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -1250,6 +1250,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. From dfc90938ba36685ef58af0846ee4bdb214fa210f Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Tue, 17 Sep 2024 21:08:47 +0000 Subject: [PATCH 065/307] 8340132: Remove internal CpException for reading malformed utf8 Reviewed-by: asotona --- .../classfile/impl/AbstractPoolEntry.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) 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 7f14560fd1854..7ef005eaf6a98 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; @@ -258,11 +259,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; @@ -273,12 +274,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; @@ -287,7 +288,7 @@ private void inflate() { } default: // 10xx xxxx, 1111 xxxx - throw new CpException("malformed input around byte " + px); + throw malformedInput(px); } } this.hash = hashString(hash); @@ -295,7 +296,10 @@ private void inflate() { 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 @@ -1134,12 +1138,4 @@ public boolean equals(Object o) { return false; } } - - static class CpException extends RuntimeException { - static final long serialVersionUID = 32L; - - CpException(String s) { - super(s); - } - } } From 202fd421f7e8b0f4a9c7393d1045e879acd13e64 Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Tue, 17 Sep 2024 22:36:37 +0000 Subject: [PATCH 066/307] 8340213: jcmd VM.events ignores max argument Reviewed-by: szaldana, cjplummer, amenkov, mli --- .../share/services/diagnosticCommand.cpp | 1 - .../serviceability/dcmd/vm/EventsTest.java | 24 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/services/diagnosticCommand.cpp b/src/hotspot/share/services/diagnosticCommand.cpp index 7a2c083814614..4d4a5239b3b54 100644 --- a/src/hotspot/share/services/diagnosticCommand.cpp +++ b/src/hotspot/share/services/diagnosticCommand.cpp @@ -899,7 +899,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; 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()); } } From 147e30070d8adbe65453a3a9316b9324890ea25f Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Wed, 18 Sep 2024 04:33:28 +0000 Subject: [PATCH 067/307] 8340015: Open source several AWT focus tests - series 7 Reviewed-by: honkar --- test/jdk/ProblemList.txt | 1 + .../Focus/MinimizeNonfocusableWindowTest.java | 76 ++++++++++++++ .../awt/Focus/WindowDisposeFocusTest.java | 98 +++++++++++++++++++ test/jdk/java/awt/Focus/bug6435715.java | 91 +++++++++++++++++ 4 files changed, 266 insertions(+) create mode 100644 test/jdk/java/awt/Focus/MinimizeNonfocusableWindowTest.java create mode 100644 test/jdk/java/awt/Focus/WindowDisposeFocusTest.java create mode 100644 test/jdk/java/awt/Focus/bug6435715.java diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index e8344ae6dd393..f8785298ee6a4 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -786,3 +786,4 @@ 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 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/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; + } + +} From d23c59e40812c9e3a5914193e68169dbdf6d09e5 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Wed, 18 Sep 2024 07:01:13 +0000 Subject: [PATCH 068/307] 8340280: Avoid calling MT.invokerType() when creating LambdaForms Reviewed-by: liach, jvernee --- .../lang/invoke/DelegatingMethodHandle.java | 2 +- .../java/lang/invoke/DirectMethodHandle.java | 20 +++++++---- .../classes/java/lang/invoke/Invokers.java | 23 ++++++------- .../classes/java/lang/invoke/LambdaForm.java | 10 ++++++ .../java/lang/invoke/MethodHandleImpl.java | 34 +++++++------------ .../java/lang/invoke/NativeMethodHandle.java | 2 +- 6 files changed, 48 insertions(+), 43 deletions(-) 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/Invokers.java b/src/java.base/share/classes/java/lang/invoke/Invokers.java index 6c383dd3f2ca3..1f4314f5421d2 100644 --- a/src/java.base/share/classes/java/lang/invoke/Invokers.java +++ b/src/java.base/share/classes/java/lang/invoke/Invokers.java @@ -314,14 +314,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 +390,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 +446,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 +589,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, 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 f17bbd17c9467..992ef38768484 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java @@ -810,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() @@ -843,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); } @@ -870,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; @@ -890,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); @@ -919,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); } @@ -1733,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(); @@ -1749,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); @@ -1777,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 @@ -1966,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; @@ -1985,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); @@ -2011,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); } @@ -2055,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. @@ -2088,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); @@ -2106,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); } @@ -2169,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, @@ -2202,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]); @@ -2231,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/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]); From 5381f553ad61ddaa44d49c3039a05511cc68bdd0 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Wed, 18 Sep 2024 07:07:45 +0000 Subject: [PATCH 069/307] 8333258: C2: high memory usage in PhaseCFG::insert_anti_dependences() Reviewed-by: kvn, epeter --- src/hotspot/share/opto/gcm.cpp | 174 +- .../TestAntiDependenciesHighMemUsage.java | 2443 +++++ .../TestAntiDependenciesHighMemUsage2.java | 8444 +++++++++++++++++ 3 files changed, 11020 insertions(+), 41 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/codegen/TestAntiDependenciesHighMemUsage.java create mode 100644 test/hotspot/jtreg/compiler/codegen/TestAntiDependenciesHighMemUsage2.java 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/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; +} From 3895b8fc0b2c6d187080dba6fe08297adad4a480 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Wed, 18 Sep 2024 08:26:33 +0000 Subject: [PATCH 070/307] 8340230: Tests crash: assert(is_in_encoding_range || k->is_interface() || k->is_abstract()) failed: sanity Reviewed-by: thartmann, kvn --- src/hotspot/share/opto/compile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index f4cf9e7e4029b..6382608f36a81 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -3347,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() && t->isa_klassptr()->exact_klass()->is_in_encoding_range())) { + 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; From 4ff17c14a572a59b60d728c3626f430932eecea6 Mon Sep 17 00:00:00 2001 From: Simon Tooke Date: Wed, 18 Sep 2024 09:11:40 +0000 Subject: [PATCH 071/307] 8319873: Add windows implementation for jcmd System.map and System.dump_map Co-authored-by: Simon Tooke Reviewed-by: stuefe, kevinw, szaldana --- .../os/windows/memMapPrinter_windows.cpp | 253 ++++++++++++++++++ src/hotspot/share/nmt/memMapPrinter.cpp | 2 +- src/hotspot/share/nmt/memMapPrinter.hpp | 2 +- .../share/services/diagnosticCommand.cpp | 12 +- .../share/services/diagnosticCommand.hpp | 8 +- .../dcmd/vm/SystemDumpMapTest.java | 6 +- .../serviceability/dcmd/vm/SystemMapTest.java | 6 +- .../dcmd/vm/SystemMapTestBase.java | 47 +++- .../tools/jcmd/TestJcmdPIDSubstitution.java | 2 + 9 files changed, 322 insertions(+), 16 deletions(-) create mode 100644 src/hotspot/os/windows/memMapPrinter_windows.cpp diff --git a/src/hotspot/os/windows/memMapPrinter_windows.cpp b/src/hotspot/os/windows/memMapPrinter_windows.cpp new file mode 100644 index 0000000000000..550647709e1f6 --- /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 "runtime/os.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/share/nmt/memMapPrinter.cpp b/src/hotspot/share/nmt/memMapPrinter.cpp index 9d84121a452c2..34ddb7a871336 100644 --- a/src/hotspot/share/nmt/memMapPrinter.cpp +++ b/src/hotspot/share/nmt/memMapPrinter.cpp @@ -25,7 +25,7 @@ #include "precompiled.hpp" -#ifdef LINUX +#if defined(LINUX) || defined(_WIN64) #include "gc/shared/collectedHeap.hpp" #include "logging/logAsyncWriter.hpp" diff --git a/src/hotspot/share/nmt/memMapPrinter.hpp b/src/hotspot/share/nmt/memMapPrinter.hpp index 533fa75210483..7f3ef9abca893 100644 --- a/src/hotspot/share/nmt/memMapPrinter.hpp +++ b/src/hotspot/share/nmt/memMapPrinter.hpp @@ -30,7 +30,7 @@ #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/services/diagnosticCommand.cpp b/src/hotspot/share/services/diagnosticCommand.cpp index 4d4a5239b3b54..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)); @@ -1172,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) {} @@ -1190,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/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..bd3f97f764377 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" + 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/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)); } } From 45e438f3f470c4af9d5066a4ae680f819bb3cde0 Mon Sep 17 00:00:00 2001 From: Nizar Benalla Date: Wed, 18 Sep 2024 11:08:13 +0000 Subject: [PATCH 072/307] 8339845: Update color.org and wapforum.org links to use HTTPS instead of HTTP Reviewed-by: prr, honkar, aivanov --- .../share/classes/java/awt/color/ICC_ColorSpace.java | 4 ++-- .../share/classes/java/awt/color/ICC_Profile.java | 4 ++-- .../share/classes/java/awt/image/ColorConvertOp.java | 2 +- .../share/classes/javax/imageio/package-info.java | 4 ++-- .../javax/imageio/plugins/tiff/BaselineTIFFTagSet.java | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) 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; From 19b2cee42081e1f8e9c53e6c831ce1d2d2915fd5 Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Wed, 18 Sep 2024 11:44:14 +0000 Subject: [PATCH 073/307] 8340113: Remove JULONG as a Diagnostic Command argument type (jcmd JFR.view) Reviewed-by: lmesnik, egahlin --- .../share/jfr/recorder/service/jfrOptionSet.cpp | 8 ++++---- .../jdk/jfr/internal/dcmd/ArgumentParser.java | 4 ++-- .../classes/jdk/jfr/internal/dcmd/DCmdDump.java | 2 +- .../classes/jdk/jfr/internal/dcmd/DCmdQuery.java | 6 +++--- .../classes/jdk/jfr/internal/dcmd/DCmdStart.java | 6 +++--- .../classes/jdk/jfr/internal/dcmd/DCmdView.java | 12 ++++++------ 6 files changed, 19 insertions(+), 19 deletions(-) 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/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/ArgumentParser.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/ArgumentParser.java index c14ce6025ce9b..43a8bb96874b8 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 @@ -221,7 +221,7 @@ 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); @@ -361,4 +361,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..30d916b30e5dd 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 @@ -237,7 +237,7 @@ public String[] getHelp() { '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 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..8424fa4a811eb 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 @@ -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 @@ -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 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) }; } } From aeba1ea7c44d6b378decf8557c8cd9fc7bfb7df5 Mon Sep 17 00:00:00 2001 From: Emanuel Peter Date: Wed, 18 Sep 2024 12:03:00 +0000 Subject: [PATCH 074/307] 8340272: C2 SuperWord: JMH benchmark for Reduction vectorization Reviewed-by: kvn, jkarthikeyan --- .../bench/vm/compiler/VectorReduction2.java | 1454 +++++++++++++++++ 1 file changed, 1454 insertions(+) create mode 100644 test/micro/org/openjdk/bench/vm/compiler/VectorReduction2.java 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 {} +} + From 1d070a3238a1cd8b9359357e6e3f751cd26a3f06 Mon Sep 17 00:00:00 2001 From: Rafael Winterhalter Date: Wed, 18 Sep 2024 12:33:56 +0000 Subject: [PATCH 075/307] 8337302: Undefined type variable results in null Reviewed-by: liach --- .../java/lang/TypeNotPresentException.java | 20 +++--- .../factory/CoreReflectionFactory.java | 8 ++- .../Generics/TestMissingTypeVariable.java | 70 +++++++++++++++++++ 3 files changed, 86 insertions(+), 12 deletions(-) create mode 100644 test/jdk/java/lang/reflect/Generics/TestMissingTypeVariable.java 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/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/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()); + } + } + } +} From 08a2f841ec78a10f8d6d54b2ac3a92e89f765f14 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Wed, 18 Sep 2024 12:37:02 +0000 Subject: [PATCH 076/307] 8339738: RISC-V: Vectorize crc32 intrinsic Reviewed-by: fyang, luhenry --- .../cpu/riscv/macroAssembler_riscv.cpp | 127 ++++++++++- .../cpu/riscv/macroAssembler_riscv.hpp | 3 + src/hotspot/cpu/riscv/stubRoutines_riscv.cpp | 215 ++++++++++++++++++ 3 files changed, 340 insertions(+), 5 deletions(-) diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index cbca980288984..de0df45bbf507 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); } 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/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 }; From 471a51a5a4395f0bc6818c3c1d30455ce75500d6 Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Wed, 18 Sep 2024 13:46:19 +0000 Subject: [PATCH 077/307] 8340368: windows-x64-slowdebug build fails after JDK-8319873 Reviewed-by: jpai, kevinw, aboldtch, eosterlund --- src/hotspot/os/windows/memMapPrinter_windows.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/os/windows/memMapPrinter_windows.cpp b/src/hotspot/os/windows/memMapPrinter_windows.cpp index 550647709e1f6..eb6b24a9d139a 100644 --- a/src/hotspot/os/windows/memMapPrinter_windows.cpp +++ b/src/hotspot/os/windows/memMapPrinter_windows.cpp @@ -24,9 +24,9 @@ */ #include "precompiled.hpp" - #include "nmt/memMapPrinter.hpp" -#include "runtime/os.hpp" +#include "os_windows.hpp" +#include "runtime/vm_version.hpp" #include #include From ae39a6603c6c33a36dce30c3290a634b08a6bf05 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Wed, 18 Sep 2024 14:38:06 +0000 Subject: [PATCH 078/307] 8339992: RISC-V: some minor improvements of base64_vector_decode_round Reviewed-by: fyang, luhenry --- src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index 8792dea7de5eb..9162c1d520027 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); } /** @@ -5501,7 +5505,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 @@ -5521,7 +5525,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 From 6ff287ad9aa45d8a37aafb4dd7bd9170280f5bbb Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Wed, 18 Sep 2024 15:57:41 +0000 Subject: [PATCH 079/307] 8340233: Missed ThreadWXEnable in jfrNativeLibraryLoadEvent.cpp Reviewed-by: mgronlun --- src/hotspot/share/jfr/support/jfrNativeLibraryLoadEvent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; From 9cfc03aa81f2ae20616c8cc27e3467ad01cf985f Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Wed, 18 Sep 2024 19:17:26 +0000 Subject: [PATCH 080/307] 8340391: Windows jcmd System.map and System.dump_map tests failing Reviewed-by: cjplummer --- .../hotspot/jtreg/serviceability/dcmd/vm/SystemMapTestBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTestBase.java b/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTestBase.java index bd3f97f764377..6507117df3533 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTestBase.java +++ b/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTestBase.java @@ -78,7 +78,7 @@ public class SystemMapTestBase { 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" + 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[] = { From 31849127a06e448c705a61c536f51fc037bc4979 Mon Sep 17 00:00:00 2001 From: Harshitha Onkar Date: Wed, 18 Sep 2024 19:25:11 +0000 Subject: [PATCH 081/307] 8339962: Open source AWT TextField tests - Set1 Reviewed-by: jdv, dnguyen, prr --- .../java/awt/Label/ContainerValidateTest.java | 169 +++++++++++++++++ .../java/awt/TextField/SetEchoCharTest.java | 178 ++++++++++++++++++ .../awt/TextField/SetEchoCharWordOpsTest.java | 90 +++++++++ 3 files changed, 437 insertions(+) create mode 100644 test/jdk/java/awt/Label/ContainerValidateTest.java create mode 100644 test/jdk/java/awt/TextField/SetEchoCharTest.java create mode 100644 test/jdk/java/awt/TextField/SetEchoCharWordOpsTest.java 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/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/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; + } +} From 88a1c0550e435888c571d32c577fd697652e5620 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Wed, 18 Sep 2024 20:39:40 +0000 Subject: [PATCH 082/307] 8340078: Open source several 2D tests Reviewed-by: honkar --- .../GdiRendering/GdiBlitOffscreenTest.java | 121 ++++++++++++++++++ .../sun/java2d/GdiRendering/GdiLockTest.java | 95 ++++++++++++++ .../SunGraphics2D/DrawRoundRect0Bug.java | 69 ++++++++++ .../java2d/SunGraphics2D/RevalidateBug.java | 104 +++++++++++++++ .../java2d/SunGraphics2D/ScaledPolyTest.java | 95 ++++++++++++++ 5 files changed, 484 insertions(+) create mode 100644 test/jdk/sun/java2d/GdiRendering/GdiBlitOffscreenTest.java create mode 100644 test/jdk/sun/java2d/GdiRendering/GdiLockTest.java create mode 100644 test/jdk/sun/java2d/SunGraphics2D/DrawRoundRect0Bug.java create mode 100644 test/jdk/sun/java2d/SunGraphics2D/RevalidateBug.java create mode 100644 test/jdk/sun/java2d/SunGraphics2D/ScaledPolyTest.java 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"); + } + } + } +} From d9c67443f7d7f03efb2837b63ee2acc6113f737f Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Thu, 19 Sep 2024 01:44:45 +0000 Subject: [PATCH 083/307] 8340360: Update -mx to -Xmx in UnninstallUIMemoryLeaks test Reviewed-by: serb, prr --- .../UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); From 537447f8816129dad9a1edd21bd30f3edf69ea60 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Thu, 19 Sep 2024 04:33:01 +0000 Subject: [PATCH 084/307] 8339980: [s390x] ProblemList jdk/java/util/zip/CloseInflaterDeflaterTest.java Reviewed-by: lucy --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index f8785298ee6a4..5c5f2d2fc6567 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -714,6 +714,7 @@ com/sun/jdi/InvokeHangTest.java 8218463 linux-al ############################################################################ # jdk_util +java/util/zip/CloseInflaterDeflaterTest.java 8339216 linux-s390x ############################################################################ From ac58b6102a26ac2ca7f6df5f176d5b5ca1d00d45 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Thu, 19 Sep 2024 04:47:15 +0000 Subject: [PATCH 085/307] 8339416: [s390x] Provide implementation for resolve_global_jobject Reviewed-by: mdoerr, lucy --- .../gc/shared/barrierSetAssembler_s390.cpp | 56 +++++++++++++++++-- .../gc/shared/barrierSetAssembler_s390.hpp | 1 + .../shared/modRefBarrierSetAssembler_s390.cpp | 18 +++++- .../shared/modRefBarrierSetAssembler_s390.hpp | 6 +- src/hotspot/cpu/s390/macroAssembler_s390.cpp | 5 ++ src/hotspot/cpu/s390/macroAssembler_s390.hpp | 2 +- 6 files changed, 77 insertions(+), 11 deletions(-) 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/macroAssembler_s390.cpp b/src/hotspot/cpu/s390/macroAssembler_s390.cpp index 50de705cd9f0c..65a7d3abe90af 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 {"); diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.hpp b/src/hotspot/cpu/s390/macroAssembler_s390.hpp index 90210eb28c3ad..c380f4dec1029 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.hpp @@ -758,6 +758,7 @@ class MacroAssembler: public Assembler { void compiler_fast_unlock_lightweight_object(Register obj, 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); From 67198992ce92da1ee615a73937f22fdaba28fba1 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Thu, 19 Sep 2024 06:28:05 +0000 Subject: [PATCH 086/307] 8286851: Deprecate for removal several of the undocumented java launcher options Reviewed-by: dholmes --- src/java.base/share/native/libjli/java.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/native/libjli/java.c b/src/java.base/share/native/libjli/java.c index 79bd0c4e2337f..337ecc846830e 100644 --- a/src/java.base/share/native/libjli/java.c +++ b/src/java.base/share/native/libjli/java.c @@ -1463,14 +1463,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, "-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, "-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) { /* @@ -1479,9 +1483,10 @@ 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 '-' */ From c58fbef05eace85a2e429da1ac8ff1ae09a0b736 Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Thu, 19 Sep 2024 08:28:51 +0000 Subject: [PATCH 087/307] 8340276: Test java/lang/management/ThreadMXBean/Locks.java failed with NullPointerException Reviewed-by: cjplummer, lmesnik --- test/jdk/java/lang/management/ThreadMXBean/Locks.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; From 118c9ade1a5e17d870415f689caa25af6524ab0e Mon Sep 17 00:00:00 2001 From: Serhiy Sachkov Date: Thu, 19 Sep 2024 08:39:11 +0000 Subject: [PATCH 088/307] 8338759: Add extra diagnostic to java/net/InetAddress/ptr/Lookup.java Reviewed-by: dfuchs, shade --- test/jdk/java/net/InetAddress/ptr/Lookup.java | 3 +++ 1 file changed, 3 insertions(+) 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 + ")"); From 8908812d0a64f25f0d033d44725a69348789b223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20Sikstr=C3=B6m?= Date: Thu, 19 Sep 2024 08:47:20 +0000 Subject: [PATCH 089/307] 8337674: ZGC: Consistent style for naming private static constants Reviewed-by: stefank, aboldtch, mli --- .../cpu/aarch64/gc/z/zAddress_aarch64.cpp | 2 +- src/hotspot/cpu/ppc/gc/z/zAddress_ppc.cpp | 2 +- src/hotspot/cpu/riscv/gc/z/zAddress_riscv.cpp | 2 +- .../cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp | 2 +- .../cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp | 2 +- src/hotspot/cpu/x86/gc/z/z_x86_64.ad | 2 +- .../linux/gc/z/zPhysicalMemoryBacking_linux.cpp | 8 ++++---- src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp | 14 +++++++------- src/hotspot/share/gc/z/zBarrierSet.hpp | 2 +- src/hotspot/share/gc/z/zDirector.cpp | 2 +- src/hotspot/share/gc/z/zDirector.hpp | 2 +- src/hotspot/share/gc/z/zLiveMap.cpp | 8 ++++---- src/hotspot/share/gc/z/zLiveMap.hpp | 2 +- src/hotspot/share/gc/z/zLiveMap.inline.hpp | 16 ++++++++-------- src/hotspot/share/gc/z/zReferenceProcessor.hpp | 4 ++-- src/hotspot/share/gc/z/zStackWatermark.cpp | 2 +- src/hotspot/share/gc/z/zStackWatermark.hpp | 4 ++-- src/hotspot/share/gc/z/zStat.cpp | 8 ++++---- src/hotspot/share/gc/z/zStat.hpp | 2 +- src/hotspot/share/gc/z/zStoreBarrierBuffer.cpp | 16 ++++++++-------- src/hotspot/share/gc/z/zStoreBarrierBuffer.hpp | 8 ++++---- src/hotspot/share/gc/z/zValue.hpp | 2 +- src/hotspot/share/gc/z/zValue.inline.hpp | 10 +++++----- src/hotspot/share/gc/z/zVerify.cpp | 2 +- 24 files changed, 62 insertions(+), 62 deletions(-) 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/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/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/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 30220c0629e5e..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); %} 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/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 8901a9fbc6500..481525c425af0 100644 --- a/src/hotspot/share/gc/z/zDirector.cpp +++ b/src/hotspot/share/gc/z/zDirector.cpp @@ -839,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/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/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/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); From 2faf8b8d582183275b1fdc92313a1c63c1753e80 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Thu, 19 Sep 2024 09:44:57 +0000 Subject: [PATCH 090/307] 8340007: Refactor KeyEvent/FunctionKeyTest.java Reviewed-by: azvegint --- .../awt/event/KeyEvent/FunctionKeyTest.java | 151 ++++++++++++------ 1 file changed, 99 insertions(+), 52 deletions(-) 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; + } } } From 0120d3eed50bdc9fa53f2c41b31791620aeef613 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Thu, 19 Sep 2024 11:48:45 +0000 Subject: [PATCH 091/307] 8340306: Add border around instructions in PassFailJFrame Reviewed-by: honkar, prr --- test/jdk/java/awt/regtesthelpers/PassFailJFrame.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index 594e97152a55c..51433faa303fa 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; @@ -501,6 +502,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; } From cecb0b3d11ed0ce204cb6c3427f5a6858a844aeb Mon Sep 17 00:00:00 2001 From: Serhiy Sachkov Date: Thu, 19 Sep 2024 12:08:31 +0000 Subject: [PATCH 092/307] 8339787: Add some additional diagnostic output to java/net/ipv6tests/UdpTest.java Reviewed-by: dfuchs --- test/jdk/java/net/ipv6tests/Tests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); From 7579d3740217e4a819cbf63837ec929f00464585 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Thu, 19 Sep 2024 12:29:21 +0000 Subject: [PATCH 093/307] 8338995: New Object to ObjectMonitor mapping: PPC64 implementation Reviewed-by: rrich, lucy --- src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp | 2 +- src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp | 4 +- src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp | 2 +- src/hotspot/cpu/ppc/macroAssembler_ppc.cpp | 242 +++++++++++------- src/hotspot/cpu/ppc/macroAssembler_ppc.hpp | 10 +- src/hotspot/cpu/ppc/ppc.ad | 4 +- src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp | 4 +- .../share/runtime/basicLock.inline.hpp | 2 +- 8 files changed, 164 insertions(+), 106 deletions(-) diff --git a/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp index c05e97a4e9aa3..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); 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/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/share/runtime/basicLock.inline.hpp b/src/hotspot/share/runtime/basicLock.inline.hpp index c04c8e5b11706..1f3bf15a8769d 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) return reinterpret_cast(get_metadata()); #else // Other platforms do not make use of the cache yet, From c9bee173d61f4accfc4adc280ab5d21600191756 Mon Sep 17 00:00:00 2001 From: Prasadrao Koppula Date: Thu, 19 Sep 2024 13:21:08 +0000 Subject: [PATCH 094/307] 8331391: Enhance the keytool code by invoking the buildTrustedCerts method for essential options Reviewed-by: coffeys, mullan --- .../share/classes/sun/security/tools/keytool/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { From d555f072b2036664711242a242a35fb30d277e5a Mon Sep 17 00:00:00 2001 From: Matias Saavedra Silva Date: Thu, 19 Sep 2024 14:15:45 +0000 Subject: [PATCH 095/307] 8298614: Support CDS heap dumping for SerialGC and ParallelGC Reviewed-by: dholmes, lmesnik, iklam --- src/hotspot/share/cds/archiveHeapWriter.cpp | 19 +++++++++++-------- src/hotspot/share/cds/heapShared.cpp | 12 +++++++----- src/hotspot/share/cds/heapShared.hpp | 4 ++-- .../sharedStrings/IncompatibleOptions.java | 6 +++--- .../sharedStrings/SharedStringsHumongous.java | 1 + .../sharedStrings/SharedStringsUtils.java | 6 +++--- 6 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/hotspot/share/cds/archiveHeapWriter.cpp b/src/hotspot/share/cds/archiveHeapWriter.cpp index d8ee7155452ff..17d78b6b44cfe 100644 --- a/src/hotspot/share/cds/archiveHeapWriter.cpp +++ b/src/hotspot/share/cds/archiveHeapWriter.cpp @@ -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"); } } @@ -452,26 +451,30 @@ 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; diff --git a/src/hotspot/share/cds/heapShared.cpp b/src/hotspot/share/cds/heapShared.cpp index 2bf75a5ba6512..1fddcb0d81f8a 100644 --- a/src/hotspot/share/cds/heapShared.cpp +++ b/src/hotspot/share/cds/heapShared.cpp @@ -471,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(); diff --git a/src/hotspot/share/cds/heapShared.hpp b/src/hotspot/share/cds/heapShared.hpp index 9bb85db0fe9d2..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;) } 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); From 3bb8de31457a544d9c20a12f8d8d30d6d1cd9cba Mon Sep 17 00:00:00 2001 From: Matias Saavedra Silva Date: Thu, 19 Sep 2024 14:18:03 +0000 Subject: [PATCH 096/307] 8338693: assert(Atomic::add(&ik->_shared_class_load_count, 1) == 1) failed: shared class loaded more than once Reviewed-by: iklam, dholmes --- src/hotspot/share/classfile/systemDictionary.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; } From 2ada313cdd9a20ed33f7e0a7298c8a0e69a81c6f Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Thu, 19 Sep 2024 15:25:04 +0000 Subject: [PATCH 097/307] 8340329: (fs) Message of NotLinkException thrown by FIles.readSymbolicLink does not include file name (win) Reviewed-by: alanb --- .../sun/nio/fs/WindowsLinkSupport.java | 18 +++++++------ test/jdk/java/nio/file/Files/Links.java | 27 ++++++++++++++++--- 2 files changed, 34 insertions(+), 11 deletions(-) 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/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); + } } /** From 5f3e7aa83348edafb83480ce67d0c58c46e11b24 Mon Sep 17 00:00:00 2001 From: Justin Lu Date: Thu, 19 Sep 2024 16:18:37 +0000 Subject: [PATCH 098/307] 8339735: Remove references to Applet in core-libs/security APIs Reviewed-by: coffeys, naoto, iris, rriggs, lancea, mullan --- .../java/lang/doc-files/threadPrimitiveDeprecation.html | 8 ++++---- .../share/classes/java/net/HttpURLConnection.java | 5 ++--- .../classes/java/nio/charset/spi/CharsetProvider.java | 4 ++-- .../share/classes/javax/crypto/CryptoPermission.java | 4 ++-- .../share/classes/javax/crypto/ExemptionMechanism.java | 4 ++-- .../share/classes/javax/crypto/JceSecurityManager.java | 8 ++++---- src/java.base/share/classes/javax/net/SocketFactory.java | 4 ++-- 7 files changed, 18 insertions(+), 19 deletions(-) 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/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/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/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 From bc36ace72c1189dcd6d0c05d40d8c568acd89b01 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Thu, 19 Sep 2024 16:22:17 +0000 Subject: [PATCH 099/307] 8340271: Open source several AWT Robot tests Reviewed-by: abhiscxk, honkar --- .../java/awt/Robot/CreateScreenCapture.java | 81 ++++++++++++++ test/jdk/java/awt/Robot/RobotScrollTest.java | 101 ++++++++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 test/jdk/java/awt/Robot/CreateScreenCapture.java create mode 100644 test/jdk/java/awt/Robot/RobotScrollTest.java 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); + } + } + } + +} + From d1d824008d1dc70029013820814fd03c40b4e309 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Thu, 19 Sep 2024 16:59:51 +0000 Subject: [PATCH 100/307] 8340308: PassFailJFrame: Make rows default to number of lines in instructions Reviewed-by: honkar, azvegint --- .../awt/regtesthelpers/PassFailJFrame.java | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index 51433faa303fa..e2693e7c555f4 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -1184,11 +1184,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; @@ -1483,7 +1517,7 @@ private void validate() { } if (rows == 0) { - rows = ROWS; + rows = getDefaultRows(); } if (columns == 0) { From ec3cba02963b5128480bcf62431ab03ecdb26db6 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 19 Sep 2024 17:10:23 +0000 Subject: [PATCH 101/307] 8340399: Update comment in SourceVersion for language evolution history Reviewed-by: iris --- .../share/classes/javax/lang/model/SourceVersion.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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..871487b98e6f4 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 */ /** From 15ae1155a11b401e3d1dd39177c209f17f077119 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 19 Sep 2024 17:47:08 +0000 Subject: [PATCH 102/307] 8340166: [REDO] CDS: Trim down minimum GC region alignment Reviewed-by: ccheung, iklam --- src/hotspot/share/cds/archiveHeapWriter.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/cds/archiveHeapWriter.hpp b/src/hotspot/share/cds/archiveHeapWriter.hpp index 961d2b52133f8..29ea50ba5fe86 100644 --- a/src/hotspot/share/cds/archiveHeapWriter.hpp +++ b/src/hotspot/share/cds/archiveHeapWriter.hpp @@ -111,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; From 75d5e117770590d2432fcfe8d89734c7038d4e55 Mon Sep 17 00:00:00 2001 From: William Kemper Date: Thu, 19 Sep 2024 17:55:23 +0000 Subject: [PATCH 103/307] 8340400: Shenandoah: Whitebox breakpoint GC requests may cause assertions Reviewed-by: shade --- .../gc/shenandoah/shenandoahControlThread.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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(); } } From fde8508379d2983fa70784faef60699c81f9c359 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Thu, 19 Sep 2024 19:51:05 +0000 Subject: [PATCH 104/307] 8339902: Open source couple TextField related tests Reviewed-by: honkar --- .../CaretPositionTest/CaretPositionTest.java | 105 +++++++++++++++ .../SetBoundsTest/SetBoundsTest.java | 124 ++++++++++++++++++ .../SetEchoCharTest4/SetEchoCharTest4.java | 102 ++++++++++++++ .../SetPasswordTest/SetPasswordTest.java | 106 +++++++++++++++ .../ZeroEchoCharTest/ZeroEchoCharTest.java | 90 +++++++++++++ 5 files changed, 527 insertions(+) create mode 100644 test/jdk/java/awt/TextField/CaretPositionTest/CaretPositionTest.java create mode 100644 test/jdk/java/awt/TextField/SetBoundsTest/SetBoundsTest.java create mode 100644 test/jdk/java/awt/TextField/SetEchoCharTest4/SetEchoCharTest4.java create mode 100644 test/jdk/java/awt/TextField/SetPasswordTest/SetPasswordTest.java create mode 100644 test/jdk/java/awt/TextField/ZeroEchoCharTest/ZeroEchoCharTest.java 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..d55353c4d1fc5 --- /dev/null +++ b/test/jdk/java/awt/TextField/CaretPositionTest/CaretPositionTest.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. + * + * summary: + * 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..68d5d1132a916 --- /dev/null +++ b/test/jdk/java/awt/TextField/SetBoundsTest/SetBoundsTest.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * summary: + * 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/SetEchoCharTest4/SetEchoCharTest4.java b/test/jdk/java/awt/TextField/SetEchoCharTest4/SetEchoCharTest4.java new file mode 100644 index 0000000000000..471e42f3f8934 --- /dev/null +++ b/test/jdk/java/awt/TextField/SetEchoCharTest4/SetEchoCharTest4.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * summary: + * 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/SetPasswordTest/SetPasswordTest.java b/test/jdk/java/awt/TextField/SetPasswordTest/SetPasswordTest.java new file mode 100644 index 0000000000000..d865ea1451133 --- /dev/null +++ b/test/jdk/java/awt/TextField/SetPasswordTest/SetPasswordTest.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * summary: + * 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..7bdb8ebf4c3ea --- /dev/null +++ b/test/jdk/java/awt/TextField/ZeroEchoCharTest/ZeroEchoCharTest.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * summary: + * 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(); + } +} From 296b49634eed83bca6cfdee514b9c7c4f8252d59 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Thu, 19 Sep 2024 21:06:46 +0000 Subject: [PATCH 105/307] 8340353: Remove CompressedOops::ptrs_base Reviewed-by: stefank, coleenp, shade, mli --- src/hotspot/cpu/aarch64/aarch64.ad | 2 +- src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp | 6 +++--- src/hotspot/cpu/riscv/macroAssembler_riscv.cpp | 4 ++-- src/hotspot/cpu/x86/macroAssembler_x86.cpp | 6 +++--- src/hotspot/share/oops/compressedOops.hpp | 6 ++---- 5 files changed, 11 insertions(+), 13 deletions(-) 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/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index 08b69b34a9462..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)); } } diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index de0df45bbf507..dc25172da259e 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -1970,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); diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index d634c1e575799..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())); } } } diff --git a/src/hotspot/share/oops/compressedOops.hpp b/src/hotspot/share/oops/compressedOops.hpp index cd3f00393ca44..a33c8e0c10380 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 @@ -88,15 +88,13 @@ class CompressedOops : public AllStatic { static void set_use_implicit_null_checks(bool use); static address base() { return _narrow_oop._base; } + static address base_addr() { return (address)&_narrow_oop._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 bool is_in(void* addr); static bool is_in(MemRegion mr); From fdc16a373459cb2311316448c765b1bee5c73694 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Thu, 19 Sep 2024 22:20:05 +0000 Subject: [PATCH 106/307] 8340480: Bad copyright notices in changes from JDK-8339902 Reviewed-by: kcr, bpb, kizune --- .../java/awt/TextField/CaretPositionTest/CaretPositionTest.java | 1 - test/jdk/java/awt/TextField/SetBoundsTest/SetBoundsTest.java | 1 - .../java/awt/TextField/SetEchoCharTest4/SetEchoCharTest4.java | 1 - test/jdk/java/awt/TextField/SetPasswordTest/SetPasswordTest.java | 1 - .../java/awt/TextField/ZeroEchoCharTest/ZeroEchoCharTest.java | 1 - 5 files changed, 5 deletions(-) diff --git a/test/jdk/java/awt/TextField/CaretPositionTest/CaretPositionTest.java b/test/jdk/java/awt/TextField/CaretPositionTest/CaretPositionTest.java index d55353c4d1fc5..56a39758874e6 100644 --- a/test/jdk/java/awt/TextField/CaretPositionTest/CaretPositionTest.java +++ b/test/jdk/java/awt/TextField/CaretPositionTest/CaretPositionTest.java @@ -2,7 +2,6 @@ * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * summary: * 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. diff --git a/test/jdk/java/awt/TextField/SetBoundsTest/SetBoundsTest.java b/test/jdk/java/awt/TextField/SetBoundsTest/SetBoundsTest.java index 68d5d1132a916..e37f69232ebec 100644 --- a/test/jdk/java/awt/TextField/SetBoundsTest/SetBoundsTest.java +++ b/test/jdk/java/awt/TextField/SetBoundsTest/SetBoundsTest.java @@ -2,7 +2,6 @@ * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * summary: * 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. diff --git a/test/jdk/java/awt/TextField/SetEchoCharTest4/SetEchoCharTest4.java b/test/jdk/java/awt/TextField/SetEchoCharTest4/SetEchoCharTest4.java index 471e42f3f8934..c1cc07afac0ad 100644 --- a/test/jdk/java/awt/TextField/SetEchoCharTest4/SetEchoCharTest4.java +++ b/test/jdk/java/awt/TextField/SetEchoCharTest4/SetEchoCharTest4.java @@ -2,7 +2,6 @@ * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * summary: * 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. diff --git a/test/jdk/java/awt/TextField/SetPasswordTest/SetPasswordTest.java b/test/jdk/java/awt/TextField/SetPasswordTest/SetPasswordTest.java index d865ea1451133..cff5e3750173e 100644 --- a/test/jdk/java/awt/TextField/SetPasswordTest/SetPasswordTest.java +++ b/test/jdk/java/awt/TextField/SetPasswordTest/SetPasswordTest.java @@ -2,7 +2,6 @@ * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * summary: * 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. diff --git a/test/jdk/java/awt/TextField/ZeroEchoCharTest/ZeroEchoCharTest.java b/test/jdk/java/awt/TextField/ZeroEchoCharTest/ZeroEchoCharTest.java index 7bdb8ebf4c3ea..274cec225729c 100644 --- a/test/jdk/java/awt/TextField/ZeroEchoCharTest/ZeroEchoCharTest.java +++ b/test/jdk/java/awt/TextField/ZeroEchoCharTest/ZeroEchoCharTest.java @@ -2,7 +2,6 @@ * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * summary: * 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. From 969c2af95387992c55a2e1768de848a354e74127 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Thu, 19 Sep 2024 23:45:26 +0000 Subject: [PATCH 107/307] 8339192: Native annotation parsing code of deprecated annotations causes crash Reviewed-by: jrose, mgronlun --- .../share/classfile/classFileParser.cpp | 46 +++-- .../BadContendedGroupBadCPIndex.jcod | 123 +++++++++++++ .../BadContendedGroupWrongType.jcod | 123 +++++++++++++ .../BadDeprecatedExtraMemberAtEnd.jcod | 163 ++++++++++++++++++ .../BadDeprecatedExtraMemberAtStart.jcod | 163 ++++++++++++++++++ .../BadDeprecatedForRemovalBadCPIndex.jcod | 155 +++++++++++++++++ .../BadDeprecatedForRemovalWrongType.jcod | 155 +++++++++++++++++ .../BadDeprecatedSinceWrongType.jcod | 155 +++++++++++++++++ .../Annotations/TestBadAnnotations.java | 64 +++++++ 9 files changed, 1134 insertions(+), 13 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/Annotations/BadContendedGroupBadCPIndex.jcod create mode 100644 test/hotspot/jtreg/runtime/Annotations/BadContendedGroupWrongType.jcod create mode 100644 test/hotspot/jtreg/runtime/Annotations/BadDeprecatedExtraMemberAtEnd.jcod create mode 100644 test/hotspot/jtreg/runtime/Annotations/BadDeprecatedExtraMemberAtStart.jcod create mode 100644 test/hotspot/jtreg/runtime/Annotations/BadDeprecatedForRemovalBadCPIndex.jcod create mode 100644 test/hotspot/jtreg/runtime/Annotations/BadDeprecatedForRemovalWrongType.jcod create mode 100644 test/hotspot/jtreg/runtime/Annotations/BadDeprecatedSinceWrongType.jcod create mode 100644 test/hotspot/jtreg/runtime/Annotations/TestBadAnnotations.java 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/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"); + } +} From 94c33179b6a1205100d7c125f3a7c11e29621db9 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Fri, 20 Sep 2024 03:05:22 +0000 Subject: [PATCH 108/307] 8339895: Open source several AWT focus tests - series 3 Reviewed-by: prr --- test/jdk/ProblemList.txt | 1 + .../jdk/java/awt/Focus/ActivateFocusTest.java | 148 ++++++++++++ .../Focus/CanvasPanelFocusOnClickTest.java | 212 ++++++++++++++++++ test/jdk/java/awt/Focus/FocusPolicyTest.java | 177 +++++++++++++++ .../awt/Focus/RequestInInactiveFrame.java | 106 +++++++++ 5 files changed, 644 insertions(+) create mode 100644 test/jdk/java/awt/Focus/ActivateFocusTest.java create mode 100644 test/jdk/java/awt/Focus/CanvasPanelFocusOnClickTest.java create mode 100644 test/jdk/java/awt/Focus/FocusPolicyTest.java create mode 100644 test/jdk/java/awt/Focus/RequestInInactiveFrame.java diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 5c5f2d2fc6567..8990b02c1601f 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -136,6 +136,7 @@ java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java 8169096 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 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/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/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/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; + } + +} From 0f7d9e599593bb8e31e7e33a559d25ec803c7ba4 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Fri, 20 Sep 2024 04:15:55 +0000 Subject: [PATCH 109/307] 8340436: Remove unused CompressedOops::AnyNarrowOopMode Reviewed-by: haosun, dholmes --- src/hotspot/share/oops/compressedOops.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hotspot/share/oops/compressedOops.hpp b/src/hotspot/share/oops/compressedOops.hpp index a33c8e0c10380..a9446469c8781 100644 --- a/src/hotspot/share/oops/compressedOops.hpp +++ b/src/hotspot/share/oops/compressedOops.hpp @@ -73,8 +73,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. From f4e401791efb920b9773f2886b34904c95106727 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 20 Sep 2024 04:19:12 +0000 Subject: [PATCH 110/307] 8339984: Open source AWT MenuItem related tests Reviewed-by: aivanov --- test/jdk/java/awt/MenuItem/GiantFontTest.java | 83 +++++++++++++ .../awt/MenuItem/LotsOfMenuItemsTest.java | 117 ++++++++++++++++++ .../java/awt/MenuItem/MenuSetFontTest.java | 72 +++++++++++ .../MenuItem/NullOrEmptyStringLabelTest.java | 105 ++++++++++++++++ .../awt/MenuItem/UnicodeMenuItemTest.java | 91 ++++++++++++++ 5 files changed, 468 insertions(+) create mode 100644 test/jdk/java/awt/MenuItem/GiantFontTest.java create mode 100644 test/jdk/java/awt/MenuItem/LotsOfMenuItemsTest.java create mode 100644 test/jdk/java/awt/MenuItem/MenuSetFontTest.java create mode 100644 test/jdk/java/awt/MenuItem/NullOrEmptyStringLabelTest.java create mode 100644 test/jdk/java/awt/MenuItem/UnicodeMenuItemTest.java 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; + } +} From 46b02f49bcc730d94e37cf17fa996fdd12bdb990 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Fri, 20 Sep 2024 06:06:27 +0000 Subject: [PATCH 111/307] 8339906: Open source several AWT focus tests - series 4 Reviewed-by: abhiscxk, prr --- test/jdk/java/awt/Focus/AltTabEventsTest.java | 151 +++++++++++++++++ .../awt/Focus/ComponentLostFocusTest.java | 154 ++++++++++++++++++ test/jdk/java/awt/Focus/FocusKeepTest.java | 103 ++++++++++++ test/jdk/java/awt/Focus/KeyStrokeTest.java | 118 ++++++++++++++ 4 files changed, 526 insertions(+) create mode 100644 test/jdk/java/awt/Focus/AltTabEventsTest.java create mode 100644 test/jdk/java/awt/Focus/ComponentLostFocusTest.java create mode 100644 test/jdk/java/awt/Focus/FocusKeepTest.java create mode 100644 test/jdk/java/awt/Focus/KeyStrokeTest.java 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/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/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/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"); + } + +} From 9d76c7c60ff3133c1078892d7c50a2cfc9ff9c1b Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 20 Sep 2024 07:00:38 +0000 Subject: [PATCH 112/307] 8340418: GHA: MacOS AArch64 bundles can be removed prematurely Reviewed-by: erikj --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) 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: From 5d611c0377d4b5d5495d3941a6a63b128142a2dc Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Fri, 20 Sep 2024 07:34:26 +0000 Subject: [PATCH 113/307] 8340439: AArch64: Extra entry declaration for assember test Reviewed-by: haosun, lmesnik, mli --- .../cpu/aarch64/templateInterpreterGenerator_aarch64.cpp | 6 ------ 1 file changed, 6 deletions(-) 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(); From a50440fadcd1aa9d8bfddc153dbde6fd55ceb9fa Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Fri, 20 Sep 2024 09:21:12 +0000 Subject: [PATCH 114/307] 8340456: Reduce overhead of proxying Object methods in ProxyGenerator Reviewed-by: liach --- .../java/lang/reflect/ProxyGenerator.java | 52 ++++++++----- .../reflect/{Proxy => proxy}/ProxyBench.java | 0 .../ProxyGeneratorBench.java} | 78 ++++++------------- 3 files changed, 55 insertions(+), 75 deletions(-) rename test/micro/org/openjdk/bench/java/lang/reflect/{Proxy => proxy}/ProxyBench.java (100%) rename test/micro/org/openjdk/bench/java/lang/reflect/{Proxy/ProxyPerf.java => proxy/ProxyGeneratorBench.java} (57%) 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/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(); + } } From 3ad6e31d81bb8a47dc73a6342a6524a901f07687 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Fri, 20 Sep 2024 09:33:31 +0000 Subject: [PATCH 115/307] 8340438: RISC-V: minor improvement in base64 Reviewed-by: fyang --- src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index 9162c1d520027..ee14d045407a0 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp @@ -5491,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); @@ -5513,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); @@ -5533,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); From 3c22d83c0fb9eee2e2b87e607680b96363849c16 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Fri, 20 Sep 2024 10:07:03 +0000 Subject: [PATCH 116/307] 8340008: KeyEvent/KeyTyped/Numpad1KeyTyped.java has 15 seconds timeout Reviewed-by: azvegint, prr --- .../KeyEvent/KeyTyped/Numpad1KeyTyped.java | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 test/jdk/java/awt/event/KeyEvent/KeyTyped/Numpad1KeyTyped.java 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"); + } + +} From fe80618bf3f80094a93239dd43d4a9b515c5fa18 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Fri, 20 Sep 2024 12:43:57 +0000 Subject: [PATCH 117/307] 8339972: Make a few fields in SortingFocusTraversalPolicy static Reviewed-by: azvegint, aivanov --- .../classes/javax/swing/SortingFocusTraversalPolicy.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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. From ae63aaaa5847a68542e1483ecf1f0d5a3704e741 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Fri, 20 Sep 2024 14:10:39 +0000 Subject: [PATCH 118/307] 8340540: Problemlist DcmdMBeanPermissionsTest.java and SystemDumpMapTest.java Reviewed-by: kevinw --- test/hotspot/jtreg/ProblemList.txt | 2 ++ test/jdk/ProblemList.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 2086bc2ed054b..b1a56bcce12c8 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -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/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 8990b02c1601f..0990e1da457fd 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -516,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 From 9bcde4ffca20941b010ed454b2fcb948d24b3cac Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Fri, 20 Sep 2024 14:46:10 +0000 Subject: [PATCH 119/307] 8338658: New Object to ObjectMonitor mapping: s390x implementation Reviewed-by: lucy, mdoerr --- .../cpu/s390/c1_MacroAssembler_s390.cpp | 2 +- .../cpu/s390/c2_MacroAssembler_s390.cpp | 4 +- src/hotspot/cpu/s390/interp_masm_s390.cpp | 2 +- src/hotspot/cpu/s390/macroAssembler_s390.cpp | 199 ++++++++++++------ src/hotspot/cpu/s390/macroAssembler_s390.hpp | 6 +- src/hotspot/cpu/s390/sharedRuntime_s390.cpp | 4 +- .../share/runtime/basicLock.inline.hpp | 2 +- 7 files changed, 144 insertions(+), 75 deletions(-) diff --git a/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp b/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp index f3fa19ddb31e0..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; 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/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 65a7d3abe90af..6c26e17d5ce3b 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp @@ -6007,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; @@ -6022,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)); @@ -6145,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; @@ -6155,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); @@ -6219,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"); @@ -6270,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. @@ -6294,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 @@ -6315,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) { @@ -6353,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)); @@ -6378,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 c380f4dec1029..5d3a4c2994091 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.hpp @@ -752,10 +752,10 @@ 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); diff --git a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp index 9954c78ce1efa..65c94db09dcc8 100644 --- a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp +++ b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp @@ -1713,7 +1713,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 +1917,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/share/runtime/basicLock.inline.hpp b/src/hotspot/share/runtime/basicLock.inline.hpp index 1f3bf15a8769d..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) || defined(PPC64) +#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, From e087edeb256a9743d1fdb6c295cb5add78d4552e Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Fri, 20 Sep 2024 14:48:11 +0000 Subject: [PATCH 120/307] 8340269: [s390x] TestLargeStub.java failure after 8338123 Reviewed-by: mdoerr, lucy --- src/hotspot/cpu/s390/downcallLinker_s390.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, From 90d3a64b0afd5810981287b174c6687f0f604f36 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Fri, 20 Sep 2024 16:02:25 +0000 Subject: [PATCH 121/307] 8340537: Typo in javadoc of java.util.jar.JarFile Reviewed-by: mullan, lancea, iris --- src/java.base/share/classes/java/util/jar/JarFile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From ab81197d0ded93b82eea9f8fb35d1647c4520f1e Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Fri, 20 Sep 2024 16:11:39 +0000 Subject: [PATCH 122/307] 8339198: Remove tag field from AbstractPoolEntry Reviewed-by: asotona, redestad --- .../classfile/impl/AbstractPoolEntry.java | 179 +++++++++++++----- 1 file changed, 136 insertions(+), 43 deletions(-) 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 7ef005eaf6a98..5cc08d06ec3ee 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 @@ -57,6 +57,8 @@ import jdk.internal.util.ArraysSupport; import jdk.internal.vm.annotation.Stable; +import static java.lang.classfile.ClassFile.*; + public abstract sealed class AbstractPoolEntry { /* Invariant: a {CP,BSM} entry for pool P refer only to {CP,BSM} entries @@ -96,12 +98,10 @@ public static T maybeClone(ConstantPoolBuilder cp, T entry } 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; @@ -116,12 +116,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); @@ -159,7 +157,7 @@ enum State { RAW, BYTE, CHAR, STRING } 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; @@ -171,7 +169,7 @@ enum State { RAW, BYTE, CHAR, STRING } } Utf8EntryImpl(ConstantPool cpm, int index, String s, int hash) { - super(cpm, ClassFile.TAG_UTF8, index, 0); + super(cpm, index, 0); this.rawBytes = null; this.offset = 0; this.rawLen = 0; @@ -182,7 +180,7 @@ enum State { RAW, BYTE, CHAR, STRING } } 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; @@ -194,6 +192,11 @@ enum State { RAW, BYTE, CHAR, STRING } this.typeSym = u.typeSym; } + @Override + public byte tag() { + return TAG_UTF8; + } + /** * {@jvms 4.4.7} String content is encoded in modified UTF-8. * @@ -417,7 +420,7 @@ public boolean equalsString(String s) { @Override void writeTo(BufWriterImpl pool) { - pool.writeU1(tag); + pool.writeU1(TAG_UTF8); if (rawBytes != null) { pool.writeU2(rawLen); pool.writeBytes(rawBytes, offset, rawLen); @@ -449,7 +452,7 @@ abstract static sealed class AbstractRefEntry extends Abstr 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; } @@ -458,7 +461,7 @@ public T ref1() { } void writeTo(BufWriterImpl pool) { - pool.writeU1(tag); + pool.writeU1(tag()); pool.writeU2(ref1.index()); } @@ -474,7 +477,7 @@ abstract static sealed class AbstractRefsEntry Date: Fri, 20 Sep 2024 17:54:06 +0000 Subject: [PATCH 123/307] 8340232: Optimize DataInputStream::readUTF Reviewed-by: liach, bpb --- .../classes/java/io/DataInputStream.java | 54 ++++++++++++++----- 1 file changed, 40 insertions(+), 14 deletions(-) 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) { From 5cffddc689a0134e1aaacb432d2f0fdd61dd74b1 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Fri, 20 Sep 2024 18:38:29 +0000 Subject: [PATCH 124/307] 8338471: Assert deleted methods not returned by CallInfo Reviewed-by: shade, jwaters, dholmes --- src/hotspot/share/code/compiledIC.cpp | 3 +++ src/hotspot/share/interpreter/linkResolver.cpp | 12 ++++++------ src/hotspot/share/interpreter/linkResolver.hpp | 1 - src/hotspot/share/oops/cpCache.cpp | 1 + 4 files changed, 10 insertions(+), 7 deletions(-) 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/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/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); From 64275e6bbf1377c9a9d77fe3c3ed8d4143138f11 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Fri, 20 Sep 2024 19:34:24 +0000 Subject: [PATCH 125/307] 8340092: [Linux] containers/systemd/SystemdMemoryAwarenessTest.java failing on some systems Reviewed-by: mbaesken --- .../jtreg/containers/systemd/TEST.properties | 24 +++++++ .../containers/systemd/SystemdTestUtils.java | 62 +++++++++++++------ 2 files changed, 68 insertions(+), 18 deletions(-) create mode 100644 test/hotspot/jtreg/containers/systemd/TEST.properties 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/lib/jdk/test/lib/containers/systemd/SystemdTestUtils.java b/test/lib/jdk/test/lib/containers/systemd/SystemdTestUtils.java index 341b24c3e051a..9acff93aaca23 100644 --- a/test/lib/jdk/test/lib/containers/systemd/SystemdTestUtils.java +++ b/test/lib/jdk/test/lib/containers/systemd/SystemdTestUtils.java @@ -28,6 +28,7 @@ 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; @@ -92,19 +93,23 @@ public static OutputAnalyzer buildAndRunSystemdJava(SystemdRunOptions opts) thro try { return SystemdTestUtils.systemdRunJava(opts); } finally { - 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 + 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 } } @@ -135,15 +140,23 @@ private static ResultFiles buildSystemdSlices(SystemdRunOptions runOpts) throws if (runOpts.hasSliceDLimit()) { String dirName = String.format("%s.slice.d", SLICE_NAMESPACE_PREFIX); sliceDotDDir = SYSTEMD_CONFIG_HOME.resolve(Path.of(dirName)); - Files.createDirectory(sliceDotDDir); + // 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)); + 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)); + Files.writeString(cpuConfig, + getCPUDSliceContent(runOpts), + StandardOpenOption.TRUNCATE_EXISTING, + StandardOpenOption.CREATE); } } @@ -159,7 +172,7 @@ private static ResultFiles buildSystemdSlices(SystemdRunOptions runOpts) throws throw new AssertionError("Failed to write systemd slice files"); } - systemdDaemonReload(cpu); + systemdDaemonReload(cpu, memory, sliceDotDDir); return new ResultFiles(memory, cpu, sliceDotDDir); } @@ -175,12 +188,25 @@ private static String sliceNameCpu(SystemdRunOptions runOpts) { return String.format("%s-cpu", slice); } - private static void systemdDaemonReload(Path cpu) throws Exception { + private static void systemdDaemonReload(Path cpu, Path memory, Path sliceDdir) throws Exception { List daemonReload = systemCtl(); daemonReload.add("daemon-reload"); if (execute(daemonReload).getExitValue() != 0) { - throw new AssertionError("Failed to reload systemd daemon"); + 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"); + } } } From 08b25611f688ae85c05242afc4cee5b538db4f67 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Fri, 20 Sep 2024 21:27:22 +0000 Subject: [PATCH 126/307] 8339781: Better use of Javadoc tags in javax.lang.model Reviewed-by: jjg --- .../annotation/processing/Processor.java | 21 ++++++++++--------- .../javax/lang/model/AnnotatedConstruct.java | 14 ++++++------- .../javax/lang/model/element/NestingKind.java | 4 ++-- .../classes/javax/lang/model/util/Types.java | 2 +- 4 files changed, 21 insertions(+), 20 deletions(-) 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/lang/model/AnnotatedConstruct.java b/src/java.compiler/share/classes/javax/lang/model/AnnotatedConstruct.java index 10363b5a618d1..6dc1b1ccab129 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,8 +41,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"}. * * The terms directly present, present, * indirectly present, and associated are used @@ -54,7 +54,7 @@ * annotation interface AI. If AI is a repeatable annotation * interface, the type of the containing annotation is AIC. * - *

    Annotation A is directly present on a construct + *

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

      @@ -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: * *
      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/util/Types.java b/src/java.compiler/share/classes/javax/lang/model/util/Types.java index 0cea2734e213c..bbbf4e3d95e6a 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 @@ -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 From 2461263aac35b25e2a48b6fc84da49e4b553dbc3 Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Sat, 21 Sep 2024 00:21:04 +0000 Subject: [PATCH 127/307] 8339217: Optimize ClassFile API loadConstant Reviewed-by: liach, redestad, asotona --- .../java/lang/classfile/CodeBuilder.java | 93 +++++++++++++------ .../lang/invoke/InvokerBytecodeGenerator.java | 2 +- 2 files changed, 68 insertions(+), 27 deletions(-) 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 5f4e5b72a1919..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 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 6031b55a107b2..4a905a3030b9a 100644 --- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java +++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java @@ -1645,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_(); } From ab06a878f888827026424530781f0af414a8a611 Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Sun, 22 Sep 2024 01:01:31 +0000 Subject: [PATCH 128/307] 8340544: Optimize setLocalsFromArg Reviewed-by: redestad, liach --- .../classfile/impl/StackMapGenerator.java | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) 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; From dd498794f20df0ac1a73d84e54591905c8a5a5c7 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Mon, 23 Sep 2024 05:48:42 +0000 Subject: [PATCH 129/307] 8340524: Remove NarrowPtrStruct Reviewed-by: shade, jwaters --- src/hotspot/share/oops/compressedOops.cpp | 18 +++++++----- src/hotspot/share/oops/compressedOops.hpp | 29 ++++++++----------- src/hotspot/share/runtime/vmStructs.cpp | 6 ++-- .../sun/jvm/hotspot/oops/CompressedOops.java | 6 ++-- 4 files changed, 28 insertions(+), 31 deletions(-) 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 a9446469c8781..33af420305cba 100644 --- a/src/hotspot/share/oops/compressedOops.hpp +++ b/src/hotspot/share/oops/compressedOops.hpp @@ -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; @@ -86,13 +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_addr() { return (address)&_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 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/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/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() { From 34cddfbedd20d5804cab8044fbc402564e98eb9c Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Mon, 23 Sep 2024 06:40:33 +0000 Subject: [PATCH 130/307] 8340387: Update OS detection code to recognize Windows Server 2025 Reviewed-by: mdoerr, jwaters, dholmes --- src/hotspot/os/windows/os_windows.cpp | 5 ++++- src/java.base/windows/native/libjava/java_props_md.c | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 1acce2540a855..ed62fe612aae3 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"); 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..357c697ab5f30 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 @@ -444,6 +444,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 +529,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"; From f31f97ddb6f1fca1a74761e3e3eeef497f8a7416 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 23 Sep 2024 07:02:48 +0000 Subject: [PATCH 131/307] 8340171: CDS: Enhance bitmap truncation Reviewed-by: matsaave, iklam --- src/hotspot/share/cds/archiveHeapWriter.cpp | 12 +++--- src/hotspot/share/cds/filemap.cpp | 41 ++++++++++----------- src/hotspot/share/cds/filemap.hpp | 2 +- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/hotspot/share/cds/archiveHeapWriter.cpp b/src/hotspot/share/cds/archiveHeapWriter.cpp index 17d78b6b44cfe..853d459c691dd 100644 --- a/src/hotspot/share/cds/archiveHeapWriter.cpp +++ b/src/hotspot/share/cds/archiveHeapWriter.cpp @@ -248,11 +248,16 @@ void ArchiveHeapWriter::copy_roots_to_buffer(GrowableArrayCHeap_rank; int rank_b = b->_rank; diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index 7bbb9688015e7..c935541d7cf0a 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -1581,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(); diff --git a/src/hotspot/share/cds/filemap.hpp b/src/hotspot/share/cds/filemap.hpp index aa728b9d4949f..1bf2510a3351c 100644 --- a/src/hotspot/share/cds/filemap.hpp +++ b/src/hotspot/share/cds/filemap.hpp @@ -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); From 0f253d11033a26d15ea20df19db6765bb274a848 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 23 Sep 2024 07:02:59 +0000 Subject: [PATCH 132/307] 8340392: Handle OopStorage in location decoder Reviewed-by: kbarrett, dholmes --- src/hotspot/share/gc/shared/oopStorage.cpp | 20 +++++ src/hotspot/share/gc/shared/oopStorage.hpp | 1 + .../share/gc/shared/oopStorage.inline.hpp | 2 + src/hotspot/share/gc/shared/oopStorageSet.cpp | 17 ++++ src/hotspot/share/gc/shared/oopStorageSet.hpp | 3 + src/hotspot/share/runtime/os.cpp | 6 ++ .../gtest/gc/shared/test_oopStorageSet.cpp | 84 ++++++++++++++++++- 7 files changed, 132 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shared/oopStorage.cpp b/src/hotspot/share/gc/shared/oopStorage.cpp index 6c5e57c947952..568888ac7d97e 100644 --- a/src/hotspot/share/gc/shared/oopStorage.cpp +++ b/src/hotspot/share/gc/shared/oopStorage.cpp @@ -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 f78746fc14a27..96cc5a23d6a91 100644 --- a/src/hotspot/share/gc/shared/oopStorage.hpp +++ b/src/hotspot/share/gc/shared/oopStorage.hpp @@ -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. diff --git a/src/hotspot/share/gc/shared/oopStorage.inline.hpp b/src/hotspot/share/gc/shared/oopStorage.inline.hpp index ce78e507efc12..545da0be0a76e 100644 --- a/src/hotspot/share/gc/shared/oopStorage.inline.hpp +++ b/src/hotspot/share/gc/shared/oopStorage.inline.hpp @@ -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 d061fc7763868..c6947590d96fb 100644 --- a/src/hotspot/share/gc/shared/oopStorageSet.cpp +++ b/src/hotspot/share/gc/shared/oopStorageSet.cpp @@ -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 273a769dd59d4..867172c41ad74 100644 --- a/src/hotspot/share/gc/shared/oopStorageSet.hpp +++ b/src/hotspot/share/gc/shared/oopStorageSet.hpp @@ -26,6 +26,7 @@ #define SHARE_GC_SHARED_OOPSTORAGESET_HPP #include "nmt/memTag.hpp" +#include "oops/oop.hpp" #include "utilities/debug.hpp" #include "utilities/enumIterator.hpp" #include "utilities/globalDefinitions.hpp" @@ -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/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index 9c9dfbc62306d..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" @@ -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; 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); + } + } +} From a07052e83d20e107f21fd0d266ab638043531c8a Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Mon, 23 Sep 2024 08:02:16 +0000 Subject: [PATCH 133/307] 8340573: Remove unused G1ParScanThreadState::_partial_objarray_chunk_size Reviewed-by: tschatzl --- src/hotspot/share/gc/g1/g1ParScanThreadState.hpp | 2 -- 1 file changed, 2 deletions(-) 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; From bc7c0dc45dcd66d24ece8ebbd5c1b25e131eae67 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 23 Sep 2024 08:02:36 +0000 Subject: [PATCH 134/307] 8340084: Open source AWT Frame related tests Reviewed-by: psadhukhan, honkar --- .../java/awt/Frame/DefaultLocationTest.java | 66 +++++++++++++ test/jdk/java/awt/Frame/EmptyFrameTest.java | 99 +++++++++++++++++++ test/jdk/java/awt/Frame/FrameLayoutTest.java | 70 +++++++++++++ .../awt/Frame/FrameSetMinimumSizeTest.java | 91 +++++++++++++++++ test/jdk/java/awt/Frame/PackTwiceTest.java | 67 +++++++++++++ 5 files changed, 393 insertions(+) create mode 100644 test/jdk/java/awt/Frame/DefaultLocationTest.java create mode 100644 test/jdk/java/awt/Frame/EmptyFrameTest.java create mode 100644 test/jdk/java/awt/Frame/FrameLayoutTest.java create mode 100644 test/jdk/java/awt/Frame/FrameSetMinimumSizeTest.java create mode 100644 test/jdk/java/awt/Frame/PackTwiceTest.java 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; + } +} From 67448b0eb2e83501b9c1dd0c79c7fe03aaef6b09 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Mon, 23 Sep 2024 10:32:58 +0000 Subject: [PATCH 135/307] 8339852: Fix typos in java.compiler documentation Reviewed-by: liach, darcy --- .../processing/AbstractProcessor.java | 4 ++-- .../processing/RoundEnvironment.java | 6 ++--- .../javax/lang/model/AnnotatedConstruct.java | 13 ++++++----- .../javax/lang/model/SourceVersion.java | 23 +++++++++---------- .../lang/model/element/AnnotationMirror.java | 4 ++-- .../lang/model/element/ExecutableElement.java | 4 ++-- .../javax/lang/model/element/TypeElement.java | 6 ++--- .../lang/model/element/package-info.java | 4 ++-- .../javax/lang/model/util/Elements.java | 18 +++++++-------- .../classes/javax/lang/model/util/Types.java | 8 +++---- .../javax/tools/ForwardingFileObject.java | 4 ++-- .../tools/ForwardingJavaFileManager.java | 4 ++-- .../javax/tools/ForwardingJavaFileObject.java | 4 ++-- .../classes/javax/tools/JavaFileManager.java | 6 ++--- .../javax/tools/StandardJavaFileManager.java | 4 ++-- .../classes/javax/tools/ToolProvider.java | 6 ++--- 16 files changed, 59 insertions(+), 59 deletions(-) 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/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 6dc1b1ccab129..2bb275a046b09 100644 --- a/src/java.compiler/share/classes/javax/lang/model/AnnotatedConstruct.java +++ b/src/java.compiler/share/classes/javax/lang/model/AnnotatedConstruct.java @@ -45,14 +45,14 @@ * {@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 {@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 @@ -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 871487b98e6f4..adc45006601ed 100644 --- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java +++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java @@ -208,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 @@ -476,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 @@ -502,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. * @@ -596,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, 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 @@ -613,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, 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/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 bbbf4e3d95e6a..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 @@ -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} */ From 384deda65fd63e23d4caaaa9762f2ac80de78029 Mon Sep 17 00:00:00 2001 From: Per Minborg Date: Mon, 23 Sep 2024 10:57:43 +0000 Subject: [PATCH 136/307] 8325949: Create an internal utility method for creating VarHandle instances Reviewed-by: rriggs --- .../classes/java/lang/ThreadBuilders.java | 15 ++-- .../classes/java/lang/invoke/Invokers.java | 14 +--- .../share/classes/java/net/Socket.java | 13 ++-- .../java/nio/channels/SelectionKey.java | 16 ++-- .../channels/spi/AbstractSelectionKey.java | 14 +--- .../nio/channels/spi/AbstractSelector.java | 14 ++-- .../util/concurrent/CompletableFuture.java | 14 ++-- .../java/util/concurrent/Exchanger.java | 16 ++-- .../java/util/concurrent/FutureTask.java | 14 ++-- .../classes/java/util/concurrent/Phaser.java | 12 +-- .../concurrent/PriorityBlockingQueue.java | 16 ++-- .../util/concurrent/StructuredTaskScope.java | 24 ++---- .../util/concurrent/SubmissionPublisher.java | 16 ++-- .../concurrent/ThreadPerTaskExecutor.java | 26 ++----- .../util/concurrent/atomic/AtomicBoolean.java | 13 +--- .../atomic/AtomicMarkableReference.java | 14 +--- .../concurrent/atomic/AtomicReference.java | 13 +--- .../atomic/AtomicStampedReference.java | 14 +--- .../util/concurrent/atomic/Striped64.java | 31 +++----- .../classes/java/util/stream/ForEachOps.java | 15 ++-- .../classes/java/util/stream/GathererOp.java | 13 +--- .../jdk/internal/foreign/ConfinedSession.java | 14 +--- .../internal/foreign/MemorySessionImpl.java | 15 ++-- .../jdk/internal/foreign/SharedSession.java | 14 +--- .../internal/foreign/abi/DowncallLinker.java | 19 ++--- .../foreign/layout/AbstractLayout.java | 13 +--- .../classes/jdk/internal/invoke/MhUtil.java | 78 +++++++++++++++++++ .../jdk/internal/misc/ThreadFlock.java | 13 ++-- .../reflect/DirectMethodHandleAccessor.java | 18 ++--- .../internal/vm/SharedThreadContainer.java | 15 ++-- .../sun/nio/ch/DatagramChannelImpl.java | 13 +--- 31 files changed, 232 insertions(+), 317 deletions(-) create mode 100644 src/java.base/share/classes/jdk/internal/invoke/MhUtil.java 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/invoke/Invokers.java b/src/java.base/share/classes/java/lang/invoke/Invokers.java index 1f4314f5421d2..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; @@ -681,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/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/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/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/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 c6671deaa2eb5..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; 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 da445da61badc..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; 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/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/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/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/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/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/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/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 From 37ec80df8d3b014292fc3d31a1b2aad4e8218ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20Sikstr=C3=B6m?= Date: Mon, 23 Sep 2024 12:28:43 +0000 Subject: [PATCH 137/307] 8339161: ZGC: Remove unused remembered sets Reviewed-by: aboldtch, stefank --- src/hotspot/share/gc/z/zHeap.cpp | 11 +++---- src/hotspot/share/gc/z/zPage.cpp | 26 +++------------ src/hotspot/share/gc/z/zPage.hpp | 8 ++--- src/hotspot/share/gc/z/zPageAllocator.cpp | 4 +-- src/hotspot/share/gc/z/zRelocate.cpp | 39 ++++------------------- src/hotspot/share/gc/z/zRememberedSet.cpp | 27 +++------------- src/hotspot/share/gc/z/zRememberedSet.hpp | 7 ++-- 7 files changed, 28 insertions(+), 94 deletions(-) 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/zPage.cpp b/src/hotspot/share/gc/z/zPage.cpp index dc40c5367c121..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 @@ -78,27 +78,16 @@ void ZPage::reset_seqnum() { Atomic::store(&_seqnum_other, ZGeneration::generation(_generation_id == ZGenerationId::young ? ZGenerationId::old : ZGenerationId::young)->seqnum()); } -void ZPage::remset_initialize() { - // Remsets should only be initialized once and only for old pages. +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"); _remembered_set.initialize(size()); } -void ZPage::remset_initialize_or_verify_cleared() { - assert(is_old(), "Only old pages need a remset"); - - if (_remembered_set.is_initialized()) { - verify_remset_cleared_current(); - verify_remset_cleared_previous(); - } else { - remset_initialize(); - } -} - -void ZPage::remset_clear() { - _remembered_set.clear_all(); +void ZPage::remset_delete() { + _remembered_set.delete_all(); } void ZPage::reset(ZPageAge age) { @@ -123,7 +112,6 @@ void ZPage::reset_top_for_allocation() { void ZPage::reset_type_and_size(ZPageType type) { _type = type; _livemap.resize(object_max_count()); - _remembered_set.resize(size()); } ZPage* ZPage::retype(ZPageType type) { @@ -216,10 +204,6 @@ 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(); } diff --git a/src/hotspot/share/gc/z/zPage.hpp b/src/hotspot/share/gc/z/zPage.hpp index 42e14f904bc77..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 @@ -155,9 +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_initialize(); - void remset_initialize_or_verify_cleared(); - 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); @@ -182,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 f5d8ae6e3d160..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 @@ -733,7 +733,7 @@ ZPage* ZPageAllocator::alloc_page(ZPageType type, size_t size, ZAllocationFlags page->reset_top_for_allocation(); page->reset_livemap(); if (age == ZPageAge::old) { - page->remset_initialize_or_verify_cleared(); + page->remset_alloc(); } // Update allocation statistics. Exclude gc relocations to avoid diff --git a/src/hotspot/share/gc/z/zRelocate.cpp b/src/hotspot/share/gc/z/zRelocate.cpp index 90209e4c62253..33304bcefd37f 100644 --- a/src/hotspot/share/gc/z/zRelocate.cpp +++ b/src/hotspot/share/gc/z/zRelocate.cpp @@ -848,7 +848,7 @@ class ZRelocateWork : public StackObj { to_page->reset(to_age); to_page->reset_top_for_allocation(); if (promotion) { - to_page->remset_initialize(); + to_page->remset_alloc(); } // Verify that the inactive remset is clear when resetting the page for @@ -943,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() { @@ -1017,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)"); @@ -1029,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 @@ -1292,7 +1267,7 @@ class ZFlipAgePagesTask : public ZTask { new_page->reset(to_age); new_page->reset_livemap(); if (promotion) { - new_page->remset_initialize(); + new_page->remset_alloc(); } if (promotion) { 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(); From 63e611cd5d7eb4fc6ea6633ff9123e4bee5f5993 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Mon, 23 Sep 2024 12:30:30 +0000 Subject: [PATCH 138/307] 8335334: Stress mode to randomly execute unstable if traps Reviewed-by: chagedorn, kvn --- src/hotspot/share/opto/c2_globals.hpp | 3 + src/hotspot/share/opto/cfgnode.hpp | 2 +- src/hotspot/share/opto/compile.cpp | 10 +-- src/hotspot/share/opto/ifnode.cpp | 4 +- src/hotspot/share/opto/parse.hpp | 5 ++ src/hotspot/share/opto/parse2.cpp | 77 +++++++++++++++++++ .../compiler/arguments/TestStressOptions.java | 10 ++- .../c2/irTests/TestPrunedExHandler.java | 1 + .../cha/StrengthReduceInterfaceCall.java | 1 + .../MaterializeVirtualObjectTest.java | 1 + .../rangechecks/TestExplicitRangeChecks.java | 1 + .../uncommontrap/TestUnstableIfTrap.java | 2 +- .../runner/BasicBooleanOpTest.java | 1 + .../whitebox/DeoptimizeFramesTest.java | 1 + .../event/compiler/TestDeoptimization.java | 1 + 15 files changed, 110 insertions(+), 10 deletions(-) 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/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 6382608f36a81..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; 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/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/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/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/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/jvmci/compilerToVM/MaterializeVirtualObjectTest.java b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java index 5855440d0b275..1dcef0c96cd64 100644 --- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java @@ -27,6 +27,7 @@ * * @requires vm.jvmci & vm.compMode == "Xmixed" * @requires vm.opt.final.EliminateAllocations == true + * @requires vm.opt.StressUnstableIfTraps == null | !vm.opt.StressUnstableIfTraps * * @comment no "-Xcomp -XX:-TieredCompilation" combination allowed until JDK-8140018 is resolved * @requires vm.opt.TieredCompilation == null | vm.opt.TieredCompilation == true 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/vectorization/runner/BasicBooleanOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java index bb6185177e75f..18e7721e0d6c1 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java @@ -25,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 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/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 From a9b0f9ccbf98c6b90626fcd7087fa8eeb0c168eb Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Mon, 23 Sep 2024 13:58:00 +0000 Subject: [PATCH 139/307] 8340393: Open source closed choice tests #2 Reviewed-by: psadhukhan --- test/jdk/java/awt/Choice/CheckChoiceTest.java | 92 +++++++++++++++++++ test/jdk/java/awt/Choice/ChoiceBigTest.java | 70 ++++++++++++++ test/jdk/java/awt/Choice/ChoiceFocusTest.java | 81 ++++++++++++++++ test/jdk/java/awt/Choice/DisabledList.java | 79 ++++++++++++++++ 4 files changed, 322 insertions(+) create mode 100644 test/jdk/java/awt/Choice/CheckChoiceTest.java create mode 100644 test/jdk/java/awt/Choice/ChoiceBigTest.java create mode 100644 test/jdk/java/awt/Choice/ChoiceFocusTest.java create mode 100644 test/jdk/java/awt/Choice/DisabledList.java 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/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; + } +} From ea8f35b98e618bfa55371e45b3ef61fa5289dd94 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 23 Sep 2024 14:33:17 +0000 Subject: [PATCH 140/307] 8340183: Shenandoah: Incorrect match for clone barrier in is_gc_barrier_node Reviewed-by: roland, rkennke --- .../shenandoah/c2/shenandoahBarrierSetC2.cpp | 21 +++++++------------ .../shenandoah/c2/shenandoahBarrierSetC2.hpp | 1 + .../gc/shenandoah/c2/shenandoahSupport.cpp | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp index 368d76696058c..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; @@ -675,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", From 0f9f777520c5341be1e9f985f41304a297b08936 Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Mon, 23 Sep 2024 16:07:12 +0000 Subject: [PATCH 141/307] 8336025: Improve ZipOutputSream validation of MAX CEN Header field limits Reviewed-by: alanb --- .../share/classes/java/util/zip/ZipEntry.java | 2 +- .../java/util/zip/ZipOutputStream.java | 32 +++- .../util/zip/ZipFile/CenSizeTooLarge.java | 41 ++--- .../ZipOutputStreamMaxCenHdrTest.java | 169 ++++++++++++++++++ 4 files changed, 210 insertions(+), 34 deletions(-) create mode 100644 test/jdk/java/util/zip/ZipOutputStream/ZipOutputStreamMaxCenHdrTest.java 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 8c8bfeb322960..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. 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/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; + } +} From c6f1d5f374bfa9bde75765391d5dae0e8e28b4ab Mon Sep 17 00:00:00 2001 From: Francisco Ferrari Bihurriet Date: Mon, 23 Sep 2024 17:45:38 +0000 Subject: [PATCH 142/307] 8319332: Security properties files inclusion Co-authored-by: Francisco Ferrari Bihurriet Co-authored-by: Martin Balao Reviewed-by: weijun, mullan, kdriver --- .../share/classes/java/security/Security.java | 359 +++++-- .../sun/security/util/PropertyExpander.java | 33 +- .../share/conf/security/java.security | 27 + .../security/Security/ConfigFileTest.java | 970 ++++++++++++++++-- .../jdk/java/security/Security/override.props | 7 - .../Security/signedfirst/DynStatic.java | 10 +- 6 files changed, 1173 insertions(+), 233 deletions(-) delete mode 100644 test/jdk/java/security/Security/override.props 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/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/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/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"); } From 833ff29983e0d433ccd4c7e946b15e42045faeaa Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Mon, 23 Sep 2024 18:25:12 +0000 Subject: [PATCH 143/307] 8340461: Amend description for logArea Reviewed-by: azvegint, prr --- .../java/awt/regtesthelpers/PassFailJFrame.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index e2693e7c555f4..17bec86c725fb 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -159,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.
  • * */ @@ -1113,9 +1113,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); @@ -1124,7 +1125,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"); @@ -1133,7 +1135,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) { From 8dcf7b8fa7b17bf34c62c561c6ed78e8080df1ff Mon Sep 17 00:00:00 2001 From: Phil Race Date: Mon, 23 Sep 2024 18:26:52 +0000 Subject: [PATCH 144/307] 8340411: open source several 2D imaging tests Reviewed-by: azvegint --- .../image/BytePackedRaster/DitherTest.java | 147 ++++++++++++++++++ .../awt/image/BytePackedRaster/MultiOp.java | 108 +++++++++++++ .../ByteBinaryBitmask.java | 88 +++++++++++ .../ImageRepresentation/CustomSourceCM.java | 142 +++++++++++++++++ 4 files changed, 485 insertions(+) create mode 100644 test/jdk/sun/awt/image/BytePackedRaster/DitherTest.java create mode 100644 test/jdk/sun/awt/image/BytePackedRaster/MultiOp.java create mode 100644 test/jdk/sun/awt/image/ImageRepresentation/ByteBinaryBitmask.java create mode 100644 test/jdk/sun/awt/image/ImageRepresentation/CustomSourceCM.java 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); + } +} From e97f0fe1b4046bfcc40e85ba1bee4f4c40053300 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Mon, 23 Sep 2024 18:31:31 +0000 Subject: [PATCH 145/307] 8340365: Position the first window of a window list Reviewed-by: azvegint, prr --- test/jdk/java/awt/regtesthelpers/PassFailJFrame.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index 17bec86c725fb..3a142c716b199 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -349,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(); From cd796e0aef321d46c96f79dc5446d095b8a30e60 Mon Sep 17 00:00:00 2001 From: Alexey Semenyuk Date: Tue, 24 Sep 2024 00:13:49 +0000 Subject: [PATCH 146/307] 8338918: Remove non translated file name from WinResources resource bundle Reviewed-by: jlu, almatvee --- .../classes/jdk/jpackage/internal/I18N.java | 56 ++++++++++++++----- .../resources/WinResources.properties | 1 - .../resources/WinResourcesNoL10N.properties | 28 ++++++++++ .../WinResourcesNoL10N_de.properties | 28 ++++++++++ .../WinResourcesNoL10N_ja.properties | 28 ++++++++++ .../WinResourcesNoL10N_zh_CN.properties | 28 ++++++++++ .../resources/WinResources_de.properties | 1 - .../resources/WinResources_ja.properties | 1 - .../resources/WinResources_zh_CN.properties | 1 - 9 files changed, 154 insertions(+), 18 deletions(-) create mode 100644 src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N.properties create mode 100644 src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_de.properties create mode 100644 src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_ja.properties create mode 100644 src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_zh_CN.properties 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/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 项目文件 From c8ae8480496d56a8e51b9f5a6df50c70a429672f Mon Sep 17 00:00:00 2001 From: David Holmes Date: Tue, 24 Sep 2024 00:37:21 +0000 Subject: [PATCH 147/307] 8340707: ProblemList applications/ctw/modules/java_base.java due to JDK-8340683 Reviewed-by: darcy --- test/hotspot/jtreg/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index b1a56bcce12c8..a9afd119f8032 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 From 40cde003e8061a0eb6b0214d5a44325c3d55cdc6 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Tue, 24 Sep 2024 01:47:57 +0000 Subject: [PATCH 148/307] 8340114: Remove outdated SelectVersion() function from the launcher and update the code comments explaining the code flow Reviewed-by: dholmes, alanb --- .../macosx/native/libjli/java_md_macosx.m | 168 ++++------ src/java.base/share/native/libjli/emessages.h | 3 - src/java.base/share/native/libjli/java.c | 297 ++++++------------ src/java.base/share/native/libjli/java.h | 30 +- .../share/native/libjli/manifest_info.h | 6 +- .../share/native/libjli/parse_manifest.c | 18 +- src/java.base/unix/native/libjli/java_md.c | 166 +++++----- .../tools/launcher/MultipleJRERemoved.java | 214 ------------- 8 files changed, 260 insertions(+), 642 deletions(-) delete mode 100644 test/jdk/tools/launcher/MultipleJRERemoved.java 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/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 337ecc846830e..ca0bc4df3c7d7 100644 --- a/src/java.base/share/native/libjli/java.c +++ b/src/java.base/share/native/libjli/java.c @@ -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; @@ -1492,7 +1320,7 @@ ParseArguments(int *pargc, char ***pargv, snprintf(tmp, tmpSize, "-X%s", arg + 1); /* skip '-' */ AddOption(tmp, NULL); } 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)) { @@ -1501,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); } @@ -1551,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. @@ -2340,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/libjli/java_md.c b/src/java.base/unix/native/libjli/java_md.c index 2a1a4e7795a2e..4bebc8dd10b8d 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,7 +205,7 @@ 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) { 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; - } - } -} From 3411f9dff79c2e7cb7ce8ebf036f8b3fd9bb647d Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Tue, 24 Sep 2024 02:08:06 +0000 Subject: [PATCH 149/307] 8339995: Open source several AWT focus tests - series 6 Reviewed-by: prr --- test/jdk/ProblemList.txt | 1 + .../java/awt/Focus/ConsumedKeyEventTest.java | 197 ++++++++++++++++++ .../java/awt/Focus/EmptyWindowKeyTest.java | 87 ++++++++ .../jdk/java/awt/Focus/InactiveFocusRace.java | 188 +++++++++++++++++ .../awt/Focus/InitialPrintDlgFocusTest.java | 107 ++++++++++ 5 files changed, 580 insertions(+) create mode 100644 test/jdk/java/awt/Focus/ConsumedKeyEventTest.java create mode 100644 test/jdk/java/awt/Focus/EmptyWindowKeyTest.java create mode 100644 test/jdk/java/awt/Focus/InactiveFocusRace.java create mode 100644 test/jdk/java/awt/Focus/InitialPrintDlgFocusTest.java diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 0990e1da457fd..1727722335f67 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -791,3 +791,4 @@ 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/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/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); + + } +} + From 865d99f63475799b9a0503a3dcc21a7534b014d1 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Tue, 24 Sep 2024 02:08:20 +0000 Subject: [PATCH 150/307] 8340596: Remove dead code from RequiresSetenv function in java.base/unix/native/libjli/java_md.c Reviewed-by: dholmes --- src/java.base/unix/native/libjli/java_md.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/java.base/unix/native/libjli/java_md.c b/src/java.base/unix/native/libjli/java_md.c index 4bebc8dd10b8d..7f2f5638a6b83 100644 --- a/src/java.base/unix/native/libjli/java_md.c +++ b/src/java.base/unix/native/libjli/java_md.c @@ -211,7 +211,6 @@ static jboolean RequiresSetenv(const char *jvmpath) { char jpath[PATH_MAX + 1]; char *llp; - char *dmllp = NULL; char *p; /* a utility pointer */ #ifdef MUSL_LIBC @@ -229,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 @@ -268,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 */ From 6c91a16f16cbeb1bb0a79459e7db1fd9f576e743 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Tue, 24 Sep 2024 02:09:42 +0000 Subject: [PATCH 151/307] 8340367: Opensource few AWT image tests Reviewed-by: prr --- .../image/BufferedImage/GrayAATextTest.java | 104 +++++++++++ test/jdk/java/awt/image/GrayAlpha.java | 175 ++++++++++++++++++ test/jdk/java/awt/image/ImageOffsetTest.java | 123 ++++++++++++ test/jdk/java/awt/image/TransformImage.java | 111 +++++++++++ test/jdk/java/awt/image/duke.gif | Bin 0 -> 1929 bytes 5 files changed, 513 insertions(+) create mode 100644 test/jdk/java/awt/image/BufferedImage/GrayAATextTest.java create mode 100644 test/jdk/java/awt/image/GrayAlpha.java create mode 100644 test/jdk/java/awt/image/ImageOffsetTest.java create mode 100644 test/jdk/java/awt/image/TransformImage.java create mode 100644 test/jdk/java/awt/image/duke.gif 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 0000000000000000000000000000000000000000..ed32e0ff79b05c07b82863ce6fb07fa9898adaa2 GIT binary patch literal 1929 zcmWlYe^AtB8pi`HvM4_?{J2I$8$dLc1#@!R2zwgXMWdj^k;9xr+bDW&4{JlE8WpDj z7F-cwwK{H<)?L&#SJz$!;hJ{%BY2FYf)Wp^xl?aq!5Xcdi$c#hV~>m9_n-Hl=Xsy+ z=li^?*Q~;pZ+R1N1J40KRkeWM7ew3~jLM24A{CM-A}~TzqzYpq&od0GC=z71!w_=b z-==B0rt2t*nA}((5YSLs6a*Z@X__WqiSjTW6oLo{5km&|K1mGAimYjhs#wwZtvV8SV~7LCFpgub+-TTAk%UQb0dE_cj+pc?!+0o?qG$?% zVFD)%!w7Z;g)ndE8Uk6Aky=+kLaUQ{UW`XS?Nn*s@SQ{VmFgGdkV{&&98EcEQ5hjc@H$`e)fX zj@&GdchxpMUo|-A^M4iBP3(#Ib53Ap?5{nGT7SBA_V!o!TTzL5R~FUWe)4X?@iTd8 z1;TcF^rQLj?4p0uy?@ikb2eUSXdHVa_jIn=@W%a<6~57D>am6&Z!{lzc=@ZbuGB8` zpU38H8d~@82Da!+qdYG5ls&Cx?~|oPMnbqTHMw%I*KlV~?fc{rSwe29?Om}fsknG# z@n5IwY=4Mx>>0WJLG>=yJX^WbHA30iQ$H!X)3<4K zBe1|sf3NKKTS;)mg{$k(2eDJG^u5=&x{@M!V>EWgzRA((>}?o{WQBehp1mIHU!BGG zYz5_6B(+KIVdCVoum2ItM&gXZd+SB^vQTN=a zeYbbah=i-xCho2{4Pazv_i%2mH`EkM{r8XYDLbdY@(a7Ud}$%!$QrTN_DqwNXA9~g zTGKxKyfto7NDp;5A3O5zgb(hyxjN@OAG!(zy^*Ug4!yjF=Y*8aHA@ovB1({&a4;sR zTf1CVC{>Pgy`m$lG;P1$pC_6F7u%iP+qz0q4{lXT`i9g-ThiYgO^GXC`f?JNo*|@p zr{b%U-tSKw99q0|YJa9{Va?`H{IaNICo>p5lGEY*+IDR4bfIUwq~CTRuC_mGWA%~W zea{@eKJ(Iq^7MvdsPsR%&vt$@4i&s?bPptz#y#!FcRZEaMS0WFTyXMCUEfsNxnJ_9 zPwpt`Er4O>``2G{7=4r1GCSTO8#0xw+{<^L4X(K8y1wKj72KLrYD}Y7SJuY7y==wf z;UkI5?(v?h+4r;vR{P*U`ul~=D@U7K5$eV8c!%rX-38vE>azU80UrhFXCv#d`(ylZS4+i2a^vI91MTIxCx%9gd2&N&D9RC&xcpx8#f=GZv%9;F z#?CEVT%UV$nk;L%RJA+d=f8ZB@U*Xz-TZbG?HKKT(VJZMBH!)$#qRuwbFc%Aljqha zoNBs8od~V$_^vux0ZSk!iP!hI($t35SxY8`FV{pxCjpU}Ova2VIg1&>V)CvvMb_ Date: Tue, 24 Sep 2024 05:35:12 +0000 Subject: [PATCH 152/307] 8340146: ZGC: TestAllocateHeapAt.java should not run with UseLargePages Reviewed-by: tschatzl, stefank --- test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java | 3 ++- test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java | 3 ++- test/jtreg-ext/requires/VMProps.java | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java b/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java index bacd7a2078e97..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 diff --git a/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java b/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java index 28d2ebd6aea01..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 diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index 795a658afa591..5aa703c5b26c2 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -386,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"); } From 1dd60b62e384090b13a08d2afa62e49ef52bc46c Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Tue, 24 Sep 2024 06:47:20 +0000 Subject: [PATCH 153/307] 8323688: C2: Fix UB of jlong overflow in PhaseIdealLoop::is_counted_loop() Reviewed-by: thartmann, kvn --- src/hotspot/share/opto/loopnode.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) 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; From 88801caef6ccdc5ba9ade2af830f3b3cd96e1467 Mon Sep 17 00:00:00 2001 From: Gui Cao Date: Tue, 24 Sep 2024 07:09:10 +0000 Subject: [PATCH 154/307] 8340590: RISC-V: C2: Small improvement to vector gather load and scatter store Reviewed-by: fyang, dzhang --- src/hotspot/cpu/riscv/riscv_v.ad | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/hotspot/cpu/riscv/riscv_v.ad b/src/hotspot/cpu/riscv/riscv_v.ad index 54947f6bf9a19..510c0ff5d4646 100644 --- a/src/hotspot/cpu/riscv/riscv_v.ad +++ b/src/hotspot/cpu/riscv/riscv_v.ad @@ -4895,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)); %} @@ -4929,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), @@ -4969,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)); %} @@ -5003,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); %} From 9176f6810ef914579b8ca8e3bc20a0fdf3a934c8 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 24 Sep 2024 07:22:27 +0000 Subject: [PATCH 155/307] 8340623: Remove outdated PROCESSOR_ARCHITECTURE_IA64 from Windows coding Reviewed-by: alanb, dholmes --- src/java.base/windows/native/libjava/java_props_md.c | 3 --- 1 file changed, 3 deletions(-) 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 357c697ab5f30..d26d6df1affad 100644 --- a/src/java.base/windows/native/libjava/java_props_md.c +++ b/src/java.base/windows/native/libjava/java_props_md.c @@ -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 From e60e8821568a74269340417fece2acb71f633098 Mon Sep 17 00:00:00 2001 From: Afshin Zafari Date: Tue, 24 Sep 2024 07:56:14 +0000 Subject: [PATCH 156/307] 8335167: Test runtime/Thread/TestAlwaysPreTouchStacks.java failed with Expected a higher ratio between stack committed and reserved Reviewed-by: stuefe, dholmes, gziemski --- test/hotspot/jtreg/ProblemList.txt | 1 - .../Thread/TestAlwaysPreTouchStacks.java | 177 +++++++++--------- 2 files changed, 88 insertions(+), 90 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index a9afd119f8032..bec3f64c7d8c2 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -116,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 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); + } + } } } From 44024826e52373d1613ec366e3f5a9d5bbaefa41 Mon Sep 17 00:00:00 2001 From: Yudi Zheng Date: Tue, 24 Sep 2024 08:25:06 +0000 Subject: [PATCH 157/307] 8340585: [JVMCI] compiler/unsafe/UnsafeGetStableArrayElement.java fails with -XX:-UseCompressedClassPointers Reviewed-by: dnsimon --- .../unsafe/UnsafeGetStableArrayElement.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) 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); From 4cd8c75a55163be33917b1fba9f360ea816f3aa9 Mon Sep 17 00:00:00 2001 From: Tomas Zezula Date: Tue, 24 Sep 2024 10:19:38 +0000 Subject: [PATCH 158/307] 8340398: [JVMCI] Unintuitive behavior of UseJVMCICompiler option Reviewed-by: dnsimon --- src/hotspot/share/jvmci/jvmci_globals.cpp | 18 ++++++++++++------ src/hotspot/share/jvmci/jvmci_globals.hpp | 2 +- .../ci/hotspot/HotSpotJVMCICompilerConfig.java | 7 +++++-- 3 files changed, 18 insertions(+), 9 deletions(-) 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/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 { From 3e673d9e46ddb464263ff76f385ca5bf98a0b19d Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Tue, 24 Sep 2024 10:48:35 +0000 Subject: [PATCH 159/307] 8340680: Fix typos in javax.lang.model.SourceVersion Reviewed-by: darcy, iris --- .../share/classes/javax/lang/model/SourceVersion.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 adc45006601ed..231a5e34c62b7 100644 --- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java +++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java @@ -601,7 +601,7 @@ public static boolean isName(CharSequence name, SourceVersion version) { * keywords. * * @param s the string to check - * @return {@code true} if {@code s} is a keyword, boolean + * @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 @@ -619,7 +619,7 @@ public static boolean isKeyword(CharSequence s) { * * @param s the string to check * @param version the version to use - * @return {@code true} if {@code s} is a keyword, boolean + * @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 From e1c4d3039f6b5106ce3f65d50f607eacc2a8d168 Mon Sep 17 00:00:00 2001 From: Kuai Wei Date: Tue, 24 Sep 2024 11:08:36 +0000 Subject: [PATCH 160/307] 8339299: C1 will miss type profile when inline final method Reviewed-by: lmesnik, vlivanov --- src/hotspot/share/c1/c1_LIR.hpp | 5 +- .../compiler/cha/TypeProfileFinalMethod.java | 147 ++++++++++++++++++ 2 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/cha/TypeProfileFinalMethod.java 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/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; + } + } +} + + From 49d15edd31c863faf3722af1bae8b50662ecf71f Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Tue, 24 Sep 2024 12:43:00 +0000 Subject: [PATCH 161/307] 8340657: [PPC64] SA determines wrong unextendedSP Reviewed-by: ysuenaga, mbaesken --- .../classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"); From 3c97d2437d34d2db47f3607fbb95ac3b8e2ec60b Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 24 Sep 2024 12:50:33 +0000 Subject: [PATCH 162/307] 8340383: VM issues warning failure to find kernel32.dll on Windows nanoserver Reviewed-by: dholmes, jwaters --- src/hotspot/os/windows/os_windows.cpp | 41 ++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index ed62fe612aae3..817757f1ac6a2 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -4093,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."); @@ -4110,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) { From 279086d4ce7e05972e099022e8045f39680dd4e8 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Tue, 24 Sep 2024 13:16:43 +0000 Subject: [PATCH 163/307] 8340408: Shenandoah: Remove redundant task stats printing code in ShenandoahTaskQueue Reviewed-by: shade, wkemper --- .../shenandoah/shenandoahConcurrentMark.cpp | 3 +- .../share/gc/shenandoah/shenandoahSTWMark.cpp | 3 +- .../gc/shenandoah/shenandoahTaskqueue.cpp | 39 ------------------- .../gc/shenandoah/shenandoahTaskqueue.hpp | 6 --- 4 files changed, 2 insertions(+), 49 deletions(-) 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/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 2b160a2938794..10887ad8c19d6 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp @@ -355,12 +355,6 @@ class ShenandoahObjToScanQueueSet: public ParallelClaimableQueueSet Date: Tue, 24 Sep 2024 14:28:05 +0000 Subject: [PATCH 164/307] 8338546: Speed up ConstantPoolBuilder::classEntry(ClassDesc) Reviewed-by: asotona, redestad --- .../classfile/impl/AbstractPoolEntry.java | 158 +++++++++++----- .../classfile/impl/SplitConstantPool.java | 178 +++++++++++++----- .../jdk/internal/classfile/impl/Util.java | 79 ++++++++ .../classfile/ConstantDescSymbolsTest.java | 65 ++++++- test/jdk/jdk/classfile/UtilTest.java | 57 +++++- .../internal/classfile/impl/UtilAccess.java | 41 ++++ .../ConstantPoolBuildingClassEntry.java | 164 ++++++++++++++++ 7 files changed, 647 insertions(+), 95 deletions(-) create mode 100644 test/jdk/jdk/classfile/java.base/jdk/internal/classfile/impl/UtilAccess.java create mode 100644 test/micro/org/openjdk/bench/jdk/classfile/ConstantPoolBuildingClassEntry.java 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 5cc08d06ec3ee..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 @@ -86,14 +86,24 @@ 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); } @@ -146,7 +156,7 @@ enum State { RAW, BYTE, CHAR, STRING } private final int offset; private final int rawLen; // Set in any state other than RAW - private @Stable int hash; + private @Stable int contentHash; private @Stable int charLen; // Set in CHAR state private @Stable char[] chars; @@ -165,10 +175,10 @@ 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) { + Utf8EntryImpl(ConstantPool cpm, int index, String s, int contentHash) { super(cpm, index, 0); this.rawBytes = null; this.offset = 0; @@ -176,7 +186,7 @@ enum State { RAW, BYTE, CHAR, STRING } this.state = State.STRING; this.stringValue = s; this.charLen = s.length(); - this.hash = hash; + this.contentHash = contentHash; } Utf8EntryImpl(ConstantPool cpm, int index, Utf8EntryImpl u) { @@ -185,7 +195,7 @@ enum State { RAW, BYTE, CHAR, STRING } 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; @@ -236,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; } @@ -294,7 +304,7 @@ private void inflate() { throw malformedInput(px); } } - this.hash = hashString(hash); + this.contentHash = hash; charLen = chararr_count; this.chars = chararr; state = State.CHAR; @@ -307,8 +317,6 @@ private ConstantPoolException malformedInput(int 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); @@ -316,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 @@ -389,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) @@ -397,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 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(); for (int token = map1.firstToken(hash); token != -1; token = map1.nextToken(hash, token)) { @@ -538,8 +633,7 @@ 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(); @@ -569,8 +663,7 @@ 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(); @@ -628,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 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 7f3dd914e7f8c..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 @@ -50,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; @@ -337,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/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/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/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))); + } + } +} From 85aed877960ef86b483b76ce4fcf95602ae2b924 Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Tue, 24 Sep 2024 14:40:38 +0000 Subject: [PATCH 165/307] 8338405: JFR: Use FILE type for dcmds Reviewed-by: egahlin, lmesnik --- .../jdk/jfr/internal/dcmd/AbstractDCmd.java | 38 --------------- .../jdk/jfr/internal/dcmd/ArgumentParser.java | 48 +++++++++++++++++++ .../jdk/jfr/internal/dcmd/DCmdDump.java | 6 +-- .../jdk/jfr/internal/dcmd/DCmdStart.java | 6 +-- .../jdk/jfr/internal/dcmd/DCmdStop.java | 6 +-- 5 files changed, 57 insertions(+), 47 deletions(-) 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 43a8bb96874b8..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<>(); @@ -226,10 +230,54 @@ private Object value(String name, String type, String 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"); 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 30d916b30e5dd..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,7 +230,7 @@ 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 @@ -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/DCmdStart.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java index 8424fa4a811eb..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"); @@ -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 @@ -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) }; } } From 2669e22b76c99c1e41a324099154b561e0433b56 Mon Sep 17 00:00:00 2001 From: Andrew Dinn Date: Tue, 24 Sep 2024 14:51:28 +0000 Subject: [PATCH 166/307] 8340793: Fix client builds after JDK-8337987 Reviewed-by: shade, fyang --- src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp | 1 + src/hotspot/cpu/arm/sharedRuntime_arm.cpp | 1 + src/hotspot/cpu/s390/sharedRuntime_s390.cpp | 1 + 3 files changed, 3 insertions(+) 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/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/s390/sharedRuntime_s390.cpp b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp index 65c94db09dcc8..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" From 212e32931cafe446d94219d6c3ffd92261984dff Mon Sep 17 00:00:00 2001 From: vamsi-parasa Date: Tue, 24 Sep 2024 15:11:13 +0000 Subject: [PATCH 167/307] 8338694: x86_64 intrinsic for tanh using libm Reviewed-by: kvn, jbhateja, sgibbons, sviswanathan --- src/hotspot/cpu/x86/assembler_x86.cpp | 8 + src/hotspot/cpu/x86/assembler_x86.hpp | 1 + src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp | 14 +- src/hotspot/cpu/x86/stubGenerator_x86_64.cpp | 3 + src/hotspot/cpu/x86/stubGenerator_x86_64.hpp | 1 + .../cpu/x86/stubGenerator_x86_64_tanh.cpp | 502 ++++++++++++++++++ .../templateInterpreterGenerator_x86_32.cpp | 6 +- .../templateInterpreterGenerator_x86_64.cpp | 6 +- src/hotspot/share/c1/c1_Compiler.cpp | 5 +- src/hotspot/share/c1/c1_GraphBuilder.cpp | 1 + src/hotspot/share/c1/c1_LIRGenerator.cpp | 1 + src/hotspot/share/c1/c1_Runtime1.cpp | 1 + src/hotspot/share/classfile/vmIntrinsics.cpp | 3 + src/hotspot/share/classfile/vmIntrinsics.hpp | 3 +- .../share/interpreter/abstractInterpreter.cpp | 3 + .../share/interpreter/abstractInterpreter.hpp | 4 +- .../templateInterpreterGenerator.cpp | 4 +- .../zero/zeroInterpreterGenerator.cpp | 4 +- src/hotspot/share/jvmci/jvmciCompilerToVM.hpp | 1 + .../share/jvmci/jvmciCompilerToVMInit.cpp | 14 + src/hotspot/share/opto/c2compiler.cpp | 1 + src/hotspot/share/opto/library_call.cpp | 4 + src/hotspot/share/runtime/stubRoutines.cpp | 1 + src/hotspot/share/runtime/stubRoutines.hpp | 2 + .../share/classes/java/lang/Math.java | 1 + test/jdk/java/lang/Math/HyperbolicTests.java | 396 +++++++++++++- 26 files changed, 980 insertions(+), 10 deletions(-) create mode 100644 src/hotspot/cpu/x86/stubGenerator_x86_64_tanh.cpp diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index 352cfc0018848..07476ab342f6d 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -8048,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); diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index 7f4790e05665e..62700d1fa1bd5 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -2631,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_LIRGenerator_x86.cpp b/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp index ff237d16d2216..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 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_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/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_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index 4e63736503fe0..74fdf7a5b76a3 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -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 5b44d5c0f1983..915f00f77c523 100644 --- a/src/hotspot/share/c1/c1_Runtime1.cpp +++ b/src/hotspot/share/c1/c1_Runtime1.cpp @@ -347,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 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/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/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/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/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/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/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 f5b932569be81..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; @@ -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/java.base/share/classes/java/lang/Math.java b/src/java.base/share/classes/java/lang/Math.java index 044982a588af8..6b576c88b4710 100644 --- a/src/java.base/share/classes/java/lang/Math.java +++ b/src/java.base/share/classes/java/lang/Math.java @@ -2737,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); } 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; } From 90c2c0b4ad4ee7d2ea149aea771cf81bd666b1dc Mon Sep 17 00:00:00 2001 From: Phil Race Date: Tue, 24 Sep 2024 18:07:33 +0000 Subject: [PATCH 168/307] 8340143: Open source several Java2D rendering loop tests. Reviewed-by: psadhukhan --- test/jdk/sun/java2d/loops/ARGBBgToRGB.java | 57 ++++++++++ test/jdk/sun/java2d/loops/CopyNegative.java | 103 ++++++++++++++++++ .../sun/java2d/loops/DitheredSolidFill.java | 73 +++++++++++++ .../java2d/loops/OffsetCalculationTest.java | 68 ++++++++++++ test/jdk/sun/java2d/loops/XORClearRect.java | 93 ++++++++++++++++ 5 files changed, 394 insertions(+) create mode 100644 test/jdk/sun/java2d/loops/ARGBBgToRGB.java create mode 100644 test/jdk/sun/java2d/loops/CopyNegative.java create mode 100644 test/jdk/sun/java2d/loops/DitheredSolidFill.java create mode 100644 test/jdk/sun/java2d/loops/OffsetCalculationTest.java create mode 100644 test/jdk/sun/java2d/loops/XORClearRect.java 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) + } +} From 8c08c43a34b7a237c0281ef58594af4f263ba3ca Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Tue, 24 Sep 2024 18:56:22 +0000 Subject: [PATCH 169/307] 8340433: Open source closed choice tests #3 Reviewed-by: honkar, prr --- test/jdk/java/awt/Choice/ChoicePosTest.java | 137 ++++++++++++++++++++ test/jdk/java/awt/Choice/DeadlockTest.java | 113 ++++++++++++++++ test/jdk/java/awt/Choice/SetFontTest.java | 91 +++++++++++++ 3 files changed, 341 insertions(+) create mode 100644 test/jdk/java/awt/Choice/ChoicePosTest.java create mode 100644 test/jdk/java/awt/Choice/DeadlockTest.java create mode 100644 test/jdk/java/awt/Choice/SetFontTest.java 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/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; + } +} From e3d80f1e1e8b5d503f13b8037172e3dac29e27ad Mon Sep 17 00:00:00 2001 From: Artur Barashev Date: Tue, 24 Sep 2024 18:57:58 +0000 Subject: [PATCH 170/307] 8340670: Policy.UNSUPPORTED_EMPTY_COLLECTION.isReadOnly does not return true Reviewed-by: mullan --- .../share/classes/java/security/Policy.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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(); + } } } From b639661e797fb52ce32ce397a153c886fdc40f53 Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 24 Sep 2024 19:35:59 +0000 Subject: [PATCH 171/307] 8340804: doc/building.md update Xcode instructions to note that full install is required Reviewed-by: erikj, jwaters --- doc/building.html | 7 +++---- doc/building.md | 10 +++------- 2 files changed, 6 insertions(+), 11 deletions(-) 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: From 0b8c9f6d2397dcb480dc5ae109607d86f2b15619 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Tue, 24 Sep 2024 20:09:40 +0000 Subject: [PATCH 172/307] 8338525: Leading and trailing code blocks by indentation Reviewed-by: hannesw, prappo --- .../tools/javac/parser/DocCommentParser.java | 20 +++- .../sun/tools/javac/tree/DocTreeMaker.java | 49 +++++---- .../testMarkdown/TestMarkdownCodeBlocks.java | 103 ++++++++++++++++++ .../tools/javac/doctree/DocCommentTester.java | 3 +- .../tools/javac/doctree/MarkdownTest.java | 46 ++++++++ 5 files changed, 197 insertions(+), 24 deletions(-) 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/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/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 +] +*/ + } From c0fcb258bbd02892267970dc4bc082dc7761f074 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Wed, 25 Sep 2024 01:45:04 +0000 Subject: [PATCH 173/307] 8340717: Remove unused function declarations from java.c/java.h of the launcher Reviewed-by: alanb, dholmes, shade, jwaters --- src/java.base/share/native/libjli/java.c | 4 ---- src/java.base/share/native/libjli/java.h | 8 -------- 2 files changed, 12 deletions(-) diff --git a/src/java.base/share/native/libjli/java.c b/src/java.base/share/native/libjli/java.c index ca0bc4df3c7d7..d4e20fb21fe75 100644 --- a/src/java.base/share/native/libjli/java.c +++ b/src/java.base/share/native/libjli/java.c @@ -118,7 +118,6 @@ static jclass GetApplicationClass(JNIEnv *env); static void TranslateApplicationArgs(int jargc, const char **jargv, int *pargc, char ***pargv); static jboolean AddApplicationOptions(int cpathc, const char **cpathv); -static void SetApplicationClassPath(const char**); static void PrintJavaVersion(JNIEnv *env); static void PrintUsage(JNIEnv* env, jboolean doXUsage); @@ -126,9 +125,6 @@ static void ShowSettings(JNIEnv* env, char *optString); static void ShowResolvedModules(JNIEnv* env); static void ListModules(JNIEnv* env); static void DescribeModule(JNIEnv* env, char* optString); -static jboolean ValidateModules(JNIEnv* env); - -static void SetPaths(int argc, char **argv); static void DumpState(); diff --git a/src/java.base/share/native/libjli/java.h b/src/java.base/share/native/libjli/java.h index 281964d815f57..ce5224a7da346 100644 --- a/src/java.base/share/native/libjli/java.h +++ b/src/java.base/share/native/libjli/java.h @@ -48,8 +48,6 @@ # define MB (1024UL * KB) # define GB (1024UL * MB) -#define CURRENT_DATA_MODEL (CHAR_BIT * sizeof(void*)) - /* * 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 @@ -103,17 +101,12 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */ jboolean LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn); -void -GetXUsagePath(char *buf, jint bufsize); - jboolean GetApplicationHome(char *buf, jint bufsize); jboolean GetApplicationHomeFromDll(char *buf, jint bufsize); -#define GetArch() GetArchPath(CURRENT_DATA_MODEL) - /* * Different platforms will implement this, here * pargc is a pointer to the original argc, @@ -149,7 +142,6 @@ void JLI_ShowMessage(const char * message, ...); */ JNIEXPORT void JNICALL JLI_ReportExceptionDescription(JNIEnv * env); -void PrintMachineDependentOptions(); /* * Block current thread and continue execution in new thread. From a37bb2e0372a7c074c88d31824fc418a47f63405 Mon Sep 17 00:00:00 2001 From: Gui Cao Date: Wed, 25 Sep 2024 02:29:06 +0000 Subject: [PATCH 174/307] 8340643: RISC-V: Small refactoring for sub/subw macro-assembler routines Reviewed-by: fyang, luhenry --- src/hotspot/cpu/riscv/macroAssembler_riscv.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index dc25172da259e..42a18e9a75399 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -2085,23 +2085,11 @@ void MacroAssembler::addw(Register Rd, Register Rn, int32_t increment, Register } void MacroAssembler::sub(Register Rd, Register Rn, int64_t decrement, Register temp) { - if (is_simm12(-decrement)) { - addi(Rd, Rn, -decrement); - } else { - assert_different_registers(Rn, temp); - li(temp, decrement); - sub(Rd, Rn, temp); - } + add(Rd, Rn, -decrement, temp); } void MacroAssembler::subw(Register Rd, Register Rn, int32_t decrement, Register temp) { - if (is_simm12(-decrement)) { - addiw(Rd, Rn, -decrement); - } else { - assert_different_registers(Rn, temp); - li(temp, decrement); - subw(Rd, Rn, temp); - } + addw(Rd, Rn, -decrement, temp); } void MacroAssembler::andrw(Register Rd, Register Rs1, Register Rs2) { From 9bcc7b66de6495d3da8fc7f30a2a88187dbe847d Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Wed, 25 Sep 2024 02:30:46 +0000 Subject: [PATCH 175/307] 8340708: Optimize StackMapGenerator::processMethod Reviewed-by: liach --- .../jdk/internal/classfile/impl/StackMapGenerator.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 f5cd9b80af844..3cf6770e49b16 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 @@ -400,6 +400,8 @@ private static Type cpIndexToType(int index, ConstantPoolBuilder cp) { } private void processMethod() { + var frames = this.frames; + var currentFrame = this.currentFrame; currentFrame.setLocalsFromArg(methodName, methodDesc, isStatic, thisType); currentFrame.stackSize = 0; currentFrame.flags = 0; @@ -415,10 +417,10 @@ private void processMethod() { throw generatorError("Expecting a stack map frame"); } if (thisOffset == bcs.bci()) { + Frame nextFrame = frames.get(stackmapIndex++); if (!ncf) { - currentFrame.checkAssignableTo(frames.get(stackmapIndex)); + currentFrame.checkAssignableTo(nextFrame); } - Frame nextFrame = frames.get(stackmapIndex++); while (!nextFrame.dirty) { //skip unmatched frames if (stackmapIndex == frames.size()) return; //skip the rest of this round nextFrame = frames.get(stackmapIndex++); @@ -429,7 +431,7 @@ private void processMethod() { currentFrame.copyFrom(nextFrame); nextFrame.dirty = false; } else if (thisOffset < bcs.bci()) { - throw new ClassFormatError(String.format("Bad stack map offset %d", thisOffset)); + throw generatorError("Bad stack map offset"); } } else if (ncf) { throw generatorError("Expecting a stack map frame"); From 2d38af61e4133ca98d5a98b3cfb6a6dde2877026 Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Wed, 25 Sep 2024 02:32:29 +0000 Subject: [PATCH 176/307] 8340587: Optimize StackMapGenerator$Frame::checkAssignableTo Reviewed-by: liach --- .../jdk/internal/classfile/impl/StackMapGenerator.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 3cf6770e49b16..964a0dc2b2727 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 @@ -1095,11 +1095,15 @@ void copyFrom(Frame src) { } void checkAssignableTo(Frame target) { + int localsSize = this.localsSize; + int stackSize = this.stackSize; if (target.flags == -1) { - target.locals = locals == null ? null : Arrays.copyOf(locals, localsSize); + target.locals = locals == null ? null : locals.clone(); target.localsSize = localsSize; - target.stack = stack == null ? null : Arrays.copyOf(stack, stackSize); - target.stackSize = stackSize; + if (stackSize > 0) { + target.stack = stack.clone(); + target.stackSize = stackSize; + } target.flags = flags; target.dirty = true; } else { From 2e0554a69548dae6e8ce9eec48c82e08dd3c1ffa Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Wed, 25 Sep 2024 02:35:41 +0000 Subject: [PATCH 177/307] 8340710: Optimize DirectClassBuilder::build Reviewed-by: liach --- .../classfile/impl/BufWriterImpl.java | 19 +++++++++++++++- .../classfile/impl/DirectClassBuilder.java | 22 +++++++++---------- .../classfile/impl/DirectCodeBuilder.java | 7 ++++++ .../jdk/internal/classfile/impl/Util.java | 17 +++++++++----- 4 files changed, 46 insertions(+), 19 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/BufWriterImpl.java b/src/java.base/share/classes/jdk/internal/classfile/impl/BufWriterImpl.java index 15d3c8f5b347c..4cc6c205fe4ff 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/BufWriterImpl.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/BufWriterImpl.java @@ -36,6 +36,7 @@ import jdk.internal.access.JavaLangAccess; import jdk.internal.access.SharedSecrets; +import jdk.internal.vm.annotation.ForceInline; public final class BufWriterImpl implements BufWriter { private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess(); @@ -99,6 +100,7 @@ public void writeU1(int x) { elems[offset++] = (byte) x; } + @ForceInline @Override public void writeU2(int x) { reserveSpace(2); @@ -283,14 +285,19 @@ public void copyTo(byte[] array, int bufferOffset) { // writeIndex methods ensure that any CP info written // is relative to the correct constant pool + @ForceInline @Override public void writeIndex(PoolEntry entry) { int idx = AbstractPoolEntry.maybeClone(constantPool, entry).index(); if (idx < 1 || idx > Character.MAX_VALUE) - throw new IllegalArgumentException(idx + " is not a valid index. Entry: " + entry); + throw invalidIndex(idx, entry); writeU2(idx); } + static IllegalArgumentException invalidIndex(int idx, PoolEntry entry) { + return new IllegalArgumentException(idx + " is not a valid index. Entry: " + entry); + } + @Override public void writeIndexOrZero(PoolEntry entry) { if (entry == null || entry.index() == 0) @@ -298,4 +305,14 @@ public void writeIndexOrZero(PoolEntry entry) { else writeIndex(entry); } + + /** + * Join head and tail into an exact-size buffer + */ + static byte[] join(BufWriterImpl head, BufWriterImpl tail) { + byte[] result = new byte[head.size() + tail.size()]; + head.copyTo(result, 0); + tail.copyTo(result, head.size()); + return result; + } } 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 6901ae7e24cf9..e92494e699258 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 @@ -175,14 +175,16 @@ public byte[] build() { // BSM writers until everything else is written. // Do this early because it might trigger CP activity + var constantPool = this.constantPool; ClassEntry superclass = superclassEntry; if (superclass != null) superclass = AbstractPoolEntry.maybeClone(constantPool, superclass); else if ((flags & ClassFile.ACC_MODULE) == 0 && !"java/lang/Object".equals(thisClassEntry.asInternalName())) superclass = constantPool.classEntry(ConstantDescs.CD_Object); - List ies = new ArrayList<>(interfaceEntries.size()); - for (ClassEntry ce : interfaceEntries) - ies.add(AbstractPoolEntry.maybeClone(constantPool, ce)); + int interfaceEntriesSize = interfaceEntries.size(); + List ies = new ArrayList<>(interfaceEntriesSize); + for (int i = 0; i < interfaceEntriesSize; i++) + ies.add(AbstractPoolEntry.maybeClone(constantPool, interfaceEntries.get(i))); // We maintain two writers, and then we join them at the end int size = sizeHint == 0 ? 256 : sizeHint; @@ -197,16 +199,15 @@ else if ((flags & ClassFile.ACC_MODULE) == 0 && !"java/lang/Object".equals(thisC attributes.writeTo(tail); // Now we have to append the BSM, if there is one - boolean written = constantPool.writeBootstrapMethods(tail); - if (written) { + if (constantPool.writeBootstrapMethods(tail)) { // Update attributes count tail.patchU2(attributesOffset, attributes.size() + 1); } // Now we can make the head - head.writeInt(ClassFile.MAGIC_NUMBER); - head.writeU2(minorVersion); - head.writeU2(majorVersion); + head.writeLong((((long) ClassFile.MAGIC_NUMBER) << 32) + | ((minorVersion & 0xFFFFL) << 16) + | (majorVersion & 0xFFFFL)); constantPool.writeTo(head); head.writeU2(flags); head.writeIndex(thisClassEntry); @@ -214,9 +215,6 @@ else if ((flags & ClassFile.ACC_MODULE) == 0 && !"java/lang/Object".equals(thisC Util.writeListIndices(head, ies); // Join head and tail into an exact-size buffer - byte[] result = new byte[head.size() + tail.size()]; - head.copyTo(result, 0); - tail.copyTo(result, head.size()); - return result; + return BufWriterImpl.join(head, tail); } } diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java b/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java index a9be069591162..fd7a8e55bf840 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java @@ -190,6 +190,13 @@ private void writeExceptionHandlers(BufWriterImpl buf) { int pos = buf.size(); int handlersSize = handlers.size(); buf.writeU2(handlersSize); + if (handlersSize > 0) { + writeExceptionHandlers(buf, pos); + } + } + + private void writeExceptionHandlers(BufWriterImpl buf, int pos) { + int handlersSize = handlers.size(); for (AbstractPseudoInstruction.ExceptionCatchImpl h : handlers) { int startPc = labelToBci(h.tryStart()); int endPc = labelToBci(h.tryEnd()); 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 80d908f6ce749..e1e3f6fb3d2b4 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 @@ -50,6 +50,7 @@ import java.lang.constant.ModuleDesc; import java.lang.reflect.AccessFlag; import jdk.internal.access.SharedSecrets; +import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.Stable; import static java.lang.classfile.ClassFile.ACC_STATIC; @@ -249,17 +250,21 @@ private static > void writeAttribute(BufWriterImpl writer } } + @ForceInline public static void writeAttributes(BufWriterImpl buf, List> list) { - buf.writeU2(list.size()); - for (var e : list) { - writeAttribute(buf, e); + int size = list.size(); + buf.writeU2(size); + for (int i = 0; i < size; i++) { + writeAttribute(buf, list.get(i)); } } + @ForceInline static void writeList(BufWriterImpl buf, List list) { - buf.writeU2(list.size()); - for (var e : list) { - e.writeTo(buf); + int size = list.size(); + buf.writeU2(size); + for (int i = 0; i < size; i++) { + list.get(i).writeTo(buf); } } From b1f8d2ea76322a89eea84851a1e791f52c31261b Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Wed, 25 Sep 2024 03:07:45 +0000 Subject: [PATCH 178/307] 8339935: Open source several AWT focus tests - series 5 Reviewed-by: prr --- test/jdk/java/awt/Focus/DeiconifyTest.java | 79 +++++++++++++++++ .../java/awt/Focus/HiddenTraversalTest.java | 72 +++++++++++++++ .../java/awt/Focus/LightweightPopupTest.java | 87 +++++++++++++++++++ .../java/awt/Focus/ProxiedWindowHideTest.java | 77 ++++++++++++++++ 4 files changed, 315 insertions(+) create mode 100644 test/jdk/java/awt/Focus/DeiconifyTest.java create mode 100644 test/jdk/java/awt/Focus/HiddenTraversalTest.java create mode 100644 test/jdk/java/awt/Focus/LightweightPopupTest.java create mode 100644 test/jdk/java/awt/Focus/ProxiedWindowHideTest.java diff --git a/test/jdk/java/awt/Focus/DeiconifyTest.java b/test/jdk/java/awt/Focus/DeiconifyTest.java new file mode 100644 index 0000000000000..e87b13b8e65fa --- /dev/null +++ b/test/jdk/java/awt/Focus/DeiconifyTest.java @@ -0,0 +1,79 @@ +/* + * 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 4380809 + * @summary Focus disappears after deiconifying frame + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual DeiconifyTest +*/ + +import java.awt.Button; +import java.awt.Frame; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; + +public class DeiconifyTest { + + private static final String INSTRUCTIONS = """ + 1. Activate frame \"Main frame\" + be sure that button has focus + 2. Minimize frame and then restore it. + If the button has focus then test passed, else failed"""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("DeiconifyTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int)INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(DeiconifyTest::createTestUI) + .logArea() + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame frame = new Frame("Main frame"); + Button button = new Button("button"); + button.addFocusListener(new FocusListener() { + public void focusGained(FocusEvent fe) { + println("focus gained"); + } + public void focusLost(FocusEvent fe) { + println("focus lost"); + } + }); + frame.add(button); + frame.setSize(300, 100); + + return frame; + } + + static void println(String messageIn) { + PassFailJFrame.log(messageIn); + } +} + diff --git a/test/jdk/java/awt/Focus/HiddenTraversalTest.java b/test/jdk/java/awt/Focus/HiddenTraversalTest.java new file mode 100644 index 0000000000000..59e7f477945e5 --- /dev/null +++ b/test/jdk/java/awt/Focus/HiddenTraversalTest.java @@ -0,0 +1,72 @@ +/* + * 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 4157017 + * @summary Checks whether focus can be traversed when component not visible + within parent container. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual HiddenTraversalTest +*/ + +import java.awt.Button; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Panel; + +public class HiddenTraversalTest { + + private static final String INSTRUCTIONS = """ + Examine the Frame. If six buttons are visible, resize the frame + so that only four are visible. If fewer than six buttons are + visible, do nothing.\n + Now, repeatedly press the tab key. Focus should cycle through the + visible and invisible buttons. If after six presses of the tab + button 'Button 0' has focus, the test passes. If focus is instead + stuck at 'Button 3', the test fails."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("HiddenTraversalTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(HiddenTraversalTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame f = new Frame("Focus test"); + Panel p = new Panel(new FlowLayout()); + for (int i = 0; i < 6; i++) { + p.add(new Button("Button " + i)); + } + f.add(p); + f.setSize(200, 100); + return f; + } + +} + diff --git a/test/jdk/java/awt/Focus/LightweightPopupTest.java b/test/jdk/java/awt/Focus/LightweightPopupTest.java new file mode 100644 index 0000000000000..bc3dd0d038b9b --- /dev/null +++ b/test/jdk/java/awt/Focus/LightweightPopupTest.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 4472032 + * @summary Switching between lightweight menus by horizontal arrow key works incorrect + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual LightweightPopupTest +*/ + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; + +public class LightweightPopupTest { + + private static final String INSTRUCTIONS = """ + When the test starts, you will see a frame titled + 'Lightweight Popup Test', which contains a button + (titled 'JButton') and two menus ('Menu 1' and 'Menu 2'). + Make sure that both menus, when expanded, fit entirely + into the frame. Now take the following steps: + 1. Click on 'JButton' to focus it. + 2. Click 'Menu 1' to expand it. + 3. Press right arrow to select 'Menu 2'. + Now check where the focus is. If it is on 'JButton' + (you can press space bar to see if it is there), then + the test failed. If 'JButton' is not focused, then + the test passed."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("LightweightPopupTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int)INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(LightweightPopupTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static JFrame createTestUI() { + + JFrame frame = new JFrame("Lightweight Popup Test"); + JButton button = new JButton("JButton"); + JMenuBar menuBar = new JMenuBar(); + JMenu menu1 = new JMenu("Menu 1"); + menu1.add(new JMenuItem("Menu Item 1")); + menu1.add(new JMenuItem("Menu Item 2")); + menuBar.add(menu1); + JMenu menu2 = new JMenu("Menu 2"); + menu2.add(new JMenuItem("Menu Item 3")); + menu2.add(new JMenuItem("Menu Item 4")); + menuBar.add(menu2); + + frame.add(button); + frame.setJMenuBar(menuBar); + frame.setSize(300, 200); + return frame; + } + +} + diff --git a/test/jdk/java/awt/Focus/ProxiedWindowHideTest.java b/test/jdk/java/awt/Focus/ProxiedWindowHideTest.java new file mode 100644 index 0000000000000..a99ec4f0a0d90 --- /dev/null +++ b/test/jdk/java/awt/Focus/ProxiedWindowHideTest.java @@ -0,0 +1,77 @@ +/* + * 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 4396407 + * @summary Tests that after a proxied window is hidden, focus is being restored correctly + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ProxiedWindowHideTest +*/ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Container; +import javax.swing.Box; +import javax.swing.JComboBox; +import javax.swing.JFrame; + +public class ProxiedWindowHideTest { + + private static final String INSTRUCTIONS = """ + You will see a JFrame. + Click on JComboBox, list will expand then select any item in it. + After selection, list should collapse. + Click on Button('Push'). + If you are able to make it focused by mouse click, + (black rectangle will appear around it) the test is PASSED, + otherwise the test is FAILED."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("ProxiedWindowHideTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(ProxiedWindowHideTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static JFrame createTestUI() { + JFrame frame = new JFrame("ProxiedWindowHideTest frame"); + String[] petStrings = { "Bird", "Cat", "Dog", "Rabbit", "Pig" }; + JComboBox cb = new JComboBox(petStrings); + + cb.setLightWeightPopupEnabled(false); + Container parent = Box.createVerticalBox(); + parent.add(new Button("Push")); + parent.add(cb); + frame.add(parent, BorderLayout.CENTER); + frame.pack(); + return frame; + } + +} + From 97a3933f1be2cabfc574689bb60618fe6fa3a8a4 Mon Sep 17 00:00:00 2001 From: Robbin Ehn Date: Wed, 25 Sep 2024 08:11:00 +0000 Subject: [PATCH 179/307] 8339771: RISC-V: Reduce icache flushes Reviewed-by: fyang, mli, luhenry --- src/hotspot/cpu/riscv/assembler_riscv.hpp | 10 +++++ .../riscv/gc/z/zBarrierSetAssembler_riscv.cpp | 16 +++++++- src/hotspot/cpu/riscv/globals_riscv.hpp | 4 +- .../cpu/riscv/macroAssembler_riscv.cpp | 7 ++++ .../cpu/riscv/macroAssembler_riscv.hpp | 2 + src/hotspot/cpu/riscv/relocInfo_riscv.cpp | 16 +++++++- src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 8 ++++ src/hotspot/cpu/riscv/vm_version_riscv.hpp | 1 + .../linux_riscv/orderAccess_linux_riscv.hpp | 18 +++++++++ .../linux_riscv/vm_version_linux_riscv.cpp | 37 +++++++++++++++++++ 10 files changed, 115 insertions(+), 4 deletions(-) diff --git a/src/hotspot/cpu/riscv/assembler_riscv.hpp b/src/hotspot/cpu/riscv/assembler_riscv.hpp index 98ab86bf72eb6..d1021d9e283d2 100644 --- a/src/hotspot/cpu/riscv/assembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/assembler_riscv.hpp @@ -705,6 +705,16 @@ class Assembler : public AbstractAssembler { emit(insn); } + void fencei() { + unsigned insn = 0; + patch((address)&insn, 6, 0, 0b0001111); // opcode + patch((address)&insn, 11, 7, 0b00000); // rd + patch((address)&insn, 14, 12, 0b001); // func + patch((address)&insn, 19, 15, 0b00000); // rs1 + patch((address)&insn, 31, 20, 0b000000000000); // fm + emit(insn); + } + #define INSN(NAME, op, funct3, funct7) \ void NAME() { \ unsigned insn = 0; \ diff --git a/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp index 8fbeaa45371d1..cbb918ade00fe 100644 --- a/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp @@ -636,8 +636,20 @@ void ZBarrierSetAssembler::patch_barrier_relocation(address addr, int format) { ShouldNotReachHere(); } - // A full fence is generated before icache_flush by default in invalidate_word - ICache::invalidate_range(addr, bytes); + // If we are using UseCtxFencei no ICache invalidation is needed here. + // Instead every hart will preform an fence.i either by a Java thread + // (due to patching epoch will take it to slow path), + // or by the kernel when a Java thread is moved to a hart. + // The instruction streams changes must only happen before the disarm of + // the nmethod barrier. Where the disarm have a leading full two way fence. + // If this is performed during a safepoint, all Java threads will emit a fence.i + // before transitioning to 'Java', e.g. leaving native or the safepoint wait barrier. + if (!UseCtxFencei) { + // ICache invalidation is a serialization point. + // The above patching of instructions happens before the invalidation. + // Hence it have a leading full two way fence (wr, wr). + ICache::invalidate_range(addr, bytes); + } } #ifdef COMPILER2 diff --git a/src/hotspot/cpu/riscv/globals_riscv.hpp b/src/hotspot/cpu/riscv/globals_riscv.hpp index c2585f2d1618d..dd31de14704ab 100644 --- a/src/hotspot/cpu/riscv/globals_riscv.hpp +++ b/src/hotspot/cpu/riscv/globals_riscv.hpp @@ -122,6 +122,8 @@ define_pd_global(intx, InlineSmallCode, 1000); product(bool, UseRVVForBigIntegerShiftIntrinsics, true, \ "Use RVV instructions for left/right shift of BigInteger") \ product(bool, UseTrampolines, false, EXPERIMENTAL, \ - "Far calls uses jal to trampoline.") + "Far calls uses jal to trampoline.") \ + product(bool, UseCtxFencei, false, EXPERIMENTAL, \ + "Use PR_RISCV_CTX_SW_FENCEI_ON to avoid explicit icache flush") #endif // CPU_RISCV_GLOBALS_RISCV_HPP diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index 42a18e9a75399..3987812d58a8d 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -3159,6 +3159,13 @@ void MacroAssembler::membar(uint32_t order_constraint) { } } +void MacroAssembler::cmodx_fence() { + BLOCK_COMMENT("cmodx fence"); + if (VM_Version::supports_fencei_barrier()) { + Assembler::fencei(); + } +} + // Form an address from base + offset in Rd. Rd my or may not // actually be used: you must use the Address that is returned. It // is up to you to ensure that the shift provided matches the size diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp index 43d9dc387ca20..13df99085f66c 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp @@ -431,6 +431,8 @@ class MacroAssembler: public Assembler { } } + void cmodx_fence(); + void pause() { Assembler::fence(w, 0); } diff --git a/src/hotspot/cpu/riscv/relocInfo_riscv.cpp b/src/hotspot/cpu/riscv/relocInfo_riscv.cpp index d0903c96e2271..18b4302c7e68e 100644 --- a/src/hotspot/cpu/riscv/relocInfo_riscv.cpp +++ b/src/hotspot/cpu/riscv/relocInfo_riscv.cpp @@ -55,7 +55,21 @@ void Relocation::pd_set_data_value(address x, bool verify_only) { bytes = MacroAssembler::pd_patch_instruction_size(addr(), x); break; } - ICache::invalidate_range(addr(), bytes); + + // If we are using UseCtxFencei no ICache invalidation is needed here. + // Instead every hart will preform an fence.i either by a Java thread + // (due to patching epoch will take it to slow path), + // or by the kernel when a Java thread is moved to a hart. + // The instruction streams changes must only happen before the disarm of + // the nmethod barrier. Where the disarm have a leading full two way fence. + // If this is performed during a safepoint, all Java threads will emit a fence.i + // before transitioning to 'Java', e.g. leaving native or the safepoint wait barrier. + if (!UseCtxFencei) { + // ICache invalidation is a serialization point. + // The above patching of instructions happens before the invalidation. + // Hence it have a leading full two way fence (wr, wr). + ICache::invalidate_range(addr(), bytes); + } } address Relocation::pd_call_destination(address orig_addr) { diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index ee14d045407a0..d4ec76da94315 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp @@ -2428,6 +2428,14 @@ class StubGenerator: public StubCodeGenerator { __ la(t1, ExternalAddress(bs_asm->patching_epoch_addr())); __ lwu(t1, t1); __ sw(t1, thread_epoch_addr); + // There are two ways this can work: + // - The writer did system icache shootdown after the instruction stream update. + // Hence do nothing. + // - The writer trust us to make sure our icache is in sync before entering. + // Hence use cmodx fence (fence.i, may change). + if (UseCtxFencei) { + __ cmodx_fence(); + } __ membar(__ LoadLoad); } diff --git a/src/hotspot/cpu/riscv/vm_version_riscv.hpp b/src/hotspot/cpu/riscv/vm_version_riscv.hpp index bd4bfe86d9bf7..8fdde0094f40d 100644 --- a/src/hotspot/cpu/riscv/vm_version_riscv.hpp +++ b/src/hotspot/cpu/riscv/vm_version_riscv.hpp @@ -285,6 +285,7 @@ class VM_Version : public Abstract_VM_Version { // RISCV64 supports fast class initialization checks static bool supports_fast_class_init_checks() { return true; } + static bool supports_fencei_barrier() { return ext_Zifencei.enabled(); } }; #endif // CPU_RISCV_VM_VERSION_RISCV_HPP diff --git a/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp b/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp index a7dc84770f84c..368d6c971fae0 100644 --- a/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp +++ b/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp @@ -54,6 +54,24 @@ inline void OrderAccess::fence() { } inline void OrderAccess::cross_modify_fence_impl() { + // From 3 “Zifencei” Instruction-Fetch Fence, Version 2.0 + // "RISC-V does not guarantee that stores to instruction memory will be made + // visible to instruction fetches on a RISC-V hart until that hart executes a + // FENCE.I instruction. A FENCE.I instruction ensures that a subsequent + // instruction fetch on a RISC-V hart will see any previous data stores + // already visible to the same RISC-V hart. FENCE.I does not ensure that other + // RISC-V harts’ instruction fetches will observe the local hart’s stores in a + // multiprocessor system." + // + // Hence to be able to use fence.i directly we need a kernel that supports + // PR_RISCV_CTX_SW_FENCEI_ON. Thus if context switch to another hart we are + // ensured that instruction fetch will see any previous data stores + // + // The alternative is using full system IPI (system wide icache sync) then + // this barrier is not strictly needed. As this is emitted in runtime slow-path + // we will just always emit it, typically after a safepoint. + guarantee(VM_Version::supports_fencei_barrier(), "Linux kernel require fence.i"); + __asm__ volatile("fence.i" : : : "memory"); } #endif // OS_CPU_LINUX_RISCV_ORDERACCESS_LINUX_RISCV_HPP diff --git a/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp b/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp index 3f9f26b525ba5..a3a226502f6fc 100644 --- a/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp +++ b/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #ifndef HWCAP_ISA_I #define HWCAP_ISA_I nth_bit('I' - 'A') @@ -82,6 +83,23 @@ __v; \ }) +// prctl PR_RISCV_SET_ICACHE_FLUSH_CTX is from Linux 6.9 +#ifndef PR_RISCV_SET_ICACHE_FLUSH_CTX +#define PR_RISCV_SET_ICACHE_FLUSH_CTX 71 +#endif +#ifndef PR_RISCV_CTX_SW_FENCEI_ON +#define PR_RISCV_CTX_SW_FENCEI_ON 0 +#endif +#ifndef PR_RISCV_CTX_SW_FENCEI_OFF +#define PR_RISCV_CTX_SW_FENCEI_OFF 1 +#endif +#ifndef PR_RISCV_SCOPE_PER_PROCESS +#define PR_RISCV_SCOPE_PER_PROCESS 0 +#endif +#ifndef PR_RISCV_SCOPE_PER_THREAD +#define PR_RISCV_SCOPE_PER_THREAD 1 +#endif + uint32_t VM_Version::cpu_vector_length() { assert(ext_V.enabled(), "should not call this"); return (uint32_t)read_csr(CSR_VLENB); @@ -102,6 +120,7 @@ void VM_Version::setup_cpu_available_features() { if (!RiscvHwprobe::probe_features()) { os_aux_features(); } + char* uarch = os_uarch_additional_features(); vendor_features(); @@ -155,6 +174,24 @@ void VM_Version::setup_cpu_available_features() { i++; } + // Linux kernel require Zifencei + if (!ext_Zifencei.enabled()) { + log_info(os, cpu)("Zifencei not found, required by Linux, enabling."); + ext_Zifencei.enable_feature(); + } + + if (UseCtxFencei) { + // Note that we can set this up only for effected threads + // via PR_RISCV_SCOPE_PER_THREAD, i.e. on VM attach/deattach. + int ret = prctl(PR_RISCV_SET_ICACHE_FLUSH_CTX, PR_RISCV_CTX_SW_FENCEI_ON, PR_RISCV_SCOPE_PER_PROCESS); + if (ret == 0) { + log_debug(os, cpu)("UseCtxFencei (PR_RISCV_CTX_SW_FENCEI_ON) enabled."); + } else { + FLAG_SET_ERGO(UseCtxFencei, false); + log_info(os, cpu)("UseCtxFencei (PR_RISCV_CTX_SW_FENCEI_ON) disabled, unsupported by kernel."); + } + } + _features_string = os::strdup(buf); } From 9806d2139cb5994effdee3f7bc6b23eb81858ed3 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Wed, 25 Sep 2024 08:13:25 +0000 Subject: [PATCH 180/307] 8340808: RISC-V: Client build fails after JDK-8339738 Reviewed-by: fyang --- src/hotspot/cpu/riscv/macroAssembler_riscv.cpp | 6 ++++++ src/hotspot/cpu/riscv/macroAssembler_riscv.hpp | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index 3987812d58a8d..32a446959a246 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -1455,6 +1455,7 @@ void MacroAssembler::update_word_crc32(Register crc, Register v, Register tmp1, } +#ifdef COMPILER2 // 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, @@ -1550,6 +1551,7 @@ void MacroAssembler::vector_update_crc32(Register crc, Register buf, Register le addi(buf, buf, N*4); } } +#endif // COMPILER2 /** * @param crc register containing existing CRC (32-bit) @@ -1576,11 +1578,13 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len, add(table2, table0, 2*single_table_size*sizeof(juint), tmp1); add(table3, table2, 1*single_table_size*sizeof(juint), tmp1); +#ifdef COMPILER2 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); } +#endif // COMPILER2 subw(len, len, unroll_words); bge(len, zr, L_unroll_loop_entry); @@ -1643,6 +1647,7 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len, andi(tmp2, tmp2, right_8_bits); update_byte_crc32(crc, tmp2, table0); +#ifdef COMPILER2 // 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`. @@ -1655,6 +1660,7 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len, addiw(len, len, 4); bgt(len, zr, L_by1_loop); } +#endif // COMPILER2 bind(L_exit); andn(crc, tmp5, crc); diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp index 13df99085f66c..fd174f241eb0b 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp @@ -1321,11 +1321,12 @@ class MacroAssembler: public Assembler { Register table0, Register table1, Register table2, Register table3, bool upper); void update_byte_crc32(Register crc, Register val, Register table); + +#ifdef COMPILER2 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, Register len, Register k, Register tmp); void wide_mul(Register prod_lo, Register prod_hi, Register n, Register m); @@ -1355,7 +1356,7 @@ class MacroAssembler: public Assembler { Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5, Register tmp6, Register product_hi); -#endif +#endif // COMPILER2 void inflate_lo32(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); void inflate_hi32(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); From 1b9898a44fd3f8159a7184053ef50cba55419d6e Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Wed, 25 Sep 2024 09:26:06 +0000 Subject: [PATCH 181/307] 8340843: [PPC64/s390x] Error: ShouldNotReachHere() in TemplateInterpreterGenerator::generate_math_entry after 8338694 Reviewed-by: mbaesken, amitkumar --- src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp | 1 + src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp index 03dca2aeb9b7b..cf3dd4cbd34c0 100644 --- a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp @@ -1078,6 +1078,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M case Interpreter::java_lang_math_sin : runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dsin); break; case Interpreter::java_lang_math_cos : runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dcos); break; case Interpreter::java_lang_math_tan : runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dtan); break; + case Interpreter::java_lang_math_tanh : /* run interpreted */ break; case Interpreter::java_lang_math_abs : /* run interpreted */ break; case Interpreter::java_lang_math_sqrt : runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dsqrt); break; case Interpreter::java_lang_math_log : runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dlog); break; diff --git a/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp b/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp index c16e444904563..2c2e8ed9e3b3a 100644 --- a/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp +++ b/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp @@ -1224,6 +1224,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M case Interpreter::java_lang_math_sin : runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dsin); break; case Interpreter::java_lang_math_cos : runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dcos); break; case Interpreter::java_lang_math_tan : runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dtan); break; + case Interpreter::java_lang_math_tanh : /* run interpreted */ break; case Interpreter::java_lang_math_abs : /* run interpreted */ break; case Interpreter::java_lang_math_sqrt : /* runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dsqrt); not available */ break; case Interpreter::java_lang_math_log : runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dlog); break; From 120463dc90d717bffb2bd0d5e6b1ea707f5d1b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Wed, 25 Sep 2024 12:15:07 +0000 Subject: [PATCH 182/307] 8339541: CSS rule is not specific enough Reviewed-by: jjg --- .../internal/doclets/formats/html/resources/stylesheet.css | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css index 1130f14dc35b4..97fcc91eadcfd 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css @@ -360,8 +360,11 @@ main { padding:10px 20px; position:relative; } -section[id$=-description] :is(dl, ol, ul, p, div, blockquote, pre):last-child, -section[id$=-description] :is(dl, ol, ul):last-child > :is(li, dd):last-child { +/* Compensate for non-collapsing margins between element description and summary tables */ +div.horizontal-scroll > section[id$=-description] > :is(dl, ol, ul, p, div, blockquote, pre):last-child, +div.horizontal-scroll > section[id$=-description] > :last-child > :is(li, dd):last-child, +section.class-description > div.horizontal-scroll > :is(dl, ol, ul, p, div, blockquote, pre):last-child, +section.class-description > div.horizontal-scroll > :last-child > :is(li, dd):last-child { margin-bottom:4px; } dl.notes > dt { From d8790aa0489fe49b499535c31cdfb691003792ff Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Wed, 25 Sep 2024 13:04:46 +0000 Subject: [PATCH 183/307] 8340885: Desugar ZipCoder.Comparison Reviewed-by: lancea, eirbjo --- .../share/classes/java/util/zip/ZipCoder.java | 43 +++++++++---------- .../share/classes/java/util/zip/ZipFile.java | 6 +-- 2 files changed, 24 insertions(+), 25 deletions(-) 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 6692703c1b3f0..8d4a05389eede 100644 --- a/src/java.base/share/classes/java/util/zip/ZipCoder.java +++ b/src/java.base/share/classes/java/util/zip/ZipCoder.java @@ -56,28 +56,27 @@ public static ZipCoder get(Charset charset) { } /** - * This enum represents the three possible return values for + * Constants representing the three possible return values for * {@link #compare(String, byte[], int, int, boolean)} when * this method compares a lookup name to a string encoded in the * CEN byte array. */ - enum Comparison { - /** + static final byte + /* * The lookup string is exactly equal * to the encoded string. - */ - EXACT_MATCH, - /** + */ + EXACT_MATCH = 0, + /* * The lookup string and the encoded string differs only * by the encoded string having a trailing '/' character. */ - DIRECTORY_MATCH, - /** + DIRECTORY_MATCH = 1, + /* * The lookup string and the encoded string do not match. * (They are neither an exact match or a directory match.) */ - NO_MATCH - } + NO_MATCH = 2; String toString(byte[] ba, int off, int length) { try { @@ -197,13 +196,13 @@ private CharsetEncoder encoder() { * The return values of this method are as follows: * * If the lookup name is exactly equal to the encoded string, return - * {@link Comparison#EXACT_MATCH}. + * {@link EXACT_MATCH}. * * If the parameter {@code matchDirectory} is {@code true} and the * two strings differ only by the encoded string having an extra - * trailing '/' character, then return {@link Comparison#DIRECTORY_MATCH}. + * trailing '/' character, then return {@link DIRECTORY_MATCH}. * - * Otherwise, return {@link Comparison#NO_MATCH} + * Otherwise, return {@link NO_MATCH} * * While a general implementation will need to decode bytes into a * String for comparison, this can be avoided if the String coder @@ -217,18 +216,18 @@ private CharsetEncoder encoder() { * a directory match will also be tested * */ - Comparison compare(String str, byte[] b, int off, int len, boolean matchDirectory) { + byte compare(String str, byte[] b, int off, int len, boolean matchDirectory) { String decoded = toString(b, off, len); if (decoded.startsWith(str)) { if (decoded.length() == str.length()) { - return Comparison.EXACT_MATCH; + return EXACT_MATCH; } else if (matchDirectory && decoded.length() == str.length() + 1 && decoded.endsWith("/") ) { - return Comparison.DIRECTORY_MATCH; + return DIRECTORY_MATCH; } } - return Comparison.NO_MATCH; + return NO_MATCH; } static final class UTF8ZipCoder extends ZipCoder { @@ -278,19 +277,19 @@ private boolean hasTrailingSlash(byte[] a, int end) { } @Override - Comparison compare(String str, byte[] b, int off, int len, boolean matchDirectory) { + byte compare(String str, byte[] b, int off, int len, boolean matchDirectory) { try { byte[] encoded = JLA.getBytesNoRepl(str, UTF_8.INSTANCE); int mismatch = Arrays.mismatch(encoded, 0, encoded.length, b, off, off+len); if (mismatch == -1) { - return Comparison.EXACT_MATCH; + return EXACT_MATCH; } else if (matchDirectory && len == mismatch + 1 && hasTrailingSlash(b, off + len)) { - return Comparison.DIRECTORY_MATCH; + return DIRECTORY_MATCH; } else { - return Comparison.NO_MATCH; + return NO_MATCH; } } catch (CharacterCodingException e) { - return Comparison.NO_MATCH; + return NO_MATCH; } } } 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 333e3d0184976..d54e6c1e4fcb9 100644 --- a/src/java.base/share/classes/java/util/zip/ZipFile.java +++ b/src/java.base/share/classes/java/util/zip/ZipFile.java @@ -1869,15 +1869,15 @@ private EntryPos getEntryPos(String name, boolean addSlash) { // Compare the lookup name with the name encoded in the CEN switch (zc.compare(name, cen, noff, nlen, addSlash)) { - case EXACT_MATCH: + case ZipCoder.EXACT_MATCH: // We found an exact match for "name" return new EntryPos(name, pos); - case DIRECTORY_MATCH: + case ZipCoder.DIRECTORY_MATCH: // We found the directory "name/" // Track its position, then continue the search for "name" dirPos = pos; break; - case NO_MATCH: + case ZipCoder.NO_MATCH: // Hash collision, continue searching } } From 083b98083136933fc51499181f85ca30a77da9e1 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Wed, 25 Sep 2024 13:12:47 +0000 Subject: [PATCH 184/307] 8340568: Incorrect escaping of single quotes when pretty-printing character literals Reviewed-by: mcimadamore --- .../com/sun/tools/javac/tree/Pretty.java | 2 +- .../tools/javac/tree/PrettyCharLiteral.java | 89 +++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 test/langtools/tools/javac/tree/PrettyCharLiteral.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java index e97d07b1d2bfa..919b2325ef669 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java @@ -1467,7 +1467,7 @@ public void visitLiteral(JCLiteral tree) { break; case CHAR: print('\''); - print(Convert.quote(String.valueOf((char)((Number)tree.value).intValue()))); + print(Convert.quote((char)((Number)tree.value).intValue(), true)); print('\''); break; case BOOLEAN: diff --git a/test/langtools/tools/javac/tree/PrettyCharLiteral.java b/test/langtools/tools/javac/tree/PrettyCharLiteral.java new file mode 100644 index 0000000000000..eced3209607ce --- /dev/null +++ b/test/langtools/tools/javac/tree/PrettyCharLiteral.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2024, Google LLC. All rights reserved. + * 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 8340568 + * @summary Incorrect escaping of single quotes when pretty-printing character literals + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.file + * jdk.compiler/com.sun.tools.javac.tree + * jdk.compiler/com.sun.tools.javac.util + */ + +import com.sun.tools.javac.file.JavacFileManager; +import com.sun.tools.javac.tree.Pretty; +import com.sun.tools.javac.tree.TreeMaker; +import com.sun.tools.javac.util.Context; + +import java.io.IOException; +import java.io.StringWriter; + +public class PrettyCharLiteral { + public static void main(String... args) throws Exception { + new PrettyCharLiteral().run(); + } + + private final TreeMaker make; + + private PrettyCharLiteral() { + Context ctx = new Context(); + JavacFileManager.preRegister(ctx); + this.make = TreeMaker.instance(ctx); + } + + void run() throws Exception { + assertEquals( + prettyPrintLiteral('\''), + """ + '\\'' + """.trim()); + assertEquals( + prettyPrintLiteral('"'), + """ + '"' + """.trim()); + assertEquals( + prettyPrintLiteral("'"), + """ + "'" + """.trim()); + assertEquals( + prettyPrintLiteral("\""), + """ + "\\"" + """.trim()); + } + + private void assertEquals(String actual, String expected) { + if (!actual.equals(expected)) { + throw new AssertionError("expected: " + expected + ", actual: " + actual); + } + } + + private String prettyPrintLiteral(Object value) throws IOException { + StringWriter sw = new StringWriter(); + new Pretty(sw, true).printExpr(make.Literal(value)); + return sw.toString(); + } +} From fb703258774ca14a6a239fc6d47a37e021e6036a Mon Sep 17 00:00:00 2001 From: Leonov Kirill <91743110+kirleo2@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:18:25 +0000 Subject: [PATCH 185/307] 8338583: NMT: Malloc overhead is calculated incorrectly Reviewed-by: azafari, yan, gziemski --- src/hotspot/share/nmt/mallocHeader.hpp | 1 + src/hotspot/share/nmt/mallocTracker.hpp | 4 ++-- src/hotspot/share/nmt/memTracker.hpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/nmt/mallocHeader.hpp b/src/hotspot/share/nmt/mallocHeader.hpp index c76e61fb4b5a2..6711c2b993e6f 100644 --- a/src/hotspot/share/nmt/mallocHeader.hpp +++ b/src/hotspot/share/nmt/mallocHeader.hpp @@ -127,6 +127,7 @@ class MallocHeader { inline MallocHeader(size_t size, MemTag mem_tag, uint32_t mst_marker); + inline static size_t malloc_overhead() { return sizeof(MallocHeader) + sizeof(uint16_t); } inline size_t size() const { return _size; } inline MemTag mem_tag() const { return _mem_tag; } inline uint32_t mst_marker() const { return _mst_marker; } diff --git a/src/hotspot/share/nmt/mallocTracker.hpp b/src/hotspot/share/nmt/mallocTracker.hpp index 39d120433ef02..de30f32373edf 100644 --- a/src/hotspot/share/nmt/mallocTracker.hpp +++ b/src/hotspot/share/nmt/mallocTracker.hpp @@ -166,7 +166,7 @@ class MallocMemorySnapshot { } inline size_t malloc_overhead() const { - return _all_mallocs.count() * sizeof(MallocHeader); + return _all_mallocs.count() * MallocHeader::malloc_overhead(); } // Total malloc invocation count @@ -269,7 +269,7 @@ class MallocTracker : AllStatic { // The overhead that is incurred by switching on NMT (we need, per malloc allocation, // space for header and 16-bit footer) - static const size_t overhead_per_malloc = sizeof(MallocHeader) + sizeof(uint16_t); + static inline size_t overhead_per_malloc() { return MallocHeader::malloc_overhead(); } // Parameter name convention: // memblock : the beginning address for user data diff --git a/src/hotspot/share/nmt/memTracker.hpp b/src/hotspot/share/nmt/memTracker.hpp index 31b1e66b8a6b3..6ba1db2e7ffe6 100644 --- a/src/hotspot/share/nmt/memTracker.hpp +++ b/src/hotspot/share/nmt/memTracker.hpp @@ -72,7 +72,7 @@ class MemTracker : AllStatic { // Per-malloc overhead incurred by NMT, depending on the current NMT level static size_t overhead_per_malloc() { - return enabled() ? MallocTracker::overhead_per_malloc : 0; + return enabled() ? MallocTracker::overhead_per_malloc() : 0; } static inline void* record_malloc(void* mem_base, size_t size, MemTag mem_tag, From 0474f020bf276c761f46bc8ba0873ed90a8fd19b Mon Sep 17 00:00:00 2001 From: George Adams Date: Wed, 25 Sep 2024 16:25:23 +0000 Subject: [PATCH 186/307] 8340815: Add SECURITY.md file Reviewed-by: mr, jwaters, erikj --- SECURITY.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000000..f4c5e7e67cb46 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,3 @@ +# JDK Vulnerabilities + +Please follow the process outlined in the [OpenJDK Vulnerability Policy](https://openjdk.org/groups/vulnerability/report) to disclose vulnerabilities in the JDK. From 81b5f0974903accc738c07cdf7be09fa6ea8fbdd Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Wed, 25 Sep 2024 16:36:28 +0000 Subject: [PATCH 187/307] 8340946: Add vmTestbase/gc/memory/Nio/Nio.java and java/nio/Buffer/LimitDirectMemory.java to problem list Reviewed-by: liach, dcubed, alanb --- test/hotspot/jtreg/ProblemList.txt | 1 + test/jdk/ProblemList.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index bec3f64c7d8c2..aefe09fd3aec2 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -174,6 +174,7 @@ vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/TestDescription.java 807 vmTestbase/nsk/jvmti/InterruptThread/intrpthrd003/TestDescription.java 8288911 macosx-all vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8192647 generic-all +vmTestbase/gc/memory/Nio/Nio.java 8340728 generic-all vmTestbase/jit/escape/LockCoarsening/LockCoarsening001.java 8148743 generic-all vmTestbase/jit/escape/LockCoarsening/LockCoarsening002.java 8208259 generic-all diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 1727722335f67..36043645ca989 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -563,6 +563,8 @@ java/net/Socket/asyncClose/Race.java 8317801 aix-ppc6 # jdk_nio +java/nio/Buffer/LimitDirectMemory.java 8340728 generic-all + java/nio/channels/AsynchronousSocketChannel/StressLoopback.java 8211851 aix-ppc64 java/nio/channels/Channels/SocketChannelStreams.java 8317838 aix-ppc64 From 0e0b0b0d2626cda032f1500e64f6729554e47038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirik=20Bj=C3=B8rsn=C3=B8s?= Date: Wed, 25 Sep 2024 16:36:44 +0000 Subject: [PATCH 188/307] 8340684: Reading from an input stream backed by a closed ZipFile has no test coverage Reviewed-by: lancea --- .../java/util/zip/ZipFile/ReadAfterClose.java | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 test/jdk/java/util/zip/ZipFile/ReadAfterClose.java diff --git a/test/jdk/java/util/zip/ZipFile/ReadAfterClose.java b/test/jdk/java/util/zip/ZipFile/ReadAfterClose.java new file mode 100644 index 0000000000000..a083daf766871 --- /dev/null +++ b/test/jdk/java/util/zip/ZipFile/ReadAfterClose.java @@ -0,0 +1,128 @@ +/* + * 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 8340684 + @summary Verify unspecified, but long-standing behavior when reading + from an input stream obtained using ZipFile::getInputStream after + the ZipFile has been closed. + @run junit ReadAfterClose + */ + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.stream.Stream; +import java.util.zip.CRC32; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class ReadAfterClose { + + // ZIP file used in this test + private Path zip = Path.of("read-after-close.zip"); + + /** + * Create a sample ZIP file for use by this test + * @throws IOException if an unexpected IOException occurs + */ + @BeforeEach + public void setUp() throws IOException { + byte[] content = "hello".repeat(1000).getBytes(StandardCharsets.UTF_8); + try (OutputStream out = Files.newOutputStream(zip); + ZipOutputStream zo = new ZipOutputStream(out)) { + { + zo.putNextEntry(new ZipEntry("deflated.txt")); + zo.write(content); + } + { + ZipEntry entry = new ZipEntry("stored.txt"); + entry.setMethod(ZipEntry.STORED); + CRC32 crc = new CRC32(); + crc.update(content); + entry.setCrc(crc.getValue()); + entry.setSize(content.length); + zo.putNextEntry(entry); + zo.write(content); + } + } + } + + /** + * Delete the ZIP file produced by this test + * @throws IOException if an unexpected IOException occurs + */ + @AfterEach + public void cleanup() throws IOException { + Files.deleteIfExists(zip); + } + + /** + * Produce arguments with a variation of stored / deflated entries, + * and read behavior before closing the ZipFile. + * @return + */ + public static Stream arguments() { + return Stream.of( + Arguments.of("stored.txt", true), + Arguments.of("stored.txt", false), + Arguments.of("deflated.txt", true), + Arguments.of("deflated.txt", false) + ); + } + /** + * Attempting to read from an InputStream obtained by ZipFile.getInputStream + * after the backing ZipFile is closed should throw IOException + * + * @throws IOException if an unexpected IOException occurs + */ + @ParameterizedTest + @MethodSource("arguments") + public void readAfterClose(String entryName, boolean readFirst) throws IOException { + // Retain a reference to an input stream backed by a closed ZipFile + InputStream in; + try (ZipFile zf = new ZipFile(zip.toFile())) { + in = zf.getInputStream(new ZipEntry(entryName)); + // Optionally consume a single byte from the stream before closing + if (readFirst) { + in.read(); + } + } + + assertThrows(IOException.class, () -> { + in.read(); + }); + } +} \ No newline at end of file From f7bc9ba552cf913eef2131b964c48f1b4b55131c Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Wed, 25 Sep 2024 16:46:49 +0000 Subject: [PATCH 189/307] 8340228: Open source couple more miscellaneous AWT tests Reviewed-by: prr --- .../EditAndPrintTest/EditAndPrintTest.java | 152 ++++++++++++++++++ .../TextField/GetTextTest/GetTextTest.java | 104 ++++++++++++ .../SetEchoCharTest3/SetEchoCharTest3.java | 65 ++++++++ 3 files changed, 321 insertions(+) create mode 100644 test/jdk/java/awt/Desktop/EditAndPrintTest/EditAndPrintTest.java create mode 100644 test/jdk/java/awt/TextField/GetTextTest/GetTextTest.java create mode 100644 test/jdk/java/awt/TextField/SetEchoCharTest3/SetEchoCharTest3.java diff --git a/test/jdk/java/awt/Desktop/EditAndPrintTest/EditAndPrintTest.java b/test/jdk/java/awt/Desktop/EditAndPrintTest/EditAndPrintTest.java new file mode 100644 index 0000000000000..3f161f7fcaf90 --- /dev/null +++ b/test/jdk/java/awt/Desktop/EditAndPrintTest/EditAndPrintTest.java @@ -0,0 +1,152 @@ +/* + * 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. + */ + +/* + * @test + * @key printer + * @bug 6255196 + * @summary Verifies the function of methods edit(java.io.File file) and + * print(java.io.File file) + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual EditAndPrintTest + */ + +import java.awt.Desktop; +import java.awt.Desktop.Action; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import javax.swing.JPanel; + +public class EditAndPrintTest extends JPanel { + + static final String INSTRUCTIONS = """ + This test tries to edit and print a directory, which will expectedly raise IOException. + Then this test would edit and print a .txt file, which should be successful. + After test execution close the editor if it was launched by test. + If you see any EXCEPTION messages in the output press FAIL. + """; + + public EditAndPrintTest() { + if (!Desktop.isDesktopSupported()) { + PassFailJFrame.log("Class java.awt.Desktop is not supported on " + + "current platform. Further testing will not be performed"); + PassFailJFrame.forcePass(); + } + + Desktop desktop = Desktop.getDesktop(); + + if (!desktop.isSupported(Action.PRINT) && !desktop.isSupported(Action.EDIT)) { + PassFailJFrame.log("Neither EDIT nor PRINT actions are supported. Nothing to test."); + PassFailJFrame.forcePass(); + } + + /* + * Part 1: print or edit a directory, which should throw an IOException. + */ + File userHome = new File(System.getProperty("user.home")); + try { + if (desktop.isSupported(Action.EDIT)) { + PassFailJFrame.log("Trying to edit " + userHome); + desktop.edit(userHome); + PassFailJFrame.log("No exception has been thrown for editing " + + "directory " + userHome.getPath()); + PassFailJFrame.log("Test failed."); + } else { + PassFailJFrame.log("Action EDIT is unsupported."); + } + } catch (IOException e) { + PassFailJFrame.log("Expected IOException is caught."); + } + + try { + if (desktop.isSupported(Action.PRINT)) { + PassFailJFrame.log("Trying to print " + userHome); + desktop.print(userHome); + PassFailJFrame.log("No exception has been thrown for printing " + + "directory " + userHome.getPath()); + PassFailJFrame.log("Test failed."); + } else { + PassFailJFrame.log("Action PRINT is unsupported.\n"); + } + } catch (IOException e) { + PassFailJFrame.log("Expected IOException is caught."); + } + + /* + * Part 2: print or edit a normal .txt file, which may succeed if there + * is associated application to print or edit the given file. It fails + * otherwise. + */ + // Create a temp .txt file for test. + String testFilePath = System.getProperty("java.io.tmpdir") + File.separator + "JDIC-test.txt"; + File testFile = null; + try { + PassFailJFrame.log("Creating temporary file."); + testFile = File.createTempFile("JDIC-test", ".txt", new File(System.getProperty("java.io.tmpdir"))); + testFile.deleteOnExit(); + FileWriter writer = new FileWriter(testFile); + writer.write("This is a temp file used to test print() method of Desktop."); + writer.flush(); + writer.close(); + } catch (java.io.IOException ioe){ + PassFailJFrame.log("EXCEPTION: " + ioe.getMessage()); + PassFailJFrame.forceFail("Failed to create temp file for testing."); + } + + try { + if (desktop.isSupported(Action.EDIT)) { + PassFailJFrame.log("Try to edit " + testFile); + desktop.edit(testFile); + PassFailJFrame.log("Succeed."); + } + } catch (IOException e) { + PassFailJFrame.log("EXCEPTION: " + e.getMessage()); + } + + try { + if (desktop.isSupported(Action.PRINT)) { + PassFailJFrame.log("Trying to print " + testFile); + desktop.print(testFile); + PassFailJFrame.log("Succeed."); + } + } catch (IOException e) { + PassFailJFrame.log("EXCEPTION: " + e.getMessage()); + } + } + + public static void main(String args[]) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Edit and Print test") + .splitUI(EditAndPrintTest::new) + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(60) + .logArea() + .build() + .awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/TextField/GetTextTest/GetTextTest.java b/test/jdk/java/awt/TextField/GetTextTest/GetTextTest.java new file mode 100644 index 0000000000000..ab5aebc11d47a --- /dev/null +++ b/test/jdk/java/awt/TextField/GetTextTest/GetTextTest.java @@ -0,0 +1,104 @@ +/* + * 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 4100188 + * @key headful + * @summary Make sure that TextFields contain all of, + * and exactly, the text that was entered into them. + * @run main GetTextTest + */ + +import java.awt.AWTException; +import java.awt.Dimension; +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.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.lang.reflect.InvocationTargetException; + +public class GetTextTest extends Frame implements ActionListener { + private final String s = "test string"; + private volatile String ac; + private TextField t; + private Point location; + private Dimension size; + + public void setupGUI() { + setLayout(new FlowLayout(FlowLayout.LEFT)); + + t = new TextField(s, 32); + add(new Label("Hit after text")); + add(t); + t.addActionListener(this); + setLocationRelativeTo(null); + pack(); + setVisible(true); + } + + public void actionPerformed(ActionEvent evt) { + ac = evt.getActionCommand(); + } + + public void performTest() throws AWTException, InterruptedException, + InvocationTargetException { + EventQueue.invokeAndWait(() -> { + location = t.getLocationOnScreen(); + size = t.getSize(); + }); + Robot robot = new Robot(); + robot.setAutoDelay(50); + robot.delay(1000); + robot.waitForIdle(); + robot.mouseMove(location.x + size.width - 3, location.y + (size.height / 2)); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(1000); + robot.waitForIdle(); + robot.keyPress(KeyEvent.VK_ENTER); + robot.keyRelease(KeyEvent.VK_ENTER); + robot.delay(1000); + if (!s.equals(ac)) { + throw new RuntimeException("Action command should be the same as text field content"); + } + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException, AWTException { + GetTextTest test = new GetTextTest(); + EventQueue.invokeAndWait(test::setupGUI); + try { + test.performTest(); + } finally { + EventQueue.invokeAndWait(test::dispose); + } + } +} diff --git a/test/jdk/java/awt/TextField/SetEchoCharTest3/SetEchoCharTest3.java b/test/jdk/java/awt/TextField/SetEchoCharTest3/SetEchoCharTest3.java new file mode 100644 index 0000000000000..10779365defc4 --- /dev/null +++ b/test/jdk/java/awt/TextField/SetEchoCharTest3/SetEchoCharTest3.java @@ -0,0 +1,65 @@ +/* + * 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 4222122 + * @summary TextField.setEchoCharacter() seems to be broken + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual SetEchoCharTest3 + */ + +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Label; +import java.awt.TextField; +import java.lang.reflect.InvocationTargetException; + +public class SetEchoCharTest3 extends Frame { + static String INSTRUCTIONS = """ + Type in the text field and "*" characters should echo. + If only one "*" echoes and then the system beeps after + the second character is typed, then press Fail, otherwise press Pass. + """; + public SetEchoCharTest3() { + setLayout(new FlowLayout()); + add(new Label("Enter text:")); + TextField tf = new TextField(15); + tf.setEchoChar('*'); + add(tf); + pack(); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Set Echo Char Test 3") + .testUI(SetEchoCharTest3::new) + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(40) + .build() + .awaitAndCheck(); + } +} From 1b2d40addfc5e32229418d29ae90fb440720479e Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Wed, 25 Sep 2024 17:19:02 +0000 Subject: [PATCH 190/307] 8340956: ProblemList 4 java/nio/channels/DatagramChannel tests on macosx-all Reviewed-by: liach, alanb, darcy, dfuchs --- test/jdk/ProblemList.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 36043645ca989..8060792a51f9a 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -569,10 +569,13 @@ java/nio/channels/AsynchronousSocketChannel/StressLoopback.java 8211851 aix-ppc6 java/nio/channels/Channels/SocketChannelStreams.java 8317838 aix-ppc64 -java/nio/channels/DatagramChannel/AdaptorMulticasting.java 8308807 aix-ppc64 +java/nio/channels/DatagramChannel/AdaptorMulticasting.java 8308807,8144003 aix-ppc64,macosx-all java/nio/channels/DatagramChannel/AfterDisconnect.java 8308807 aix-ppc64 java/nio/channels/DatagramChannel/ManySourcesAndTargets.java 8264385 macosx-aarch64 java/nio/channels/DatagramChannel/Unref.java 8233437 generic-all +java/nio/channels/DatagramChannel/BasicMulticastTests.java 8144003 macosx-all +java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java 8144003 macosx-all +java/nio/channels/DatagramChannel/Promiscuous.java 8144003 macosx-all ############################################################################ From df1959fd7a57f11839d58858bab4ea61f5b2bb8d Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Wed, 25 Sep 2024 18:29:30 +0000 Subject: [PATCH 191/307] 8340838: Clean up MutableCallSite to use explicit release fence instead of AtomicInteger Reviewed-by: jrose, redestad, shade --- .../share/classes/java/lang/invoke/MutableCallSite.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java b/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java index 50ba77d8f96f9..65872e360a73f 100644 --- a/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java +++ b/src/java.base/share/classes/java/lang/invoke/MutableCallSite.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 @@ -26,7 +26,8 @@ package java.lang.invoke; import java.util.Objects; -import java.util.concurrent.atomic.AtomicInteger; + +import static java.lang.invoke.MethodHandleStatics.UNSAFE; /** * A {@code MutableCallSite} is a {@link CallSite} whose target variable @@ -274,11 +275,10 @@ public final MethodHandle dynamicInvoker() { */ public static void syncAll(MutableCallSite[] sites) { if (sites.length == 0) return; - STORE_BARRIER.lazySet(0); + UNSAFE.storeFence(); for (MutableCallSite site : sites) { Objects.requireNonNull(site); // trigger NPE on first null } // FIXME: NYI } - private static final AtomicInteger STORE_BARRIER = new AtomicInteger(); } From 84751cbfddf69bd9ed6bc5c39f8e056009440331 Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Wed, 25 Sep 2024 18:31:24 +0000 Subject: [PATCH 192/307] 8340831: Simplify simple validation for class definition in MethodHandles.Lookup Reviewed-by: redestad --- .../java/lang/invoke/MethodHandles.java | 185 ++++++++---------- .../share/classes/jdk/internal/misc/VM.java | 28 +-- 2 files changed, 85 insertions(+), 128 deletions(-) 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 6a73266ae80a4..9e292373f9caf 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -39,7 +39,9 @@ import sun.reflect.misc.ReflectUtil; import sun.security.util.SecurityConstants; +import java.lang.classfile.ClassFile; import java.lang.classfile.ClassModel; +import java.lang.constant.ClassDesc; import java.lang.constant.ConstantDescs; import java.lang.invoke.LambdaForm.BasicType; import java.lang.invoke.MethodHandleImpl.Intrinsic; @@ -2242,85 +2244,70 @@ private static ClassFileDumper defaultDumper() { private static final ClassFileDumper DEFAULT_DUMPER = ClassFileDumper.getInstance( "jdk.invoke.MethodHandle.dumpClassFiles", "DUMP_CLASS_FILES"); - static class ClassFile { - final String name; // internal name - final int accessFlags; - final byte[] bytes; - ClassFile(String name, int accessFlags, byte[] bytes) { - this.name = name; - this.accessFlags = accessFlags; - this.bytes = bytes; + /** + * This method checks the class file version and the structure of `this_class`. + * and checks if the bytes is a class or interface (ACC_MODULE flag not set) + * that is in the named package. + * + * @throws IllegalArgumentException if ACC_MODULE flag is set in access flags + * or the class is not in the given package name. + */ + static String validateAndFindInternalName(byte[] bytes, String pkgName) { + int magic = readInt(bytes, 0); + if (magic != ClassFile.MAGIC_NUMBER) { + throw new ClassFormatError("Incompatible magic value: " + magic); } + // We have to read major and minor this way as ClassFile API throws IAE + // yet we want distinct ClassFormatError and UnsupportedClassVersionError + int minor = readUnsignedShort(bytes, 4); + int major = readUnsignedShort(bytes, 6); - static ClassFile newInstanceNoCheck(String name, byte[] bytes) { - return new ClassFile(name, 0, bytes); + if (!VM.isSupportedClassFileVersion(major, minor)) { + throw new UnsupportedClassVersionError("Unsupported class file version " + major + "." + minor); } - /** - * This method checks the class file version and the structure of `this_class`. - * and checks if the bytes is a class or interface (ACC_MODULE flag not set) - * that is in the named package. - * - * @throws IllegalArgumentException if ACC_MODULE flag is set in access flags - * or the class is not in the given package name. - */ - static ClassFile newInstance(byte[] bytes, String pkgName) { - var cf = readClassFile(bytes); - - // check if it's in the named package - int index = cf.name.lastIndexOf('/'); - String pn = (index == -1) ? "" : cf.name.substring(0, index).replace('/', '.'); - if (!pn.equals(pkgName)) { - throw newIllegalArgumentException(cf.name + " not in same package as lookup class"); - } - return cf; + String name; + ClassDesc sym; + int accessFlags; + try { + ClassModel cm = ClassFile.of().parse(bytes); + var thisClass = cm.thisClass(); + name = thisClass.asInternalName(); + sym = thisClass.asSymbol(); + accessFlags = cm.flags().flagsMask(); + } catch (IllegalArgumentException e) { + ClassFormatError cfe = new ClassFormatError(); + cfe.initCause(e); + throw cfe; + } + // must be a class or interface + if ((accessFlags & ACC_MODULE) != 0) { + throw newIllegalArgumentException("Not a class or interface: ACC_MODULE flag is set"); } - private static ClassFile readClassFile(byte[] bytes) { - int magic = readInt(bytes, 0); - if (magic != 0xCAFEBABE) { - throw new ClassFormatError("Incompatible magic value: " + magic); - } - int minor = readUnsignedShort(bytes, 4); - int major = readUnsignedShort(bytes, 6); - if (!VM.isSupportedClassFileVersion(major, minor)) { - throw new UnsupportedClassVersionError("Unsupported class file version " + major + "." + minor); - } - - String name; - int accessFlags; - try { - ClassModel cm = java.lang.classfile.ClassFile.of().parse(bytes); - name = cm.thisClass().asInternalName(); - accessFlags = cm.flags().flagsMask(); - } catch (IllegalArgumentException e) { - ClassFormatError cfe = new ClassFormatError(); - cfe.initCause(e); - throw cfe; - } - // must be a class or interface - if ((accessFlags & ACC_MODULE) != 0) { - throw newIllegalArgumentException("Not a class or interface: ACC_MODULE flag is set"); - } - return new ClassFile(name, accessFlags, bytes); + String pn = sym.packageName(); + if (!pn.equals(pkgName)) { + throw newIllegalArgumentException(name + " not in same package as lookup class"); } - private static int readInt(byte[] bytes, int offset) { - if ((offset+4) > bytes.length) { - throw new ClassFormatError("Invalid ClassFile structure"); - } - return ((bytes[offset] & 0xFF) << 24) - | ((bytes[offset + 1] & 0xFF) << 16) - | ((bytes[offset + 2] & 0xFF) << 8) - | (bytes[offset + 3] & 0xFF); + return name; + } + + private static int readInt(byte[] bytes, int offset) { + if ((offset + 4) > bytes.length) { + throw new ClassFormatError("Invalid ClassFile structure"); } + return ((bytes[offset] & 0xFF) << 24) + | ((bytes[offset + 1] & 0xFF) << 16) + | ((bytes[offset + 2] & 0xFF) << 8) + | (bytes[offset + 3] & 0xFF); + } - private static int readUnsignedShort(byte[] bytes, int offset) { - if ((offset+2) > bytes.length) { - throw new ClassFormatError("Invalid ClassFile structure"); - } - return ((bytes[offset] & 0xFF) << 8) | (bytes[offset + 1] & 0xFF); + private static int readUnsignedShort(byte[] bytes, int offset) { + if ((offset+2) > bytes.length) { + throw new ClassFormatError("Invalid ClassFile structure"); } + return ((bytes[offset] & 0xFF) << 8) | (bytes[offset + 1] & 0xFF); } /* @@ -2334,23 +2321,22 @@ private static int readUnsignedShort(byte[] bytes, int offset) { * {@code bytes} denotes a class in a different package than the lookup class */ private ClassDefiner makeClassDefiner(byte[] bytes) { - ClassFile cf = ClassFile.newInstance(bytes, lookupClass().getPackageName()); - return new ClassDefiner(this, cf, STRONG_LOADER_LINK, defaultDumper()); + var internalName = validateAndFindInternalName(bytes, lookupClass().getPackageName()); + return new ClassDefiner(this, internalName, bytes, STRONG_LOADER_LINK, defaultDumper()); } /** * Returns a ClassDefiner that creates a {@code Class} object of a normal class * from the given bytes. No package name check on the given bytes. * - * @param name internal name + * @param internalName internal name * @param bytes class bytes * @param dumper dumper to write the given bytes to the dumper's output directory * @return ClassDefiner that defines a normal class of the given bytes. */ - ClassDefiner makeClassDefiner(String name, byte[] bytes, ClassFileDumper dumper) { + ClassDefiner makeClassDefiner(String internalName, byte[] bytes, ClassFileDumper dumper) { // skip package name validation - ClassFile cf = ClassFile.newInstanceNoCheck(name, bytes); - return new ClassDefiner(this, cf, STRONG_LOADER_LINK, dumper); + return new ClassDefiner(this, internalName, bytes, STRONG_LOADER_LINK, dumper); } /** @@ -2368,8 +2354,8 @@ ClassDefiner makeClassDefiner(String name, byte[] bytes, ClassFileDumper dumper) * {@code bytes} denotes a class in a different package than the lookup class */ ClassDefiner makeHiddenClassDefiner(byte[] bytes, ClassFileDumper dumper) { - ClassFile cf = ClassFile.newInstance(bytes, lookupClass().getPackageName()); - return makeHiddenClassDefiner(cf, false, dumper, 0); + var internalName = validateAndFindInternalName(bytes, lookupClass().getPackageName()); + return makeHiddenClassDefiner(internalName, bytes, false, dumper, 0); } /** @@ -2391,51 +2377,53 @@ ClassDefiner makeHiddenClassDefiner(byte[] bytes, ClassFileDumper dumper) { private ClassDefiner makeHiddenClassDefiner(byte[] bytes, boolean accessVmAnnotations, int flags) { - ClassFile cf = ClassFile.newInstance(bytes, lookupClass().getPackageName()); - return makeHiddenClassDefiner(cf, accessVmAnnotations, defaultDumper(), flags); + var internalName = validateAndFindInternalName(bytes, lookupClass().getPackageName()); + return makeHiddenClassDefiner(internalName, bytes, 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 internalName 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) { + ClassDefiner makeHiddenClassDefiner(String internalName, byte[] bytes, ClassFileDumper dumper) { Objects.requireNonNull(dumper); // skip name and access flags validation - return makeHiddenClassDefiner(ClassFile.newInstanceNoCheck(name, bytes), false, dumper, 0); + return makeHiddenClassDefiner(internalName, bytes, false, dumper, 0); } /** * 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 internalName internal name that specifies the prefix of the hidden class * @param bytes class bytes * @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, ClassFileDumper dumper, int flags) { + ClassDefiner makeHiddenClassDefiner(String internalName, byte[] bytes, ClassFileDumper dumper, int flags) { Objects.requireNonNull(dumper); // skip name and access flags validation - return makeHiddenClassDefiner(ClassFile.newInstanceNoCheck(name, bytes), false, dumper, flags); + return makeHiddenClassDefiner(internalName, bytes, false, dumper, flags); } /** * Returns a ClassDefiner that creates a {@code Class} object of a hidden class * from the given class file and options. * - * @param cf ClassFile + * @param internalName internal name + * @param bytes Class byte array * @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, + private ClassDefiner makeHiddenClassDefiner(String internalName, + byte[] bytes, boolean accessVmAnnotations, ClassFileDumper dumper, int flags) { @@ -2446,27 +2434,12 @@ private ClassDefiner makeHiddenClassDefiner(ClassFile cf, flags |= ACCESS_VM_ANNOTATIONS; } - return new ClassDefiner(this, cf, flags, dumper); + return new ClassDefiner(this, internalName, bytes, flags, dumper); } - static class ClassDefiner { - private final Lookup lookup; - private final String name; // internal name - private final byte[] bytes; - private final int classFlags; - private final ClassFileDumper dumper; - - private ClassDefiner(Lookup lookup, ClassFile cf, int flags, ClassFileDumper dumper) { - assert ((flags & HIDDEN_CLASS) != 0 || (flags & STRONG_LOADER_LINK) == STRONG_LOADER_LINK); - this.lookup = lookup; - this.bytes = cf.bytes; - this.name = cf.name; - this.classFlags = flags; - this.dumper = dumper; - } - - String internalName() { - return name; + record ClassDefiner(Lookup lookup, String internalName, byte[] bytes, int classFlags, ClassFileDumper dumper) { + ClassDefiner { + assert ((classFlags & HIDDEN_CLASS) != 0 || (classFlags & STRONG_LOADER_LINK) == STRONG_LOADER_LINK); } Class defineClass(boolean initialize) { @@ -2495,7 +2468,7 @@ Class defineClass(boolean initialize, Object classData) { Class c = null; try { c = SharedSecrets.getJavaLangAccess() - .defineClass(loader, lookupClass, name, bytes, pd, initialize, classFlags, classData); + .defineClass(loader, lookupClass, internalName, bytes, pd, initialize, classFlags, classData); assert !isNestmate() || c.getNestHost() == lookupClass.getNestHost(); return c; } finally { diff --git a/src/java.base/share/classes/jdk/internal/misc/VM.java b/src/java.base/share/classes/jdk/internal/misc/VM.java index de6f011fe8ffd..1c31ef5a184e2 100644 --- a/src/java.base/share/classes/jdk/internal/misc/VM.java +++ b/src/java.base/share/classes/jdk/internal/misc/VM.java @@ -28,6 +28,7 @@ import static java.lang.Thread.State.*; import java.io.PrintStream; +import java.lang.classfile.ClassFile; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -158,10 +159,6 @@ public static boolean isDirectMemoryPageAligned() { return pageAlignDirectMemory; } - private static int classFileMajorVersion; - private static int classFileMinorVersion; - private static final int PREVIEW_MINOR_VERSION = 65535; - /** * Tests if the given version is a supported {@code class} * file version. @@ -175,11 +172,11 @@ public static boolean isDirectMemoryPageAligned() { * @jvms 4.1 Table 4.1-A. class file format major versions */ public static boolean isSupportedClassFileVersion(int major, int minor) { - if (major < 45 || major > classFileMajorVersion) return false; + if (major < ClassFile.JAVA_1_VERSION || major > ClassFile.latestMajorVersion()) return false; // for major version is between 45 and 55 inclusive, the minor version may be any value - if (major < 56) return true; + if (major < ClassFile.JAVA_12_VERSION) return true; // otherwise, the minor version must be 0 or 65535 - return minor == 0 || minor == PREVIEW_MINOR_VERSION; + return minor == 0 || (minor == ClassFile.PREVIEW_MINOR_VERSION && major == ClassFile.latestMajorVersion()); } /** @@ -189,12 +186,8 @@ public static boolean isSupportedClassFileVersion(int major, int minor) { * major.minor version >= 53.0 */ public static boolean isSupportedModuleDescriptorVersion(int major, int minor) { - if (major < 53 || major > classFileMajorVersion) return false; - // for major version is between 45 and 55 inclusive, the minor version may be any value - if (major < 56) return true; - // otherwise, the minor version must be 0 or 65535 - // preview features do not apply to module-info.class but JVMS allows it - return minor == 0 || minor == PREVIEW_MINOR_VERSION; + if (major < ClassFile.JAVA_9_VERSION) return false; + return isSupportedClassFileVersion(major, minor); } /** @@ -271,15 +264,6 @@ public static void saveProperties(Map props) { s = props.get("sun.nio.PageAlignDirectMemory"); if ("true".equals(s)) pageAlignDirectMemory = true; - - s = props.get("java.class.version"); - int index = s.indexOf('.'); - try { - classFileMajorVersion = Integer.parseInt(s.substring(0, index)); - classFileMinorVersion = Integer.parseInt(s.substring(index + 1)); - } catch (NumberFormatException e) { - throw new InternalError(e); - } } // Initialize any miscellaneous operating system settings that need to be From 8f756196b430af67a8e31a13811a183d52df8497 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Wed, 25 Sep 2024 18:51:16 +0000 Subject: [PATCH 193/307] 8340864: Remove unused lines related to vmClasses Reviewed-by: shade, kvn --- src/hotspot/share/classfile/systemDictionary.hpp | 7 ------- src/hotspot/share/classfile/vmClasses.cpp | 10 ---------- src/hotspot/share/classfile/vmClasses.hpp | 4 +--- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/hotspot/share/classfile/systemDictionary.hpp b/src/hotspot/share/classfile/systemDictionary.hpp index ee50aa38dd0cf..04980291716c7 100644 --- a/src/hotspot/share/classfile/systemDictionary.hpp +++ b/src/hotspot/share/classfile/systemDictionary.hpp @@ -293,13 +293,6 @@ class SystemDictionary : AllStatic { const char* message); static const char* find_nest_host_error(const constantPoolHandle& pool, int which); -protected: - static InstanceKlass* _well_known_klasses[]; - -private: - // table of box klasses (int_klass, etc.) - static InstanceKlass* _box_klasses[T_VOID+1]; - static OopHandle _java_system_loader; static OopHandle _java_platform_loader; diff --git a/src/hotspot/share/classfile/vmClasses.cpp b/src/hotspot/share/classfile/vmClasses.cpp index 0b9b437c67b78..b62d699dfe20e 100644 --- a/src/hotspot/share/classfile/vmClasses.cpp +++ b/src/hotspot/share/classfile/vmClasses.cpp @@ -45,14 +45,6 @@ InstanceKlass* vmClasses::_klasses[static_cast(vmClassID::LIMIT)] = { nullptr /*, nullptr...*/ }; InstanceKlass* vmClasses::_box_klasses[T_VOID+1] = { nullptr /*, nullptr...*/ }; - -// CDS: scan and relocate all classes referenced by _klasses[]. -void vmClasses::metaspace_pointers_do(MetaspaceClosure* it) { - for (auto id : EnumRange{}) { - it->push(klass_addr_at(id)); - } -} - bool vmClasses::is_loaded(InstanceKlass* klass) { return klass != nullptr && klass->is_loaded(); } @@ -205,8 +197,6 @@ void vmClasses::resolve_all(TRAPS) { _box_klasses[T_SHORT] = vmClasses::Short_klass(); _box_klasses[T_INT] = vmClasses::Integer_klass(); _box_klasses[T_LONG] = vmClasses::Long_klass(); - //_box_klasses[T_OBJECT] = vmClasses::object_klass(); - //_box_klasses[T_ARRAY] = vmClasses::object_klass(); #ifdef ASSERT if (CDSConfig::is_using_archive()) { diff --git a/src/hotspot/share/classfile/vmClasses.hpp b/src/hotspot/share/classfile/vmClasses.hpp index f2b8c5666eeb1..4fa078c50cd80 100644 --- a/src/hotspot/share/classfile/vmClasses.hpp +++ b/src/hotspot/share/classfile/vmClasses.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 @@ -32,7 +32,6 @@ class ClassLoaderData; class InstanceKlass; -class MetaspaceClosure; class vmClasses : AllStatic { friend class VMStructs; @@ -95,7 +94,6 @@ class vmClasses : AllStatic { return &_klasses[as_int(id)]; } - static void metaspace_pointers_do(MetaspaceClosure* it); static void resolve_all(TRAPS); static BasicType box_klass_type(Klass* k); // inverse of box_klass From 66f1639846645f1d3b4096ef6d62f2b301cf7ed2 Mon Sep 17 00:00:00 2001 From: Alisen Chung Date: Thu, 26 Sep 2024 01:16:13 +0000 Subject: [PATCH 194/307] 8339271: giflib attribution correction Reviewed-by: dnguyen, prr --- src/java.desktop/share/legal/giflib.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/java.desktop/share/legal/giflib.md b/src/java.desktop/share/legal/giflib.md index 8b8fde8706d92..5697dc7ca9ab2 100644 --- a/src/java.desktop/share/legal/giflib.md +++ b/src/java.desktop/share/legal/giflib.md @@ -23,8 +23,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +--------------------------------- +The below applies to the following file(s): +giflib/openbsd-reallocarray.c + +Copyright (C) 2008 Otto Moerbeek +SPDX-License-Identifier: MIT -tree/README == Authors == @@ -38,13 +43,4 @@ former maintainer Eric Raymond current as well as long time former maintainer of giflib code -There have been many other contributors; see the attributions in the -version-control history to learn more. - - -tree/openbsd-reallocarray.c - -Copyright (C) 2008 Otto Moerbeek -SPDX-License-Identifier: MIT - ``` From 47c10694c66bc131c8a5e1572340415b8daaba08 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Thu, 26 Sep 2024 06:03:29 +0000 Subject: [PATCH 195/307] 8340812: LambdaForm customization via MethodHandle::updateForm is not thread safe Reviewed-by: liach, shade, jvernee --- .../java/lang/invoke/MethodHandle.java | 5 +- .../invoke/TestLambdaFormCustomization.java | 70 +++++++++++++++++++ 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 test/jdk/java/lang/invoke/TestLambdaFormCustomization.java diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java index edcecce37e05d..104248c27e61a 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.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 @@ -1879,8 +1879,7 @@ void updateForm(Function updater) { if (oldForm != newForm) { assert (newForm.customized == null || newForm.customized == this); newForm.prepare(); // as in MethodHandle. - UNSAFE.putReference(this, FORM_OFFSET, newForm); - UNSAFE.fullFence(); + UNSAFE.putReferenceRelease(this, FORM_OFFSET, newForm); // properly publish newForm } } finally { updateInProgress = false; diff --git a/test/jdk/java/lang/invoke/TestLambdaFormCustomization.java b/test/jdk/java/lang/invoke/TestLambdaFormCustomization.java new file mode 100644 index 0000000000000..60ba4af590e78 --- /dev/null +++ b/test/jdk/java/lang/invoke/TestLambdaFormCustomization.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. + */ + +import java.lang.invoke.MethodHandles; +import java.lang.invoke.VarHandle; +import java.util.ArrayList; + +/** + * @test + * @bug 8340812 + * @summary Verify that LambdaForm customization via MethodHandle::updateForm is thread safe. + * @run main TestLambdaFormCustomization + * @run main/othervm -Djava.lang.invoke.MethodHandle.CUSTOMIZE_THRESHOLD=0 TestLambdaFormCustomization + */ +public class TestLambdaFormCustomization { + + String str = "test"; + static final String value = "test" + 42; + + // Trigger concurrent LambdaForm customization for VarHandle invokers + void test() throws NoSuchFieldException, IllegalAccessException { + VarHandle varHandle = MethodHandles.lookup().in(getClass()).findVarHandle(getClass(), "str", String.class); + + ArrayList threads = new ArrayList<>(); + for (int threadIdx = 0; threadIdx < 10; threadIdx++) { + threads.add(new Thread(() -> { + for (int i = 0; i < 1000; i++) { + varHandle.compareAndExchange(this, value, value); + varHandle.compareAndExchange(this, value, value); + varHandle.compareAndExchange(this, value, value); + } + })); + } + threads.forEach(Thread::start); + threads.forEach(t -> { + try { + t.join(); + } catch (Throwable e) { + throw new IllegalStateException(e); + } + }); + } + + public static void main(String[] args) throws Exception { + TestLambdaFormCustomization t = new TestLambdaFormCustomization(); + for (int i = 0; i < 4000; ++i) { + t.test(); + } + } +} From 8c8f0d85ce30e45c34d4b096f7f1430cd9e7fd70 Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Thu, 26 Sep 2024 06:34:18 +0000 Subject: [PATCH 196/307] 8339260: Move rarely used constants out of ClassFile Reviewed-by: asotona --- .../java/lang/classfile/AnnotationValue.java | 69 +- .../java/lang/classfile/ClassFile.java | 874 +----------------- .../classes/java/lang/classfile/Opcode.java | 433 ++++----- .../java/lang/classfile/TypeAnnotation.java | 214 ++++- .../attribute/CharacterRangeInfo.java | 23 +- .../attribute/StackMapFrameInfo.java | 50 +- .../classfile/constantpool/PoolEntry.java | 55 ++ .../classfile/instruction/CharacterRange.java | 49 +- .../classfile/impl/AbstractInstruction.java | 4 +- .../classfile/impl/AbstractPoolEntry.java | 53 +- .../classfile/impl/AnnotationImpl.java | 28 +- .../classfile/impl/AnnotationReader.java | 83 +- .../classfile/impl/BytecodeHelpers.java | 2 +- .../classfile/impl/ClassHierarchyImpl.java | 9 +- .../classfile/impl/ClassPrinterImpl.java | 28 +- .../classfile/impl/ClassReaderImpl.java | 52 +- .../jdk/internal/classfile/impl/CodeImpl.java | 2 +- .../classfile/impl/DirectClassBuilder.java | 4 +- .../classfile/impl/DirectCodeBuilder.java | 8 +- .../classfile/impl/RawBytecodeHelper.java | 208 ++++- .../classfile/impl/SplitConstantPool.java | 44 +- .../internal/classfile/impl/StackCounter.java | 10 +- .../classfile/impl/StackMapDecoder.java | 40 +- .../classfile/impl/StackMapGenerator.java | 9 +- .../classfile/impl/TargetInfoImpl.java | 14 +- .../impl/verifier/VerificationBytecodes.java | 478 +++++----- .../classfile/impl/verifier/VerifierImpl.java | 479 +++++----- .../com/sun/tools/javap/AttributeWriter.java | 33 +- .../com/sun/tools/javap/ClassWriter.java | 4 +- .../com/sun/tools/javap/ConstantWriter.java | 27 +- .../com/sun/tools/javap/StackMapWriter.java | 14 +- .../plugins/IncludeLocalesPlugin.java | 16 +- .../internal/plugins/StringSharingPlugin.java | 8 +- test/jdk/jdk/classfile/LimitsTest.java | 7 +- test/jdk/jdk/classfile/StackMapsTest.java | 4 +- test/jdk/jdk/classfile/VerifierSelfTest.java | 3 +- .../jdk/classfile/helpers/ClassRecord.java | 23 +- 37 files changed, 1545 insertions(+), 1916 deletions(-) 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 c4474a248b520..50bfa0b7aa6fb 100644 --- a/src/java.base/share/classes/java/lang/classfile/AnnotationValue.java +++ b/src/java.base/share/classes/java/lang/classfile/AnnotationValue.java @@ -60,7 +60,7 @@ public sealed interface AnnotationValue { /** * Models an annotation value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_ANNOTATION}. + * The {@linkplain #tag tag} of this value is {@value TAG_ANNOTATION}. * * @since 22 */ @@ -73,7 +73,7 @@ sealed interface OfAnnotation extends AnnotationValue /** * Models an array value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_ARRAY}. + * The {@linkplain #tag tag} of this value is {@value TAG_ARRAY}. * * @since 22 */ @@ -131,7 +131,7 @@ sealed interface OfConstant extends AnnotationValue { /** * Models a string value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_STRING}. + * The {@linkplain #tag tag} of this value is {@value TAG_STRING}. * * @since 22 */ @@ -159,7 +159,7 @@ default String resolvedValue() { /** * Models a double value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_DOUBLE}. + * The {@linkplain #tag tag} of this value is {@value TAG_DOUBLE}. * * @since 22 */ @@ -187,7 +187,7 @@ default Double resolvedValue() { /** * Models a float value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_FLOAT}. + * The {@linkplain #tag tag} of this value is {@value TAG_FLOAT}. * * @since 22 */ @@ -215,7 +215,7 @@ default Float resolvedValue() { /** * Models a long value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_LONG}. + * The {@linkplain #tag tag} of this value is {@value TAG_LONG}. * * @since 22 */ @@ -243,7 +243,7 @@ default Long resolvedValue() { /** * Models an int value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_INT}. + * The {@linkplain #tag tag} of this value is {@value TAG_INT}. * * @since 22 */ @@ -271,7 +271,7 @@ default Integer resolvedValue() { /** * Models a short value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_SHORT}. + * The {@linkplain #tag tag} of this value is {@value TAG_SHORT}. * * @since 22 */ @@ -302,7 +302,7 @@ default Short resolvedValue() { /** * Models a char value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_CHAR}. + * The {@linkplain #tag tag} of this value is {@value TAG_CHAR}. * * @since 22 */ @@ -333,7 +333,7 @@ default Character resolvedValue() { /** * Models a byte value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_BYTE}. + * The {@linkplain #tag tag} of this value is {@value TAG_BYTE}. * * @since 22 */ @@ -364,7 +364,7 @@ default Byte resolvedValue() { /** * Models a boolean value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_BOOLEAN}. + * The {@linkplain #tag tag} of this value is {@value TAG_BOOLEAN}. * * @since 22 */ @@ -395,7 +395,7 @@ default Boolean resolvedValue() { /** * Models a class value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_CLASS}. + * The {@linkplain #tag tag} of this value is {@value TAG_CLASS}. * * @since 22 */ @@ -413,7 +413,7 @@ default ClassDesc classSymbol() { /** * Models an enum value of an element-value pair. - * The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_ENUM}. + * The {@linkplain #tag tag} of this value is {@value TAG_ENUM}. * * @since 22 */ @@ -432,9 +432,52 @@ default ClassDesc classSymbol() { Utf8Entry constantName(); } + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfByte}. */ + int TAG_BYTE = 'B'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfChar}. */ + int TAG_CHAR = 'C'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfDouble}. */ + int TAG_DOUBLE = 'D'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfFloat}. */ + int TAG_FLOAT = 'F'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfInt}. */ + int TAG_INT = 'I'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfLong}. */ + int TAG_LONG = 'J'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfShort}. */ + int TAG_SHORT = 'S'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfBoolean}. */ + int TAG_BOOLEAN = 'Z'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfString}. */ + int TAG_STRING = 's'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfEnum}. */ + int TAG_ENUM = 'e'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfClass}. */ + int TAG_CLASS = 'c'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfAnnotation}. */ + int TAG_ANNOTATION = '@'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfArray}. */ + int TAG_ARRAY = '['; + /** * {@return the tag character for this value as per JVMS {@jvms 4.7.16.1}} * The tag characters have a one-to-one mapping to the types of annotation element values. + * + * @apiNote + * {@code TAG_}-prefixed constants in this class, such as {@link #TAG_INT}, + * describe the possible return values of this method. */ char tag(); 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 a305878d3ebf2..284503ee62714 100644 --- a/src/java.base/share/classes/java/lang/classfile/ClassFile.java +++ b/src/java.base/share/classes/java/lang/classfile/ClassFile.java @@ -512,903 +512,75 @@ default List verify(Path path) throws IOException { /** 0xCAFEBABE */ int MAGIC_NUMBER = 0xCAFEBABE; - /** The integer value used to encode the NOP instruction. */ - int NOP = 0; - - /** The integer value used to encode the ACONST_NULL instruction. */ - int ACONST_NULL = 1; - - /** The integer value used to encode the ICONST_M1 instruction. */ - int ICONST_M1 = 2; - - /** The integer value used to encode the ICONST_0 instruction. */ - int ICONST_0 = 3; - - /** The integer value used to encode the ICONST_1 instruction. */ - int ICONST_1 = 4; - - /** The integer value used to encode the ICONST_2 instruction. */ - int ICONST_2 = 5; - - /** The integer value used to encode the ICONST_3 instruction. */ - int ICONST_3 = 6; - - /** The integer value used to encode the ICONST_4 instruction. */ - int ICONST_4 = 7; - - /** The integer value used to encode the ICONST_5 instruction. */ - int ICONST_5 = 8; - - /** The integer value used to encode the LCONST_0 instruction. */ - int LCONST_0 = 9; - - /** The integer value used to encode the LCONST_1 instruction. */ - int LCONST_1 = 10; - - /** The integer value used to encode the FCONST_0 instruction. */ - int FCONST_0 = 11; - - /** The integer value used to encode the FCONST_1 instruction. */ - int FCONST_1 = 12; - - /** The integer value used to encode the FCONST_2 instruction. */ - int FCONST_2 = 13; - - /** The integer value used to encode the DCONST_0 instruction. */ - int DCONST_0 = 14; - - /** The integer value used to encode the DCONST_1 instruction. */ - int DCONST_1 = 15; - - /** The integer value used to encode the BIPUSH instruction. */ - int BIPUSH = 16; - - /** The integer value used to encode the SIPUSH instruction. */ - int SIPUSH = 17; - - /** The integer value used to encode the LDC instruction. */ - int LDC = 18; - - /** The integer value used to encode the LDC_W instruction. */ - int LDC_W = 19; - - /** The integer value used to encode the LDC2_W instruction. */ - int LDC2_W = 20; - - /** The integer value used to encode the ILOAD instruction. */ - int ILOAD = 21; - - /** The integer value used to encode the LLOAD instruction. */ - int LLOAD = 22; - - /** The integer value used to encode the FLOAD instruction. */ - int FLOAD = 23; - - /** The integer value used to encode the DLOAD instruction. */ - int DLOAD = 24; - - /** The integer value used to encode the ALOAD instruction. */ - int ALOAD = 25; - - /** The integer value used to encode the ILOAD_0 instruction. */ - int ILOAD_0 = 26; - - /** The integer value used to encode the ILOAD_1 instruction. */ - int ILOAD_1 = 27; - - /** The integer value used to encode the ILOAD_2 instruction. */ - int ILOAD_2 = 28; - - /** The integer value used to encode the ILOAD_3 instruction. */ - int ILOAD_3 = 29; - - /** The integer value used to encode the LLOAD_0 instruction. */ - int LLOAD_0 = 30; - - /** The integer value used to encode the LLOAD_1 instruction. */ - int LLOAD_1 = 31; - - /** The integer value used to encode the LLOAD_2 instruction. */ - int LLOAD_2 = 32; - - /** The integer value used to encode the LLOAD_3 instruction. */ - int LLOAD_3 = 33; - - /** The integer value used to encode the FLOAD_0 instruction. */ - int FLOAD_0 = 34; - - /** The integer value used to encode the FLOAD_1 instruction. */ - int FLOAD_1 = 35; - - /** The integer value used to encode the FLOAD_2 instruction. */ - int FLOAD_2 = 36; - - /** The integer value used to encode the FLOAD_3 instruction. */ - int FLOAD_3 = 37; - - /** The integer value used to encode the DLOAD_0 instruction. */ - int DLOAD_0 = 38; - - /** The integer value used to encode the DLOAD_1 instruction. */ - int DLOAD_1 = 39; - - /** The integer value used to encode the DLOAD_2 instruction. */ - int DLOAD_2 = 40; - - /** The integer value used to encode the DLOAD_3 instruction. */ - int DLOAD_3 = 41; - - /** The integer value used to encode the ALOAD_0 instruction. */ - int ALOAD_0 = 42; - - /** The integer value used to encode the ALOAD_1 instruction. */ - int ALOAD_1 = 43; - - /** The integer value used to encode the ALOAD_2 instruction. */ - int ALOAD_2 = 44; - - /** The integer value used to encode the ALOAD_3 instruction. */ - int ALOAD_3 = 45; - - /** The integer value used to encode the IALOAD instruction. */ - int IALOAD = 46; - - /** The integer value used to encode the LALOAD instruction. */ - int LALOAD = 47; - - /** The integer value used to encode the FALOAD instruction. */ - int FALOAD = 48; - - /** The integer value used to encode the DALOAD instruction. */ - int DALOAD = 49; - - /** The integer value used to encode the AALOAD instruction. */ - int AALOAD = 50; - - /** The integer value used to encode the BALOAD instruction. */ - int BALOAD = 51; - - /** The integer value used to encode the CALOAD instruction. */ - int CALOAD = 52; - - /** The integer value used to encode the SALOAD instruction. */ - int SALOAD = 53; - - /** The integer value used to encode the ISTORE instruction. */ - int ISTORE = 54; - - /** The integer value used to encode the LSTORE instruction. */ - int LSTORE = 55; - - /** The integer value used to encode the FSTORE instruction. */ - int FSTORE = 56; - - /** The integer value used to encode the DSTORE instruction. */ - int DSTORE = 57; - - /** The integer value used to encode the ASTORE instruction. */ - int ASTORE = 58; - - /** The integer value used to encode the ISTORE_0 instruction. */ - int ISTORE_0 = 59; - - /** The integer value used to encode the ISTORE_1 instruction. */ - int ISTORE_1 = 60; - - /** The integer value used to encode the ISTORE_2 instruction. */ - int ISTORE_2 = 61; - - /** The integer value used to encode the ISTORE_3 instruction. */ - int ISTORE_3 = 62; - - /** The integer value used to encode the LSTORE_0 instruction. */ - int LSTORE_0 = 63; - - /** The integer value used to encode the LSTORE_1 instruction. */ - int LSTORE_1 = 64; - - /** The integer value used to encode the LSTORE_2 instruction. */ - int LSTORE_2 = 65; - - /** The integer value used to encode the LSTORE_3 instruction. */ - int LSTORE_3 = 66; - - /** The integer value used to encode the FSTORE_0 instruction. */ - int FSTORE_0 = 67; - - /** The integer value used to encode the FSTORE_1 instruction. */ - int FSTORE_1 = 68; - - /** The integer value used to encode the FSTORE_2 instruction. */ - int FSTORE_2 = 69; - - /** The integer value used to encode the FSTORE_3 instruction. */ - int FSTORE_3 = 70; - - /** The integer value used to encode the DSTORE_0 instruction. */ - int DSTORE_0 = 71; - - /** The integer value used to encode the DSTORE_1 instruction. */ - int DSTORE_1 = 72; - - /** The integer value used to encode the DSTORE_2 instruction. */ - int DSTORE_2 = 73; - - /** The integer value used to encode the DSTORE_3 instruction. */ - int DSTORE_3 = 74; - - /** The integer value used to encode the ASTORE_0 instruction. */ - int ASTORE_0 = 75; - - /** The integer value used to encode the ASTORE_1 instruction. */ - int ASTORE_1 = 76; - - /** The integer value used to encode the ASTORE_2 instruction. */ - int ASTORE_2 = 77; - - /** The integer value used to encode the ASTORE_3 instruction. */ - int ASTORE_3 = 78; - - /** The integer value used to encode the IASTORE instruction. */ - int IASTORE = 79; - - /** The integer value used to encode the LASTORE instruction. */ - int LASTORE = 80; - - /** The integer value used to encode the FASTORE instruction. */ - int FASTORE = 81; - - /** The integer value used to encode the DASTORE instruction. */ - int DASTORE = 82; - - /** The integer value used to encode the AASTORE instruction. */ - int AASTORE = 83; - - /** The integer value used to encode the BASTORE instruction. */ - int BASTORE = 84; - - /** The integer value used to encode the CASTORE instruction. */ - int CASTORE = 85; - - /** The integer value used to encode the SASTORE instruction. */ - int SASTORE = 86; - - /** The integer value used to encode the POP instruction. */ - int POP = 87; - - /** The integer value used to encode the POP2 instruction. */ - int POP2 = 88; - - /** The integer value used to encode the DUP instruction. */ - int DUP = 89; - - /** The integer value used to encode the DUP_X1 instruction. */ - int DUP_X1 = 90; - - /** The integer value used to encode the DUP_X2 instruction. */ - int DUP_X2 = 91; - - /** The integer value used to encode the DUP2 instruction. */ - int DUP2 = 92; - - /** The integer value used to encode the DUP2_X1 instruction. */ - int DUP2_X1 = 93; - - /** The integer value used to encode the DUP2_X2 instruction. */ - int DUP2_X2 = 94; - - /** The integer value used to encode the SWAP instruction. */ - int SWAP = 95; - - /** The integer value used to encode the IADD instruction. */ - int IADD = 96; - - /** The integer value used to encode the LADD instruction. */ - int LADD = 97; - - /** The integer value used to encode the FADD instruction. */ - int FADD = 98; - - /** The integer value used to encode the DADD instruction. */ - int DADD = 99; - - /** The integer value used to encode the ISUB instruction. */ - int ISUB = 100; - - /** The integer value used to encode the LSUB instruction. */ - int LSUB = 101; - - /** The integer value used to encode the FSUB instruction. */ - int FSUB = 102; - - /** The integer value used to encode the DSUB instruction. */ - int DSUB = 103; - - /** The integer value used to encode the IMUL instruction. */ - int IMUL = 104; - - /** The integer value used to encode the LMUL instruction. */ - int LMUL = 105; - - /** The integer value used to encode the FMUL instruction. */ - int FMUL = 106; - - /** The integer value used to encode the DMUL instruction. */ - int DMUL = 107; - - /** The integer value used to encode the IDIV instruction. */ - int IDIV = 108; - - /** The integer value used to encode the LDIV instruction. */ - int LDIV = 109; - - /** The integer value used to encode the FDIV instruction. */ - int FDIV = 110; - - /** The integer value used to encode the DDIV instruction. */ - int DDIV = 111; - - /** The integer value used to encode the IREM instruction. */ - int IREM = 112; - - /** The integer value used to encode the LREM instruction. */ - int LREM = 113; - - /** The integer value used to encode the FREM instruction. */ - int FREM = 114; - - /** The integer value used to encode the DREM instruction. */ - int DREM = 115; - - /** The integer value used to encode the INEG instruction. */ - int INEG = 116; - - /** The integer value used to encode the LNEG instruction. */ - int LNEG = 117; - - /** The integer value used to encode the FNEG instruction. */ - int FNEG = 118; - - /** The integer value used to encode the DNEG instruction. */ - int DNEG = 119; - - /** The integer value used to encode the ISHL instruction. */ - int ISHL = 120; - - /** The integer value used to encode the LSHL instruction. */ - int LSHL = 121; - - /** The integer value used to encode the ISHR instruction. */ - int ISHR = 122; - - /** The integer value used to encode the LSHR instruction. */ - int LSHR = 123; - - /** The integer value used to encode the IUSHR instruction. */ - int IUSHR = 124; - - /** The integer value used to encode the LUSHR instruction. */ - int LUSHR = 125; - - /** The integer value used to encode the IAND instruction. */ - int IAND = 126; - - /** The integer value used to encode the LAND instruction. */ - int LAND = 127; - - /** The integer value used to encode the IOR instruction. */ - int IOR = 128; - - /** The integer value used to encode the LOR instruction. */ - int LOR = 129; - - /** The integer value used to encode the IXOR instruction. */ - int IXOR = 130; - - /** The integer value used to encode the LXOR instruction. */ - int LXOR = 131; - - /** The integer value used to encode the IINC instruction. */ - int IINC = 132; - - /** The integer value used to encode the I2L instruction. */ - int I2L = 133; - - /** The integer value used to encode the I2F instruction. */ - int I2F = 134; - - /** The integer value used to encode the I2D instruction. */ - int I2D = 135; - - /** The integer value used to encode the L2I instruction. */ - int L2I = 136; - - /** The integer value used to encode the L2F instruction. */ - int L2F = 137; - - /** The integer value used to encode the L2D instruction. */ - int L2D = 138; - - /** The integer value used to encode the F2I instruction. */ - int F2I = 139; - - /** The integer value used to encode the F2L instruction. */ - int F2L = 140; - - /** The integer value used to encode the F2D instruction. */ - int F2D = 141; - - /** The integer value used to encode the D2I instruction. */ - int D2I = 142; - - /** The integer value used to encode the D2L instruction. */ - int D2L = 143; - - /** The integer value used to encode the D2F instruction. */ - int D2F = 144; - - /** The integer value used to encode the I2B instruction. */ - int I2B = 145; - - /** The integer value used to encode the I2C instruction. */ - int I2C = 146; - - /** The integer value used to encode the I2S instruction. */ - int I2S = 147; - - /** The integer value used to encode the LCMP instruction. */ - int LCMP = 148; - - /** The integer value used to encode the FCMPL instruction. */ - int FCMPL = 149; - - /** The integer value used to encode the FCMPG instruction. */ - int FCMPG = 150; - - /** The integer value used to encode the DCMPL instruction. */ - int DCMPL = 151; - - /** The integer value used to encode the DCMPG instruction. */ - int DCMPG = 152; - - /** The integer value used to encode the IFEQ instruction. */ - int IFEQ = 153; - - /** The integer value used to encode the IFNE instruction. */ - int IFNE = 154; - - /** The integer value used to encode the IFLT instruction. */ - int IFLT = 155; - - /** The integer value used to encode the IFGE instruction. */ - int IFGE = 156; - - /** The integer value used to encode the IFGT instruction. */ - int IFGT = 157; - - /** The integer value used to encode the IFLE instruction. */ - int IFLE = 158; - - /** The integer value used to encode the IF_ICMPEQ instruction. */ - int IF_ICMPEQ = 159; - - /** The integer value used to encode the IF_ICMPNE instruction. */ - int IF_ICMPNE = 160; - - /** The integer value used to encode the IF_ICMPLT instruction. */ - int IF_ICMPLT = 161; - - /** The integer value used to encode the IF_ICMPGE instruction. */ - int IF_ICMPGE = 162; - - /** The integer value used to encode the IF_ICMPGT instruction. */ - int IF_ICMPGT = 163; - - /** The integer value used to encode the IF_ICMPLE instruction. */ - int IF_ICMPLE = 164; - - /** The integer value used to encode the IF_ACMPEQ instruction. */ - int IF_ACMPEQ = 165; - - /** The integer value used to encode the IF_ACMPNE instruction. */ - int IF_ACMPNE = 166; - - /** The integer value used to encode the GOTO instruction. */ - int GOTO = 167; - - /** The integer value used to encode the JSR instruction. */ - int JSR = 168; - - /** The integer value used to encode the RET instruction. */ - int RET = 169; - - /** The integer value used to encode the TABLESWITCH instruction. */ - int TABLESWITCH = 170; - - /** The integer value used to encode the LOOKUPSWITCH instruction. */ - int LOOKUPSWITCH = 171; - - /** The integer value used to encode the IRETURN instruction. */ - int IRETURN = 172; - - /** The integer value used to encode the LRETURN instruction. */ - int LRETURN = 173; - - /** The integer value used to encode the FRETURN instruction. */ - int FRETURN = 174; - - /** The integer value used to encode the DRETURN instruction. */ - int DRETURN = 175; - - /** The integer value used to encode the ARETURN instruction. */ - int ARETURN = 176; - - /** The integer value used to encode the RETURN instruction. */ - int RETURN = 177; - - /** The integer value used to encode the GETSTATIC instruction. */ - int GETSTATIC = 178; - - /** The integer value used to encode the PUTSTATIC instruction. */ - int PUTSTATIC = 179; - - /** The integer value used to encode the GETFIELD instruction. */ - int GETFIELD = 180; - - /** The integer value used to encode the PUTFIELD instruction. */ - int PUTFIELD = 181; - - /** The integer value used to encode the INVOKEVIRTUAL instruction. */ - int INVOKEVIRTUAL = 182; - - /** The integer value used to encode the INVOKESPECIAL instruction. */ - int INVOKESPECIAL = 183; - - /** The integer value used to encode the INVOKESTATIC instruction. */ - int INVOKESTATIC = 184; - - /** The integer value used to encode the INVOKEINTERFACE instruction. */ - int INVOKEINTERFACE = 185; - - /** The integer value used to encode the INVOKEDYNAMIC instruction. */ - int INVOKEDYNAMIC = 186; - - /** The integer value used to encode the NEW instruction. */ - int NEW = 187; - - /** The integer value used to encode the NEWARRAY instruction. */ - int NEWARRAY = 188; - - /** The integer value used to encode the ANEWARRAY instruction. */ - int ANEWARRAY = 189; - - /** The integer value used to encode the ARRAYLENGTH instruction. */ - int ARRAYLENGTH = 190; - - /** The integer value used to encode the ATHROW instruction. */ - int ATHROW = 191; - - /** The integer value used to encode the CHECKCAST instruction. */ - int CHECKCAST = 192; - - /** The integer value used to encode the INSTANCEOF instruction. */ - int INSTANCEOF = 193; - - /** The integer value used to encode the MONITORENTER instruction. */ - int MONITORENTER = 194; - - /** The integer value used to encode the MONITOREXIT instruction. */ - int MONITOREXIT = 195; - - /** The integer value used to encode the WIDE instruction. */ - int WIDE = 196; - - /** The integer value used to encode the MULTIANEWARRAY instruction. */ - int MULTIANEWARRAY = 197; - - /** The integer value used to encode the IFNULL instruction. */ - int IFNULL = 198; - - /** The integer value used to encode the IFNONNULL instruction. */ - int IFNONNULL = 199; - - /** The integer value used to encode the GOTO_W instruction. */ - int GOTO_W = 200; - - /** The integer value used to encode the JSR_W instruction. */ - int JSR_W = 201; - - /** The value of PUBLIC access and property modifier. */ + /** The bit mask of PUBLIC access and property modifier. */ int ACC_PUBLIC = 0x0001; - /** The value of PROTECTED access and property modifier. */ + /** The bit mask of PROTECTED access and property modifier. */ int ACC_PROTECTED = 0x0004; - /** The value of PRIVATE access and property modifier. */ + /** The bit mask of PRIVATE access and property modifier. */ int ACC_PRIVATE = 0x0002; - /** The value of INTERFACE access and property modifier. */ + /** The bit mask of INTERFACE access and property modifier. */ int ACC_INTERFACE = 0x0200; - /** The value of ENUM access and property modifier. */ + /** The bit mask of ENUM access and property modifier. */ int ACC_ENUM = 0x4000; - /** The value of ANNOTATION access and property modifier. */ + /** The bit mask of ANNOTATION access and property modifier. */ int ACC_ANNOTATION = 0x2000; - /** The value of SUPER access and property modifier. */ + /** The bit mask of SUPER access and property modifier. */ int ACC_SUPER = 0x0020; - /** The value of ABSTRACT access and property modifier. */ + /** The bit mask of ABSTRACT access and property modifier. */ int ACC_ABSTRACT = 0x0400; - /** The value of VOLATILE access and property modifier. */ + /** The bit mask of VOLATILE access and property modifier. */ int ACC_VOLATILE = 0x0040; - /** The value of TRANSIENT access and property modifier. */ + /** The bit mask of TRANSIENT access and property modifier. */ int ACC_TRANSIENT = 0x0080; - /** The value of SYNTHETIC access and property modifier. */ + /** The bit mask of SYNTHETIC access and property modifier. */ int ACC_SYNTHETIC = 0x1000; - /** The value of STATIC access and property modifier. */ + /** The bit mask of STATIC access and property modifier. */ int ACC_STATIC = 0x0008; - /** The value of FINAL access and property modifier. */ + /** The bit mask of FINAL access and property modifier. */ int ACC_FINAL = 0x0010; - /** The value of SYNCHRONIZED access and property modifier. */ + /** The bit mask of SYNCHRONIZED access and property modifier. */ int ACC_SYNCHRONIZED = 0x0020; - /** The value of BRIDGE access and property modifier. */ + /** The bit mask of BRIDGE access and property modifier. */ int ACC_BRIDGE = 0x0040; - /** The value of VARARGS access and property modifier. */ + /** The bit mask of VARARGS access and property modifier. */ int ACC_VARARGS = 0x0080; - /** The value of NATIVE access and property modifier. */ + /** The bit mask of NATIVE access and property modifier. */ int ACC_NATIVE = 0x0100; - /** The value of STRICT access and property modifier. */ + /** The bit mask of STRICT access and property modifier. */ int ACC_STRICT = 0x0800; - /** The value of MODULE access and property modifier. */ + /** The bit mask of MODULE access and property modifier. */ int ACC_MODULE = 0x8000; - /** The value of OPEN access and property modifier. */ + /** The bit mask of OPEN access and property modifier. */ int ACC_OPEN = 0x20; - /** The value of MANDATED access and property modifier. */ + /** The bit mask of MANDATED access and property modifier. */ int ACC_MANDATED = 0x8000; - /** The value of TRANSITIVE access and property modifier. */ + /** The bit mask of TRANSITIVE access and property modifier. */ int ACC_TRANSITIVE = 0x20; - /** The value of STATIC_PHASE access and property modifier. */ + /** The bit mask of STATIC_PHASE access and property modifier. */ int ACC_STATIC_PHASE = 0x40; - /** The value of STATEMENT {@link CharacterRangeInfo} kind. */ - int CRT_STATEMENT = 0x0001; - - /** The value of BLOCK {@link CharacterRangeInfo} kind. */ - int CRT_BLOCK = 0x0002; - - /** The value of ASSIGNMENT {@link CharacterRangeInfo} kind. */ - int CRT_ASSIGNMENT = 0x0004; - - /** The value of FLOW_CONTROLLER {@link CharacterRangeInfo} kind. */ - int CRT_FLOW_CONTROLLER = 0x0008; - - /** The value of FLOW_TARGET {@link CharacterRangeInfo} kind. */ - int CRT_FLOW_TARGET = 0x0010; - - /** The value of INVOKE {@link CharacterRangeInfo} kind. */ - int CRT_INVOKE = 0x0020; - - /** The value of CREATE {@link CharacterRangeInfo} kind. */ - int CRT_CREATE = 0x0040; - - /** The value of BRANCH_TRUE {@link CharacterRangeInfo} kind. */ - int CRT_BRANCH_TRUE = 0x0080; - - /** The value of BRANCH_FALSE {@link CharacterRangeInfo} kind. */ - int CRT_BRANCH_FALSE = 0x0100; - - /** The value of constant pool tag CLASS. */ - int TAG_CLASS = 7; - - /** The value of constant pool tag CONSTANTDYNAMIC. */ - int TAG_CONSTANTDYNAMIC = 17; - - /** The value of constant pool tag DOUBLE. */ - int TAG_DOUBLE = 6; - - /** The value of constant pool tag FIELDREF. */ - int TAG_FIELDREF = 9; - - /** The value of constant pool tag FLOAT. */ - int TAG_FLOAT = 4; - - /** The value of constant pool tag INTEGER. */ - int TAG_INTEGER = 3; - - /** The value of constant pool tag INTERFACEMETHODREF. */ - int TAG_INTERFACEMETHODREF = 11; - - /** The value of constant pool tag INVOKEDYNAMIC. */ - int TAG_INVOKEDYNAMIC = 18; - - /** The value of constant pool tag LONG. */ - int TAG_LONG = 5; - - /** The value of constant pool tag METHODHANDLE. */ - int TAG_METHODHANDLE = 15; - - /** The value of constant pool tag METHODREF. */ - int TAG_METHODREF = 10; - - /** The value of constant pool tag METHODTYPE. */ - int TAG_METHODTYPE = 16; - - /** The value of constant pool tag MODULE. */ - int TAG_MODULE = 19; - - /** The value of constant pool tag NAMEANDTYPE. */ - int TAG_NAMEANDTYPE = 12; - - /** The value of constant pool tag PACKAGE. */ - int TAG_PACKAGE = 20; - - /** The value of constant pool tag STRING. */ - int TAG_STRING = 8; - - /** The value of constant pool tag UNICODE. */ - int TAG_UNICODE = 2; - - /** The value of constant pool tag UTF8. */ - int TAG_UTF8 = 1; - - // annotation element values - - /** The value of annotation element value type AEV_BYTE. */ - int AEV_BYTE = 'B'; - - /** The value of annotation element value type AEV_CHAR. */ - int AEV_CHAR = 'C'; - - /** The value of annotation element value type AEV_DOUBLE. */ - int AEV_DOUBLE = 'D'; - - /** The value of annotation element value type AEV_FLOAT. */ - int AEV_FLOAT = 'F'; - - /** The value of annotation element value type AEV_INT. */ - int AEV_INT = 'I'; - - /** The value of annotation element value type AEV_LONG. */ - int AEV_LONG = 'J'; - - /** The value of annotation element value type AEV_SHORT. */ - int AEV_SHORT = 'S'; - - /** The value of annotation element value type AEV_BOOLEAN. */ - int AEV_BOOLEAN = 'Z'; - - /** The value of annotation element value type AEV_STRING. */ - int AEV_STRING = 's'; - - /** The value of annotation element value type AEV_ENUM. */ - int AEV_ENUM = 'e'; - - /** The value of annotation element value type AEV_CLASS. */ - int AEV_CLASS = 'c'; - - /** The value of annotation element value type AEV_ANNOTATION. */ - int AEV_ANNOTATION = '@'; - - /** The value of annotation element value type AEV_ARRAY. */ - int AEV_ARRAY = '['; - - //type annotations - - /** The value of type annotation target type CLASS_TYPE_PARAMETER. */ - int TAT_CLASS_TYPE_PARAMETER = 0x00; - - /** The value of type annotation target type METHOD_TYPE_PARAMETER. */ - int TAT_METHOD_TYPE_PARAMETER = 0x01; - - /** The value of type annotation target type CLASS_EXTENDS. */ - int TAT_CLASS_EXTENDS = 0x10; - - /** The value of type annotation target type CLASS_TYPE_PARAMETER_BOUND. */ - int TAT_CLASS_TYPE_PARAMETER_BOUND = 0x11; - - /** The value of type annotation target type METHOD_TYPE_PARAMETER_BOUND. */ - int TAT_METHOD_TYPE_PARAMETER_BOUND = 0x12; - - /** The value of type annotation target type FIELD. */ - int TAT_FIELD = 0x13; - - /** The value of type annotation target type METHOD_RETURN. */ - int TAT_METHOD_RETURN = 0x14; - - /** The value of type annotation target type METHOD_RECEIVER. */ - int TAT_METHOD_RECEIVER = 0x15; - - /** The value of type annotation target type METHOD_FORMAL_PARAMETER. */ - int TAT_METHOD_FORMAL_PARAMETER = 0x16; - - /** The value of type annotation target type THROWS. */ - int TAT_THROWS = 0x17; - - /** The value of type annotation target type LOCAL_VARIABLE. */ - int TAT_LOCAL_VARIABLE = 0x40; - - /** The value of type annotation target type RESOURCE_VARIABLE. */ - int TAT_RESOURCE_VARIABLE = 0x41; - - /** The value of type annotation target type EXCEPTION_PARAMETER. */ - int TAT_EXCEPTION_PARAMETER = 0x42; - - /** The value of type annotation target type INSTANCEOF. */ - int TAT_INSTANCEOF = 0x43; - - /** The value of type annotation target type NEW. */ - int TAT_NEW = 0x44; - - /** The value of type annotation target type CONSTRUCTOR_REFERENCE. */ - int TAT_CONSTRUCTOR_REFERENCE = 0x45; - - /** The value of type annotation target type METHOD_REFERENCE. */ - int TAT_METHOD_REFERENCE = 0x46; - - /** The value of type annotation target type CAST. */ - int TAT_CAST = 0x47; - - /** The value of type annotation target type CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT. */ - int TAT_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT = 0x48; - - /** The value of type annotation target type METHOD_INVOCATION_TYPE_ARGUMENT. */ - int TAT_METHOD_INVOCATION_TYPE_ARGUMENT = 0x49; - - /** The value of type annotation target type CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT. */ - int TAT_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = 0x4A; - - /** The value of type annotation target type METHOD_REFERENCE_TYPE_ARGUMENT. */ - int TAT_METHOD_REFERENCE_TYPE_ARGUMENT = 0x4B; - - //stackmap verification types - - /** The value of verification type TOP. */ - int VT_TOP = 0; - - /** The value of verification type INTEGER. */ - int VT_INTEGER = 1; - - /** The value of verification type FLOAT. */ - int VT_FLOAT = 2; - - /** The value of verification type DOUBLE. */ - int VT_DOUBLE = 3; - - /** The value of verification type LONG. */ - int VT_LONG = 4; - - /** The value of verification type NULL. */ - int VT_NULL = 5; - - /** The value of verification type UNINITIALIZED_THIS. */ - int VT_UNINITIALIZED_THIS = 6; - - /** The value of verification type OBJECT. */ - int VT_OBJECT = 7; - - /** The value of verification type UNINITIALIZED. */ - int VT_UNINITIALIZED = 8; - - /** The value of default class access flags */ - int DEFAULT_CLASS_FLAGS = ACC_PUBLIC; - /** The class major version of JAVA_1. */ int JAVA_1_VERSION = 45; diff --git a/src/java.base/share/classes/java/lang/classfile/Opcode.java b/src/java.base/share/classes/java/lang/classfile/Opcode.java index ab991d983453d..735510dbcea3b 100644 --- a/src/java.base/share/classes/java/lang/classfile/Opcode.java +++ b/src/java.base/share/classes/java/lang/classfile/Opcode.java @@ -24,6 +24,7 @@ */ package java.lang.classfile; +import jdk.internal.classfile.impl.RawBytecodeHelper; import jdk.internal.javac.PreviewFeature; /** @@ -40,658 +41,658 @@ public enum Opcode { /** Do nothing */ - NOP(ClassFile.NOP, 1, Kind.NOP), + NOP(RawBytecodeHelper.NOP, 1, Kind.NOP), /** Push null */ - ACONST_NULL(ClassFile.ACONST_NULL, 1, Kind.CONSTANT), + ACONST_NULL(RawBytecodeHelper.ACONST_NULL, 1, Kind.CONSTANT), /** Push int constant -1 */ - ICONST_M1(ClassFile.ICONST_M1, 1, Kind.CONSTANT), + ICONST_M1(RawBytecodeHelper.ICONST_M1, 1, Kind.CONSTANT), /** Push int constant 0 */ - ICONST_0(ClassFile.ICONST_0, 1, Kind.CONSTANT), + ICONST_0(RawBytecodeHelper.ICONST_0, 1, Kind.CONSTANT), /** Push int constant 1 */ - ICONST_1(ClassFile.ICONST_1, 1, Kind.CONSTANT), + ICONST_1(RawBytecodeHelper.ICONST_1, 1, Kind.CONSTANT), /** Push int constant 2 */ - ICONST_2(ClassFile.ICONST_2, 1, Kind.CONSTANT), + ICONST_2(RawBytecodeHelper.ICONST_2, 1, Kind.CONSTANT), /** Push int constant 3 */ - ICONST_3(ClassFile.ICONST_3, 1, Kind.CONSTANT), + ICONST_3(RawBytecodeHelper.ICONST_3, 1, Kind.CONSTANT), /** Push int constant 4 */ - ICONST_4(ClassFile.ICONST_4, 1, Kind.CONSTANT), + ICONST_4(RawBytecodeHelper.ICONST_4, 1, Kind.CONSTANT), /** Push int constant 5 */ - ICONST_5(ClassFile.ICONST_5, 1, Kind.CONSTANT), + ICONST_5(RawBytecodeHelper.ICONST_5, 1, Kind.CONSTANT), /** Push long constant 0 */ - LCONST_0(ClassFile.LCONST_0, 1, Kind.CONSTANT), + LCONST_0(RawBytecodeHelper.LCONST_0, 1, Kind.CONSTANT), /** Push long constant 1 */ - LCONST_1(ClassFile.LCONST_1, 1, Kind.CONSTANT), + LCONST_1(RawBytecodeHelper.LCONST_1, 1, Kind.CONSTANT), /** Push float constant 0 */ - FCONST_0(ClassFile.FCONST_0, 1, Kind.CONSTANT), + FCONST_0(RawBytecodeHelper.FCONST_0, 1, Kind.CONSTANT), /** Push float constant 1 */ - FCONST_1(ClassFile.FCONST_1, 1, Kind.CONSTANT), + FCONST_1(RawBytecodeHelper.FCONST_1, 1, Kind.CONSTANT), /** Push float constant 2 */ - FCONST_2(ClassFile.FCONST_2, 1, Kind.CONSTANT), + FCONST_2(RawBytecodeHelper.FCONST_2, 1, Kind.CONSTANT), /** Push double constant 0 */ - DCONST_0(ClassFile.DCONST_0, 1, Kind.CONSTANT), + DCONST_0(RawBytecodeHelper.DCONST_0, 1, Kind.CONSTANT), /** Push double constant 1 */ - DCONST_1(ClassFile.DCONST_1, 1, Kind.CONSTANT), + DCONST_1(RawBytecodeHelper.DCONST_1, 1, Kind.CONSTANT), /** Push byte */ - BIPUSH(ClassFile.BIPUSH, 2, Kind.CONSTANT), + BIPUSH(RawBytecodeHelper.BIPUSH, 2, Kind.CONSTANT), /** Push short */ - SIPUSH(ClassFile.SIPUSH, 3, Kind.CONSTANT), + SIPUSH(RawBytecodeHelper.SIPUSH, 3, Kind.CONSTANT), /** Push item from run-time constant pool */ - LDC(ClassFile.LDC, 2, Kind.CONSTANT), + LDC(RawBytecodeHelper.LDC, 2, Kind.CONSTANT), /** Push item from run-time constant pool (wide index) */ - LDC_W(ClassFile.LDC_W, 3, Kind.CONSTANT), + LDC_W(RawBytecodeHelper.LDC_W, 3, Kind.CONSTANT), /** Push long or double from run-time constant pool (wide index) */ - LDC2_W(ClassFile.LDC2_W, 3, Kind.CONSTANT), + LDC2_W(RawBytecodeHelper.LDC2_W, 3, Kind.CONSTANT), /** Load int from local variable */ - ILOAD(ClassFile.ILOAD, 2, Kind.LOAD), + ILOAD(RawBytecodeHelper.ILOAD, 2, Kind.LOAD), /** Load long from local variable */ - LLOAD(ClassFile.LLOAD, 2, Kind.LOAD), + LLOAD(RawBytecodeHelper.LLOAD, 2, Kind.LOAD), /** Load float from local variable */ - FLOAD(ClassFile.FLOAD, 2, Kind.LOAD), + FLOAD(RawBytecodeHelper.FLOAD, 2, Kind.LOAD), /** Load double from local variable */ - DLOAD(ClassFile.DLOAD, 2, Kind.LOAD), + DLOAD(RawBytecodeHelper.DLOAD, 2, Kind.LOAD), /** Load reference from local variable */ - ALOAD(ClassFile.ALOAD, 2, Kind.LOAD), + ALOAD(RawBytecodeHelper.ALOAD, 2, Kind.LOAD), /** Load int from local variable 0 */ - ILOAD_0(ClassFile.ILOAD_0, 1, Kind.LOAD), + ILOAD_0(RawBytecodeHelper.ILOAD_0, 1, Kind.LOAD), /** Load int from local variable 1 */ - ILOAD_1(ClassFile.ILOAD_1, 1, Kind.LOAD), + ILOAD_1(RawBytecodeHelper.ILOAD_1, 1, Kind.LOAD), /** Load int from local variable 2 */ - ILOAD_2(ClassFile.ILOAD_2, 1, Kind.LOAD), + ILOAD_2(RawBytecodeHelper.ILOAD_2, 1, Kind.LOAD), /** Load int from local variable3 */ - ILOAD_3(ClassFile.ILOAD_3, 1, Kind.LOAD), + ILOAD_3(RawBytecodeHelper.ILOAD_3, 1, Kind.LOAD), /** Load long from local variable 0 */ - LLOAD_0(ClassFile.LLOAD_0, 1, Kind.LOAD), + LLOAD_0(RawBytecodeHelper.LLOAD_0, 1, Kind.LOAD), /** Load long from local variable 1 */ - LLOAD_1(ClassFile.LLOAD_1, 1, Kind.LOAD), + LLOAD_1(RawBytecodeHelper.LLOAD_1, 1, Kind.LOAD), /** Load long from local variable 2 */ - LLOAD_2(ClassFile.LLOAD_2, 1, Kind.LOAD), + LLOAD_2(RawBytecodeHelper.LLOAD_2, 1, Kind.LOAD), /** Load long from local variable 3 */ - LLOAD_3(ClassFile.LLOAD_3, 1, Kind.LOAD), + LLOAD_3(RawBytecodeHelper.LLOAD_3, 1, Kind.LOAD), /** Load float from local variable 0 */ - FLOAD_0(ClassFile.FLOAD_0, 1, Kind.LOAD), + FLOAD_0(RawBytecodeHelper.FLOAD_0, 1, Kind.LOAD), /** Load float from local variable 1 */ - FLOAD_1(ClassFile.FLOAD_1, 1, Kind.LOAD), + FLOAD_1(RawBytecodeHelper.FLOAD_1, 1, Kind.LOAD), /** Load float from local variable 2 */ - FLOAD_2(ClassFile.FLOAD_2, 1, Kind.LOAD), + FLOAD_2(RawBytecodeHelper.FLOAD_2, 1, Kind.LOAD), /** Load float from local variable 3 */ - FLOAD_3(ClassFile.FLOAD_3, 1, Kind.LOAD), + FLOAD_3(RawBytecodeHelper.FLOAD_3, 1, Kind.LOAD), /** Load double from local variable 0 */ - DLOAD_0(ClassFile.DLOAD_0, 1, Kind.LOAD), + DLOAD_0(RawBytecodeHelper.DLOAD_0, 1, Kind.LOAD), /** Load double from local variable 1 */ - DLOAD_1(ClassFile.DLOAD_1, 1, Kind.LOAD), + DLOAD_1(RawBytecodeHelper.DLOAD_1, 1, Kind.LOAD), /** Load double from local variable 2 */ - DLOAD_2(ClassFile.DLOAD_2, 1, Kind.LOAD), + DLOAD_2(RawBytecodeHelper.DLOAD_2, 1, Kind.LOAD), /** Load double from local variable 3 */ - DLOAD_3(ClassFile.DLOAD_3, 1, Kind.LOAD), + DLOAD_3(RawBytecodeHelper.DLOAD_3, 1, Kind.LOAD), /** Load reference from local variable 0 */ - ALOAD_0(ClassFile.ALOAD_0, 1, Kind.LOAD), + ALOAD_0(RawBytecodeHelper.ALOAD_0, 1, Kind.LOAD), /** Load reference from local variable 1 */ - ALOAD_1(ClassFile.ALOAD_1, 1, Kind.LOAD), + ALOAD_1(RawBytecodeHelper.ALOAD_1, 1, Kind.LOAD), /** Load reference from local variable 2 */ - ALOAD_2(ClassFile.ALOAD_2, 1, Kind.LOAD), + ALOAD_2(RawBytecodeHelper.ALOAD_2, 1, Kind.LOAD), /** Load reference from local variable 3 */ - ALOAD_3(ClassFile.ALOAD_3, 1, Kind.LOAD), + ALOAD_3(RawBytecodeHelper.ALOAD_3, 1, Kind.LOAD), /** Load int from array */ - IALOAD(ClassFile.IALOAD, 1, Kind.ARRAY_LOAD), + IALOAD(RawBytecodeHelper.IALOAD, 1, Kind.ARRAY_LOAD), /** Load long from array */ - LALOAD(ClassFile.LALOAD, 1, Kind.ARRAY_LOAD), + LALOAD(RawBytecodeHelper.LALOAD, 1, Kind.ARRAY_LOAD), /** Load float from array */ - FALOAD(ClassFile.FALOAD, 1, Kind.ARRAY_LOAD), + FALOAD(RawBytecodeHelper.FALOAD, 1, Kind.ARRAY_LOAD), /** Load double from array */ - DALOAD(ClassFile.DALOAD, 1, Kind.ARRAY_LOAD), + DALOAD(RawBytecodeHelper.DALOAD, 1, Kind.ARRAY_LOAD), /** Load reference from array */ - AALOAD(ClassFile.AALOAD, 1, Kind.ARRAY_LOAD), + AALOAD(RawBytecodeHelper.AALOAD, 1, Kind.ARRAY_LOAD), /** Load byte from array */ - BALOAD(ClassFile.BALOAD, 1, Kind.ARRAY_LOAD), + BALOAD(RawBytecodeHelper.BALOAD, 1, Kind.ARRAY_LOAD), /** Load char from array */ - CALOAD(ClassFile.CALOAD, 1, Kind.ARRAY_LOAD), + CALOAD(RawBytecodeHelper.CALOAD, 1, Kind.ARRAY_LOAD), /** Load short from array */ - SALOAD(ClassFile.SALOAD, 1, Kind.ARRAY_LOAD), + SALOAD(RawBytecodeHelper.SALOAD, 1, Kind.ARRAY_LOAD), /** Store int into local variable */ - ISTORE(ClassFile.ISTORE, 2, Kind.STORE), + ISTORE(RawBytecodeHelper.ISTORE, 2, Kind.STORE), /** Store long into local variable */ - LSTORE(ClassFile.LSTORE, 2, Kind.STORE), + LSTORE(RawBytecodeHelper.LSTORE, 2, Kind.STORE), /** Store float into local variable */ - FSTORE(ClassFile.FSTORE, 2, Kind.STORE), + FSTORE(RawBytecodeHelper.FSTORE, 2, Kind.STORE), /** Store double into local variable */ - DSTORE(ClassFile.DSTORE, 2, Kind.STORE), + DSTORE(RawBytecodeHelper.DSTORE, 2, Kind.STORE), /** Store reference into local variable */ - ASTORE(ClassFile.ASTORE, 2, Kind.STORE), + ASTORE(RawBytecodeHelper.ASTORE, 2, Kind.STORE), /** Store int into local variable 0 */ - ISTORE_0(ClassFile.ISTORE_0, 1, Kind.STORE), + ISTORE_0(RawBytecodeHelper.ISTORE_0, 1, Kind.STORE), /** Store int into local variable 1 */ - ISTORE_1(ClassFile.ISTORE_1, 1, Kind.STORE), + ISTORE_1(RawBytecodeHelper.ISTORE_1, 1, Kind.STORE), /** Store int into local variable 2 */ - ISTORE_2(ClassFile.ISTORE_2, 1, Kind.STORE), + ISTORE_2(RawBytecodeHelper.ISTORE_2, 1, Kind.STORE), /** Store int into local variable 3 */ - ISTORE_3(ClassFile.ISTORE_3, 1, Kind.STORE), + ISTORE_3(RawBytecodeHelper.ISTORE_3, 1, Kind.STORE), /** Store long into local variable 0 */ - LSTORE_0(ClassFile.LSTORE_0, 1, Kind.STORE), + LSTORE_0(RawBytecodeHelper.LSTORE_0, 1, Kind.STORE), /** Store long into local variable 1 */ - LSTORE_1(ClassFile.LSTORE_1, 1, Kind.STORE), + LSTORE_1(RawBytecodeHelper.LSTORE_1, 1, Kind.STORE), /** Store long into local variable 2 */ - LSTORE_2(ClassFile.LSTORE_2, 1, Kind.STORE), + LSTORE_2(RawBytecodeHelper.LSTORE_2, 1, Kind.STORE), /** Store long into local variable 3 */ - LSTORE_3(ClassFile.LSTORE_3, 1, Kind.STORE), + LSTORE_3(RawBytecodeHelper.LSTORE_3, 1, Kind.STORE), /** Store float into local variable 0 */ - FSTORE_0(ClassFile.FSTORE_0, 1, Kind.STORE), + FSTORE_0(RawBytecodeHelper.FSTORE_0, 1, Kind.STORE), /** Store float into local variable 1 */ - FSTORE_1(ClassFile.FSTORE_1, 1, Kind.STORE), + FSTORE_1(RawBytecodeHelper.FSTORE_1, 1, Kind.STORE), /** Store float into local variable 2 */ - FSTORE_2(ClassFile.FSTORE_2, 1, Kind.STORE), + FSTORE_2(RawBytecodeHelper.FSTORE_2, 1, Kind.STORE), /** Store float into local variable 3 */ - FSTORE_3(ClassFile.FSTORE_3, 1, Kind.STORE), + FSTORE_3(RawBytecodeHelper.FSTORE_3, 1, Kind.STORE), /** Store double into local variable 0 */ - DSTORE_0(ClassFile.DSTORE_0, 1, Kind.STORE), + DSTORE_0(RawBytecodeHelper.DSTORE_0, 1, Kind.STORE), /** Store double into local variable 1 */ - DSTORE_1(ClassFile.DSTORE_1, 1, Kind.STORE), + DSTORE_1(RawBytecodeHelper.DSTORE_1, 1, Kind.STORE), /** Store double into local variable 2 */ - DSTORE_2(ClassFile.DSTORE_2, 1, Kind.STORE), + DSTORE_2(RawBytecodeHelper.DSTORE_2, 1, Kind.STORE), /** Store double into local variable 3 */ - DSTORE_3(ClassFile.DSTORE_3, 1, Kind.STORE), + DSTORE_3(RawBytecodeHelper.DSTORE_3, 1, Kind.STORE), /** Store reference into local variable 0 */ - ASTORE_0(ClassFile.ASTORE_0, 1, Kind.STORE), + ASTORE_0(RawBytecodeHelper.ASTORE_0, 1, Kind.STORE), /** Store reference into local variable 1 */ - ASTORE_1(ClassFile.ASTORE_1, 1, Kind.STORE), + ASTORE_1(RawBytecodeHelper.ASTORE_1, 1, Kind.STORE), /** Store reference into local variable 2 */ - ASTORE_2(ClassFile.ASTORE_2, 1, Kind.STORE), + ASTORE_2(RawBytecodeHelper.ASTORE_2, 1, Kind.STORE), /** Store reference into local variable 3 */ - ASTORE_3(ClassFile.ASTORE_3, 1, Kind.STORE), + ASTORE_3(RawBytecodeHelper.ASTORE_3, 1, Kind.STORE), /** Store into int array */ - IASTORE(ClassFile.IASTORE, 1, Kind.ARRAY_STORE), + IASTORE(RawBytecodeHelper.IASTORE, 1, Kind.ARRAY_STORE), /** Store into long array */ - LASTORE(ClassFile.LASTORE, 1, Kind.ARRAY_STORE), + LASTORE(RawBytecodeHelper.LASTORE, 1, Kind.ARRAY_STORE), /** Store into float array */ - FASTORE(ClassFile.FASTORE, 1, Kind.ARRAY_STORE), + FASTORE(RawBytecodeHelper.FASTORE, 1, Kind.ARRAY_STORE), /** Store into double array */ - DASTORE(ClassFile.DASTORE, 1, Kind.ARRAY_STORE), + DASTORE(RawBytecodeHelper.DASTORE, 1, Kind.ARRAY_STORE), /** Store into reference array */ - AASTORE(ClassFile.AASTORE, 1, Kind.ARRAY_STORE), + AASTORE(RawBytecodeHelper.AASTORE, 1, Kind.ARRAY_STORE), /** Store into byte array */ - BASTORE(ClassFile.BASTORE, 1, Kind.ARRAY_STORE), + BASTORE(RawBytecodeHelper.BASTORE, 1, Kind.ARRAY_STORE), /** Store into char array */ - CASTORE(ClassFile.CASTORE, 1, Kind.ARRAY_STORE), + CASTORE(RawBytecodeHelper.CASTORE, 1, Kind.ARRAY_STORE), /** Store into short array */ - SASTORE(ClassFile.SASTORE, 1, Kind.ARRAY_STORE), + SASTORE(RawBytecodeHelper.SASTORE, 1, Kind.ARRAY_STORE), /** Pop the top operand stack value */ - POP(ClassFile.POP, 1, Kind.STACK), + POP(RawBytecodeHelper.POP, 1, Kind.STACK), /** Pop the top one or two operand stack values */ - POP2(ClassFile.POP2, 1, Kind.STACK), + POP2(RawBytecodeHelper.POP2, 1, Kind.STACK), /** Duplicate the top operand stack value */ - DUP(ClassFile.DUP, 1, Kind.STACK), + DUP(RawBytecodeHelper.DUP, 1, Kind.STACK), /** Duplicate the top operand stack value and insert two values down */ - DUP_X1(ClassFile.DUP_X1, 1, Kind.STACK), + DUP_X1(RawBytecodeHelper.DUP_X1, 1, Kind.STACK), /** Duplicate the top operand stack value and insert two or three values down */ - DUP_X2(ClassFile.DUP_X2, 1, Kind.STACK), + DUP_X2(RawBytecodeHelper.DUP_X2, 1, Kind.STACK), /** Duplicate the top one or two operand stack values */ - DUP2(ClassFile.DUP2, 1, Kind.STACK), + DUP2(RawBytecodeHelper.DUP2, 1, Kind.STACK), /** Duplicate the top one or two operand stack values and insert two or three values down */ - DUP2_X1(ClassFile.DUP2_X1, 1, Kind.STACK), + DUP2_X1(RawBytecodeHelper.DUP2_X1, 1, Kind.STACK), /** Duplicate the top one or two operand stack values and insert two, three, or four values down */ - DUP2_X2(ClassFile.DUP2_X2, 1, Kind.STACK), + DUP2_X2(RawBytecodeHelper.DUP2_X2, 1, Kind.STACK), /** Swap the top two operand stack values */ - SWAP(ClassFile.SWAP, 1, Kind.STACK), + SWAP(RawBytecodeHelper.SWAP, 1, Kind.STACK), /** Add int */ - IADD(ClassFile.IADD, 1, Kind.OPERATOR), + IADD(RawBytecodeHelper.IADD, 1, Kind.OPERATOR), /** Add long */ - LADD(ClassFile.LADD, 1, Kind.OPERATOR), + LADD(RawBytecodeHelper.LADD, 1, Kind.OPERATOR), /** Add float */ - FADD(ClassFile.FADD, 1, Kind.OPERATOR), + FADD(RawBytecodeHelper.FADD, 1, Kind.OPERATOR), /** Add double */ - DADD(ClassFile.DADD, 1, Kind.OPERATOR), + DADD(RawBytecodeHelper.DADD, 1, Kind.OPERATOR), /** Subtract int */ - ISUB(ClassFile.ISUB, 1, Kind.OPERATOR), + ISUB(RawBytecodeHelper.ISUB, 1, Kind.OPERATOR), /** Subtract long */ - LSUB(ClassFile.LSUB, 1, Kind.OPERATOR), + LSUB(RawBytecodeHelper.LSUB, 1, Kind.OPERATOR), /** Subtract float */ - FSUB(ClassFile.FSUB, 1, Kind.OPERATOR), + FSUB(RawBytecodeHelper.FSUB, 1, Kind.OPERATOR), /** Subtract double */ - DSUB(ClassFile.DSUB, 1, Kind.OPERATOR), + DSUB(RawBytecodeHelper.DSUB, 1, Kind.OPERATOR), /** Multiply int */ - IMUL(ClassFile.IMUL, 1, Kind.OPERATOR), + IMUL(RawBytecodeHelper.IMUL, 1, Kind.OPERATOR), /** Multiply long */ - LMUL(ClassFile.LMUL, 1, Kind.OPERATOR), + LMUL(RawBytecodeHelper.LMUL, 1, Kind.OPERATOR), /** Multiply float */ - FMUL(ClassFile.FMUL, 1, Kind.OPERATOR), + FMUL(RawBytecodeHelper.FMUL, 1, Kind.OPERATOR), /** Multiply double */ - DMUL(ClassFile.DMUL, 1, Kind.OPERATOR), + DMUL(RawBytecodeHelper.DMUL, 1, Kind.OPERATOR), /** Divide int */ - IDIV(ClassFile.IDIV, 1, Kind.OPERATOR), + IDIV(RawBytecodeHelper.IDIV, 1, Kind.OPERATOR), /** Divide long */ - LDIV(ClassFile.LDIV, 1, Kind.OPERATOR), + LDIV(RawBytecodeHelper.LDIV, 1, Kind.OPERATOR), /** Divide float */ - FDIV(ClassFile.FDIV, 1, Kind.OPERATOR), + FDIV(RawBytecodeHelper.FDIV, 1, Kind.OPERATOR), /** Divide double */ - DDIV(ClassFile.DDIV, 1, Kind.OPERATOR), + DDIV(RawBytecodeHelper.DDIV, 1, Kind.OPERATOR), /** Remainder int */ - IREM(ClassFile.IREM, 1, Kind.OPERATOR), + IREM(RawBytecodeHelper.IREM, 1, Kind.OPERATOR), /** Remainder long */ - LREM(ClassFile.LREM, 1, Kind.OPERATOR), + LREM(RawBytecodeHelper.LREM, 1, Kind.OPERATOR), /** Remainder float */ - FREM(ClassFile.FREM, 1, Kind.OPERATOR), + FREM(RawBytecodeHelper.FREM, 1, Kind.OPERATOR), /** Remainder double */ - DREM(ClassFile.DREM, 1, Kind.OPERATOR), + DREM(RawBytecodeHelper.DREM, 1, Kind.OPERATOR), /** Negate int */ - INEG(ClassFile.INEG, 1, Kind.OPERATOR), + INEG(RawBytecodeHelper.INEG, 1, Kind.OPERATOR), /** Negate long */ - LNEG(ClassFile.LNEG, 1, Kind.OPERATOR), + LNEG(RawBytecodeHelper.LNEG, 1, Kind.OPERATOR), /** Negate float */ - FNEG(ClassFile.FNEG, 1, Kind.OPERATOR), + FNEG(RawBytecodeHelper.FNEG, 1, Kind.OPERATOR), /** Negate double */ - DNEG(ClassFile.DNEG, 1, Kind.OPERATOR), + DNEG(RawBytecodeHelper.DNEG, 1, Kind.OPERATOR), /** Shift left int */ - ISHL(ClassFile.ISHL, 1, Kind.OPERATOR), + ISHL(RawBytecodeHelper.ISHL, 1, Kind.OPERATOR), /** Shift left long */ - LSHL(ClassFile.LSHL, 1, Kind.OPERATOR), + LSHL(RawBytecodeHelper.LSHL, 1, Kind.OPERATOR), /** Shift right int */ - ISHR(ClassFile.ISHR, 1, Kind.OPERATOR), + ISHR(RawBytecodeHelper.ISHR, 1, Kind.OPERATOR), /** Shift right long */ - LSHR(ClassFile.LSHR, 1, Kind.OPERATOR), + LSHR(RawBytecodeHelper.LSHR, 1, Kind.OPERATOR), /** Logical shift right int */ - IUSHR(ClassFile.IUSHR, 1, Kind.OPERATOR), + IUSHR(RawBytecodeHelper.IUSHR, 1, Kind.OPERATOR), /** Logical shift right long */ - LUSHR(ClassFile.LUSHR, 1, Kind.OPERATOR), + LUSHR(RawBytecodeHelper.LUSHR, 1, Kind.OPERATOR), /** Boolean AND int */ - IAND(ClassFile.IAND, 1, Kind.OPERATOR), + IAND(RawBytecodeHelper.IAND, 1, Kind.OPERATOR), /** Boolean AND long */ - LAND(ClassFile.LAND, 1, Kind.OPERATOR), + LAND(RawBytecodeHelper.LAND, 1, Kind.OPERATOR), /** Boolean OR int */ - IOR(ClassFile.IOR, 1, Kind.OPERATOR), + IOR(RawBytecodeHelper.IOR, 1, Kind.OPERATOR), /** Boolean OR long */ - LOR(ClassFile.LOR, 1, Kind.OPERATOR), + LOR(RawBytecodeHelper.LOR, 1, Kind.OPERATOR), /** Boolean XOR int */ - IXOR(ClassFile.IXOR, 1, Kind.OPERATOR), + IXOR(RawBytecodeHelper.IXOR, 1, Kind.OPERATOR), /** Boolean XOR long */ - LXOR(ClassFile.LXOR, 1, Kind.OPERATOR), + LXOR(RawBytecodeHelper.LXOR, 1, Kind.OPERATOR), /** Increment local variable by constant */ - IINC(ClassFile.IINC, 3, Kind.INCREMENT), + IINC(RawBytecodeHelper.IINC, 3, Kind.INCREMENT), /** Convert int to long */ - I2L(ClassFile.I2L, 1, Kind.CONVERT), + I2L(RawBytecodeHelper.I2L, 1, Kind.CONVERT), /** Convert int to float */ - I2F(ClassFile.I2F, 1, Kind.CONVERT), + I2F(RawBytecodeHelper.I2F, 1, Kind.CONVERT), /** Convert int to double */ - I2D(ClassFile.I2D, 1, Kind.CONVERT), + I2D(RawBytecodeHelper.I2D, 1, Kind.CONVERT), /** Convert long to int */ - L2I(ClassFile.L2I, 1, Kind.CONVERT), + L2I(RawBytecodeHelper.L2I, 1, Kind.CONVERT), /** Convert long to float */ - L2F(ClassFile.L2F, 1, Kind.CONVERT), + L2F(RawBytecodeHelper.L2F, 1, Kind.CONVERT), /** Convert long to double */ - L2D(ClassFile.L2D, 1, Kind.CONVERT), + L2D(RawBytecodeHelper.L2D, 1, Kind.CONVERT), /** Convert float to int */ - F2I(ClassFile.F2I, 1, Kind.CONVERT), + F2I(RawBytecodeHelper.F2I, 1, Kind.CONVERT), /** Convert float to long */ - F2L(ClassFile.F2L, 1, Kind.CONVERT), + F2L(RawBytecodeHelper.F2L, 1, Kind.CONVERT), /** Convert float to double */ - F2D(ClassFile.F2D, 1, Kind.CONVERT), + F2D(RawBytecodeHelper.F2D, 1, Kind.CONVERT), /** Convert double to int */ - D2I(ClassFile.D2I, 1, Kind.CONVERT), + D2I(RawBytecodeHelper.D2I, 1, Kind.CONVERT), /** Convert double to long */ - D2L(ClassFile.D2L, 1, Kind.CONVERT), + D2L(RawBytecodeHelper.D2L, 1, Kind.CONVERT), /** Convert double to float */ - D2F(ClassFile.D2F, 1, Kind.CONVERT), + D2F(RawBytecodeHelper.D2F, 1, Kind.CONVERT), /** Convert int to byte */ - I2B(ClassFile.I2B, 1, Kind.CONVERT), + I2B(RawBytecodeHelper.I2B, 1, Kind.CONVERT), /** Convert int to char */ - I2C(ClassFile.I2C, 1, Kind.CONVERT), + I2C(RawBytecodeHelper.I2C, 1, Kind.CONVERT), /** Convert int to short */ - I2S(ClassFile.I2S, 1, Kind.CONVERT), + I2S(RawBytecodeHelper.I2S, 1, Kind.CONVERT), /** Compare long */ - LCMP(ClassFile.LCMP, 1, Kind.OPERATOR), + LCMP(RawBytecodeHelper.LCMP, 1, Kind.OPERATOR), /** Compare float */ - FCMPL(ClassFile.FCMPL, 1, Kind.OPERATOR), + FCMPL(RawBytecodeHelper.FCMPL, 1, Kind.OPERATOR), /** Compare float */ - FCMPG(ClassFile.FCMPG, 1, Kind.OPERATOR), + FCMPG(RawBytecodeHelper.FCMPG, 1, Kind.OPERATOR), /** Compare double */ - DCMPL(ClassFile.DCMPL, 1, Kind.OPERATOR), + DCMPL(RawBytecodeHelper.DCMPL, 1, Kind.OPERATOR), /** Compare double */ - DCMPG(ClassFile.DCMPG, 1, Kind.OPERATOR), + DCMPG(RawBytecodeHelper.DCMPG, 1, Kind.OPERATOR), /** Branch if int comparison with zero succeeds */ - IFEQ(ClassFile.IFEQ, 3, Kind.BRANCH), + IFEQ(RawBytecodeHelper.IFEQ, 3, Kind.BRANCH), /** Branch if int comparison with zero succeeds */ - IFNE(ClassFile.IFNE, 3, Kind.BRANCH), + IFNE(RawBytecodeHelper.IFNE, 3, Kind.BRANCH), /** Branch if int comparison with zero succeeds */ - IFLT(ClassFile.IFLT, 3, Kind.BRANCH), + IFLT(RawBytecodeHelper.IFLT, 3, Kind.BRANCH), /** Branch if int comparison with zero succeeds */ - IFGE(ClassFile.IFGE, 3, Kind.BRANCH), + IFGE(RawBytecodeHelper.IFGE, 3, Kind.BRANCH), /** Branch if int comparison with zero succeeds */ - IFGT(ClassFile.IFGT, 3, Kind.BRANCH), + IFGT(RawBytecodeHelper.IFGT, 3, Kind.BRANCH), /** Branch if int comparison with zero succeeds */ - IFLE(ClassFile.IFLE, 3, Kind.BRANCH), + IFLE(RawBytecodeHelper.IFLE, 3, Kind.BRANCH), /** Branch if int comparison succeeds */ - IF_ICMPEQ(ClassFile.IF_ICMPEQ, 3, Kind.BRANCH), + IF_ICMPEQ(RawBytecodeHelper.IF_ICMPEQ, 3, Kind.BRANCH), /** Branch if int comparison succeeds */ - IF_ICMPNE(ClassFile.IF_ICMPNE, 3, Kind.BRANCH), + IF_ICMPNE(RawBytecodeHelper.IF_ICMPNE, 3, Kind.BRANCH), /** Branch if int comparison succeeds */ - IF_ICMPLT(ClassFile.IF_ICMPLT, 3, Kind.BRANCH), + IF_ICMPLT(RawBytecodeHelper.IF_ICMPLT, 3, Kind.BRANCH), /** Branch if int comparison succeeds */ - IF_ICMPGE(ClassFile.IF_ICMPGE, 3, Kind.BRANCH), + IF_ICMPGE(RawBytecodeHelper.IF_ICMPGE, 3, Kind.BRANCH), /** Branch if int comparison succeeds */ - IF_ICMPGT(ClassFile.IF_ICMPGT, 3, Kind.BRANCH), + IF_ICMPGT(RawBytecodeHelper.IF_ICMPGT, 3, Kind.BRANCH), /** Branch if int comparison succeeds */ - IF_ICMPLE(ClassFile.IF_ICMPLE, 3, Kind.BRANCH), + IF_ICMPLE(RawBytecodeHelper.IF_ICMPLE, 3, Kind.BRANCH), /** Branch if reference comparison succeeds */ - IF_ACMPEQ(ClassFile.IF_ACMPEQ, 3, Kind.BRANCH), + IF_ACMPEQ(RawBytecodeHelper.IF_ACMPEQ, 3, Kind.BRANCH), /** Branch if reference comparison succeeds */ - IF_ACMPNE(ClassFile.IF_ACMPNE, 3, Kind.BRANCH), + IF_ACMPNE(RawBytecodeHelper.IF_ACMPNE, 3, Kind.BRANCH), /** Branch always */ - GOTO(ClassFile.GOTO, 3, Kind.BRANCH), + GOTO(RawBytecodeHelper.GOTO, 3, Kind.BRANCH), /** * Jump subroutine is discontinued opcode * @see java.lang.classfile.instruction.DiscontinuedInstruction */ - JSR(ClassFile.JSR, 3, Kind.DISCONTINUED_JSR), + JSR(RawBytecodeHelper.JSR, 3, Kind.DISCONTINUED_JSR), /** * Return from subroutine is discontinued opcode * @see java.lang.classfile.instruction.DiscontinuedInstruction */ - RET(ClassFile.RET, 2, Kind.DISCONTINUED_RET), + RET(RawBytecodeHelper.RET, 2, Kind.DISCONTINUED_RET), /** Access jump table by index and jump */ - TABLESWITCH(ClassFile.TABLESWITCH, -1, Kind.TABLE_SWITCH), + TABLESWITCH(RawBytecodeHelper.TABLESWITCH, -1, Kind.TABLE_SWITCH), /** Access jump table by key match and jump */ - LOOKUPSWITCH(ClassFile.LOOKUPSWITCH, -1, Kind.LOOKUP_SWITCH), + LOOKUPSWITCH(RawBytecodeHelper.LOOKUPSWITCH, -1, Kind.LOOKUP_SWITCH), /** Return int from method */ - IRETURN(ClassFile.IRETURN, 1, Kind.RETURN), + IRETURN(RawBytecodeHelper.IRETURN, 1, Kind.RETURN), /** Return long from method */ - LRETURN(ClassFile.LRETURN, 1, Kind.RETURN), + LRETURN(RawBytecodeHelper.LRETURN, 1, Kind.RETURN), /** Return float from method */ - FRETURN(ClassFile.FRETURN, 1, Kind.RETURN), + FRETURN(RawBytecodeHelper.FRETURN, 1, Kind.RETURN), /** Return double from method */ - DRETURN(ClassFile.DRETURN, 1, Kind.RETURN), + DRETURN(RawBytecodeHelper.DRETURN, 1, Kind.RETURN), /** Return reference from method */ - ARETURN(ClassFile.ARETURN, 1, Kind.RETURN), + ARETURN(RawBytecodeHelper.ARETURN, 1, Kind.RETURN), /** Return void from method */ - RETURN(ClassFile.RETURN, 1, Kind.RETURN), + RETURN(RawBytecodeHelper.RETURN, 1, Kind.RETURN), /** Get static field from class */ - GETSTATIC(ClassFile.GETSTATIC, 3, Kind.FIELD_ACCESS), + GETSTATIC(RawBytecodeHelper.GETSTATIC, 3, Kind.FIELD_ACCESS), /** Set static field in class */ - PUTSTATIC(ClassFile.PUTSTATIC, 3, Kind.FIELD_ACCESS), + PUTSTATIC(RawBytecodeHelper.PUTSTATIC, 3, Kind.FIELD_ACCESS), /** Fetch field from object */ - GETFIELD(ClassFile.GETFIELD, 3, Kind.FIELD_ACCESS), + GETFIELD(RawBytecodeHelper.GETFIELD, 3, Kind.FIELD_ACCESS), /** Set field in object */ - PUTFIELD(ClassFile.PUTFIELD, 3, Kind.FIELD_ACCESS), + PUTFIELD(RawBytecodeHelper.PUTFIELD, 3, Kind.FIELD_ACCESS), /** Invoke instance method; dispatch based on class */ - INVOKEVIRTUAL(ClassFile.INVOKEVIRTUAL, 3, Kind.INVOKE), + INVOKEVIRTUAL(RawBytecodeHelper.INVOKEVIRTUAL, 3, Kind.INVOKE), /** * Invoke instance method; direct invocation of instance initialization * methods and methods of the current class and its supertypes */ - INVOKESPECIAL(ClassFile.INVOKESPECIAL, 3, Kind.INVOKE), + INVOKESPECIAL(RawBytecodeHelper.INVOKESPECIAL, 3, Kind.INVOKE), /** Invoke a class (static) method */ - INVOKESTATIC(ClassFile.INVOKESTATIC, 3, Kind.INVOKE), + INVOKESTATIC(RawBytecodeHelper.INVOKESTATIC, 3, Kind.INVOKE), /** Invoke interface method */ - INVOKEINTERFACE(ClassFile.INVOKEINTERFACE, 5, Kind.INVOKE), + INVOKEINTERFACE(RawBytecodeHelper.INVOKEINTERFACE, 5, Kind.INVOKE), /** Invoke a dynamically-computed call site */ - INVOKEDYNAMIC(ClassFile.INVOKEDYNAMIC, 5, Kind.INVOKE_DYNAMIC), + INVOKEDYNAMIC(RawBytecodeHelper.INVOKEDYNAMIC, 5, Kind.INVOKE_DYNAMIC), /** Create new object */ - NEW(ClassFile.NEW, 3, Kind.NEW_OBJECT), + NEW(RawBytecodeHelper.NEW, 3, Kind.NEW_OBJECT), /** Create new array */ - NEWARRAY(ClassFile.NEWARRAY, 2, Kind.NEW_PRIMITIVE_ARRAY), + NEWARRAY(RawBytecodeHelper.NEWARRAY, 2, Kind.NEW_PRIMITIVE_ARRAY), /** Create new array of reference */ - ANEWARRAY(ClassFile.ANEWARRAY, 3, Kind.NEW_REF_ARRAY), + ANEWARRAY(RawBytecodeHelper.ANEWARRAY, 3, Kind.NEW_REF_ARRAY), /** Get length of array */ - ARRAYLENGTH(ClassFile.ARRAYLENGTH, 1, Kind.OPERATOR), + ARRAYLENGTH(RawBytecodeHelper.ARRAYLENGTH, 1, Kind.OPERATOR), /** Throw exception or error */ - ATHROW(ClassFile.ATHROW, 1, Kind.THROW_EXCEPTION), + ATHROW(RawBytecodeHelper.ATHROW, 1, Kind.THROW_EXCEPTION), /** Check whether object is of given type */ - CHECKCAST(ClassFile.CHECKCAST, 3, Kind.TYPE_CHECK), + CHECKCAST(RawBytecodeHelper.CHECKCAST, 3, Kind.TYPE_CHECK), /** Determine if object is of given type */ - INSTANCEOF(ClassFile.INSTANCEOF, 3, Kind.TYPE_CHECK), + INSTANCEOF(RawBytecodeHelper.INSTANCEOF, 3, Kind.TYPE_CHECK), /** Enter monitor for object */ - MONITORENTER(ClassFile.MONITORENTER, 1, Kind.MONITOR), + MONITORENTER(RawBytecodeHelper.MONITORENTER, 1, Kind.MONITOR), /** Exit monitor for object */ - MONITOREXIT(ClassFile.MONITOREXIT, 1, Kind.MONITOR), + MONITOREXIT(RawBytecodeHelper.MONITOREXIT, 1, Kind.MONITOR), /** Create new multidimensional array */ - MULTIANEWARRAY(ClassFile.MULTIANEWARRAY, 4, Kind.NEW_MULTI_ARRAY), + MULTIANEWARRAY(RawBytecodeHelper.MULTIANEWARRAY, 4, Kind.NEW_MULTI_ARRAY), /** Branch if reference is null */ - IFNULL(ClassFile.IFNULL, 3, Kind.BRANCH), + IFNULL(RawBytecodeHelper.IFNULL, 3, Kind.BRANCH), /** Branch if reference not null */ - IFNONNULL(ClassFile.IFNONNULL, 3, Kind.BRANCH), + IFNONNULL(RawBytecodeHelper.IFNONNULL, 3, Kind.BRANCH), /** Branch always (wide index) */ - GOTO_W(ClassFile.GOTO_W, 5, Kind.BRANCH), + GOTO_W(RawBytecodeHelper.GOTO_W, 5, Kind.BRANCH), /** * Jump subroutine (wide index) is discontinued opcode * @see java.lang.classfile.instruction.DiscontinuedInstruction */ - JSR_W(ClassFile.JSR_W, 5, Kind.DISCONTINUED_JSR), + JSR_W(RawBytecodeHelper.JSR_W, 5, Kind.DISCONTINUED_JSR), /** Load int from local variable (wide index) */ - ILOAD_W((ClassFile.WIDE << 8) | ClassFile.ILOAD, 4, Kind.LOAD), + ILOAD_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.ILOAD, 4, Kind.LOAD), /** Load long from local variable (wide index) */ - LLOAD_W((ClassFile.WIDE << 8) | ClassFile.LLOAD, 4, Kind.LOAD), + LLOAD_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.LLOAD, 4, Kind.LOAD), /** Load float from local variable (wide index) */ - FLOAD_W((ClassFile.WIDE << 8) | ClassFile.FLOAD, 4, Kind.LOAD), + FLOAD_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.FLOAD, 4, Kind.LOAD), /** Load double from local variable (wide index) */ - DLOAD_W((ClassFile.WIDE << 8) | ClassFile.DLOAD, 4, Kind.LOAD), + DLOAD_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.DLOAD, 4, Kind.LOAD), /** Load reference from local variable (wide index) */ - ALOAD_W((ClassFile.WIDE << 8) | ClassFile.ALOAD, 4, Kind.LOAD), + ALOAD_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.ALOAD, 4, Kind.LOAD), /** Store int into local variable (wide index) */ - ISTORE_W((ClassFile.WIDE << 8) | ClassFile.ISTORE, 4, Kind.STORE), + ISTORE_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.ISTORE, 4, Kind.STORE), /** Store long into local variable (wide index) */ - LSTORE_W((ClassFile.WIDE << 8) | ClassFile.LSTORE, 4, Kind.STORE), + LSTORE_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.LSTORE, 4, Kind.STORE), /** Store float into local variable (wide index) */ - FSTORE_W((ClassFile.WIDE << 8) | ClassFile.FSTORE, 4, Kind.STORE), + FSTORE_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.FSTORE, 4, Kind.STORE), /** Store double into local variable (wide index) */ - DSTORE_W((ClassFile.WIDE << 8) | ClassFile.DSTORE, 4, Kind.STORE), + DSTORE_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.DSTORE, 4, Kind.STORE), /** Store reference into local variable (wide index) */ - ASTORE_W((ClassFile.WIDE << 8) | ClassFile.ASTORE, 4, Kind.STORE), + ASTORE_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.ASTORE, 4, Kind.STORE), /** * Return from subroutine (wide index) is discontinued opcode * @see java.lang.classfile.instruction.DiscontinuedInstruction */ - RET_W((ClassFile.WIDE << 8) | ClassFile.RET, 4, Kind.DISCONTINUED_RET), + RET_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.RET, 4, Kind.DISCONTINUED_RET), /** Increment local variable by constant (wide index) */ - IINC_W((ClassFile.WIDE << 8) | ClassFile.IINC, 6, Kind.INCREMENT); + IINC_W((RawBytecodeHelper.WIDE << 8) | RawBytecodeHelper.IINC, 6, Kind.INCREMENT); /** * Kinds of opcodes. @@ -1085,13 +1086,13 @@ public static enum Kind { /** * {@return the opcode value} For {@linkplain #isWide() wide} pseudo-opcodes, returns the - * first 2 bytes of the instruction, which are the {@code wide} opcode and the functional - * local variable opcode, as a U2 value. + * first 2 bytes of the instruction, which are the wide opcode {@code 196} ({@code 0xC4}) + * and the functional opcode, as a U2 value. */ public int bytecode() { return bytecode; } /** - * {@return true if this is a pseudo-opcode modified by {@code wide}} + * {@return true if this is a pseudo-opcode modified by wide opcode} * * @see #ILOAD_W * @see #LLOAD_W diff --git a/src/java.base/share/classes/java/lang/classfile/TypeAnnotation.java b/src/java.base/share/classes/java/lang/classfile/TypeAnnotation.java index b6c9aec76a1a3..139c8eef835dc 100644 --- a/src/java.base/share/classes/java/lang/classfile/TypeAnnotation.java +++ b/src/java.base/share/classes/java/lang/classfile/TypeAnnotation.java @@ -31,31 +31,10 @@ import java.lang.classfile.attribute.RuntimeVisibleTypeAnnotationsAttribute; import jdk.internal.classfile.impl.TargetInfoImpl; import jdk.internal.classfile.impl.UnboundAttribute; - -import static java.lang.classfile.ClassFile.TAT_CAST; -import static java.lang.classfile.ClassFile.TAT_CLASS_EXTENDS; -import static java.lang.classfile.ClassFile.TAT_CLASS_TYPE_PARAMETER; -import static java.lang.classfile.ClassFile.TAT_CLASS_TYPE_PARAMETER_BOUND; -import static java.lang.classfile.ClassFile.TAT_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT; -import static java.lang.classfile.ClassFile.TAT_CONSTRUCTOR_REFERENCE; -import static java.lang.classfile.ClassFile.TAT_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT; -import static java.lang.classfile.ClassFile.TAT_EXCEPTION_PARAMETER; -import static java.lang.classfile.ClassFile.TAT_FIELD; -import static java.lang.classfile.ClassFile.TAT_INSTANCEOF; -import static java.lang.classfile.ClassFile.TAT_LOCAL_VARIABLE; -import static java.lang.classfile.ClassFile.TAT_METHOD_FORMAL_PARAMETER; -import static java.lang.classfile.ClassFile.TAT_METHOD_INVOCATION_TYPE_ARGUMENT; -import static java.lang.classfile.ClassFile.TAT_METHOD_RECEIVER; -import static java.lang.classfile.ClassFile.TAT_METHOD_REFERENCE; -import static java.lang.classfile.ClassFile.TAT_METHOD_REFERENCE_TYPE_ARGUMENT; -import static java.lang.classfile.ClassFile.TAT_METHOD_RETURN; -import static java.lang.classfile.ClassFile.TAT_METHOD_TYPE_PARAMETER; -import static java.lang.classfile.ClassFile.TAT_METHOD_TYPE_PARAMETER_BOUND; -import static java.lang.classfile.ClassFile.TAT_NEW; -import static java.lang.classfile.ClassFile.TAT_RESOURCE_VARIABLE; -import static java.lang.classfile.ClassFile.TAT_THROWS; import jdk.internal.javac.PreviewFeature; +import static java.lang.classfile.TypeAnnotation.TargetInfo.*; + /** * Models a {@code type_annotation} structure (JVMS {@jvms 4.7.20}). This model * indicates the annotated type within a declaration or expression and the part @@ -87,70 +66,70 @@ public sealed interface TypeAnnotation @PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API) public enum TargetType { /** For annotations on a class type parameter declaration. */ - CLASS_TYPE_PARAMETER(TAT_CLASS_TYPE_PARAMETER, 1), + CLASS_TYPE_PARAMETER(TARGET_CLASS_TYPE_PARAMETER, 1), /** For annotations on a method type parameter declaration. */ - METHOD_TYPE_PARAMETER(TAT_METHOD_TYPE_PARAMETER, 1), + METHOD_TYPE_PARAMETER(TARGET_METHOD_TYPE_PARAMETER, 1), /** For annotations on the type of an "extends" or "implements" clause. */ - CLASS_EXTENDS(TAT_CLASS_EXTENDS, 2), + CLASS_EXTENDS(TARGET_CLASS_EXTENDS, 2), /** For annotations on a bound of a type parameter of a class. */ - CLASS_TYPE_PARAMETER_BOUND(TAT_CLASS_TYPE_PARAMETER_BOUND, 2), + CLASS_TYPE_PARAMETER_BOUND(TARGET_CLASS_TYPE_PARAMETER_BOUND, 2), /** For annotations on a bound of a type parameter of a method. */ - METHOD_TYPE_PARAMETER_BOUND(TAT_METHOD_TYPE_PARAMETER_BOUND, 2), + METHOD_TYPE_PARAMETER_BOUND(TARGET_METHOD_TYPE_PARAMETER_BOUND, 2), /** For annotations on a field. */ - FIELD(TAT_FIELD, 0), + FIELD(TARGET_FIELD, 0), /** For annotations on a method return type. */ - METHOD_RETURN(TAT_METHOD_RETURN, 0), + METHOD_RETURN(TARGET_METHOD_RETURN, 0), /** For annotations on the method receiver. */ - METHOD_RECEIVER(TAT_METHOD_RECEIVER, 0), + METHOD_RECEIVER(TARGET_METHOD_RECEIVER, 0), /** For annotations on a method parameter. */ - METHOD_FORMAL_PARAMETER(TAT_METHOD_FORMAL_PARAMETER, 1), + METHOD_FORMAL_PARAMETER(TARGET_METHOD_FORMAL_PARAMETER, 1), /** For annotations on a throws clause in a method declaration. */ - THROWS(TAT_THROWS, 2), + THROWS(TARGET_THROWS, 2), /** For annotations on a local variable. */ - LOCAL_VARIABLE(TAT_LOCAL_VARIABLE, -1), + LOCAL_VARIABLE(TARGET_LOCAL_VARIABLE, -1), /** For annotations on a resource variable. */ - RESOURCE_VARIABLE(TAT_RESOURCE_VARIABLE, -1), + RESOURCE_VARIABLE(TARGET_RESOURCE_VARIABLE, -1), /** For annotations on an exception parameter. */ - EXCEPTION_PARAMETER(TAT_EXCEPTION_PARAMETER, 2), + EXCEPTION_PARAMETER(TARGET_EXCEPTION_PARAMETER, 2), /** For annotations on a type test. */ - INSTANCEOF(TAT_INSTANCEOF, 2), + INSTANCEOF(TARGET_INSTANCEOF, 2), /** For annotations on an object creation expression. */ - NEW(TAT_NEW, 2), + NEW(TARGET_NEW, 2), /** For annotations on a constructor reference receiver. */ - CONSTRUCTOR_REFERENCE(TAT_CONSTRUCTOR_REFERENCE, 2), + CONSTRUCTOR_REFERENCE(TARGET_CONSTRUCTOR_REFERENCE, 2), /** For annotations on a method reference receiver. */ - METHOD_REFERENCE(TAT_METHOD_REFERENCE, 2), + METHOD_REFERENCE(TARGET_METHOD_REFERENCE, 2), /** For annotations on a typecast. */ - CAST(TAT_CAST, 3), + CAST(TARGET_CAST, 3), /** For annotations on a type argument of an object creation expression. */ - CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT(TAT_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT, 3), + CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT(TARGET_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT, 3), /** For annotations on a type argument of a method call. */ - METHOD_INVOCATION_TYPE_ARGUMENT(TAT_METHOD_INVOCATION_TYPE_ARGUMENT, 3), + METHOD_INVOCATION_TYPE_ARGUMENT(TARGET_METHOD_INVOCATION_TYPE_ARGUMENT, 3), /** For annotations on a type argument of a constructor reference. */ - CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT(TAT_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT, 3), + CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT(TARGET_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT, 3), /** For annotations on a type argument of a method reference. */ - METHOD_REFERENCE_TYPE_ARGUMENT(TAT_METHOD_REFERENCE_TYPE_ARGUMENT, 3); + METHOD_REFERENCE_TYPE_ARGUMENT(TARGET_METHOD_REFERENCE_TYPE_ARGUMENT, 3); private final int targetTypeValue; private final int sizeIfFixed; @@ -162,6 +141,11 @@ private TargetType(int targetTypeValue, int sizeIfFixed) { /** * {@return the target type value} + * + * @apiNote + * {@code TARGET_}-prefixed constants in {@link TargetInfo}, such as {@link + * TargetInfo#TARGET_CLASS_TYPE_PARAMETER}, describe the possible return + * values of this method. */ public int targetTypeValue() { return targetTypeValue; @@ -214,6 +198,146 @@ static TypeAnnotation of(TargetInfo targetInfo, List targetPa @PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API) sealed interface TargetInfo { + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER}. + */ + int TARGET_CLASS_TYPE_PARAMETER = 0x00; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER}. + */ + int TARGET_METHOD_TYPE_PARAMETER = 0x01; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#CLASS_EXTENDS CLASS_EXTENDS}. + */ + int TARGET_CLASS_EXTENDS = 0x10; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#CLASS_TYPE_PARAMETER_BOUND + * CLASS_TYPE_PARAMETER_BOUND}. + */ + int TARGET_CLASS_TYPE_PARAMETER_BOUND = 0x11; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#METHOD_TYPE_PARAMETER_BOUND + * METHOD_TYPE_PARAMETER_BOUND}. + */ + int TARGET_METHOD_TYPE_PARAMETER_BOUND = 0x12; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#FIELD FIELD}. + */ + int TARGET_FIELD = 0x13; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#METHOD_RETURN METHOD_RETURN}. + */ + int TARGET_METHOD_RETURN = 0x14; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#METHOD_RECEIVER METHOD_RECEIVER}. + */ + int TARGET_METHOD_RECEIVER = 0x15; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#METHOD_FORMAL_PARAMETER + * METHOD_FORMAL_PARAMETER}. + */ + int TARGET_METHOD_FORMAL_PARAMETER = 0x16; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#THROWS THROWS}. + */ + int TARGET_THROWS = 0x17; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#LOCAL_VARIABLE LOCAL_VARIABLE}. + */ + int TARGET_LOCAL_VARIABLE = 0x40; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#RESOURCE_VARIABLE RESOURCE_VARIABLE}. + */ + int TARGET_RESOURCE_VARIABLE = 0x41; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#EXCEPTION_PARAMETER EXCEPTION_PARAMETER}. + */ + int TARGET_EXCEPTION_PARAMETER = 0x42; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#INSTANCEOF INSTANCEOF}. + */ + int TARGET_INSTANCEOF = 0x43; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#NEW NEW}. + */ + int TARGET_NEW = 0x44; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#CONSTRUCTOR_REFERENCE + * CONSTRUCTOR_REFERENCE}. + */ + int TARGET_CONSTRUCTOR_REFERENCE = 0x45; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#METHOD_REFERENCE METHOD_REFERENCE}. + */ + int TARGET_METHOD_REFERENCE = 0x46; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#CAST CAST}. + */ + int TARGET_CAST = 0x47; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT + * CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT}. + */ + int TARGET_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT = 0x48; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#METHOD_INVOCATION_TYPE_ARGUMENT + * METHOD_INVOCATION_TYPE_ARGUMENT}. + */ + int TARGET_METHOD_INVOCATION_TYPE_ARGUMENT = 0x49; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT + * CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}. + */ + int TARGET_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = 0x4A; + + /** + * The {@linkplain TargetType#targetTypeValue() value} of type annotation {@linkplain + * #targetType target type} {@link TargetType#METHOD_REFERENCE_TYPE_ARGUMENT + * METHOD_REFERENCE_TYPE_ARGUMENT}. + */ + int TARGET_METHOD_REFERENCE_TYPE_ARGUMENT = 0x4B; + /** * {@return the type of the target} */ diff --git a/src/java.base/share/classes/java/lang/classfile/attribute/CharacterRangeInfo.java b/src/java.base/share/classes/java/lang/classfile/attribute/CharacterRangeInfo.java index 37abcb027132e..126ba1037cefb 100644 --- a/src/java.base/share/classes/java/lang/classfile/attribute/CharacterRangeInfo.java +++ b/src/java.base/share/classes/java/lang/classfile/attribute/CharacterRangeInfo.java @@ -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 @@ -24,6 +24,8 @@ */ package java.lang.classfile.attribute; +import java.lang.classfile.instruction.CharacterRange; + import jdk.internal.classfile.impl.UnboundAttribute; import jdk.internal.javac.PreviewFeature; @@ -70,17 +72,17 @@ public sealed interface CharacterRangeInfo * The value of the flags item describes the kind of range. Multiple flags * may be set within flags. *
      - *
    • {@link java.lang.classfile.ClassFile#CRT_STATEMENT} Range is a Statement + *
    • {@link CharacterRange#FLAG_STATEMENT} Range is a Statement * (except ExpressionStatement), StatementExpression {@jls 14.8}, as well as each * VariableDeclaratorId = VariableInitializer of * LocalVariableDeclarationStatement {@jls 14.4} or FieldDeclaration {@jls 8.3} in the * grammar. - *
    • {@link java.lang.classfile.ClassFile#CRT_BLOCK} Range is a Block in the + *
    • {@link CharacterRange#FLAG_BLOCK} Range is a Block in the * grammar. - *
    • {@link java.lang.classfile.ClassFile#CRT_ASSIGNMENT} Range is an assignment + *
    • {@link CharacterRange#FLAG_ASSIGNMENT} Range is an assignment * expression - Expression1 AssignmentOperator Expression1 in the grammar as * well as increment and decrement expressions (both prefix and postfix). - *
    • {@link java.lang.classfile.ClassFile#CRT_FLOW_CONTROLLER} An expression + *
    • {@link CharacterRange#FLAG_FLOW_CONTROLLER} An expression * whose value will effect control flow. {@code Flowcon} in the following: *
            * if ( Flowcon ) Statement [else Statement]
      @@ -92,7 +94,7 @@ public sealed interface CharacterRangeInfo
            * Flowcon && Expression3
            * Flowcon ? Expression : Expression1
            * 
      - *
    • {@link java.lang.classfile.ClassFile#CRT_FLOW_TARGET} Statement or + *
    • {@link CharacterRange#FLAG_FLOW_TARGET} Statement or * expression effected by a CRT_FLOW_CONTROLLER. {@code Flowtarg} in the following: *
            * if ( Flowcon ) Flowtarg [else Flowtarg]
      @@ -103,11 +105,11 @@ public sealed interface CharacterRangeInfo
            * Flowcon && Flowtarg
            * Flowcon ? Flowtarg : Flowtarg
            * 
      - *
    • {@link java.lang.classfile.ClassFile#CRT_INVOKE} Method invocation. For + *
    • {@link CharacterRange#FLAG_INVOKE} Method invocation. For * example: Identifier Arguments. - *
    • {@link java.lang.classfile.ClassFile#CRT_CREATE} New object creation. For + *
    • {@link CharacterRange#FLAG_CREATE} New object creation. For * example: new Creator. - *
    • {@link java.lang.classfile.ClassFile#CRT_BRANCH_TRUE} A condition encoded + *
    • {@link CharacterRange#FLAG_BRANCH_TRUE} A condition encoded * in the branch instruction immediately contained in the code range for * this item is not inverted towards the corresponding branch condition in * the source code. I.e. actual jump occurs if and only if the the source @@ -119,7 +121,7 @@ public sealed interface CharacterRangeInfo * if<cond>, ifnonull, ifnull or goto. CRT_BRANCH_TRUE and * CRT_BRANCH_FALSE are special kinds of entries that can be used to * determine what branch of a condition was chosen during the runtime. - *
    • {@link java.lang.classfile.ClassFile#CRT_BRANCH_FALSE} A condition encoded + *
    • {@link CharacterRange#FLAG_BRANCH_FALSE} A condition encoded * in the branch instruction immediately contained in the code range for * this item is inverted towards the corresponding branch condition in the * source code. I.e. actual jump occurs if and only if the the source code @@ -134,6 +136,7 @@ public sealed interface CharacterRangeInfo * All bits of the flags item not assigned above are reserved for future use. They should be set to zero in generated class files and should be ignored by Java virtual machine implementations. * * @return the flags + * @see CharacterRange#flags() */ int flags(); diff --git a/src/java.base/share/classes/java/lang/classfile/attribute/StackMapFrameInfo.java b/src/java.base/share/classes/java/lang/classfile/attribute/StackMapFrameInfo.java index 46caa66ef9adf..3415c89174ae9 100644 --- a/src/java.base/share/classes/java/lang/classfile/attribute/StackMapFrameInfo.java +++ b/src/java.base/share/classes/java/lang/classfile/attribute/StackMapFrameInfo.java @@ -32,7 +32,6 @@ import java.lang.classfile.constantpool.ClassEntry; import jdk.internal.classfile.impl.StackMapDecoder; import jdk.internal.classfile.impl.TemporaryConstantPool; -import static java.lang.classfile.ClassFile.*; import jdk.internal.javac.PreviewFeature; /** @@ -85,8 +84,39 @@ public static StackMapFrameInfo of(Label target, @PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API) sealed interface VerificationTypeInfo { + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#TOP TOP}. */ + int ITEM_TOP = 0; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#INTEGER INTEGER}. */ + int ITEM_INTEGER = 1; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#FLOAT FLOAT}. */ + int ITEM_FLOAT = 2; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#DOUBLE DOUBLE}. */ + int ITEM_DOUBLE = 3; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#LONG LONG}. */ + int ITEM_LONG = 4; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#NULL NULL}. */ + int ITEM_NULL = 5; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#UNINITIALIZED_THIS UNINITIALIZED_THIS}. */ + int ITEM_UNINITIALIZED_THIS = 6; + + /** The {@link #tag() tag} for verification type info {@link ObjectVerificationTypeInfo OBJECT}. */ + int ITEM_OBJECT = 7; + + /** The {@link #tag() tag} for verification type info {@link UninitializedVerificationTypeInfo UNINITIALIZED}. */ + int ITEM_UNINITIALIZED = 8; + /** * {@return the tag of the type info} + * + * @apiNote + * {@code ITEM_}-prefixed constants in this class, such as {@link #ITEM_TOP}, describe the + * possible return values of this method. */ int tag(); } @@ -100,25 +130,25 @@ sealed interface VerificationTypeInfo { public enum SimpleVerificationTypeInfo implements VerificationTypeInfo { /** verification type top */ - ITEM_TOP(VT_TOP), + TOP(ITEM_TOP), /** verification type int */ - ITEM_INTEGER(VT_INTEGER), + INTEGER(ITEM_INTEGER), /** verification type float */ - ITEM_FLOAT(VT_FLOAT), + FLOAT(ITEM_FLOAT), /** verification type double */ - ITEM_DOUBLE(VT_DOUBLE), + DOUBLE(ITEM_DOUBLE), /** verification type long */ - ITEM_LONG(VT_LONG), + LONG(ITEM_LONG), /** verification type null */ - ITEM_NULL(VT_NULL), + NULL(ITEM_NULL), /** verification type uninitializedThis */ - ITEM_UNINITIALIZED_THIS(VT_UNINITIALIZED_THIS); + UNINITIALIZED_THIS(ITEM_UNINITIALIZED_THIS); private final int tag; @@ -134,7 +164,7 @@ public int tag() { } /** - * A stack value for an object type. + * A stack value for an object type. Its {@link #tag() tag} is {@value #ITEM_OBJECT}. * * @since 22 */ @@ -173,7 +203,7 @@ default ClassDesc classSymbol() { } /** - * An uninitialized stack value. + * An uninitialized stack value. Its {@link #tag() tag} is {@value #ITEM_UNINITIALIZED}. * * @since 22 */ diff --git a/src/java.base/share/classes/java/lang/classfile/constantpool/PoolEntry.java b/src/java.base/share/classes/java/lang/classfile/constantpool/PoolEntry.java index c8b74a139280e..d2af4c7c11ae5 100644 --- a/src/java.base/share/classes/java/lang/classfile/constantpool/PoolEntry.java +++ b/src/java.base/share/classes/java/lang/classfile/constantpool/PoolEntry.java @@ -38,6 +38,57 @@ public sealed interface PoolEntry LoadableConstantEntry, MemberRefEntry, ModuleEntry, NameAndTypeEntry, PackageEntry { + /** The {@linkplain #tag tag} for {@link ClassEntry CONSTANT_Class} constant kind. */ + int TAG_CLASS = 7; + + /** The {@linkplain #tag tag} for {@link DoubleEntry CONSTANT_Double} constant kind. */ + int TAG_DOUBLE = 6; + + /** The {@linkplain #tag tag} for {@link ConstantDynamicEntry CONSTANT_Dynamic} constant kind. */ + int TAG_DYNAMIC = 17; + + /** The {@linkplain #tag tag} for {@link FieldRefEntry CONSTANT_Fieldref} constant kind. */ + int TAG_FIELDREF = 9; + + /** The {@linkplain #tag tag} for {@link FloatEntry CONSTANT_Float} constant kind. */ + int TAG_FLOAT = 4; + + /** The {@linkplain #tag tag} for {@link IntegerEntry CONSTANT_Integer} constant kind. */ + int TAG_INTEGER = 3; + + /** The {@linkplain #tag tag} for {@link InterfaceMethodRefEntry CONSTANT_InterfaceMethodref} constant kind. */ + int TAG_INTERFACE_METHODREF = 11; + + /** The {@linkplain #tag tag} for {@link InvokeDynamicEntry CONSTANT_InvokeDynamic} constant kind. */ + int TAG_INVOKE_DYNAMIC = 18; + + /** The {@linkplain #tag tag} for {@link LongEntry CONSTANT_Long} constant kind. */ + int TAG_LONG = 5; + + /** The {@linkplain #tag tag} for {@link MethodHandleEntry CONSTANT_MethodHandle} constant kind. */ + int TAG_METHOD_HANDLE = 15; + + /** The {@linkplain #tag tag} for {@link MethodRefEntry CONSTANT_Methodref} constant kind. */ + int TAG_METHODREF = 10; + + /** The {@linkplain #tag tag} for {@link MethodTypeEntry CONSTANT_MethodType} constant kind. */ + int TAG_METHOD_TYPE = 16; + + /** The {@linkplain #tag tag} for {@link ModuleEntry CONSTANT_Module} constant kind. */ + int TAG_MODULE = 19; + + /** The {@linkplain #tag tag} for {@link NameAndTypeEntry CONSTANT_NameAndType} constant kind. */ + int TAG_NAME_AND_TYPE = 12; + + /** The {@linkplain #tag tag} for {@link PackageEntry CONSTANT_Package} constant kind. */ + int TAG_PACKAGE = 20; + + /** The {@linkplain #tag tag} for {@link StringEntry CONSTANT_String} constant kind. */ + int TAG_STRING = 8; + + /** The {@linkplain #tag tag} for {@link Utf8Entry CONSTANT_Utf8} constant kind. */ + int TAG_UTF8 = 1; + /** * {@return the constant pool this entry is from} */ @@ -45,6 +96,10 @@ public sealed interface PoolEntry /** * {@return the constant pool tag that describes the type of this entry} + * + * @apiNote + * {@code TAG_}-prefixed constants in this class, such as {@link #TAG_UTF8}, + * describe the possible return values of this method. */ byte tag(); diff --git a/src/java.base/share/classes/java/lang/classfile/instruction/CharacterRange.java b/src/java.base/share/classes/java/lang/classfile/instruction/CharacterRange.java index 89a54caeaf2fe..fca3279cd2228 100644 --- a/src/java.base/share/classes/java/lang/classfile/instruction/CharacterRange.java +++ b/src/java.base/share/classes/java/lang/classfile/instruction/CharacterRange.java @@ -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,6 +29,7 @@ import java.lang.classfile.CodeModel; import java.lang.classfile.Label; import java.lang.classfile.PseudoInstruction; +import java.lang.classfile.attribute.CharacterRangeInfo; import java.lang.classfile.attribute.CharacterRangeTableAttribute; import jdk.internal.classfile.impl.AbstractPseudoInstruction; import jdk.internal.classfile.impl.BoundCharacterRange; @@ -45,6 +46,34 @@ @PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API) public sealed interface CharacterRange extends PseudoInstruction permits AbstractPseudoInstruction.UnboundCharacterRange, BoundCharacterRange { + + /** The bit mask of STATEMENT {@link CharacterRangeInfo} kind. */ + int FLAG_STATEMENT = 0x0001; + + /** The bit mask of BLOCK {@link CharacterRangeInfo} kind. */ + int FLAG_BLOCK = 0x0002; + + /** The bit mask of ASSIGNMENT {@link CharacterRangeInfo} kind. */ + int FLAG_ASSIGNMENT = 0x0004; + + /** The bit mask of FLOW_CONTROLLER {@link CharacterRangeInfo} kind. */ + int FLAG_FLOW_CONTROLLER = 0x0008; + + /** The bit mask of FLOW_TARGET {@link CharacterRangeInfo} kind. */ + int FLAG_FLOW_TARGET = 0x0010; + + /** The bit mask of INVOKE {@link CharacterRangeInfo} kind. */ + int FLAG_INVOKE = 0x0020; + + /** The bit mask of CREATE {@link CharacterRangeInfo} kind. */ + int FLAG_CREATE = 0x0040; + + /** The bit mask of BRANCH_TRUE {@link CharacterRangeInfo} kind. */ + int FLAG_BRANCH_TRUE = 0x0080; + + /** The bit mask of BRANCH_FALSE {@link CharacterRangeInfo} kind. */ + int FLAG_BRANCH_FALSE = 0x0100; + /** * {@return the start of the instruction range} */ @@ -75,15 +104,15 @@ public sealed interface CharacterRange extends PseudoInstruction * A flags word, indicating the kind of range. Multiple flag bits * may be set. Valid flags include: *
        - *
      • {@link java.lang.classfile.ClassFile#CRT_STATEMENT} - *
      • {@link java.lang.classfile.ClassFile#CRT_BLOCK} - *
      • {@link java.lang.classfile.ClassFile#CRT_ASSIGNMENT} - *
      • {@link java.lang.classfile.ClassFile#CRT_FLOW_CONTROLLER} - *
      • {@link java.lang.classfile.ClassFile#CRT_FLOW_TARGET} - *
      • {@link java.lang.classfile.ClassFile#CRT_INVOKE} - *
      • {@link java.lang.classfile.ClassFile#CRT_CREATE} - *
      • {@link java.lang.classfile.ClassFile#CRT_BRANCH_TRUE} - *
      • {@link java.lang.classfile.ClassFile#CRT_BRANCH_FALSE} + *
      • {@link #FLAG_STATEMENT} + *
      • {@link #FLAG_BLOCK} + *
      • {@link #FLAG_ASSIGNMENT} + *
      • {@link #FLAG_FLOW_CONTROLLER} + *
      • {@link #FLAG_FLOW_TARGET} + *
      • {@link #FLAG_INVOKE} + *
      • {@link #FLAG_CREATE} + *
      • {@link #FLAG_BRANCH_TRUE} + *
      • {@link #FLAG_BRANCH_FALSE} *
      * * @see java.lang.classfile.attribute.CharacterRangeInfo#flags() diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractInstruction.java b/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractInstruction.java index 48c0cb7685702..edcd6a7abff25 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractInstruction.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractInstruction.java @@ -24,11 +24,11 @@ */ package jdk.internal.classfile.impl; +import java.lang.classfile.constantpool.PoolEntry; import java.lang.constant.ConstantDesc; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.lang.classfile.ClassFile; import java.lang.classfile.Instruction; import java.lang.classfile.constantpool.ClassEntry; import java.lang.classfile.instruction.SwitchCase; @@ -421,7 +421,7 @@ public MemberRefEntry method() { @Override public boolean isInterface() { - return method().tag() == ClassFile.TAG_INTERFACEMETHODREF; + return method().tag() == PoolEntry.TAG_INTERFACE_METHODREF; } @Override 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 8498e77cb36bc..1d8d298857a7b 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 @@ -30,7 +30,6 @@ import java.nio.charset.StandardCharsets; import java.util.Arrays; -import java.lang.classfile.ClassFile; import java.lang.classfile.constantpool.ClassEntry; import java.lang.classfile.constantpool.ConstantDynamicEntry; import java.lang.classfile.constantpool.ConstantPool; @@ -57,8 +56,6 @@ import jdk.internal.util.ArraysSupport; import jdk.internal.vm.annotation.Stable; -import static java.lang.classfile.ClassFile.*; - public abstract sealed class AbstractPoolEntry { /* Invariant: a {CP,BSM} entry for pool P refer only to {CP,BSM} entries @@ -92,7 +89,7 @@ static int hashClassFromUtf8(boolean isArray, Utf8EntryImpl content) { } static int hashClassFromDescriptor(int descriptorHash) { - return hash1(ClassFile.TAG_CLASS, descriptorHash); + return hash1(PoolEntry.TAG_CLASS, descriptorHash); } static boolean isArrayDescriptor(Utf8EntryImpl cs) { @@ -570,17 +567,17 @@ public static final class ClassEntryImpl extends AbstractNamedEntry implements C super(cpm, TAG_CLASS, index, name); } - @Override - public byte tag() { - return TAG_CLASS; - } - ClassEntryImpl(ConstantPool cpm, int index, Utf8EntryImpl name, int hash, ClassDesc sym) { - super(cpm, ClassFile.TAG_CLASS, index, name); + super(cpm, TAG_CLASS, index, name); this.hash = hash; this.sym = sym; } + @Override + public byte tag() { + return TAG_CLASS; + } + @Override public ClassEntry clone(ConstantPoolBuilder cp) { return ((SplitConstantPool) cp).cloneClassEntry(this); @@ -696,12 +693,12 @@ public static final class NameAndTypeEntryImpl extends AbstractRefsEntry elements) implements Annotation { public AnnotationImpl { @@ -62,7 +60,7 @@ public record OfStringImpl(Utf8Entry constant) implements AnnotationValue.OfString { @Override public char tag() { - return AEV_STRING; + return TAG_STRING; } @Override @@ -75,7 +73,7 @@ public record OfDoubleImpl(DoubleEntry constant) implements AnnotationValue.OfDouble { @Override public char tag() { - return AEV_DOUBLE; + return TAG_DOUBLE; } @Override @@ -88,7 +86,7 @@ public record OfFloatImpl(FloatEntry constant) implements AnnotationValue.OfFloat { @Override public char tag() { - return AEV_FLOAT; + return TAG_FLOAT; } @Override @@ -101,7 +99,7 @@ public record OfLongImpl(LongEntry constant) implements AnnotationValue.OfLong { @Override public char tag() { - return AEV_LONG; + return TAG_LONG; } @Override @@ -114,7 +112,7 @@ public record OfIntImpl(IntegerEntry constant) implements AnnotationValue.OfInt { @Override public char tag() { - return AEV_INT; + return TAG_INT; } @Override @@ -127,7 +125,7 @@ public record OfShortImpl(IntegerEntry constant) implements AnnotationValue.OfShort { @Override public char tag() { - return AEV_SHORT; + return TAG_SHORT; } @Override @@ -140,7 +138,7 @@ public record OfCharImpl(IntegerEntry constant) implements AnnotationValue.OfChar { @Override public char tag() { - return AEV_CHAR; + return TAG_CHAR; } @Override @@ -153,7 +151,7 @@ public record OfByteImpl(IntegerEntry constant) implements AnnotationValue.OfByte { @Override public char tag() { - return AEV_BYTE; + return TAG_BYTE; } @Override @@ -166,7 +164,7 @@ public record OfBooleanImpl(IntegerEntry constant) implements AnnotationValue.OfBoolean { @Override public char tag() { - return AEV_BOOLEAN; + return TAG_BOOLEAN; } @Override @@ -183,7 +181,7 @@ public record OfArrayImpl(List values) @Override public char tag() { - return AEV_ARRAY; + return TAG_ARRAY; } } @@ -191,7 +189,7 @@ public record OfEnumImpl(Utf8Entry className, Utf8Entry constantName) implements AnnotationValue.OfEnum { @Override public char tag() { - return AEV_ENUM; + return TAG_ENUM; } } @@ -199,7 +197,7 @@ public record OfAnnotationImpl(Annotation annotation) implements AnnotationValue.OfAnnotation { @Override public char tag() { - return AEV_ANNOTATION; + return TAG_ANNOTATION; } } @@ -207,7 +205,7 @@ public record OfClassImpl(Utf8Entry className) implements AnnotationValue.OfClass { @Override public char tag() { - return AEV_CLASS; + return TAG_CLASS; } } } diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/AnnotationReader.java b/src/java.base/share/classes/jdk/internal/classfile/impl/AnnotationReader.java index 69511131b3700..e33012ef18353 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/AnnotationReader.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/AnnotationReader.java @@ -32,7 +32,8 @@ import java.lang.classfile.ClassReader; import java.lang.classfile.constantpool.*; import java.lang.classfile.TypeAnnotation; -import static java.lang.classfile.ClassFile.*; + +import static java.lang.classfile.AnnotationValue.*; import static java.lang.classfile.TypeAnnotation.TargetInfo.*; import java.util.List; @@ -59,20 +60,20 @@ public static AnnotationValue readElementValue(ClassReader classReader, int p) { char tag = (char) classReader.readU1(p); ++p; return switch (tag) { - case AEV_BYTE -> new AnnotationImpl.OfByteImpl(classReader.readEntry(p, IntegerEntry.class)); - case AEV_CHAR -> new AnnotationImpl.OfCharImpl(classReader.readEntry(p, IntegerEntry.class)); - case AEV_DOUBLE -> new AnnotationImpl.OfDoubleImpl(classReader.readEntry(p, DoubleEntry.class)); - case AEV_FLOAT -> new AnnotationImpl.OfFloatImpl(classReader.readEntry(p, FloatEntry.class)); - case AEV_INT -> new AnnotationImpl.OfIntImpl(classReader.readEntry(p, IntegerEntry.class)); - case AEV_LONG -> new AnnotationImpl.OfLongImpl(classReader.readEntry(p, LongEntry.class)); - case AEV_SHORT -> new AnnotationImpl.OfShortImpl(classReader.readEntry(p, IntegerEntry.class)); - case AEV_BOOLEAN -> new AnnotationImpl.OfBooleanImpl(classReader.readEntry(p, IntegerEntry.class)); - case AEV_STRING -> new AnnotationImpl.OfStringImpl(classReader.readEntry(p, Utf8Entry.class)); - case AEV_ENUM -> new AnnotationImpl.OfEnumImpl(classReader.readEntry(p, Utf8Entry.class), + case TAG_BYTE -> new AnnotationImpl.OfByteImpl(classReader.readEntry(p, IntegerEntry.class)); + case TAG_CHAR -> new AnnotationImpl.OfCharImpl(classReader.readEntry(p, IntegerEntry.class)); + case TAG_DOUBLE -> new AnnotationImpl.OfDoubleImpl(classReader.readEntry(p, DoubleEntry.class)); + case TAG_FLOAT -> new AnnotationImpl.OfFloatImpl(classReader.readEntry(p, FloatEntry.class)); + case TAG_INT -> new AnnotationImpl.OfIntImpl(classReader.readEntry(p, IntegerEntry.class)); + case TAG_LONG -> new AnnotationImpl.OfLongImpl(classReader.readEntry(p, LongEntry.class)); + case TAG_SHORT -> new AnnotationImpl.OfShortImpl(classReader.readEntry(p, IntegerEntry.class)); + case TAG_BOOLEAN -> new AnnotationImpl.OfBooleanImpl(classReader.readEntry(p, IntegerEntry.class)); + case TAG_STRING -> new AnnotationImpl.OfStringImpl(classReader.readEntry(p, Utf8Entry.class)); + case TAG_ENUM -> new AnnotationImpl.OfEnumImpl(classReader.readEntry(p, Utf8Entry.class), classReader.readEntry(p + 2, Utf8Entry.class)); - case AEV_CLASS -> new AnnotationImpl.OfClassImpl(classReader.readEntry(p, Utf8Entry.class)); - case AEV_ANNOTATION -> new AnnotationImpl.OfAnnotationImpl(readAnnotation(classReader, p)); - case AEV_ARRAY -> { + case TAG_CLASS -> new AnnotationImpl.OfClassImpl(classReader.readEntry(p, Utf8Entry.class)); + case TAG_ANNOTATION -> new AnnotationImpl.OfAnnotationImpl(readAnnotation(classReader, p)); + case TAG_ARRAY -> { int numValues = classReader.readU2(p); p += 2; var values = new Object[numValues]; @@ -179,49 +180,49 @@ private static Label getLabel(LabelContext lc, int bciOffset, int targetType, in private static TypeAnnotation readTypeAnnotation(ClassReader classReader, int p, LabelContext lc) { int targetType = classReader.readU1(p++); var targetInfo = switch (targetType) { - case TAT_CLASS_TYPE_PARAMETER -> + case TARGET_CLASS_TYPE_PARAMETER -> ofClassTypeParameter(classReader.readU1(p)); - case TAT_METHOD_TYPE_PARAMETER -> + case TARGET_METHOD_TYPE_PARAMETER -> ofMethodTypeParameter(classReader.readU1(p)); - case TAT_CLASS_EXTENDS -> + case TARGET_CLASS_EXTENDS -> ofClassExtends(classReader.readU2(p)); - case TAT_CLASS_TYPE_PARAMETER_BOUND -> + case TARGET_CLASS_TYPE_PARAMETER_BOUND -> ofClassTypeParameterBound(classReader.readU1(p), classReader.readU1(p + 1)); - case TAT_METHOD_TYPE_PARAMETER_BOUND -> + case TARGET_METHOD_TYPE_PARAMETER_BOUND -> ofMethodTypeParameterBound(classReader.readU1(p), classReader.readU1(p + 1)); - case TAT_FIELD -> + case TARGET_FIELD -> ofField(); - case TAT_METHOD_RETURN -> + case TARGET_METHOD_RETURN -> ofMethodReturn(); - case TAT_METHOD_RECEIVER -> + case TARGET_METHOD_RECEIVER -> ofMethodReceiver(); - case TAT_METHOD_FORMAL_PARAMETER -> + case TARGET_METHOD_FORMAL_PARAMETER -> ofMethodFormalParameter(classReader.readU1(p)); - case TAT_THROWS -> + case TARGET_THROWS -> ofThrows(classReader.readU2(p)); - case TAT_LOCAL_VARIABLE -> + case TARGET_LOCAL_VARIABLE -> ofLocalVariable(readLocalVarEntries(classReader, p, lc, targetType)); - case TAT_RESOURCE_VARIABLE -> + case TARGET_RESOURCE_VARIABLE -> ofResourceVariable(readLocalVarEntries(classReader, p, lc, targetType)); - case TAT_EXCEPTION_PARAMETER -> + case TARGET_EXCEPTION_PARAMETER -> ofExceptionParameter(classReader.readU2(p)); - case TAT_INSTANCEOF -> + case TARGET_INSTANCEOF -> ofInstanceofExpr(getLabel(lc, classReader.readU2(p), targetType, p)); - case TAT_NEW -> + case TARGET_NEW -> ofNewExpr(getLabel(lc, classReader.readU2(p), targetType, p)); - case TAT_CONSTRUCTOR_REFERENCE -> + case TARGET_CONSTRUCTOR_REFERENCE -> ofConstructorReference(getLabel(lc, classReader.readU2(p), targetType, p)); - case TAT_METHOD_REFERENCE -> + case TARGET_METHOD_REFERENCE -> ofMethodReference(getLabel(lc, classReader.readU2(p), targetType, p)); - case TAT_CAST -> + case TARGET_CAST -> ofCastExpr(getLabel(lc, classReader.readU2(p), targetType, p), classReader.readU1(p + 2)); - case TAT_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT -> + case TARGET_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT -> ofConstructorInvocationTypeArgument(getLabel(lc, classReader.readU2(p), targetType, p), classReader.readU1(p + 2)); - case TAT_METHOD_INVOCATION_TYPE_ARGUMENT -> + case TARGET_METHOD_INVOCATION_TYPE_ARGUMENT -> ofMethodInvocationTypeArgument(getLabel(lc, classReader.readU2(p), targetType, p), classReader.readU1(p + 2)); - case TAT_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT -> + case TARGET_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT -> ofConstructorReferenceTypeArgument(getLabel(lc, classReader.readU2(p), targetType, p), classReader.readU1(p + 2)); - case TAT_METHOD_REFERENCE_TYPE_ARGUMENT -> + case TARGET_METHOD_REFERENCE_TYPE_ARGUMENT -> ofMethodReferenceTypeArgument(getLabel(lc, classReader.readU2(p), targetType, p), classReader.readU1(p + 2)); default -> throw new IllegalArgumentException("Unexpected targetType '%d' in TypeAnnotation, pos = %d".formatted(targetType, p - 1)); @@ -362,16 +363,16 @@ public static void writeAnnotationValue(BufWriterImpl buf, AnnotationValue value var tag = value.tag(); buf.writeU1(tag); switch (value.tag()) { - case AEV_BOOLEAN, AEV_BYTE, AEV_CHAR, AEV_DOUBLE, AEV_FLOAT, AEV_INT, AEV_LONG, AEV_SHORT, AEV_STRING -> + case TAG_BOOLEAN, TAG_BYTE, TAG_CHAR, TAG_DOUBLE, TAG_FLOAT, TAG_INT, TAG_LONG, TAG_SHORT, TAG_STRING -> buf.writeIndex(((AnnotationValue.OfConstant) value).constant()); - case AEV_CLASS -> buf.writeIndex(((AnnotationValue.OfClass) value).className()); - case AEV_ENUM -> { + case TAG_CLASS -> buf.writeIndex(((AnnotationValue.OfClass) value).className()); + case TAG_ENUM -> { var enumValue = (AnnotationValue.OfEnum) value; buf.writeIndex(enumValue.className()); buf.writeIndex(enumValue.constantName()); } - case AEV_ANNOTATION -> writeAnnotation(buf, ((AnnotationValue.OfAnnotation) value).annotation()); - case AEV_ARRAY -> { + case TAG_ANNOTATION -> writeAnnotation(buf, ((AnnotationValue.OfAnnotation) value).annotation()); + case TAG_ARRAY -> { var array = ((AnnotationValue.OfArray) value).values(); buf.writeU2(array.size()); for (var e : array) { diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/BytecodeHelpers.java b/src/java.base/share/classes/jdk/internal/classfile/impl/BytecodeHelpers.java index 75991531c319f..a5b4b55b05b27 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/BytecodeHelpers.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/BytecodeHelpers.java @@ -46,7 +46,7 @@ import java.lang.classfile.constantpool.MethodHandleEntry; import java.lang.classfile.constantpool.NameAndTypeEntry; -import static java.lang.classfile.ClassFile.*; +import static jdk.internal.classfile.impl.RawBytecodeHelper.*; /** * Note: This class switches on opcode.bytecode for code size diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/ClassHierarchyImpl.java b/src/java.base/share/classes/jdk/internal/classfile/impl/ClassHierarchyImpl.java index 6765bdee3bdac..34e6f5f7c1aa7 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/ClassHierarchyImpl.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/ClassHierarchyImpl.java @@ -40,6 +40,7 @@ import static java.lang.constant.ConstantDescs.CD_Object; import static java.lang.classfile.ClassFile.*; +import static java.lang.classfile.constantpool.PoolEntry.*; import static java.util.Objects.requireNonNull; import static jdk.internal.constant.ConstantUtils.referenceClassDesc; @@ -174,10 +175,10 @@ public ClassHierarchyResolver.ClassHierarchyInfo getClassInfo(ClassDesc classDes switch (tag = in.readUnsignedByte()) { case TAG_UTF8 -> cpStrings[i] = in.readUTF(); case TAG_CLASS -> cpClasses[i] = in.readUnsignedShort(); - case TAG_STRING, TAG_METHODTYPE, TAG_MODULE, TAG_PACKAGE -> in.skipBytes(2); - case TAG_METHODHANDLE -> in.skipBytes(3); - case TAG_INTEGER, TAG_FLOAT, TAG_FIELDREF, TAG_METHODREF, TAG_INTERFACEMETHODREF, - TAG_NAMEANDTYPE, TAG_CONSTANTDYNAMIC, TAG_INVOKEDYNAMIC -> in.skipBytes(4); + case TAG_STRING, TAG_METHOD_TYPE, TAG_MODULE, TAG_PACKAGE -> in.skipBytes(2); + case TAG_METHOD_HANDLE -> in.skipBytes(3); + case TAG_INTEGER, TAG_FLOAT, TAG_FIELDREF, TAG_METHODREF, TAG_INTERFACE_METHODREF, + TAG_NAME_AND_TYPE, TAG_DYNAMIC, TAG_INVOKE_DYNAMIC -> in.skipBytes(4); case TAG_LONG, TAG_DOUBLE -> { in.skipBytes(8); i++; diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/ClassPrinterImpl.java b/src/java.base/share/classes/jdk/internal/classfile/impl/ClassPrinterImpl.java index 837cf3366be83..02026b1acf33d 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/ClassPrinterImpl.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/ClassPrinterImpl.java @@ -58,9 +58,9 @@ import java.lang.classfile.constantpool.*; import java.lang.classfile.instruction.*; -import static java.lang.classfile.ClassFile.*; import java.lang.classfile.CompoundElement; import java.lang.classfile.FieldModel; +import static java.lang.classfile.constantpool.PoolEntry.*; import static jdk.internal.classfile.impl.ClassPrinterImpl.Style.*; public final class ClassPrinterImpl { @@ -536,21 +536,21 @@ private static Stream convertVTIs(CodeAttribute lr, List { switch (s) { - case ITEM_DOUBLE -> { + case DOUBLE -> { ret.accept("double"); ret.accept("double2"); } - case ITEM_FLOAT -> + case FLOAT -> ret.accept("float"); - case ITEM_INTEGER -> + case INTEGER -> ret.accept("int"); - case ITEM_LONG -> { + case LONG -> { ret.accept("long"); ret.accept("long2"); } - case ITEM_NULL -> ret.accept("null"); - case ITEM_TOP -> ret.accept("?"); - case ITEM_UNINITIALIZED_THIS -> ret.accept("THIS"); + case NULL -> ret.accept("null"); + case TOP -> ret.accept("?"); + case UNINITIALIZED_THIS -> ret.accept("THIS"); } } case ObjectVerificationTypeInfo o -> @@ -603,12 +603,12 @@ private static Node[] constantPoolToTree(ConstantPool cp, Verbosity verbosity) { case TAG_STRING -> "String"; case TAG_FIELDREF -> "Fieldref"; case TAG_METHODREF -> "Methodref"; - case TAG_INTERFACEMETHODREF -> "InterfaceMethodref"; - case TAG_NAMEANDTYPE -> "NameAndType"; - case TAG_METHODHANDLE -> "MethodHandle"; - case TAG_METHODTYPE -> "MethodType"; - case TAG_CONSTANTDYNAMIC -> "Dynamic"; - case TAG_INVOKEDYNAMIC -> "InvokeDynamic"; + case TAG_INTERFACE_METHODREF -> "InterfaceMethodref"; + case TAG_NAME_AND_TYPE -> "NameAndType"; + case TAG_METHOD_HANDLE -> "MethodHandle"; + case TAG_METHOD_TYPE -> "MethodType"; + case TAG_DYNAMIC -> "Dynamic"; + case TAG_INVOKE_DYNAMIC -> "InvokeDynamic"; case TAG_MODULE -> "Module"; case TAG_PACKAGE -> "Package"; default -> throw new AssertionError("Unknown CP tag: " + e.tag()); diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/ClassReaderImpl.java b/src/java.base/share/classes/jdk/internal/classfile/impl/ClassReaderImpl.java index 6a4b0cd486f07..2ef39504e9b74 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/ClassReaderImpl.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/ClassReaderImpl.java @@ -36,23 +36,7 @@ import java.lang.classfile.attribute.BootstrapMethodsAttribute; import java.lang.classfile.constantpool.*; -import static java.lang.classfile.ClassFile.TAG_CLASS; -import static java.lang.classfile.ClassFile.TAG_CONSTANTDYNAMIC; -import static java.lang.classfile.ClassFile.TAG_DOUBLE; -import static java.lang.classfile.ClassFile.TAG_FIELDREF; -import static java.lang.classfile.ClassFile.TAG_FLOAT; -import static java.lang.classfile.ClassFile.TAG_INTEGER; -import static java.lang.classfile.ClassFile.TAG_INTERFACEMETHODREF; -import static java.lang.classfile.ClassFile.TAG_INVOKEDYNAMIC; -import static java.lang.classfile.ClassFile.TAG_LONG; -import static java.lang.classfile.ClassFile.TAG_METHODHANDLE; -import static java.lang.classfile.ClassFile.TAG_METHODREF; -import static java.lang.classfile.ClassFile.TAG_METHODTYPE; -import static java.lang.classfile.ClassFile.TAG_MODULE; -import static java.lang.classfile.ClassFile.TAG_NAMEANDTYPE; -import static java.lang.classfile.ClassFile.TAG_PACKAGE; -import static java.lang.classfile.ClassFile.TAG_STRING; -import static java.lang.classfile.ClassFile.TAG_UTF8; +import static java.lang.classfile.constantpool.PoolEntry.*; public final class ClassReaderImpl implements ClassReader { @@ -98,15 +82,15 @@ public final class ClassReaderImpl ++p; switch (tag) { // 2 - case TAG_CLASS, TAG_METHODTYPE, TAG_MODULE, TAG_STRING, TAG_PACKAGE -> p += 2; + case TAG_CLASS, TAG_METHOD_TYPE, TAG_MODULE, TAG_STRING, TAG_PACKAGE -> p += 2; // 3 - case TAG_METHODHANDLE -> p += 3; + case TAG_METHOD_HANDLE -> p += 3; // 4 - case TAG_CONSTANTDYNAMIC, TAG_FIELDREF, TAG_FLOAT, TAG_INTEGER, - TAG_INTERFACEMETHODREF, TAG_INVOKEDYNAMIC, TAG_METHODREF, - TAG_NAMEANDTYPE -> p += 4; + case TAG_DYNAMIC, TAG_FIELDREF, TAG_FLOAT, TAG_INTEGER, + TAG_INTERFACE_METHODREF, TAG_INVOKE_DYNAMIC, TAG_METHODREF, + TAG_NAME_AND_TYPE -> p += 4; // 8 case TAG_DOUBLE, TAG_LONG -> { @@ -354,12 +338,12 @@ private static boolean checkTag(int tag, Class cls) { case TAG_STRING -> AbstractPoolEntry.StringEntryImpl.class; case TAG_FIELDREF -> AbstractPoolEntry.FieldRefEntryImpl.class; case TAG_METHODREF -> AbstractPoolEntry.MethodRefEntryImpl.class; - case TAG_INTERFACEMETHODREF -> AbstractPoolEntry.InterfaceMethodRefEntryImpl.class; - case TAG_NAMEANDTYPE -> AbstractPoolEntry.NameAndTypeEntryImpl.class; - case TAG_METHODHANDLE -> AbstractPoolEntry.MethodHandleEntryImpl.class; - case TAG_METHODTYPE -> AbstractPoolEntry.MethodTypeEntryImpl.class; - case TAG_CONSTANTDYNAMIC -> AbstractPoolEntry.ConstantDynamicEntryImpl.class; - case TAG_INVOKEDYNAMIC -> AbstractPoolEntry.InvokeDynamicEntryImpl.class; + case TAG_INTERFACE_METHODREF -> AbstractPoolEntry.InterfaceMethodRefEntryImpl.class; + case TAG_NAME_AND_TYPE -> AbstractPoolEntry.NameAndTypeEntryImpl.class; + case TAG_METHOD_HANDLE -> AbstractPoolEntry.MethodHandleEntryImpl.class; + case TAG_METHOD_TYPE -> AbstractPoolEntry.MethodTypeEntryImpl.class; + case TAG_DYNAMIC -> AbstractPoolEntry.ConstantDynamicEntryImpl.class; + case TAG_INVOKE_DYNAMIC -> AbstractPoolEntry.InvokeDynamicEntryImpl.class; case TAG_MODULE -> AbstractPoolEntry.ModuleEntryImpl.class; case TAG_PACKAGE -> AbstractPoolEntry.PackageEntryImpl.class; default -> null; @@ -402,15 +386,15 @@ public T entryByIndex(int index, Class cls) { readEntry(q + 2, AbstractPoolEntry.NameAndTypeEntryImpl.class)); case TAG_METHODREF -> new AbstractPoolEntry.MethodRefEntryImpl(this, index, readEntry(q, AbstractPoolEntry.ClassEntryImpl.class), readEntry(q + 2, AbstractPoolEntry.NameAndTypeEntryImpl.class)); - case TAG_INTERFACEMETHODREF -> new AbstractPoolEntry.InterfaceMethodRefEntryImpl(this, index, readEntry(q, AbstractPoolEntry.ClassEntryImpl.class), + case TAG_INTERFACE_METHODREF -> new AbstractPoolEntry.InterfaceMethodRefEntryImpl(this, index, readEntry(q, AbstractPoolEntry.ClassEntryImpl.class), readEntry(q + 2, AbstractPoolEntry.NameAndTypeEntryImpl.class)); - case TAG_NAMEANDTYPE -> new AbstractPoolEntry.NameAndTypeEntryImpl(this, index, readEntry(q, AbstractPoolEntry.Utf8EntryImpl.class), + case TAG_NAME_AND_TYPE -> new AbstractPoolEntry.NameAndTypeEntryImpl(this, index, readEntry(q, AbstractPoolEntry.Utf8EntryImpl.class), readEntry(q + 2, AbstractPoolEntry.Utf8EntryImpl.class)); - case TAG_METHODHANDLE -> new AbstractPoolEntry.MethodHandleEntryImpl(this, index, readU1(q), + case TAG_METHOD_HANDLE -> new AbstractPoolEntry.MethodHandleEntryImpl(this, index, readU1(q), readEntry(q + 1, AbstractPoolEntry.AbstractMemberRefEntry.class)); - case TAG_METHODTYPE -> new AbstractPoolEntry.MethodTypeEntryImpl(this, index, readEntry(q, AbstractPoolEntry.Utf8EntryImpl.class)); - case TAG_CONSTANTDYNAMIC -> new AbstractPoolEntry.ConstantDynamicEntryImpl(this, index, readU2(q), readEntry(q + 2, AbstractPoolEntry.NameAndTypeEntryImpl.class)); - case TAG_INVOKEDYNAMIC -> new AbstractPoolEntry.InvokeDynamicEntryImpl(this, index, readU2(q), readEntry(q + 2, AbstractPoolEntry.NameAndTypeEntryImpl.class)); + case TAG_METHOD_TYPE -> new AbstractPoolEntry.MethodTypeEntryImpl(this, index, readEntry(q, AbstractPoolEntry.Utf8EntryImpl.class)); + case TAG_DYNAMIC -> new AbstractPoolEntry.ConstantDynamicEntryImpl(this, index, readU2(q), readEntry(q + 2, AbstractPoolEntry.NameAndTypeEntryImpl.class)); + case TAG_INVOKE_DYNAMIC -> new AbstractPoolEntry.InvokeDynamicEntryImpl(this, index, readU2(q), readEntry(q + 2, AbstractPoolEntry.NameAndTypeEntryImpl.class)); case TAG_MODULE -> new AbstractPoolEntry.ModuleEntryImpl(this, index, readEntry(q, AbstractPoolEntry.Utf8EntryImpl.class)); case TAG_PACKAGE -> new AbstractPoolEntry.PackageEntryImpl(this, index, readEntry(q, AbstractPoolEntry.Utf8EntryImpl.class)); default -> throw new ConstantPoolException( diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/CodeImpl.java b/src/java.base/share/classes/jdk/internal/classfile/impl/CodeImpl.java index e08d2b76479be..48394d3da96c3 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/CodeImpl.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/CodeImpl.java @@ -39,7 +39,7 @@ import java.lang.classfile.constantpool.ClassEntry; import java.lang.classfile.instruction.*; -import static java.lang.classfile.ClassFile.*; +import static jdk.internal.classfile.impl.RawBytecodeHelper.*; public final class CodeImpl extends BoundAttribute.BoundCodeAttribute 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 e92494e699258..5f02ae708ea7b 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 @@ -52,6 +52,8 @@ public final class DirectClassBuilder extends AbstractDirectBuilder implements ClassBuilder { + /** The value of default class access flags */ + static final int DEFAULT_CLASS_FLAGS = ClassFile.ACC_PUBLIC; final ClassEntry thisClassEntry; private final List fields = new ArrayList<>(); private final List methods = new ArrayList<>(); @@ -67,7 +69,7 @@ public DirectClassBuilder(SplitConstantPool constantPool, ClassEntry thisClass) { super(constantPool, context); this.thisClassEntry = AbstractPoolEntry.maybeClone(constantPool, thisClass); - this.flags = ClassFile.DEFAULT_CLASS_FLAGS; + this.flags = DEFAULT_CLASS_FLAGS; this.superclassEntry = null; this.interfaceEntries = Collections.emptyList(); this.majorVersion = ClassFile.latestMajorVersion(); diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java b/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java index fd7a8e55bf840..301b61241f71e 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java @@ -489,9 +489,11 @@ private void processDeferredLabels() { // Instruction writing public void writeBytecode(Opcode opcode) { - if (opcode.isWide()) - bytecodesBufWriter.writeU1(ClassFile.WIDE); - bytecodesBufWriter.writeU1(opcode.bytecode() & 0xFF); + if (opcode.isWide()) { + bytecodesBufWriter.writeU2(opcode.bytecode()); + } else { + bytecodesBufWriter.writeU1(opcode.bytecode()); + } } public void writeLocalVar(Opcode opcode, int localVar) { diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java b/src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java index 860b7e74b4dde..2403ae150e9dd 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java @@ -32,8 +32,6 @@ import jdk.internal.util.Preconditions; import jdk.internal.vm.annotation.Stable; -import static java.lang.classfile.ClassFile.*; - public final class RawBytecodeHelper { public static final BiFunction, IllegalArgumentException> @@ -43,6 +41,210 @@ public IllegalArgumentException apply(String s) { return new IllegalArgumentException(s); } }); + public static final int + ILLEGAL = -1, + NOP = 0, + ACONST_NULL = 1, + ICONST_M1 = 2, + ICONST_0 = 3, + ICONST_1 = 4, + ICONST_2 = 5, + ICONST_3 = 6, + ICONST_4 = 7, + ICONST_5 = 8, + LCONST_0 = 9, + LCONST_1 = 10, + FCONST_0 = 11, + FCONST_1 = 12, + FCONST_2 = 13, + DCONST_0 = 14, + DCONST_1 = 15, + BIPUSH = 16, + SIPUSH = 17, + LDC = 18, + LDC_W = 19, + LDC2_W = 20, + ILOAD = 21, + LLOAD = 22, + FLOAD = 23, + DLOAD = 24, + ALOAD = 25, + ILOAD_0 = 26, + ILOAD_1 = 27, + ILOAD_2 = 28, + ILOAD_3 = 29, + LLOAD_0 = 30, + LLOAD_1 = 31, + LLOAD_2 = 32, + LLOAD_3 = 33, + FLOAD_0 = 34, + FLOAD_1 = 35, + FLOAD_2 = 36, + FLOAD_3 = 37, + DLOAD_0 = 38, + DLOAD_1 = 39, + DLOAD_2 = 40, + DLOAD_3 = 41, + ALOAD_0 = 42, + ALOAD_1 = 43, + ALOAD_2 = 44, + ALOAD_3 = 45, + IALOAD = 46, + LALOAD = 47, + FALOAD = 48, + DALOAD = 49, + AALOAD = 50, + BALOAD = 51, + CALOAD = 52, + SALOAD = 53, + ISTORE = 54, + LSTORE = 55, + FSTORE = 56, + DSTORE = 57, + ASTORE = 58, + ISTORE_0 = 59, + ISTORE_1 = 60, + ISTORE_2 = 61, + ISTORE_3 = 62, + LSTORE_0 = 63, + LSTORE_1 = 64, + LSTORE_2 = 65, + LSTORE_3 = 66, + FSTORE_0 = 67, + FSTORE_1 = 68, + FSTORE_2 = 69, + FSTORE_3 = 70, + DSTORE_0 = 71, + DSTORE_1 = 72, + DSTORE_2 = 73, + DSTORE_3 = 74, + ASTORE_0 = 75, + ASTORE_1 = 76, + ASTORE_2 = 77, + ASTORE_3 = 78, + IASTORE = 79, + LASTORE = 80, + FASTORE = 81, + DASTORE = 82, + AASTORE = 83, + BASTORE = 84, + CASTORE = 85, + SASTORE = 86, + POP = 87, + POP2 = 88, + DUP = 89, + DUP_X1 = 90, + DUP_X2 = 91, + DUP2 = 92, + DUP2_X1 = 93, + DUP2_X2 = 94, + SWAP = 95, + IADD = 96, + LADD = 97, + FADD = 98, + DADD = 99, + ISUB = 100, + LSUB = 101, + FSUB = 102, + DSUB = 103, + IMUL = 104, + LMUL = 105, + FMUL = 106, + DMUL = 107, + IDIV = 108, + LDIV = 109, + FDIV = 110, + DDIV = 111, + IREM = 112, + LREM = 113, + FREM = 114, + DREM = 115, + INEG = 116, + LNEG = 117, + FNEG = 118, + DNEG = 119, + ISHL = 120, + LSHL = 121, + ISHR = 122, + LSHR = 123, + IUSHR = 124, + LUSHR = 125, + IAND = 126, + LAND = 127, + IOR = 128, + LOR = 129, + IXOR = 130, + LXOR = 131, + IINC = 132, + I2L = 133, + I2F = 134, + I2D = 135, + L2I = 136, + L2F = 137, + L2D = 138, + F2I = 139, + F2L = 140, + F2D = 141, + D2I = 142, + D2L = 143, + D2F = 144, + I2B = 145, + I2C = 146, + I2S = 147, + LCMP = 148, + FCMPL = 149, + FCMPG = 150, + DCMPL = 151, + DCMPG = 152, + IFEQ = 153, + IFNE = 154, + IFLT = 155, + IFGE = 156, + IFGT = 157, + IFLE = 158, + IF_ICMPEQ = 159, + IF_ICMPNE = 160, + IF_ICMPLT = 161, + IF_ICMPGE = 162, + IF_ICMPGT = 163, + IF_ICMPLE = 164, + IF_ACMPEQ = 165, + IF_ACMPNE = 166, + GOTO = 167, + JSR = 168, + RET = 169, + TABLESWITCH = 170, + LOOKUPSWITCH = 171, + IRETURN = 172, + LRETURN = 173, + FRETURN = 174, + DRETURN = 175, + ARETURN = 176, + RETURN = 177, + GETSTATIC = 178, + PUTSTATIC = 179, + GETFIELD = 180, + PUTFIELD = 181, + INVOKEVIRTUAL = 182, + INVOKESPECIAL = 183, + INVOKESTATIC = 184, + INVOKEINTERFACE = 185, + INVOKEDYNAMIC = 186, + NEW = 187, + NEWARRAY = 188, + ANEWARRAY = 189, + ARRAYLENGTH = 190, + ATHROW = 191, + CHECKCAST = 192, + INSTANCEOF = 193, + MONITORENTER = 194, + MONITOREXIT = 195, + WIDE = 196, + MULTIANEWARRAY = 197, + IFNULL = 198, + IFNONNULL = 199, + GOTO_W = 200, + JSR_W = 201; public record CodeRange(byte[] array, int length) { public RawBytecodeHelper start() { @@ -50,8 +252,6 @@ public RawBytecodeHelper start() { } } - public static final int ILLEGAL = -1; - /** * The length of opcodes, or -1 for no fixed length. * This is generated as if: 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 0541e92e5c319..2193eb761081d 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 @@ -31,7 +31,6 @@ import java.lang.classfile.Attributes; import java.lang.classfile.ClassReader; -import java.lang.classfile.ClassFile; import java.lang.classfile.BootstrapMethodEntry; import java.lang.classfile.attribute.BootstrapMethodsAttribute; import java.lang.classfile.constantpool.*; @@ -39,22 +38,7 @@ 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; -import static java.lang.classfile.ClassFile.TAG_FIELDREF; -import static java.lang.classfile.ClassFile.TAG_FLOAT; -import static java.lang.classfile.ClassFile.TAG_INTEGER; -import static java.lang.classfile.ClassFile.TAG_INTERFACEMETHODREF; -import static java.lang.classfile.ClassFile.TAG_INVOKEDYNAMIC; -import static java.lang.classfile.ClassFile.TAG_LONG; -import static java.lang.classfile.ClassFile.TAG_METHODHANDLE; -import static java.lang.classfile.ClassFile.TAG_METHODREF; -import static java.lang.classfile.ClassFile.TAG_METHODTYPE; -import static java.lang.classfile.ClassFile.TAG_MODULE; -import static java.lang.classfile.ClassFile.TAG_NAMEANDTYPE; -import static java.lang.classfile.ClassFile.TAG_PACKAGE; -import static java.lang.classfile.ClassFile.TAG_STRING; +import static java.lang.classfile.constantpool.PoolEntry.*; public final class SplitConstantPool implements ConstantPoolBuilder { @@ -371,7 +355,7 @@ private AbstractPoolEntry.Utf8EntryImpl tryFindUtf8(int hash, String target) { 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 + if (e.tag() == TAG_UTF8 && e instanceof AbstractPoolEntry.Utf8EntryImpl ce && target.equals(ce.stringValue())) return ce; @@ -387,7 +371,7 @@ private AbstractPoolEntry.Utf8EntryImpl tryFindUtf8(int hash, AbstractPoolEntry. 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_UTF8 + if (e.tag() == TAG_UTF8 && e instanceof AbstractPoolEntry.Utf8EntryImpl ce && target.equalsUtf8(ce)) return ce; @@ -404,7 +388,7 @@ private AbstractPoolEntry.Utf8EntryImpl tryFindUtf8OfRegion(int hash, String tar 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 + if (e.tag() == TAG_UTF8 && e instanceof AbstractPoolEntry.Utf8EntryImpl ce && ce.equalsRegion(target, start, end)) return ce; @@ -471,7 +455,7 @@ private AbstractPoolEntry.ClassEntryImpl tryFindClassEntry(int hash, AbstractPoo 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 + if (e.tag() == TAG_CLASS && e instanceof AbstractPoolEntry.ClassEntryImpl ce && ce.ref1.equalsUtf8(utf8)) return ce; @@ -567,7 +551,7 @@ public ModuleEntry moduleEntry(Utf8Entry nameEntry) { public AbstractPoolEntry.NameAndTypeEntryImpl nameAndTypeEntry(Utf8Entry nameEntry, Utf8Entry typeEntry) { AbstractPoolEntry.Utf8EntryImpl ne = maybeCloneUtf8Entry(nameEntry); AbstractPoolEntry.Utf8EntryImpl te = maybeCloneUtf8Entry(typeEntry); - var e = (AbstractPoolEntry.NameAndTypeEntryImpl) findEntry(TAG_NAMEANDTYPE, ne, te); + var e = (AbstractPoolEntry.NameAndTypeEntryImpl) findEntry(TAG_NAME_AND_TYPE, ne, te); return e == null ? internalAdd(new AbstractPoolEntry.NameAndTypeEntryImpl(this, size, ne, te)) : e; } @@ -591,7 +575,7 @@ public MethodRefEntry methodRefEntry(ClassEntry owner, NameAndTypeEntry nameAndT public InterfaceMethodRefEntry interfaceMethodRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType) { 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); + var e = (AbstractPoolEntry.InterfaceMethodRefEntryImpl) findEntry(TAG_INTERFACE_METHODREF, oe, ne); return e == null ? internalAdd(new AbstractPoolEntry.InterfaceMethodRefEntryImpl(this, size, oe, ne)) : e; } @@ -603,18 +587,18 @@ public MethodTypeEntry methodTypeEntry(MethodTypeDesc descriptor) { @Override public MethodTypeEntry methodTypeEntry(Utf8Entry descriptor) { AbstractPoolEntry.Utf8EntryImpl de = maybeCloneUtf8Entry(descriptor); - var e = (AbstractPoolEntry.MethodTypeEntryImpl) findEntry(TAG_METHODTYPE, de); + var e = (AbstractPoolEntry.MethodTypeEntryImpl) findEntry(TAG_METHOD_TYPE, de); return e == null ? internalAdd(new AbstractPoolEntry.MethodTypeEntryImpl(this, size, de)) : e; } @Override public MethodHandleEntry methodHandleEntry(int refKind, MemberRefEntry reference) { reference = AbstractPoolEntry.maybeClone(this, reference); - int hash = AbstractPoolEntry.hash2(TAG_METHODHANDLE, refKind, reference.index()); + int hash = AbstractPoolEntry.hash2(TAG_METHOD_HANDLE, refKind, reference.index()); EntryMap map1 = map(); for (int token = map1.firstToken(hash); token != -1; token = map1.nextToken(hash, token)) { PoolEntry e = entryByIndex(map1.getIndexByToken(token)); - if (e.tag() == TAG_METHODHANDLE + if (e.tag() == TAG_METHOD_HANDLE && e instanceof AbstractPoolEntry.MethodHandleEntryImpl ce && ce.kind() == refKind && ce.reference() == reference) return ce; @@ -634,12 +618,12 @@ public InvokeDynamicEntry invokeDynamicEntry(BootstrapMethodEntry bootstrapMetho bootstrapMethodEntry = bsmEntry(bootstrapMethodEntry.bootstrapMethod(), bootstrapMethodEntry.arguments()); nameAndType = AbstractPoolEntry.maybeClone(this, nameAndType); - int hash = AbstractPoolEntry.hash2(TAG_INVOKEDYNAMIC, + int hash = AbstractPoolEntry.hash2(TAG_INVOKE_DYNAMIC, bootstrapMethodEntry.bsmIndex(), nameAndType.index()); EntryMap map1 = map(); for (int token = map1.firstToken(hash); token != -1; token = map1.nextToken(hash, token)) { PoolEntry e = entryByIndex(map1.getIndexByToken(token)); - if (e.tag() == TAG_INVOKEDYNAMIC + if (e.tag() == TAG_INVOKE_DYNAMIC && e instanceof AbstractPoolEntry.InvokeDynamicEntryImpl ce && ce.bootstrap() == bootstrapMethodEntry && ce.nameAndType() == nameAndType) return ce; @@ -664,12 +648,12 @@ public ConstantDynamicEntry constantDynamicEntry(BootstrapMethodEntry bootstrapM bootstrapMethodEntry = bsmEntry(bootstrapMethodEntry.bootstrapMethod(), bootstrapMethodEntry.arguments()); nameAndType = AbstractPoolEntry.maybeClone(this, nameAndType); - int hash = AbstractPoolEntry.hash2(TAG_CONSTANTDYNAMIC, + int hash = AbstractPoolEntry.hash2(TAG_DYNAMIC, bootstrapMethodEntry.bsmIndex(), nameAndType.index()); EntryMap map1 = map(); for (int token = map1.firstToken(hash); token != -1; token = map1.nextToken(hash, token)) { PoolEntry e = entryByIndex(map1.getIndexByToken(token)); - if (e.tag() == TAG_CONSTANTDYNAMIC + if (e.tag() == TAG_DYNAMIC && e instanceof AbstractPoolEntry.ConstantDynamicEntryImpl ce && ce.bootstrap() == bootstrapMethodEntry && ce.nameAndType() == nameAndType) return ce; diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java b/src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java index 783ff4bf106c2..49a06b3acc6e7 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java @@ -41,6 +41,8 @@ import java.util.stream.Collectors; import static java.lang.classfile.ClassFile.*; +import static java.lang.classfile.constantpool.PoolEntry.*; +import static jdk.internal.classfile.impl.RawBytecodeHelper.*; public final class StackCounter { @@ -120,8 +122,8 @@ public StackCounter(LabelContext labelContext, for (var smfi : smta.entries()) { int frameStack = smfi.stack().size(); for (var vti : smfi.stack()) { - if (vti == StackMapFrameInfo.SimpleVerificationTypeInfo.ITEM_LONG - || vti == StackMapFrameInfo.SimpleVerificationTypeInfo.ITEM_DOUBLE) frameStack++; + if (vti == StackMapFrameInfo.SimpleVerificationTypeInfo.LONG + || vti == StackMapFrameInfo.SimpleVerificationTypeInfo.DOUBLE) frameStack++; } if (maxStack < frameStack) maxStack = frameStack; targets.add(new Target(labelContext.labelToBci(smfi.target()), frameStack)); @@ -376,11 +378,11 @@ public int maxStack() { private void processLdc(int index) { switch (cp.entryByIndex(index).tag()) { - case TAG_UTF8, TAG_STRING, TAG_CLASS, TAG_INTEGER, TAG_FLOAT, TAG_METHODHANDLE, TAG_METHODTYPE -> + case TAG_UTF8, TAG_STRING, TAG_CLASS, TAG_INTEGER, TAG_FLOAT, TAG_METHOD_HANDLE, TAG_METHOD_TYPE -> addStackSlot(+1); case TAG_DOUBLE, TAG_LONG -> addStackSlot(+2); - case TAG_CONSTANTDYNAMIC -> + case TAG_DYNAMIC -> addStackSlot(cp.entryByIndex(index, ConstantDynamicEntry.class).typeKind().slotSize()); default -> throw error("CP entry #%d %s is not loadable constant".formatted(index, cp.entryByIndex(index).tag())); diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/StackMapDecoder.java b/src/java.base/share/classes/jdk/internal/classfile/impl/StackMapDecoder.java index bdee788c9da77..884f7b8bbc8fa 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/StackMapDecoder.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/StackMapDecoder.java @@ -41,6 +41,7 @@ import java.util.Objects; import static java.lang.classfile.ClassFile.*; +import static java.lang.classfile.attribute.StackMapFrameInfo.VerificationTypeInfo.*; public class StackMapDecoder { @@ -75,7 +76,7 @@ public static List initFrameLocals(ClassEntry thisClass, S if (!isStatic) { vtis = new VerificationTypeInfo[methodType.parameterCount() + 1]; if ("".equals(methodName) && !ConstantDescs.CD_Object.equals(thisClass.asSymbol())) { - vtis[i++] = SimpleVerificationTypeInfo.ITEM_UNINITIALIZED_THIS; + vtis[i++] = SimpleVerificationTypeInfo.UNINITIALIZED_THIS; } else { vtis[i++] = new StackMapDecoder.ObjectVerificationTypeInfoImpl(thisClass); } @@ -85,10 +86,10 @@ public static List initFrameLocals(ClassEntry thisClass, S for (int pi = 0; pi < methodType.parameterCount(); pi++) { var arg = methodType.parameterType(pi); vtis[i++] = switch (arg.descriptorString().charAt(0)) { - case 'I', 'S', 'C' ,'B', 'Z' -> SimpleVerificationTypeInfo.ITEM_INTEGER; - case 'J' -> SimpleVerificationTypeInfo.ITEM_LONG; - case 'F' -> SimpleVerificationTypeInfo.ITEM_FLOAT; - case 'D' -> SimpleVerificationTypeInfo.ITEM_DOUBLE; + case 'I', 'S', 'C' ,'B', 'Z' -> SimpleVerificationTypeInfo.INTEGER; + case 'J' -> SimpleVerificationTypeInfo.LONG; + case 'F' -> SimpleVerificationTypeInfo.FLOAT; + case 'D' -> SimpleVerificationTypeInfo.DOUBLE; case 'V' -> throw new IllegalArgumentException("Illegal method argument type: " + arg); default -> new StackMapDecoder.ObjectVerificationTypeInfoImpl(TemporaryConstantPool.INSTANCE.classEntry(arg)); }; @@ -169,11 +170,12 @@ private static boolean equals(List l1, List + case ITEM_TOP, ITEM_INTEGER, ITEM_FLOAT, ITEM_DOUBLE, ITEM_LONG, ITEM_NULL, + ITEM_UNINITIALIZED_THIS -> {} - case VT_OBJECT -> + case ITEM_OBJECT -> bw.writeIndex(((ObjectVerificationTypeInfo)vti).className()); - case VT_UNINITIALIZED -> + case ITEM_UNINITIALIZED -> bw.writeU2(bw.labelContext().labelToBci(((UninitializedVerificationTypeInfo)vti).newTarget())); default -> throw new IllegalArgumentException("Invalid verification type tag: " + vti.tag()); } @@ -232,15 +234,15 @@ List entries() { private VerificationTypeInfo readVerificationTypeInfo() { int tag = classReader.readU1(p++); return switch (tag) { - case VT_TOP -> SimpleVerificationTypeInfo.ITEM_TOP; - case VT_INTEGER -> SimpleVerificationTypeInfo.ITEM_INTEGER; - case VT_FLOAT -> SimpleVerificationTypeInfo.ITEM_FLOAT; - case VT_DOUBLE -> SimpleVerificationTypeInfo.ITEM_DOUBLE; - case VT_LONG -> SimpleVerificationTypeInfo.ITEM_LONG; - case VT_NULL -> SimpleVerificationTypeInfo.ITEM_NULL; - case VT_UNINITIALIZED_THIS -> SimpleVerificationTypeInfo.ITEM_UNINITIALIZED_THIS; - case VT_OBJECT -> new ObjectVerificationTypeInfoImpl(classReader.entryByIndex(u2(), ClassEntry.class)); - case VT_UNINITIALIZED -> new UninitializedVerificationTypeInfoImpl(ctx.getLabel(u2())); + case ITEM_TOP -> SimpleVerificationTypeInfo.TOP; + case ITEM_INTEGER -> SimpleVerificationTypeInfo.INTEGER; + case ITEM_FLOAT -> SimpleVerificationTypeInfo.FLOAT; + case ITEM_DOUBLE -> SimpleVerificationTypeInfo.DOUBLE; + case ITEM_LONG -> SimpleVerificationTypeInfo.LONG; + case ITEM_NULL -> SimpleVerificationTypeInfo.NULL; + case ITEM_UNINITIALIZED_THIS -> SimpleVerificationTypeInfo.UNINITIALIZED_THIS; + case ITEM_OBJECT -> new ObjectVerificationTypeInfoImpl(classReader.entryByIndex(u2(), ClassEntry.class)); + case ITEM_UNINITIALIZED -> new UninitializedVerificationTypeInfoImpl(ctx.getLabel(u2())); default -> throw new IllegalArgumentException("Invalid verification type tag: " + tag); }; } @@ -249,7 +251,7 @@ public static record ObjectVerificationTypeInfoImpl( ClassEntry className) implements ObjectVerificationTypeInfo { @Override - public int tag() { return VT_OBJECT; } + public int tag() { return ITEM_OBJECT; } @Override public boolean equals(Object o) { @@ -274,7 +276,7 @@ public String toString() { public static record UninitializedVerificationTypeInfoImpl(Label newTarget) implements UninitializedVerificationTypeInfo { @Override - public int tag() { return VT_UNINITIALIZED; } + public int tag() { return ITEM_UNINITIALIZED; } @Override public String toString() { 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 964a0dc2b2727..ae9835206831e 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 @@ -28,7 +28,6 @@ import java.lang.classfile.Attribute; import java.lang.classfile.Attributes; import java.lang.classfile.BufWriter; -import java.lang.classfile.ClassFile; import java.lang.classfile.Label; import java.lang.classfile.attribute.StackMapTableAttribute; import java.lang.classfile.constantpool.ClassEntry; @@ -48,7 +47,9 @@ import jdk.internal.util.Preconditions; import static java.lang.classfile.ClassFile.*; +import static java.lang.classfile.constantpool.PoolEntry.*; import static java.lang.constant.ConstantDescs.*; +import static jdk.internal.classfile.impl.RawBytecodeHelper.*; /** * StackMapGenerator is responsible for stack map frames generation. @@ -696,11 +697,11 @@ private void processLdc(int index) { currentFrame.pushStack(Type.DOUBLE_TYPE, Type.DOUBLE2_TYPE); case TAG_LONG -> currentFrame.pushStack(Type.LONG_TYPE, Type.LONG2_TYPE); - case TAG_METHODHANDLE -> + case TAG_METHOD_HANDLE -> currentFrame.pushStack(Type.METHOD_HANDLE_TYPE); - case TAG_METHODTYPE -> + case TAG_METHOD_TYPE -> currentFrame.pushStack(Type.METHOD_TYPE); - case TAG_CONSTANTDYNAMIC -> + case TAG_DYNAMIC -> currentFrame.pushStack(cp.entryByIndex(index, ConstantDynamicEntry.class).asSymbol().constantType()); default -> throw generatorError("CP entry #%d %s is not loadable constant".formatted(index, cp.entryByIndex(index).tag())); diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/TargetInfoImpl.java b/src/java.base/share/classes/jdk/internal/classfile/impl/TargetInfoImpl.java index 3377e3ebd1305..b2d5cd9f62c84 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/TargetInfoImpl.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/TargetInfoImpl.java @@ -28,7 +28,7 @@ import java.util.Objects; import java.lang.classfile.Label; import java.lang.classfile.TypeAnnotation.*; -import static java.lang.classfile.ClassFile.*; + import static java.util.Objects.requireNonNull; public final class TargetInfoImpl { @@ -47,7 +47,7 @@ public record TypeParameterTargetImpl(TargetType targetType, int typeParameterIn implements TypeParameterTarget { public TypeParameterTargetImpl(TargetType targetType, int typeParameterIndex) { - this.targetType = checkValid(targetType, TAT_CLASS_TYPE_PARAMETER, TAT_METHOD_TYPE_PARAMETER); + this.targetType = checkValid(targetType, TARGET_CLASS_TYPE_PARAMETER, TARGET_METHOD_TYPE_PARAMETER); this.typeParameterIndex = typeParameterIndex; } } @@ -63,7 +63,7 @@ public record TypeParameterBoundTargetImpl(TargetType targetType, int typeParame implements TypeParameterBoundTarget { public TypeParameterBoundTargetImpl(TargetType targetType, int typeParameterIndex, int boundIndex) { - this.targetType = checkValid(targetType, TAT_CLASS_TYPE_PARAMETER_BOUND, TAT_METHOD_TYPE_PARAMETER_BOUND); + this.targetType = checkValid(targetType, TARGET_CLASS_TYPE_PARAMETER_BOUND, TARGET_METHOD_TYPE_PARAMETER_BOUND); this.typeParameterIndex = typeParameterIndex; this.boundIndex = boundIndex; } @@ -72,7 +72,7 @@ public TypeParameterBoundTargetImpl(TargetType targetType, int typeParameterInde public record EmptyTargetImpl(TargetType targetType) implements EmptyTarget { public EmptyTargetImpl(TargetType targetType) { - this.targetType = checkValid(targetType, TAT_FIELD, TAT_METHOD_RECEIVER); + this.targetType = checkValid(targetType, TARGET_FIELD, TARGET_METHOD_RECEIVER); } } @@ -94,7 +94,7 @@ public record LocalVarTargetImpl(TargetType targetType, List implements LocalVarTarget { public LocalVarTargetImpl(TargetType targetType, List table) { - this.targetType = checkValid(targetType, TAT_LOCAL_VARIABLE, TAT_RESOURCE_VARIABLE); + this.targetType = checkValid(targetType, TARGET_LOCAL_VARIABLE, TARGET_RESOURCE_VARIABLE); this.table = List.copyOf(table); } @Override @@ -122,7 +122,7 @@ public TargetType targetType() { public record OffsetTargetImpl(TargetType targetType, Label target) implements OffsetTarget { public OffsetTargetImpl(TargetType targetType, Label target) { - this.targetType = checkValid(targetType, TAT_INSTANCEOF, TAT_METHOD_REFERENCE); + this.targetType = checkValid(targetType, TARGET_INSTANCEOF, TARGET_METHOD_REFERENCE); this.target = requireNonNull(target); } } @@ -131,7 +131,7 @@ public record TypeArgumentTargetImpl(TargetType targetType, Label target, int ty implements TypeArgumentTarget { public TypeArgumentTargetImpl(TargetType targetType, Label target, int typeArgumentIndex) { - this.targetType = checkValid(targetType, TAT_CAST, TAT_METHOD_REFERENCE_TYPE_ARGUMENT); + this.targetType = checkValid(targetType, TARGET_CAST, TARGET_METHOD_REFERENCE_TYPE_ARGUMENT); this.target = requireNonNull(target); this.typeArgumentIndex = typeArgumentIndex; } diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/verifier/VerificationBytecodes.java b/src/java.base/share/classes/jdk/internal/classfile/impl/verifier/VerificationBytecodes.java index de97730aff579..5aed968c6aefc 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/verifier/VerificationBytecodes.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/verifier/VerificationBytecodes.java @@ -24,7 +24,7 @@ */ package jdk.internal.classfile.impl.verifier; -import java.lang.classfile.ClassFile; +import static jdk.internal.classfile.impl.RawBytecodeHelper.*; import jdk.internal.classfile.impl.verifier.VerificationSignature.BasicType; import static jdk.internal.classfile.impl.verifier.VerificationSignature.BasicType.*; @@ -83,7 +83,7 @@ static boolean is_valid(int code) { } static boolean is_store_into_local(int code) { - return (ClassFile.ISTORE <= code && code <= ClassFile.ASTORE_3); + return (ISTORE <= code && code <= ASTORE_3); } static final int _lengths[] = new int[number_of_codes]; @@ -104,244 +104,244 @@ static void def(int code, String name, String format, String wide_format, BasicT } static { - def(ClassFile.NOP, "nop", "b", null, T_VOID, 0); - def(ClassFile.ACONST_NULL, "aconst_null", "b", null, T_OBJECT, 1); - def(ClassFile.ICONST_M1, "iconst_m1", "b", null, T_INT, 1); - def(ClassFile.ICONST_0, "iconst_0", "b", null, T_INT, 1); - def(ClassFile.ICONST_1, "iconst_1", "b", null, T_INT, 1); - def(ClassFile.ICONST_2, "iconst_2", "b", null, T_INT, 1); - def(ClassFile.ICONST_3, "iconst_3", "b", null, T_INT, 1); - def(ClassFile.ICONST_4, "iconst_4", "b", null, T_INT, 1); - def(ClassFile.ICONST_5, "iconst_5", "b", null, T_INT, 1); - def(ClassFile.LCONST_0, "lconst_0", "b", null, T_LONG, 2); - def(ClassFile.LCONST_1, "lconst_1", "b", null, T_LONG, 2); - def(ClassFile.FCONST_0, "fconst_0", "b", null, T_FLOAT, 1); - def(ClassFile.FCONST_1, "fconst_1", "b", null, T_FLOAT, 1); - def(ClassFile.FCONST_2, "fconst_2", "b", null, T_FLOAT, 1); - def(ClassFile.DCONST_0, "dconst_0", "b", null, T_DOUBLE, 2); - def(ClassFile.DCONST_1, "dconst_1", "b", null, T_DOUBLE, 2); - def(ClassFile.BIPUSH, "bipush", "bc", null, T_INT, 1); - def(ClassFile.SIPUSH, "sipush", "bcc", null, T_INT, 1); - def(ClassFile.LDC, "ldc", "bk", null, T_ILLEGAL, 1); - def(ClassFile.LDC_W, "ldc_w", "bkk", null, T_ILLEGAL, 1); - def(ClassFile.LDC2_W, "ldc2_w", "bkk", null, T_ILLEGAL, 2); - def(ClassFile.ILOAD, "iload", "bi", "wbii", T_INT, 1); - def(ClassFile.LLOAD, "lload", "bi", "wbii", T_LONG, 2); - def(ClassFile.FLOAD, "fload", "bi", "wbii", T_FLOAT, 1); - def(ClassFile.DLOAD, "dload", "bi", "wbii", T_DOUBLE, 2); - def(ClassFile.ALOAD, "aload", "bi", "wbii", T_OBJECT, 1); - def(ClassFile.ILOAD_0, "iload_0", "b", null, T_INT, 1); - def(ClassFile.ILOAD_1, "iload_1", "b", null, T_INT, 1); - def(ClassFile.ILOAD_2, "iload_2", "b", null, T_INT, 1); - def(ClassFile.ILOAD_3, "iload_3", "b", null, T_INT, 1); - def(ClassFile.LLOAD_0, "lload_0", "b", null, T_LONG, 2); - def(ClassFile.LLOAD_1, "lload_1", "b", null, T_LONG, 2); - def(ClassFile.LLOAD_2, "lload_2", "b", null, T_LONG, 2); - def(ClassFile.LLOAD_3, "lload_3", "b", null, T_LONG, 2); - def(ClassFile.FLOAD_0, "fload_0", "b", null, T_FLOAT, 1); - def(ClassFile.FLOAD_1, "fload_1", "b", null, T_FLOAT, 1); - def(ClassFile.FLOAD_2, "fload_2", "b", null, T_FLOAT, 1); - def(ClassFile.FLOAD_3, "fload_3", "b", null, T_FLOAT, 1); - def(ClassFile.DLOAD_0, "dload_0", "b", null, T_DOUBLE, 2); - def(ClassFile.DLOAD_1, "dload_1", "b", null, T_DOUBLE, 2); - def(ClassFile.DLOAD_2, "dload_2", "b", null, T_DOUBLE, 2); - def(ClassFile.DLOAD_3, "dload_3", "b", null, T_DOUBLE, 2); - def(ClassFile.ALOAD_0, "aload_0", "b", null, T_OBJECT, 1); - def(ClassFile.ALOAD_1, "aload_1", "b", null, T_OBJECT, 1); - def(ClassFile.ALOAD_2, "aload_2", "b", null, T_OBJECT, 1); - def(ClassFile.ALOAD_3, "aload_3", "b", null, T_OBJECT, 1); - def(ClassFile.IALOAD, "iaload", "b", null, T_INT, -1); - def(ClassFile.LALOAD, "laload", "b", null, T_LONG, 0); - def(ClassFile.FALOAD, "faload", "b", null, T_FLOAT, -1); - def(ClassFile.DALOAD, "daload", "b", null, T_DOUBLE, 0); - def(ClassFile.AALOAD, "aaload", "b", null, T_OBJECT, -1); - def(ClassFile.BALOAD, "baload", "b", null, T_INT, -1); - def(ClassFile.CALOAD, "caload", "b", null, T_INT, -1); - def(ClassFile.SALOAD, "saload", "b", null, T_INT, -1); - def(ClassFile.ISTORE, "istore", "bi", "wbii", T_VOID, -1); - def(ClassFile.LSTORE, "lstore", "bi", "wbii", T_VOID, -2); - def(ClassFile.FSTORE, "fstore", "bi", "wbii", T_VOID, -1); - def(ClassFile.DSTORE, "dstore", "bi", "wbii", T_VOID, -2); - def(ClassFile.ASTORE, "astore", "bi", "wbii", T_VOID, -1); - def(ClassFile.ISTORE_0, "istore_0", "b", null, T_VOID, -1); - def(ClassFile.ISTORE_1, "istore_1", "b", null, T_VOID, -1); - def(ClassFile.ISTORE_2, "istore_2", "b", null, T_VOID, -1); - def(ClassFile.ISTORE_3, "istore_3", "b", null, T_VOID, -1); - def(ClassFile.LSTORE_0, "lstore_0", "b", null, T_VOID, -2); - def(ClassFile.LSTORE_1, "lstore_1", "b", null, T_VOID, -2); - def(ClassFile.LSTORE_2, "lstore_2", "b", null, T_VOID, -2); - def(ClassFile.LSTORE_3, "lstore_3", "b", null, T_VOID, -2); - def(ClassFile.FSTORE_0, "fstore_0", "b", null, T_VOID, -1); - def(ClassFile.FSTORE_1, "fstore_1", "b", null, T_VOID, -1); - def(ClassFile.FSTORE_2, "fstore_2", "b", null, T_VOID, -1); - def(ClassFile.FSTORE_3, "fstore_3", "b", null, T_VOID, -1); - def(ClassFile.DSTORE_0, "dstore_0", "b", null, T_VOID, -2); - def(ClassFile.DSTORE_1, "dstore_1", "b", null, T_VOID, -2); - def(ClassFile.DSTORE_2, "dstore_2", "b", null, T_VOID, -2); - def(ClassFile.DSTORE_3, "dstore_3", "b", null, T_VOID, -2); - def(ClassFile.ASTORE_0, "astore_0", "b", null, T_VOID, -1); - def(ClassFile.ASTORE_1, "astore_1", "b", null, T_VOID, -1); - def(ClassFile.ASTORE_2, "astore_2", "b", null, T_VOID, -1); - def(ClassFile.ASTORE_3, "astore_3", "b", null, T_VOID, -1); - def(ClassFile.IASTORE, "iastore", "b", null, T_VOID, -3); - def(ClassFile.LASTORE, "lastore", "b", null, T_VOID, -4); - def(ClassFile.FASTORE, "fastore", "b", null, T_VOID, -3); - def(ClassFile.DASTORE, "dastore", "b", null, T_VOID, -4); - def(ClassFile.AASTORE, "aastore", "b", null, T_VOID, -3); - def(ClassFile.BASTORE, "bastore", "b", null, T_VOID, -3); - def(ClassFile.CASTORE, "castore", "b", null, T_VOID, -3); - def(ClassFile.SASTORE, "sastore", "b", null, T_VOID, -3); - def(ClassFile.POP, "pop", "b", null, T_VOID, -1); - def(ClassFile.POP2, "pop2", "b", null, T_VOID, -2); - def(ClassFile.DUP, "dup", "b", null, T_VOID, 1); - def(ClassFile.DUP_X1, "dup_x1", "b", null, T_VOID, 1); - def(ClassFile.DUP_X2, "dup_x2", "b", null, T_VOID, 1); - def(ClassFile.DUP2, "dup2", "b", null, T_VOID, 2); - def(ClassFile.DUP2_X1, "dup2_x1", "b", null, T_VOID, 2); - def(ClassFile.DUP2_X2, "dup2_x2", "b", null, T_VOID, 2); - def(ClassFile.SWAP, "swap", "b", null, T_VOID, 0); - def(ClassFile.IADD, "iadd", "b", null, T_INT, -1); - def(ClassFile.LADD, "ladd", "b", null, T_LONG, -2); - def(ClassFile.FADD, "fadd", "b", null, T_FLOAT, -1); - def(ClassFile.DADD, "dadd", "b", null, T_DOUBLE, -2); - def(ClassFile.ISUB, "isub", "b", null, T_INT, -1); - def(ClassFile.LSUB, "lsub", "b", null, T_LONG, -2); - def(ClassFile.FSUB, "fsub", "b", null, T_FLOAT, -1); - def(ClassFile.DSUB, "dsub", "b", null, T_DOUBLE, -2); - def(ClassFile.IMUL, "imul", "b", null, T_INT, -1); - def(ClassFile.LMUL, "lmul", "b", null, T_LONG, -2); - def(ClassFile.FMUL, "fmul", "b", null, T_FLOAT, -1); - def(ClassFile.DMUL, "dmul", "b", null, T_DOUBLE, -2); - def(ClassFile.IDIV, "idiv", "b", null, T_INT, -1); - def(ClassFile.LDIV, "ldiv", "b", null, T_LONG, -2); - def(ClassFile.FDIV, "fdiv", "b", null, T_FLOAT, -1); - def(ClassFile.DDIV, "ddiv", "b", null, T_DOUBLE, -2); - def(ClassFile.IREM, "irem", "b", null, T_INT, -1); - def(ClassFile.LREM, "lrem", "b", null, T_LONG, -2); - def(ClassFile.FREM, "frem", "b", null, T_FLOAT, -1); - def(ClassFile.DREM, "drem", "b", null, T_DOUBLE, -2); - def(ClassFile.INEG, "ineg", "b", null, T_INT, 0); - def(ClassFile.LNEG, "lneg", "b", null, T_LONG, 0); - def(ClassFile.FNEG, "fneg", "b", null, T_FLOAT, 0); - def(ClassFile.DNEG, "dneg", "b", null, T_DOUBLE, 0); - def(ClassFile.ISHL, "ishl", "b", null, T_INT, -1); - def(ClassFile.LSHL, "lshl", "b", null, T_LONG, -1); - def(ClassFile.ISHR, "ishr", "b", null, T_INT, -1); - def(ClassFile.LSHR, "lshr", "b", null, T_LONG, -1); - def(ClassFile.IUSHR, "iushr", "b", null, T_INT, -1); - def(ClassFile.LUSHR, "lushr", "b", null, T_LONG, -1); - def(ClassFile.IAND, "iand", "b", null, T_INT, -1); - def(ClassFile.LAND, "land", "b", null, T_LONG, -2); - def(ClassFile.IOR, "ior", "b", null, T_INT, -1); - def(ClassFile.LOR, "lor", "b", null, T_LONG, -2); - def(ClassFile.IXOR, "ixor", "b", null, T_INT, -1); - def(ClassFile.LXOR, "lxor", "b", null, T_LONG, -2); - def(ClassFile.IINC, "iinc", "bic", "wbiicc", T_VOID, 0); - def(ClassFile.I2L, "i2l", "b", null, T_LONG, 1); - def(ClassFile.I2F, "i2f", "b", null, T_FLOAT, 0); - def(ClassFile.I2D, "i2d", "b", null, T_DOUBLE, 1); - def(ClassFile.L2I, "l2i", "b", null, T_INT, -1); - def(ClassFile.L2F, "l2f", "b", null, T_FLOAT, -1); - def(ClassFile.L2D, "l2d", "b", null, T_DOUBLE, 0); - def(ClassFile.F2I, "f2i", "b", null, T_INT, 0); - def(ClassFile.F2L, "f2l", "b", null, T_LONG, 1); - def(ClassFile.F2D, "f2d", "b", null, T_DOUBLE, 1); - def(ClassFile.D2I, "d2i", "b", null, T_INT, -1); - def(ClassFile.D2L, "d2l", "b", null, T_LONG, 0); - def(ClassFile.D2F, "d2f", "b", null, T_FLOAT, -1); - def(ClassFile.I2B, "i2b", "b", null, T_BYTE, 0); - def(ClassFile.I2C, "i2c", "b", null, T_CHAR, 0); - def(ClassFile.I2S, "i2s", "b", null, T_SHORT, 0); - def(ClassFile.LCMP, "lcmp", "b", null, T_VOID, -3); - def(ClassFile.FCMPL, "fcmpl", "b", null, T_VOID, -1); - def(ClassFile.FCMPG, "fcmpg", "b", null, T_VOID, -1); - def(ClassFile.DCMPL, "dcmpl", "b", null, T_VOID, -3); - def(ClassFile.DCMPG, "dcmpg", "b", null, T_VOID, -3); - def(ClassFile.IFEQ, "ifeq", "boo", null, T_VOID, -1); - def(ClassFile.IFNE, "ifne", "boo", null, T_VOID, -1); - def(ClassFile.IFLT, "iflt", "boo", null, T_VOID, -1); - def(ClassFile.IFGE, "ifge", "boo", null, T_VOID, -1); - def(ClassFile.IFGT, "ifgt", "boo", null, T_VOID, -1); - def(ClassFile.IFLE, "ifle", "boo", null, T_VOID, -1); - def(ClassFile.IF_ICMPEQ, "if_icmpeq", "boo", null, T_VOID, -2); - def(ClassFile.IF_ICMPNE, "if_icmpne", "boo", null, T_VOID, -2); - def(ClassFile.IF_ICMPLT, "if_icmplt", "boo", null, T_VOID, -2); - def(ClassFile.IF_ICMPGE, "if_icmpge", "boo", null, T_VOID, -2); - def(ClassFile.IF_ICMPGT, "if_icmpgt", "boo", null, T_VOID, -2); - def(ClassFile.IF_ICMPLE, "if_icmple", "boo", null, T_VOID, -2); - def(ClassFile.IF_ACMPEQ, "if_acmpeq", "boo", null, T_VOID, -2); - def(ClassFile.IF_ACMPNE, "if_acmpne", "boo", null, T_VOID, -2); - def(ClassFile.GOTO, "goto", "boo", null, T_VOID, 0); - def(ClassFile.JSR, "jsr", "boo", null, T_INT, 0); - def(ClassFile.RET, "ret", "bi", "wbii", T_VOID, 0); - def(ClassFile.TABLESWITCH, "tableswitch", "", null, T_VOID, -1); // may have backward branches - def(ClassFile.LOOKUPSWITCH, "lookupswitch", "", null, T_VOID, -1); // rewriting in interpreter - def(ClassFile.IRETURN, "ireturn", "b", null, T_INT, -1); - def(ClassFile.LRETURN, "lreturn", "b", null, T_LONG, -2); - def(ClassFile.FRETURN, "freturn", "b", null, T_FLOAT, -1); - def(ClassFile.DRETURN, "dreturn", "b", null, T_DOUBLE, -2); - def(ClassFile.ARETURN, "areturn", "b", null, T_OBJECT, -1); - def(ClassFile.RETURN, "return", "b", null, T_VOID, 0); - def(ClassFile.GETSTATIC, "getstatic", "bJJ", null, T_ILLEGAL, 1); - def(ClassFile.PUTSTATIC, "putstatic", "bJJ", null, T_ILLEGAL, -1); - def(ClassFile.GETFIELD, "getfield", "bJJ", null, T_ILLEGAL, 0); - def(ClassFile.PUTFIELD, "putfield", "bJJ", null, T_ILLEGAL, -2); - def(ClassFile.INVOKEVIRTUAL, "invokevirtual", "bJJ", null, T_ILLEGAL, -1); - def(ClassFile.INVOKESPECIAL, "invokespecial", "bJJ", null, T_ILLEGAL, -1); - def(ClassFile.INVOKESTATIC, "invokestatic", "bJJ", null, T_ILLEGAL, 0); - def(ClassFile.INVOKEINTERFACE, "invokeinterface", "bJJ__", null, T_ILLEGAL, -1); - def(ClassFile.INVOKEDYNAMIC, "invokedynamic", "bJJJJ", null, T_ILLEGAL, 0); - def(ClassFile.NEW, "new", "bkk", null, T_OBJECT, 1); - def(ClassFile.NEWARRAY, "newarray", "bc", null, T_OBJECT, 0); - def(ClassFile.ANEWARRAY, "anewarray", "bkk", null, T_OBJECT, 0); - def(ClassFile.ARRAYLENGTH, "arraylength", "b", null, T_VOID, 0); - def(ClassFile.ATHROW, "athrow", "b", null, T_VOID, -1); - def(ClassFile.CHECKCAST, "checkcast", "bkk", null, T_OBJECT, 0); - def(ClassFile.INSTANCEOF, "instanceof", "bkk", null, T_INT, 0); - def(ClassFile.MONITORENTER, "monitorenter", "b", null, T_VOID, -1); - def(ClassFile.MONITOREXIT, "monitorexit", "b", null, T_VOID, -1); - def(ClassFile.WIDE, "wide", "", null, T_VOID, 0); - def(ClassFile.MULTIANEWARRAY, "multianewarray", "bkkc", null, T_OBJECT, 1); - def(ClassFile.IFNULL, "ifnull", "boo", null, T_VOID, -1); - def(ClassFile.IFNONNULL, "ifnonnull", "boo", null, T_VOID, -1); - def(ClassFile.GOTO_W, "goto_w", "boooo", null, T_VOID, 0); - def(ClassFile.JSR_W, "jsr_w", "boooo", null, T_INT, 0); + def(NOP, "nop", "b", null, T_VOID, 0); + def(ACONST_NULL, "aconst_null", "b", null, T_OBJECT, 1); + def(ICONST_M1, "iconst_m1", "b", null, T_INT, 1); + def(ICONST_0, "iconst_0", "b", null, T_INT, 1); + def(ICONST_1, "iconst_1", "b", null, T_INT, 1); + def(ICONST_2, "iconst_2", "b", null, T_INT, 1); + def(ICONST_3, "iconst_3", "b", null, T_INT, 1); + def(ICONST_4, "iconst_4", "b", null, T_INT, 1); + def(ICONST_5, "iconst_5", "b", null, T_INT, 1); + def(LCONST_0, "lconst_0", "b", null, T_LONG, 2); + def(LCONST_1, "lconst_1", "b", null, T_LONG, 2); + def(FCONST_0, "fconst_0", "b", null, T_FLOAT, 1); + def(FCONST_1, "fconst_1", "b", null, T_FLOAT, 1); + def(FCONST_2, "fconst_2", "b", null, T_FLOAT, 1); + def(DCONST_0, "dconst_0", "b", null, T_DOUBLE, 2); + def(DCONST_1, "dconst_1", "b", null, T_DOUBLE, 2); + def(BIPUSH, "bipush", "bc", null, T_INT, 1); + def(SIPUSH, "sipush", "bcc", null, T_INT, 1); + def(LDC, "ldc", "bk", null, T_ILLEGAL, 1); + def(LDC_W, "ldc_w", "bkk", null, T_ILLEGAL, 1); + def(LDC2_W, "ldc2_w", "bkk", null, T_ILLEGAL, 2); + def(ILOAD, "iload", "bi", "wbii", T_INT, 1); + def(LLOAD, "lload", "bi", "wbii", T_LONG, 2); + def(FLOAD, "fload", "bi", "wbii", T_FLOAT, 1); + def(DLOAD, "dload", "bi", "wbii", T_DOUBLE, 2); + def(ALOAD, "aload", "bi", "wbii", T_OBJECT, 1); + def(ILOAD_0, "iload_0", "b", null, T_INT, 1); + def(ILOAD_1, "iload_1", "b", null, T_INT, 1); + def(ILOAD_2, "iload_2", "b", null, T_INT, 1); + def(ILOAD_3, "iload_3", "b", null, T_INT, 1); + def(LLOAD_0, "lload_0", "b", null, T_LONG, 2); + def(LLOAD_1, "lload_1", "b", null, T_LONG, 2); + def(LLOAD_2, "lload_2", "b", null, T_LONG, 2); + def(LLOAD_3, "lload_3", "b", null, T_LONG, 2); + def(FLOAD_0, "fload_0", "b", null, T_FLOAT, 1); + def(FLOAD_1, "fload_1", "b", null, T_FLOAT, 1); + def(FLOAD_2, "fload_2", "b", null, T_FLOAT, 1); + def(FLOAD_3, "fload_3", "b", null, T_FLOAT, 1); + def(DLOAD_0, "dload_0", "b", null, T_DOUBLE, 2); + def(DLOAD_1, "dload_1", "b", null, T_DOUBLE, 2); + def(DLOAD_2, "dload_2", "b", null, T_DOUBLE, 2); + def(DLOAD_3, "dload_3", "b", null, T_DOUBLE, 2); + def(ALOAD_0, "aload_0", "b", null, T_OBJECT, 1); + def(ALOAD_1, "aload_1", "b", null, T_OBJECT, 1); + def(ALOAD_2, "aload_2", "b", null, T_OBJECT, 1); + def(ALOAD_3, "aload_3", "b", null, T_OBJECT, 1); + def(IALOAD, "iaload", "b", null, T_INT, -1); + def(LALOAD, "laload", "b", null, T_LONG, 0); + def(FALOAD, "faload", "b", null, T_FLOAT, -1); + def(DALOAD, "daload", "b", null, T_DOUBLE, 0); + def(AALOAD, "aaload", "b", null, T_OBJECT, -1); + def(BALOAD, "baload", "b", null, T_INT, -1); + def(CALOAD, "caload", "b", null, T_INT, -1); + def(SALOAD, "saload", "b", null, T_INT, -1); + def(ISTORE, "istore", "bi", "wbii", T_VOID, -1); + def(LSTORE, "lstore", "bi", "wbii", T_VOID, -2); + def(FSTORE, "fstore", "bi", "wbii", T_VOID, -1); + def(DSTORE, "dstore", "bi", "wbii", T_VOID, -2); + def(ASTORE, "astore", "bi", "wbii", T_VOID, -1); + def(ISTORE_0, "istore_0", "b", null, T_VOID, -1); + def(ISTORE_1, "istore_1", "b", null, T_VOID, -1); + def(ISTORE_2, "istore_2", "b", null, T_VOID, -1); + def(ISTORE_3, "istore_3", "b", null, T_VOID, -1); + def(LSTORE_0, "lstore_0", "b", null, T_VOID, -2); + def(LSTORE_1, "lstore_1", "b", null, T_VOID, -2); + def(LSTORE_2, "lstore_2", "b", null, T_VOID, -2); + def(LSTORE_3, "lstore_3", "b", null, T_VOID, -2); + def(FSTORE_0, "fstore_0", "b", null, T_VOID, -1); + def(FSTORE_1, "fstore_1", "b", null, T_VOID, -1); + def(FSTORE_2, "fstore_2", "b", null, T_VOID, -1); + def(FSTORE_3, "fstore_3", "b", null, T_VOID, -1); + def(DSTORE_0, "dstore_0", "b", null, T_VOID, -2); + def(DSTORE_1, "dstore_1", "b", null, T_VOID, -2); + def(DSTORE_2, "dstore_2", "b", null, T_VOID, -2); + def(DSTORE_3, "dstore_3", "b", null, T_VOID, -2); + def(ASTORE_0, "astore_0", "b", null, T_VOID, -1); + def(ASTORE_1, "astore_1", "b", null, T_VOID, -1); + def(ASTORE_2, "astore_2", "b", null, T_VOID, -1); + def(ASTORE_3, "astore_3", "b", null, T_VOID, -1); + def(IASTORE, "iastore", "b", null, T_VOID, -3); + def(LASTORE, "lastore", "b", null, T_VOID, -4); + def(FASTORE, "fastore", "b", null, T_VOID, -3); + def(DASTORE, "dastore", "b", null, T_VOID, -4); + def(AASTORE, "aastore", "b", null, T_VOID, -3); + def(BASTORE, "bastore", "b", null, T_VOID, -3); + def(CASTORE, "castore", "b", null, T_VOID, -3); + def(SASTORE, "sastore", "b", null, T_VOID, -3); + def(POP, "pop", "b", null, T_VOID, -1); + def(POP2, "pop2", "b", null, T_VOID, -2); + def(DUP, "dup", "b", null, T_VOID, 1); + def(DUP_X1, "dup_x1", "b", null, T_VOID, 1); + def(DUP_X2, "dup_x2", "b", null, T_VOID, 1); + def(DUP2, "dup2", "b", null, T_VOID, 2); + def(DUP2_X1, "dup2_x1", "b", null, T_VOID, 2); + def(DUP2_X2, "dup2_x2", "b", null, T_VOID, 2); + def(SWAP, "swap", "b", null, T_VOID, 0); + def(IADD, "iadd", "b", null, T_INT, -1); + def(LADD, "ladd", "b", null, T_LONG, -2); + def(FADD, "fadd", "b", null, T_FLOAT, -1); + def(DADD, "dadd", "b", null, T_DOUBLE, -2); + def(ISUB, "isub", "b", null, T_INT, -1); + def(LSUB, "lsub", "b", null, T_LONG, -2); + def(FSUB, "fsub", "b", null, T_FLOAT, -1); + def(DSUB, "dsub", "b", null, T_DOUBLE, -2); + def(IMUL, "imul", "b", null, T_INT, -1); + def(LMUL, "lmul", "b", null, T_LONG, -2); + def(FMUL, "fmul", "b", null, T_FLOAT, -1); + def(DMUL, "dmul", "b", null, T_DOUBLE, -2); + def(IDIV, "idiv", "b", null, T_INT, -1); + def(LDIV, "ldiv", "b", null, T_LONG, -2); + def(FDIV, "fdiv", "b", null, T_FLOAT, -1); + def(DDIV, "ddiv", "b", null, T_DOUBLE, -2); + def(IREM, "irem", "b", null, T_INT, -1); + def(LREM, "lrem", "b", null, T_LONG, -2); + def(FREM, "frem", "b", null, T_FLOAT, -1); + def(DREM, "drem", "b", null, T_DOUBLE, -2); + def(INEG, "ineg", "b", null, T_INT, 0); + def(LNEG, "lneg", "b", null, T_LONG, 0); + def(FNEG, "fneg", "b", null, T_FLOAT, 0); + def(DNEG, "dneg", "b", null, T_DOUBLE, 0); + def(ISHL, "ishl", "b", null, T_INT, -1); + def(LSHL, "lshl", "b", null, T_LONG, -1); + def(ISHR, "ishr", "b", null, T_INT, -1); + def(LSHR, "lshr", "b", null, T_LONG, -1); + def(IUSHR, "iushr", "b", null, T_INT, -1); + def(LUSHR, "lushr", "b", null, T_LONG, -1); + def(IAND, "iand", "b", null, T_INT, -1); + def(LAND, "land", "b", null, T_LONG, -2); + def(IOR, "ior", "b", null, T_INT, -1); + def(LOR, "lor", "b", null, T_LONG, -2); + def(IXOR, "ixor", "b", null, T_INT, -1); + def(LXOR, "lxor", "b", null, T_LONG, -2); + def(IINC, "iinc", "bic", "wbiicc", T_VOID, 0); + def(I2L, "i2l", "b", null, T_LONG, 1); + def(I2F, "i2f", "b", null, T_FLOAT, 0); + def(I2D, "i2d", "b", null, T_DOUBLE, 1); + def(L2I, "l2i", "b", null, T_INT, -1); + def(L2F, "l2f", "b", null, T_FLOAT, -1); + def(L2D, "l2d", "b", null, T_DOUBLE, 0); + def(F2I, "f2i", "b", null, T_INT, 0); + def(F2L, "f2l", "b", null, T_LONG, 1); + def(F2D, "f2d", "b", null, T_DOUBLE, 1); + def(D2I, "d2i", "b", null, T_INT, -1); + def(D2L, "d2l", "b", null, T_LONG, 0); + def(D2F, "d2f", "b", null, T_FLOAT, -1); + def(I2B, "i2b", "b", null, T_BYTE, 0); + def(I2C, "i2c", "b", null, T_CHAR, 0); + def(I2S, "i2s", "b", null, T_SHORT, 0); + def(LCMP, "lcmp", "b", null, T_VOID, -3); + def(FCMPL, "fcmpl", "b", null, T_VOID, -1); + def(FCMPG, "fcmpg", "b", null, T_VOID, -1); + def(DCMPL, "dcmpl", "b", null, T_VOID, -3); + def(DCMPG, "dcmpg", "b", null, T_VOID, -3); + def(IFEQ, "ifeq", "boo", null, T_VOID, -1); + def(IFNE, "ifne", "boo", null, T_VOID, -1); + def(IFLT, "iflt", "boo", null, T_VOID, -1); + def(IFGE, "ifge", "boo", null, T_VOID, -1); + def(IFGT, "ifgt", "boo", null, T_VOID, -1); + def(IFLE, "ifle", "boo", null, T_VOID, -1); + def(IF_ICMPEQ, "if_icmpeq", "boo", null, T_VOID, -2); + def(IF_ICMPNE, "if_icmpne", "boo", null, T_VOID, -2); + def(IF_ICMPLT, "if_icmplt", "boo", null, T_VOID, -2); + def(IF_ICMPGE, "if_icmpge", "boo", null, T_VOID, -2); + def(IF_ICMPGT, "if_icmpgt", "boo", null, T_VOID, -2); + def(IF_ICMPLE, "if_icmple", "boo", null, T_VOID, -2); + def(IF_ACMPEQ, "if_acmpeq", "boo", null, T_VOID, -2); + def(IF_ACMPNE, "if_acmpne", "boo", null, T_VOID, -2); + def(GOTO, "goto", "boo", null, T_VOID, 0); + def(JSR, "jsr", "boo", null, T_INT, 0); + def(RET, "ret", "bi", "wbii", T_VOID, 0); + def(TABLESWITCH, "tableswitch", "", null, T_VOID, -1); // may have backward branches + def(LOOKUPSWITCH, "lookupswitch", "", null, T_VOID, -1); // rewriting in interpreter + def(IRETURN, "ireturn", "b", null, T_INT, -1); + def(LRETURN, "lreturn", "b", null, T_LONG, -2); + def(FRETURN, "freturn", "b", null, T_FLOAT, -1); + def(DRETURN, "dreturn", "b", null, T_DOUBLE, -2); + def(ARETURN, "areturn", "b", null, T_OBJECT, -1); + def(RETURN, "return", "b", null, T_VOID, 0); + def(GETSTATIC, "getstatic", "bJJ", null, T_ILLEGAL, 1); + def(PUTSTATIC, "putstatic", "bJJ", null, T_ILLEGAL, -1); + def(GETFIELD, "getfield", "bJJ", null, T_ILLEGAL, 0); + def(PUTFIELD, "putfield", "bJJ", null, T_ILLEGAL, -2); + def(INVOKEVIRTUAL, "invokevirtual", "bJJ", null, T_ILLEGAL, -1); + def(INVOKESPECIAL, "invokespecial", "bJJ", null, T_ILLEGAL, -1); + def(INVOKESTATIC, "invokestatic", "bJJ", null, T_ILLEGAL, 0); + def(INVOKEINTERFACE, "invokeinterface", "bJJ__", null, T_ILLEGAL, -1); + def(INVOKEDYNAMIC, "invokedynamic", "bJJJJ", null, T_ILLEGAL, 0); + def(NEW, "new", "bkk", null, T_OBJECT, 1); + def(NEWARRAY, "newarray", "bc", null, T_OBJECT, 0); + def(ANEWARRAY, "anewarray", "bkk", null, T_OBJECT, 0); + def(ARRAYLENGTH, "arraylength", "b", null, T_VOID, 0); + def(ATHROW, "athrow", "b", null, T_VOID, -1); + def(CHECKCAST, "checkcast", "bkk", null, T_OBJECT, 0); + def(INSTANCEOF, "instanceof", "bkk", null, T_INT, 0); + def(MONITORENTER, "monitorenter", "b", null, T_VOID, -1); + def(MONITOREXIT, "monitorexit", "b", null, T_VOID, -1); + def(WIDE, "wide", "", null, T_VOID, 0); + def(MULTIANEWARRAY, "multianewarray", "bkkc", null, T_OBJECT, 1); + def(IFNULL, "ifnull", "boo", null, T_VOID, -1); + def(IFNONNULL, "ifnonnull", "boo", null, T_VOID, -1); + def(GOTO_W, "goto_w", "boooo", null, T_VOID, 0); + def(JSR_W, "jsr_w", "boooo", null, T_INT, 0); def(_breakpoint, "breakpoint", "", null, T_VOID, 0); - def(_fast_agetfield, "fast_agetfield", "bJJ", null, T_OBJECT, 0, ClassFile.GETFIELD); - def(_fast_bgetfield, "fast_bgetfield", "bJJ", null, T_INT, 0, ClassFile.GETFIELD); - def(_fast_cgetfield, "fast_cgetfield", "bJJ", null, T_CHAR, 0, ClassFile.GETFIELD); - def(_fast_dgetfield, "fast_dgetfield", "bJJ", null, T_DOUBLE, 0, ClassFile.GETFIELD); - def(_fast_fgetfield, "fast_fgetfield", "bJJ", null, T_FLOAT, 0, ClassFile.GETFIELD); - def(_fast_igetfield, "fast_igetfield", "bJJ", null, T_INT, 0, ClassFile.GETFIELD); - def(_fast_lgetfield, "fast_lgetfield", "bJJ", null, T_LONG, 0, ClassFile.GETFIELD); - def(_fast_sgetfield, "fast_sgetfield", "bJJ", null, T_SHORT, 0, ClassFile.GETFIELD); - def(_fast_aputfield, "fast_aputfield", "bJJ", null, T_OBJECT, 0, ClassFile.PUTFIELD); - def(_fast_bputfield, "fast_bputfield", "bJJ", null, T_INT, 0, ClassFile.PUTFIELD); - def(_fast_zputfield, "fast_zputfield", "bJJ", null, T_INT, 0, ClassFile.PUTFIELD); - def(_fast_cputfield, "fast_cputfield", "bJJ", null, T_CHAR, 0, ClassFile.PUTFIELD); - def(_fast_dputfield, "fast_dputfield", "bJJ", null, T_DOUBLE, 0, ClassFile.PUTFIELD); - def(_fast_fputfield, "fast_fputfield", "bJJ", null, T_FLOAT, 0, ClassFile.PUTFIELD); - def(_fast_iputfield, "fast_iputfield", "bJJ", null, T_INT, 0, ClassFile.PUTFIELD); - def(_fast_lputfield, "fast_lputfield", "bJJ", null, T_LONG, 0, ClassFile.PUTFIELD); - def(_fast_sputfield, "fast_sputfield", "bJJ", null, T_SHORT, 0, ClassFile.PUTFIELD); - def(_fast_aload_0, "fast_aload_0", "b", null, T_OBJECT, 1, ClassFile.ALOAD_0); - def(_fast_iaccess_0, "fast_iaccess_0", "b_JJ", null, T_INT, 1, ClassFile.ALOAD_0); - def(_fast_aaccess_0, "fast_aaccess_0", "b_JJ", null, T_OBJECT, 1, ClassFile.ALOAD_0); - def(_fast_faccess_0, "fast_faccess_0", "b_JJ", null, T_OBJECT, 1, ClassFile.ALOAD_0); - def(_fast_iload, "fast_iload", "bi", null, T_INT, 1, ClassFile.ILOAD); - def(_fast_iload2, "fast_iload2", "bi_i", null, T_INT, 2, ClassFile.ILOAD); - def(_fast_icaload, "fast_icaload", "bi_", null, T_INT, 0, ClassFile.ILOAD); - def(_fast_invokevfinal, "fast_invokevfinal", "bJJ", null, T_ILLEGAL, -1, ClassFile.INVOKEVIRTUAL); - def(_fast_linearswitch, "fast_linearswitch", "", null, T_VOID, -1, ClassFile.LOOKUPSWITCH); - def(_fast_binaryswitch, "fast_binaryswitch", "", null, T_VOID, -1, ClassFile.LOOKUPSWITCH); - def(_return_register_finalizer, "return_register_finalizer", "b", null, T_VOID, 0, ClassFile.RETURN); - def(_invokehandle, "invokehandle", "bJJ", null, T_ILLEGAL, -1, ClassFile.INVOKEVIRTUAL); - def(_fast_aldc, "fast_aldc", "bj", null, T_OBJECT, 1, ClassFile.LDC); - def(_fast_aldc_w, "fast_aldc_w", "bJJ", null, T_OBJECT, 1, ClassFile.LDC_W); - def(_nofast_getfield, "nofast_getfield", "bJJ", null, T_ILLEGAL, 0, ClassFile.GETFIELD); - def(_nofast_putfield, "nofast PUTFIELD", "bJJ", null, T_ILLEGAL, -2, ClassFile.PUTFIELD); - def(_nofast_aload_0, "nofast_aload_0", "b", null, T_ILLEGAL, 1, ClassFile.ALOAD_0); - def(_nofast_iload, "nofast_iload", "bi", null, T_ILLEGAL, 1, ClassFile.ILOAD); + def(_fast_agetfield, "fast_agetfield", "bJJ", null, T_OBJECT, 0, GETFIELD); + def(_fast_bgetfield, "fast_bgetfield", "bJJ", null, T_INT, 0, GETFIELD); + def(_fast_cgetfield, "fast_cgetfield", "bJJ", null, T_CHAR, 0, GETFIELD); + def(_fast_dgetfield, "fast_dgetfield", "bJJ", null, T_DOUBLE, 0, GETFIELD); + def(_fast_fgetfield, "fast_fgetfield", "bJJ", null, T_FLOAT, 0, GETFIELD); + def(_fast_igetfield, "fast_igetfield", "bJJ", null, T_INT, 0, GETFIELD); + def(_fast_lgetfield, "fast_lgetfield", "bJJ", null, T_LONG, 0, GETFIELD); + def(_fast_sgetfield, "fast_sgetfield", "bJJ", null, T_SHORT, 0, GETFIELD); + def(_fast_aputfield, "fast_aputfield", "bJJ", null, T_OBJECT, 0, PUTFIELD); + def(_fast_bputfield, "fast_bputfield", "bJJ", null, T_INT, 0, PUTFIELD); + def(_fast_zputfield, "fast_zputfield", "bJJ", null, T_INT, 0, PUTFIELD); + def(_fast_cputfield, "fast_cputfield", "bJJ", null, T_CHAR, 0, PUTFIELD); + def(_fast_dputfield, "fast_dputfield", "bJJ", null, T_DOUBLE, 0, PUTFIELD); + def(_fast_fputfield, "fast_fputfield", "bJJ", null, T_FLOAT, 0, PUTFIELD); + def(_fast_iputfield, "fast_iputfield", "bJJ", null, T_INT, 0, PUTFIELD); + def(_fast_lputfield, "fast_lputfield", "bJJ", null, T_LONG, 0, PUTFIELD); + def(_fast_sputfield, "fast_sputfield", "bJJ", null, T_SHORT, 0, PUTFIELD); + def(_fast_aload_0, "fast_aload_0", "b", null, T_OBJECT, 1, ALOAD_0); + def(_fast_iaccess_0, "fast_iaccess_0", "b_JJ", null, T_INT, 1, ALOAD_0); + def(_fast_aaccess_0, "fast_aaccess_0", "b_JJ", null, T_OBJECT, 1, ALOAD_0); + def(_fast_faccess_0, "fast_faccess_0", "b_JJ", null, T_OBJECT, 1, ALOAD_0); + def(_fast_iload, "fast_iload", "bi", null, T_INT, 1, ILOAD); + def(_fast_iload2, "fast_iload2", "bi_i", null, T_INT, 2, ILOAD); + def(_fast_icaload, "fast_icaload", "bi_", null, T_INT, 0, ILOAD); + def(_fast_invokevfinal, "fast_invokevfinal", "bJJ", null, T_ILLEGAL, -1, INVOKEVIRTUAL); + def(_fast_linearswitch, "fast_linearswitch", "", null, T_VOID, -1, LOOKUPSWITCH); + def(_fast_binaryswitch, "fast_binaryswitch", "", null, T_VOID, -1, LOOKUPSWITCH); + def(_return_register_finalizer, "return_register_finalizer", "b", null, T_VOID, 0, RETURN); + def(_invokehandle, "invokehandle", "bJJ", null, T_ILLEGAL, -1, INVOKEVIRTUAL); + def(_fast_aldc, "fast_aldc", "bj", null, T_OBJECT, 1, LDC); + def(_fast_aldc_w, "fast_aldc_w", "bJJ", null, T_OBJECT, 1, LDC_W); + def(_nofast_getfield, "nofast_getfield", "bJJ", null, T_ILLEGAL, 0, GETFIELD); + def(_nofast_putfield, "nofast PUTFIELD", "bJJ", null, T_ILLEGAL, -2, PUTFIELD); + def(_nofast_aload_0, "nofast_aload_0", "b", null, T_ILLEGAL, 1, ALOAD_0); + def(_nofast_iload, "nofast_iload", "bi", null, T_ILLEGAL, 1, ILOAD); def(_shouldnotreachhere, "_shouldnotreachhere", "b", null, T_VOID, 0); } } diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/verifier/VerifierImpl.java b/src/java.base/share/classes/jdk/internal/classfile/impl/verifier/VerifierImpl.java index 9a0e781d1458a..f41647788a175 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/verifier/VerifierImpl.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/verifier/VerifierImpl.java @@ -31,10 +31,9 @@ import java.lang.classfile.ClassHierarchyResolver; import java.lang.classfile.ClassModel; import java.lang.classfile.components.ClassPrinter; -import java.lang.classfile.ClassFile; import jdk.internal.classfile.impl.ClassHierarchyImpl; import jdk.internal.classfile.impl.RawBytecodeHelper; -import static jdk.internal.classfile.impl.RawBytecodeHelper.ILLEGAL; +import static jdk.internal.classfile.impl.RawBytecodeHelper.*; import jdk.internal.classfile.impl.verifier.VerificationWrapper.ConstantPoolWrapper; import static jdk.internal.classfile.impl.verifier.VerificationSignature.BasicType.*; import jdk.internal.classfile.impl.verifier.VerificationSignature.BasicType; @@ -340,12 +339,12 @@ void verify_method(VerificationWrapper.MethodWrapper m) { VerificationType type, type2 = null; VerificationType atype; if (bcs.isWide()) { - if (opcode != ClassFile.IINC && opcode != ClassFile.ILOAD - && opcode != ClassFile.ALOAD && opcode != ClassFile.LLOAD - && opcode != ClassFile.ISTORE && opcode != ClassFile.ASTORE - && opcode != ClassFile.LSTORE && opcode != ClassFile.FLOAD - && opcode != ClassFile.DLOAD && opcode != ClassFile.FSTORE - && opcode != ClassFile.DSTORE) { + if (opcode != IINC && opcode != ILOAD + && opcode != ALOAD && opcode != LLOAD + && opcode != ISTORE && opcode != ASTORE + && opcode != LSTORE && opcode != FLOAD + && opcode != DLOAD && opcode != FSTORE + && opcode != DSTORE) { verifyError("Bad wide instruction"); } } @@ -354,107 +353,107 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verified_exc_handlers = true; } switch (opcode) { - case ClassFile.NOP : + case NOP : no_control_flow = false; break; - case ClassFile.ACONST_NULL : + case ACONST_NULL : current_frame.push_stack( VerificationType.null_type); no_control_flow = false; break; - case ClassFile.ICONST_M1 : - case ClassFile.ICONST_0 : - case ClassFile.ICONST_1 : - case ClassFile.ICONST_2 : - case ClassFile.ICONST_3 : - case ClassFile.ICONST_4 : - case ClassFile.ICONST_5 : + case ICONST_M1 : + case ICONST_0 : + case ICONST_1 : + case ICONST_2 : + case ICONST_3 : + case ICONST_4 : + case ICONST_5 : current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.LCONST_0 : - case ClassFile.LCONST_1 : + case LCONST_0 : + case LCONST_1 : current_frame.push_stack_2( VerificationType.long_type, VerificationType.long2_type); no_control_flow = false; break; - case ClassFile.FCONST_0 : - case ClassFile.FCONST_1 : - case ClassFile.FCONST_2 : + case FCONST_0 : + case FCONST_1 : + case FCONST_2 : current_frame.push_stack( VerificationType.float_type); no_control_flow = false; break; - case ClassFile.DCONST_0 : - case ClassFile.DCONST_1 : + case DCONST_0 : + case DCONST_1 : current_frame.push_stack_2( VerificationType.double_type, VerificationType.double2_type); no_control_flow = false; break; - case ClassFile.SIPUSH : - case ClassFile.BIPUSH : + case SIPUSH : + case BIPUSH : current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.LDC : + case LDC : verify_ldc( opcode, bcs.getIndexU1(), current_frame, cp, bci); no_control_flow = false; break; - case ClassFile.LDC_W : - case ClassFile.LDC2_W : + case LDC_W : + case LDC2_W : verify_ldc( opcode, bcs.getIndexU2(), current_frame, cp, bci); no_control_flow = false; break; - case ClassFile.ILOAD : + case ILOAD : verify_iload(bcs.getIndex(), current_frame); no_control_flow = false; break; - case ClassFile.ILOAD_0 : - case ClassFile.ILOAD_1 : - case ClassFile.ILOAD_2 : - case ClassFile.ILOAD_3 : - index = opcode - ClassFile.ILOAD_0; + case ILOAD_0 : + case ILOAD_1 : + case ILOAD_2 : + case ILOAD_3 : + index = opcode - ILOAD_0; verify_iload(index, current_frame); no_control_flow = false; break; - case ClassFile.LLOAD : + case LLOAD : verify_lload(bcs.getIndex(), current_frame); no_control_flow = false; break; - case ClassFile.LLOAD_0 : - case ClassFile.LLOAD_1 : - case ClassFile.LLOAD_2 : - case ClassFile.LLOAD_3 : - index = opcode - ClassFile.LLOAD_0; + case LLOAD_0 : + case LLOAD_1 : + case LLOAD_2 : + case LLOAD_3 : + index = opcode - LLOAD_0; verify_lload(index, current_frame); no_control_flow = false; break; - case ClassFile.FLOAD : + case FLOAD : verify_fload(bcs.getIndex(), current_frame); no_control_flow = false; break; - case ClassFile.FLOAD_0 : - case ClassFile.FLOAD_1 : - case ClassFile.FLOAD_2 : - case ClassFile.FLOAD_3 : - index = opcode - ClassFile.FLOAD_0; + case FLOAD_0 : + case FLOAD_1 : + case FLOAD_2 : + case FLOAD_3 : + index = opcode - FLOAD_0; verify_fload(index, current_frame); no_control_flow = false; break; - case ClassFile.DLOAD : + case DLOAD : verify_dload(bcs.getIndex(), current_frame); no_control_flow = false; break; - case ClassFile.DLOAD_0 : - case ClassFile.DLOAD_1 : - case ClassFile.DLOAD_2 : - case ClassFile.DLOAD_3 : - index = opcode - ClassFile.DLOAD_0; + case DLOAD_0 : + case DLOAD_1 : + case DLOAD_2 : + case DLOAD_3 : + index = opcode - DLOAD_0; verify_dload(index, current_frame); no_control_flow = false; break; - case ClassFile.ALOAD : + case ALOAD : verify_aload(bcs.getIndex(), current_frame); no_control_flow = false; break; - case ClassFile.ALOAD_0 : - case ClassFile.ALOAD_1 : - case ClassFile.ALOAD_2 : - case ClassFile.ALOAD_3 : - index = opcode - ClassFile.ALOAD_0; + case ALOAD_0 : + case ALOAD_1 : + case ALOAD_2 : + case ALOAD_3 : + index = opcode - ALOAD_0; verify_aload(index, current_frame); no_control_flow = false; break; - case ClassFile.IALOAD : + case IALOAD : type = current_frame.pop_stack( VerificationType.integer_type); atype = current_frame.pop_stack( @@ -465,7 +464,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.BALOAD : + case BALOAD : type = current_frame.pop_stack( VerificationType.integer_type); atype = current_frame.pop_stack( @@ -476,7 +475,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.CALOAD : + case CALOAD : type = current_frame.pop_stack( VerificationType.integer_type); atype = current_frame.pop_stack( @@ -487,7 +486,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.SALOAD : + case SALOAD : type = current_frame.pop_stack( VerificationType.integer_type); atype = current_frame.pop_stack( @@ -498,7 +497,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.LALOAD : + case LALOAD : type = current_frame.pop_stack( VerificationType.integer_type); atype = current_frame.pop_stack( @@ -510,7 +509,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { VerificationType.long_type, VerificationType.long2_type); no_control_flow = false; break; - case ClassFile.FALOAD : + case FALOAD : type = current_frame.pop_stack( VerificationType.integer_type); atype = current_frame.pop_stack( @@ -521,7 +520,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack( VerificationType.float_type); no_control_flow = false; break; - case ClassFile.DALOAD : + case DALOAD : type = current_frame.pop_stack( VerificationType.integer_type); atype = current_frame.pop_stack( @@ -533,7 +532,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { VerificationType.double_type, VerificationType.double2_type); no_control_flow = false; break; - case ClassFile.AALOAD : { + case AALOAD : { type = current_frame.pop_stack( VerificationType.integer_type); atype = current_frame.pop_stack( @@ -551,57 +550,57 @@ void verify_method(VerificationWrapper.MethodWrapper m) { } no_control_flow = false; break; } - case ClassFile.ISTORE : + case ISTORE : verify_istore(bcs.getIndex(), current_frame); no_control_flow = false; break; - case ClassFile.ISTORE_0 : - case ClassFile.ISTORE_1 : - case ClassFile.ISTORE_2 : - case ClassFile.ISTORE_3 : - index = opcode - ClassFile.ISTORE_0; + case ISTORE_0 : + case ISTORE_1 : + case ISTORE_2 : + case ISTORE_3 : + index = opcode - ISTORE_0; verify_istore(index, current_frame); no_control_flow = false; break; - case ClassFile.LSTORE : + case LSTORE : verify_lstore(bcs.getIndex(), current_frame); no_control_flow = false; break; - case ClassFile.LSTORE_0 : - case ClassFile.LSTORE_1 : - case ClassFile.LSTORE_2 : - case ClassFile.LSTORE_3 : - index = opcode - ClassFile.LSTORE_0; + case LSTORE_0 : + case LSTORE_1 : + case LSTORE_2 : + case LSTORE_3 : + index = opcode - LSTORE_0; verify_lstore(index, current_frame); no_control_flow = false; break; - case ClassFile.FSTORE : + case FSTORE : verify_fstore(bcs.getIndex(), current_frame); no_control_flow = false; break; - case ClassFile.FSTORE_0 : - case ClassFile.FSTORE_1 : - case ClassFile.FSTORE_2 : - case ClassFile.FSTORE_3 : - index = opcode - ClassFile.FSTORE_0; + case FSTORE_0 : + case FSTORE_1 : + case FSTORE_2 : + case FSTORE_3 : + index = opcode - FSTORE_0; verify_fstore(index, current_frame); no_control_flow = false; break; - case ClassFile.DSTORE : + case DSTORE : verify_dstore(bcs.getIndex(), current_frame); no_control_flow = false; break; - case ClassFile.DSTORE_0 : - case ClassFile.DSTORE_1 : - case ClassFile.DSTORE_2 : - case ClassFile.DSTORE_3 : - index = opcode - ClassFile.DSTORE_0; + case DSTORE_0 : + case DSTORE_1 : + case DSTORE_2 : + case DSTORE_3 : + index = opcode - DSTORE_0; verify_dstore(index, current_frame); no_control_flow = false; break; - case ClassFile.ASTORE : + case ASTORE : verify_astore(bcs.getIndex(), current_frame); no_control_flow = false; break; - case ClassFile.ASTORE_0 : - case ClassFile.ASTORE_1 : - case ClassFile.ASTORE_2 : - case ClassFile.ASTORE_3 : - index = opcode - ClassFile.ASTORE_0; + case ASTORE_0 : + case ASTORE_1 : + case ASTORE_2 : + case ASTORE_3 : + index = opcode - ASTORE_0; verify_astore(index, current_frame); no_control_flow = false; break; - case ClassFile.IASTORE : + case IASTORE : type = current_frame.pop_stack( VerificationType.integer_type); type2 = current_frame.pop_stack( @@ -612,7 +611,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verifyError("Bad type"); } no_control_flow = false; break; - case ClassFile.BASTORE : + case BASTORE : type = current_frame.pop_stack( VerificationType.integer_type); type2 = current_frame.pop_stack( @@ -623,7 +622,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verifyError("Bad type"); } no_control_flow = false; break; - case ClassFile.CASTORE : + case CASTORE : current_frame.pop_stack( VerificationType.integer_type); current_frame.pop_stack( @@ -634,7 +633,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verifyError("Bad type"); } no_control_flow = false; break; - case ClassFile.SASTORE : + case SASTORE : current_frame.pop_stack( VerificationType.integer_type); current_frame.pop_stack( @@ -645,7 +644,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verifyError("Bad type"); } no_control_flow = false; break; - case ClassFile.LASTORE : + case LASTORE : current_frame.pop_stack_2( VerificationType.long2_type, VerificationType.long_type); @@ -657,7 +656,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verifyError("Bad type"); } no_control_flow = false; break; - case ClassFile.FASTORE : + case FASTORE : current_frame.pop_stack( VerificationType.float_type); current_frame.pop_stack @@ -668,7 +667,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verifyError("Bad type"); } no_control_flow = false; break; - case ClassFile.DASTORE : + case DASTORE : current_frame.pop_stack_2( VerificationType.double2_type, VerificationType.double_type); @@ -680,7 +679,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verifyError("Bad type"); } no_control_flow = false; break; - case ClassFile.AASTORE : + case AASTORE : type = current_frame.pop_stack(object_type()); type2 = current_frame.pop_stack( VerificationType.integer_type); @@ -692,11 +691,11 @@ void verify_method(VerificationWrapper.MethodWrapper m) { } // 4938384: relaxed constraint in JVMS 3nd edition. no_control_flow = false; break; - case ClassFile.POP : + case POP : current_frame.pop_stack( VerificationType.category1_check); no_control_flow = false; break; - case ClassFile.POP2 : + case POP2 : type = current_frame.pop_stack(); if (type.is_category1(this)) { current_frame.pop_stack( @@ -708,13 +707,13 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verifyError("Bad type"); } no_control_flow = false; break; - case ClassFile.DUP : + case DUP : type = current_frame.pop_stack( VerificationType.category1_check); current_frame.push_stack(type); current_frame.push_stack(type); no_control_flow = false; break; - case ClassFile.DUP_X1 : + case DUP_X1 : type = current_frame.pop_stack( VerificationType.category1_check); type2 = current_frame.pop_stack( @@ -723,7 +722,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack(type2); current_frame.push_stack(type); no_control_flow = false; break; - case ClassFile.DUP_X2 : + case DUP_X2 : { VerificationType type3 = null; type = current_frame.pop_stack( @@ -744,7 +743,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack(type); no_control_flow = false; break; } - case ClassFile.DUP2 : + case DUP2 : type = current_frame.pop_stack(); if (type.is_category1(this)) { type2 = current_frame.pop_stack( @@ -760,7 +759,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack(type2); current_frame.push_stack(type); no_control_flow = false; break; - case ClassFile.DUP2_X1 : + case DUP2_X1 : { VerificationType type3; type = current_frame.pop_stack(); @@ -782,7 +781,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack(type); no_control_flow = false; break; } - case ClassFile.DUP2_X2 : + case DUP2_X2 : VerificationType type3, type4 = null; type = current_frame.pop_stack(); if (type.is_category1(this)) { @@ -811,7 +810,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack(type2); current_frame.push_stack(type); no_control_flow = false; break; - case ClassFile.SWAP : + case SWAP : type = current_frame.pop_stack( VerificationType.category1_check); type2 = current_frame.pop_stack( @@ -819,39 +818,39 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack(type); current_frame.push_stack(type2); no_control_flow = false; break; - case ClassFile.IADD : - case ClassFile.ISUB : - case ClassFile.IMUL : - case ClassFile.IDIV : - case ClassFile.IREM : - case ClassFile.ISHL : - case ClassFile.ISHR : - case ClassFile.IUSHR : - case ClassFile.IOR : - case ClassFile.IXOR : - case ClassFile.IAND : + case IADD : + case ISUB : + case IMUL : + case IDIV : + case IREM : + case ISHL : + case ISHR : + case IUSHR : + case IOR : + case IXOR : + case IAND : current_frame.pop_stack( VerificationType.integer_type); // fall through - case ClassFile.INEG : + case INEG : current_frame.pop_stack( VerificationType.integer_type); current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.LADD : - case ClassFile.LSUB : - case ClassFile.LMUL : - case ClassFile.LDIV : - case ClassFile.LREM : - case ClassFile.LAND : - case ClassFile.LOR : - case ClassFile.LXOR : + case LADD : + case LSUB : + case LMUL : + case LDIV : + case LREM : + case LAND : + case LOR : + case LXOR : current_frame.pop_stack_2( VerificationType.long2_type, VerificationType.long_type); // fall through - case ClassFile.LNEG : + case LNEG : current_frame.pop_stack_2( VerificationType.long2_type, VerificationType.long_type); @@ -859,9 +858,9 @@ void verify_method(VerificationWrapper.MethodWrapper m) { VerificationType.long_type, VerificationType.long2_type); no_control_flow = false; break; - case ClassFile.LSHL : - case ClassFile.LSHR : - case ClassFile.LUSHR : + case LSHL : + case LSHR : + case LUSHR : current_frame.pop_stack( VerificationType.integer_type); current_frame.pop_stack_2( @@ -871,30 +870,30 @@ void verify_method(VerificationWrapper.MethodWrapper m) { VerificationType.long_type, VerificationType.long2_type); no_control_flow = false; break; - case ClassFile.FADD : - case ClassFile.FSUB : - case ClassFile.FMUL : - case ClassFile.FDIV : - case ClassFile.FREM : + case FADD : + case FSUB : + case FMUL : + case FDIV : + case FREM : current_frame.pop_stack( VerificationType.float_type); // fall through - case ClassFile.FNEG : + case FNEG : current_frame.pop_stack( VerificationType.float_type); current_frame.push_stack( VerificationType.float_type); no_control_flow = false; break; - case ClassFile.DADD : - case ClassFile.DSUB : - case ClassFile.DMUL : - case ClassFile.DDIV : - case ClassFile.DREM : + case DADD : + case DSUB : + case DMUL : + case DDIV : + case DREM : current_frame.pop_stack_2( VerificationType.double2_type, VerificationType.double_type); // fall through - case ClassFile.DNEG : + case DNEG : current_frame.pop_stack_2( VerificationType.double2_type, VerificationType.double_type); @@ -902,44 +901,44 @@ void verify_method(VerificationWrapper.MethodWrapper m) { VerificationType.double_type, VerificationType.double2_type); no_control_flow = false; break; - case ClassFile.IINC : + case IINC : verify_iinc(bcs.getIndex(), current_frame); no_control_flow = false; break; - case ClassFile.I2L : + case I2L : type = current_frame.pop_stack( VerificationType.integer_type); current_frame.push_stack_2( VerificationType.long_type, VerificationType.long2_type); no_control_flow = false; break; - case ClassFile.L2I : + case L2I : current_frame.pop_stack_2( VerificationType.long2_type, VerificationType.long_type); current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.I2F : + case I2F : current_frame.pop_stack( VerificationType.integer_type); current_frame.push_stack( VerificationType.float_type); no_control_flow = false; break; - case ClassFile.I2D : + case I2D : current_frame.pop_stack( VerificationType.integer_type); current_frame.push_stack_2( VerificationType.double_type, VerificationType.double2_type); no_control_flow = false; break; - case ClassFile.L2F : + case L2F : current_frame.pop_stack_2( VerificationType.long2_type, VerificationType.long_type); current_frame.push_stack( VerificationType.float_type); no_control_flow = false; break; - case ClassFile.L2D : + case L2D : current_frame.pop_stack_2( VerificationType.long2_type, VerificationType.long_type); @@ -947,34 +946,34 @@ void verify_method(VerificationWrapper.MethodWrapper m) { VerificationType.double_type, VerificationType.double2_type); no_control_flow = false; break; - case ClassFile.F2I : + case F2I : current_frame.pop_stack( VerificationType.float_type); current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.F2L : + case F2L : current_frame.pop_stack( VerificationType.float_type); current_frame.push_stack_2( VerificationType.long_type, VerificationType.long2_type); no_control_flow = false; break; - case ClassFile.F2D : + case F2D : current_frame.pop_stack( VerificationType.float_type); current_frame.push_stack_2( VerificationType.double_type, VerificationType.double2_type); no_control_flow = false; break; - case ClassFile.D2I : + case D2I : current_frame.pop_stack_2( VerificationType.double2_type, VerificationType.double_type); current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.D2L : + case D2L : current_frame.pop_stack_2( VerificationType.double2_type, VerificationType.double_type); @@ -982,22 +981,22 @@ void verify_method(VerificationWrapper.MethodWrapper m) { VerificationType.long_type, VerificationType.long2_type); no_control_flow = false; break; - case ClassFile.D2F : + case D2F : current_frame.pop_stack_2( VerificationType.double2_type, VerificationType.double_type); current_frame.push_stack( VerificationType.float_type); no_control_flow = false; break; - case ClassFile.I2B : - case ClassFile.I2C : - case ClassFile.I2S : + case I2B : + case I2C : + case I2S : current_frame.pop_stack( VerificationType.integer_type); current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.LCMP : + case LCMP : current_frame.pop_stack_2( VerificationType.long2_type, VerificationType.long_type); @@ -1007,8 +1006,8 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.FCMPL : - case ClassFile.FCMPG : + case FCMPL : + case FCMPG : current_frame.pop_stack( VerificationType.float_type); current_frame.pop_stack( @@ -1016,8 +1015,8 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.DCMPL : - case ClassFile.DCMPG : + case DCMPL : + case DCMPG : current_frame.pop_stack_2( VerificationType.double2_type, VerificationType.double_type); @@ -1027,63 +1026,63 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.IF_ICMPEQ: - case ClassFile.IF_ICMPNE: - case ClassFile.IF_ICMPLT: - case ClassFile.IF_ICMPGE: - case ClassFile.IF_ICMPGT: - case ClassFile.IF_ICMPLE: + case IF_ICMPEQ: + case IF_ICMPNE: + case IF_ICMPLT: + case IF_ICMPGE: + case IF_ICMPGT: + case IF_ICMPLE: current_frame.pop_stack( VerificationType.integer_type); // fall through - case ClassFile.IFEQ: - case ClassFile.IFNE: - case ClassFile.IFLT: - case ClassFile.IFGE: - case ClassFile.IFGT: - case ClassFile.IFLE: + case IFEQ: + case IFNE: + case IFLT: + case IFGE: + case IFGT: + case IFLE: current_frame.pop_stack( VerificationType.integer_type); target = bcs.dest(); stackmap_table.check_jump_target( current_frame, target); no_control_flow = false; break; - case ClassFile.IF_ACMPEQ : - case ClassFile.IF_ACMPNE : + case IF_ACMPEQ : + case IF_ACMPNE : current_frame.pop_stack( VerificationType.reference_check); // fall through - case ClassFile.IFNULL : - case ClassFile.IFNONNULL : + case IFNULL : + case IFNONNULL : current_frame.pop_stack( VerificationType.reference_check); target = bcs.dest(); stackmap_table.check_jump_target (current_frame, target); no_control_flow = false; break; - case ClassFile.GOTO : + case GOTO : target = bcs.dest(); stackmap_table.check_jump_target( current_frame, target); no_control_flow = true; break; - case ClassFile.GOTO_W : + case GOTO_W : target = bcs.destW(); stackmap_table.check_jump_target( current_frame, target); no_control_flow = true; break; - case ClassFile.TABLESWITCH : - case ClassFile.LOOKUPSWITCH : + case TABLESWITCH : + case LOOKUPSWITCH : verify_switch( bcs, code_length, code_data, current_frame, stackmap_table); no_control_flow = true; break; - case ClassFile.IRETURN : + case IRETURN : type = current_frame.pop_stack( VerificationType.integer_type); verify_return_value(return_type, type, bci, current_frame); no_control_flow = true; break; - case ClassFile.LRETURN : + case LRETURN : type2 = current_frame.pop_stack( VerificationType.long2_type); type = current_frame.pop_stack( @@ -1091,13 +1090,13 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verify_return_value(return_type, type, bci, current_frame); no_control_flow = true; break; - case ClassFile.FRETURN : + case FRETURN : type = current_frame.pop_stack( VerificationType.float_type); verify_return_value(return_type, type, bci, current_frame); no_control_flow = true; break; - case ClassFile.DRETURN : + case DRETURN : type2 = current_frame.pop_stack( VerificationType.double2_type); type = current_frame.pop_stack( @@ -1105,13 +1104,13 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verify_return_value(return_type, type, bci, current_frame); no_control_flow = true; break; - case ClassFile.ARETURN : + case ARETURN : type = current_frame.pop_stack( VerificationType.reference_check); verify_return_value(return_type, type, bci, current_frame); no_control_flow = true; break; - case ClassFile.RETURN: + case RETURN: if (!return_type.is_bogus()) { verifyError("Method expects a return value"); } @@ -1120,24 +1119,24 @@ void verify_method(VerificationWrapper.MethodWrapper m) { verifyError("Constructor must call super() or this() before return"); } no_control_flow = true; break; - case ClassFile.GETSTATIC : - case ClassFile.PUTSTATIC : + case GETSTATIC : + case PUTSTATIC : verify_field_instructions(bcs, current_frame, cp, true); no_control_flow = false; break; - case ClassFile.GETFIELD : - case ClassFile.PUTFIELD : + case GETFIELD : + case PUTFIELD : verify_field_instructions(bcs, current_frame, cp, false); no_control_flow = false; break; - case ClassFile.INVOKEVIRTUAL : - case ClassFile.INVOKESPECIAL : - case ClassFile.INVOKESTATIC : + case INVOKEVIRTUAL : + case INVOKESPECIAL : + case INVOKESTATIC : this_uninit = verify_invoke_instructions(bcs, code_length, current_frame, (bci >= ex_minmax[0] && bci < ex_minmax[1]), this_uninit, return_type, cp, stackmap_table); no_control_flow = false; break; - case ClassFile.INVOKEINTERFACE : - case ClassFile.INVOKEDYNAMIC : + case INVOKEINTERFACE : + case INVOKEDYNAMIC : this_uninit = verify_invoke_instructions(bcs, code_length, current_frame, (bci >= ex_minmax[0] && bci < ex_minmax[1]), this_uninit, return_type, cp, stackmap_table); no_control_flow = false; break; - case ClassFile.NEW : + case NEW : { index = bcs.getIndexU2(); verify_cp_class_type(bci, index, cp); @@ -1150,16 +1149,16 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack(type); no_control_flow = false; break; } - case ClassFile.NEWARRAY : + case NEWARRAY : type = get_newarray_type(bcs.getIndex(), bci); current_frame.pop_stack( VerificationType.integer_type); current_frame.push_stack(type); no_control_flow = false; break; - case ClassFile.ANEWARRAY : + case ANEWARRAY : verify_anewarray(bci, bcs.getIndexU2(), cp, current_frame); no_control_flow = false; break; - case ClassFile.ARRAYLENGTH : + case ARRAYLENGTH : type = current_frame.pop_stack( VerificationType.reference_check); if (!(type.is_null() || type.is_array())) { @@ -1168,7 +1167,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack( VerificationType.integer_type); no_control_flow = false; break; - case ClassFile.CHECKCAST : + case CHECKCAST : { index = bcs.getIndexU2(); verify_cp_class_type(bci, index, cp); @@ -1178,7 +1177,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack(klass_type); no_control_flow = false; break; } - case ClassFile.INSTANCEOF : { + case INSTANCEOF : { index = bcs.getIndexU2(); verify_cp_class_type(bci, index, cp); current_frame.pop_stack(object_type()); @@ -1186,12 +1185,12 @@ void verify_method(VerificationWrapper.MethodWrapper m) { VerificationType.integer_type); no_control_flow = false; break; } - case ClassFile.MONITORENTER : - case ClassFile.MONITOREXIT : + case MONITORENTER : + case MONITOREXIT : current_frame.pop_stack( VerificationType.reference_check); no_control_flow = false; break; - case ClassFile.MULTIANEWARRAY : + case MULTIANEWARRAY : { index = bcs.getIndexU2(); int dim = _method.codeArray()[bcs.bci() +3] & 0xff; @@ -1211,7 +1210,7 @@ void verify_method(VerificationWrapper.MethodWrapper m) { current_frame.push_stack(new_array_type); no_control_flow = false; break; } - case ClassFile.ATHROW : + case ATHROW : type = VerificationType.reference_type(java_lang_Throwable); current_frame.pop_stack(type); no_control_flow = true; break; @@ -1235,7 +1234,7 @@ private byte[] generate_code_data(RawBytecodeHelper.CodeRange code) { while (bcs.next()) { if (bcs.opcode() != ILLEGAL) { int bci = bcs.bci(); - if (bcs.opcode() == ClassFile.NEW) { + if (bcs.opcode() == NEW) { code_data[bci] = NEW_OFFSET; } else { code_data[bci] = BYTECODE_OFFSET; @@ -1368,14 +1367,14 @@ void verify_ldc(int opcode, int index, VerificationFrame current_frame, Constant verify_cp_index(bci, cp, index); int tag = cp.tagAt(index); int types = 0; - if (opcode == ClassFile.LDC || opcode == ClassFile.LDC_W) { + if (opcode == LDC || opcode == LDC_W) { types = (1 << JVM_CONSTANT_Integer) | (1 << JVM_CONSTANT_Float) | (1 << JVM_CONSTANT_String) | (1 << JVM_CONSTANT_Class) | (1 << JVM_CONSTANT_MethodHandle) | (1 << JVM_CONSTANT_MethodType) | (1 << JVM_CONSTANT_Dynamic); verify_cp_type(bci, index, cp, types); } else { - if (opcode != ClassFile.LDC2_W) verifyError("must be ldc2_w"); + if (opcode != LDC2_W) verifyError("must be ldc2_w"); types = (1 << JVM_CONSTANT_Double) | (1 << JVM_CONSTANT_Long) | (1 << JVM_CONSTANT_Dynamic); verify_cp_type(bci, index, cp, types); } @@ -1395,7 +1394,7 @@ void verify_ldc(int opcode, int index, VerificationFrame current_frame, Constant VerificationType[] v_constant_type = new VerificationType[2]; var sig_stream = new VerificationSignature(constant_type, false, this); int n = change_sig_to_verificationType(sig_stream, v_constant_type, 0); - int opcode_n = (opcode == ClassFile.LDC2_W ? 2 : 1); + int opcode_n = (opcode == LDC2_W ? 2 : 1); if (n != opcode_n) { types &= ~(1 << JVM_CONSTANT_Dynamic); verify_cp_type(bci, index, cp, types); @@ -1424,7 +1423,7 @@ void verify_switch(RawBytecodeHelper bcs, int code_length, byte[] code_data, Ver int default_offset = bcs.getIntUnchecked(aligned_bci); int keys, delta; current_frame.pop_stack(VerificationType.integer_type); - if (bcs.opcode() == ClassFile.TABLESWITCH) { + if (bcs.opcode() == TABLESWITCH) { int low = bcs.getIntUnchecked(aligned_bci + 4); int high = bcs.getIntUnchecked(aligned_bci + 2*4); if (low > high) { @@ -1477,24 +1476,24 @@ void verify_field_instructions(RawBytecodeHelper bcs, VerificationFrame current_ int n = change_sig_to_verificationType(sig_stream, field_type, 0); boolean is_assignable; switch (bcs.opcode()) { - case ClassFile.GETSTATIC -> { + case GETSTATIC -> { for (int i = 0; i < n; i++) { current_frame.push_stack(field_type[i]); } } - case ClassFile.PUTSTATIC -> { + case PUTSTATIC -> { for (int i = n - 1; i >= 0; i--) { current_frame.pop_stack(field_type[i]); } } - case ClassFile.GETFIELD -> { + case GETFIELD -> { stack_object_type = current_frame.pop_stack( target_class_type); for (int i = 0; i < n; i++) { current_frame.push_stack(field_type[i]); } } - case ClassFile.PUTFIELD -> { + case PUTFIELD -> { for (int i = n - 1; i >= 0; i--) { current_frame.pop_stack(field_type[i]); } @@ -1548,7 +1547,7 @@ boolean verify_invoke_init(RawBytecodeHelper bcs, int ref_class_index, Verificat this_uninit = true; } else if (type.is_uninitialized()) { int new_offset = type.bci(this); - if (new_offset > (code_length - 3) || (_method.codeArray()[new_offset] & 0xff) != ClassFile.NEW) { + if (new_offset > (code_length - 3) || (_method.codeArray()[new_offset] & 0xff) != NEW) { verifyError("Expecting new instruction"); } int new_class_index = bcs.getU2(new_offset + 1); @@ -1585,14 +1584,14 @@ boolean verify_invoke_instructions(RawBytecodeHelper bcs, int code_length, Verif int opcode = bcs.opcode(); int types = 0; switch (opcode) { - case ClassFile.INVOKEINTERFACE: + case INVOKEINTERFACE: types = 1 << JVM_CONSTANT_InterfaceMethodref; break; - case ClassFile.INVOKEDYNAMIC: + case INVOKEDYNAMIC: types = 1 << JVM_CONSTANT_InvokeDynamic; break; - case ClassFile.INVOKESPECIAL: - case ClassFile.INVOKESTATIC: + case INVOKESPECIAL: + case INVOKESTATIC: types = (_klass.majorVersion() < STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION) ? (1 << JVM_CONSTANT_Methodref) : ((1 << JVM_CONSTANT_InterfaceMethodref) | (1 << JVM_CONSTANT_Methodref)); @@ -1605,7 +1604,7 @@ boolean verify_invoke_instructions(RawBytecodeHelper bcs, int code_length, Verif String method_sig = cp.refSignatureAt(index); if (!VerificationSignature.isValidMethodSignature(method_sig)) verifyError("Invalid method signature"); VerificationType ref_class_type = null; - if (opcode == ClassFile.INVOKEDYNAMIC) { + if (opcode == INVOKEDYNAMIC) { if (_klass.majorVersion() < INVOKEDYNAMIC_MAJOR_VERSION) { classError(String.format("invokedynamic instructions not supported by this class file version (%d), class %s", _klass.majorVersion(), _klass.thisClassName())); } @@ -1619,7 +1618,7 @@ boolean verify_invoke_instructions(RawBytecodeHelper bcs, int code_length, Verif create_method_sig_entry(mth_sig_verif_types, sig); int nargs = mth_sig_verif_types.num_args(); int bci = bcs.bci(); - if (opcode == ClassFile.INVOKEINTERFACE) { + if (opcode == INVOKEINTERFACE) { if ((_method.codeArray()[bci+3] & 0xff) != (nargs+1)) { verifyError("Inconsistent args count operand in invokeinterface"); } @@ -1627,17 +1626,17 @@ boolean verify_invoke_instructions(RawBytecodeHelper bcs, int code_length, Verif verifyError("Fourth operand byte of invokeinterface must be zero"); } } - if (opcode == ClassFile.INVOKEDYNAMIC) { + if (opcode == INVOKEDYNAMIC) { if ((_method.codeArray()[bci+3] & 0xff) != 0 || (_method.codeArray()[bci+4] & 0xff) != 0) { verifyError("Third and fourth operand bytes of invokedynamic must be zero"); } } if (method_name.charAt(0) == JVM_SIGNATURE_SPECIAL) { - if (opcode != ClassFile.INVOKESPECIAL || + if (opcode != INVOKESPECIAL || !object_initializer_name.equals(method_name)) { verifyError("Illegal call to internal method"); } - } else if (opcode == ClassFile.INVOKESPECIAL + } else if (opcode == INVOKESPECIAL && !is_same_or_direct_interface(current_class(), current_type(), ref_class_type) && !ref_class_type.equals(VerificationType.reference_type( current_class().superclassName()))) { @@ -1655,16 +1654,16 @@ boolean verify_invoke_instructions(RawBytecodeHelper bcs, int code_length, Verif for (int i = nargs - 1; i >= 0; i--) { // Run backwards current_frame.pop_stack(sig_verif_types.get(i)); } - if (opcode != ClassFile.INVOKESTATIC && - opcode != ClassFile.INVOKEDYNAMIC) { + if (opcode != INVOKESTATIC && + opcode != INVOKEDYNAMIC) { if (object_initializer_name.equals(method_name)) { // method this_uninit = verify_invoke_init(bcs, index, ref_class_type, current_frame, code_length, in_try_block, this_uninit, cp, stackmap_table); } else { switch (opcode) { - case ClassFile.INVOKESPECIAL -> + case INVOKESPECIAL -> current_frame.pop_stack(current_type()); - case ClassFile.INVOKEVIRTUAL -> { + case INVOKEVIRTUAL -> { VerificationType stack_object_type = current_frame.pop_stack(ref_class_type); if (current_type() != stack_object_type) { @@ -1672,7 +1671,7 @@ boolean verify_invoke_instructions(RawBytecodeHelper bcs, int code_length, Verif } } default -> { - if (opcode != ClassFile.INVOKEINTERFACE) + if (opcode != INVOKEINTERFACE) verifyError("Unexpected opcode encountered"); current_frame.pop_stack(ref_class_type); } diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java index 3b9336c499d9c..cccbaf14f5399 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java @@ -35,6 +35,7 @@ import java.lang.classfile.attribute.*; import static java.lang.classfile.ClassFile.*; import static java.lang.classfile.attribute.StackMapFrameInfo.*; +import static java.lang.classfile.instruction.CharacterRange.*; /* * A writer for writing Attributes as text. @@ -144,23 +145,23 @@ public void write(Attribute a, CodeAttribute lr) { (e.characterRangeStart() & 0x3ff), (e.characterRangeEnd() >> 10), (e.characterRangeEnd() & 0x3ff))); - if ((e.flags() & CRT_STATEMENT) != 0) + if ((e.flags() & FLAG_STATEMENT) != 0) print(", statement"); - if ((e.flags() & CRT_BLOCK) != 0) + if ((e.flags() & FLAG_BLOCK) != 0) print(", block"); - if ((e.flags() & CRT_ASSIGNMENT) != 0) + if ((e.flags() & FLAG_ASSIGNMENT) != 0) print(", assignment"); - if ((e.flags() & CRT_FLOW_CONTROLLER) != 0) + if ((e.flags() & FLAG_FLOW_CONTROLLER) != 0) print(", flow-controller"); - if ((e.flags() & CRT_FLOW_TARGET) != 0) + if ((e.flags() & FLAG_FLOW_TARGET) != 0) print(", flow-target"); - if ((e.flags() & CRT_INVOKE) != 0) + if ((e.flags() & FLAG_INVOKE) != 0) print(", invoke"); - if ((e.flags() & CRT_CREATE) != 0) + if ((e.flags() & FLAG_CREATE) != 0) print(", create"); - if ((e.flags() & CRT_BRANCH_TRUE) != 0) + if ((e.flags() & FLAG_BRANCH_TRUE) != 0) print(", branch-true"); - if ((e.flags() & CRT_BRANCH_FALSE) != 0) + if ((e.flags() & FLAG_BRANCH_FALSE) != 0) print(", branch-false"); println(); } @@ -705,13 +706,13 @@ void printMap(String name, List map, CodeAttribute lr) { String mapTypeName(SimpleVerificationTypeInfo type) { return switch (type) { - case ITEM_TOP -> "top"; - case ITEM_INTEGER -> "int"; - case ITEM_FLOAT -> "float"; - case ITEM_LONG -> "long"; - case ITEM_DOUBLE -> "double"; - case ITEM_NULL -> "null"; - case ITEM_UNINITIALIZED_THIS -> "this"; + case TOP -> "top"; + case INTEGER -> "int"; + case FLOAT -> "float"; + case LONG -> "long"; + case DOUBLE -> "double"; + case NULL -> "null"; + case UNINITIALIZED_THIS -> "this"; }; } diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java index 764f93bd54aeb..77fbce8839e72 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java @@ -741,7 +741,7 @@ static String getJavaName(String name) { */ String getConstantValue(ClassDesc d, ConstantValueEntry cpInfo) { switch (cpInfo.tag()) { - case ClassFile.TAG_INTEGER: { + case PoolEntry.TAG_INTEGER: { var val = (Integer)cpInfo.constantValue(); switch (d.descriptorString()) { case "C": @@ -755,7 +755,7 @@ String getConstantValue(ClassDesc d, ConstantValueEntry cpInfo) { return String.valueOf(val); } } - case ClassFile.TAG_STRING: + case PoolEntry.TAG_STRING: return getConstantStringValue(cpInfo.constantValue().toString()); default: return constantWriter.stringValue(cpInfo); diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java index c649ce982969e..b3c6b5b6c640d 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java @@ -26,7 +26,8 @@ package com.sun.tools.javap; import java.lang.classfile.constantpool.*; -import static java.lang.classfile.ClassFile.*; + +import static java.lang.classfile.constantpool.PoolEntry.*; /* * Write a constant pool entry. @@ -156,13 +157,13 @@ String cpTagName(int tag) { case TAG_CLASS -> "Class"; case TAG_STRING -> "String"; case TAG_FIELDREF -> "Fieldref"; - case TAG_METHODHANDLE -> "MethodHandle"; - case TAG_METHODTYPE -> "MethodType"; + case TAG_METHOD_HANDLE -> "MethodHandle"; + case TAG_METHOD_TYPE -> "MethodType"; case TAG_METHODREF -> "Methodref"; - case TAG_INTERFACEMETHODREF -> "InterfaceMethodref"; - case TAG_INVOKEDYNAMIC -> "InvokeDynamic"; - case TAG_CONSTANTDYNAMIC -> "Dynamic"; - case TAG_NAMEANDTYPE -> "NameAndType"; + case TAG_INTERFACE_METHODREF -> "InterfaceMethodref"; + case TAG_INVOKE_DYNAMIC -> "InvokeDynamic"; + case TAG_DYNAMIC -> "Dynamic"; + case TAG_NAME_AND_TYPE -> "NameAndType"; default -> "Unknown"; }; } @@ -177,13 +178,13 @@ String tagName(int tag) { case TAG_CLASS -> "class"; case TAG_STRING -> "String"; case TAG_FIELDREF -> "Field"; - case TAG_METHODHANDLE -> "MethodHandle"; - case TAG_METHODTYPE -> "MethodType"; + case TAG_METHOD_HANDLE -> "MethodHandle"; + case TAG_METHOD_TYPE -> "MethodType"; case TAG_METHODREF -> "Method"; - case TAG_INTERFACEMETHODREF -> "InterfaceMethod"; - case TAG_INVOKEDYNAMIC -> "InvokeDynamic"; - case TAG_CONSTANTDYNAMIC -> "Dynamic"; - case TAG_NAMEANDTYPE -> "NameAndType"; + case TAG_INTERFACE_METHODREF -> "InterfaceMethod"; + case TAG_INVOKE_DYNAMIC -> "InvokeDynamic"; + case TAG_DYNAMIC -> "Dynamic"; + case TAG_NAME_AND_TYPE -> "NameAndType"; default -> "(unknown tag " + tag + ")"; }; } diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/StackMapWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/StackMapWriter.java index a1d939bcc4f23..d899569724e66 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/StackMapWriter.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/StackMapWriter.java @@ -122,25 +122,25 @@ void print(StackMapFrameInfo.VerificationTypeInfo entry, boolean firstThis) { switch (entry) { case StackMapFrameInfo.SimpleVerificationTypeInfo s -> { switch (s) { - case ITEM_TOP -> + case TOP -> print("top"); - case ITEM_INTEGER -> + case INTEGER -> print("int"); - case ITEM_FLOAT -> + case FLOAT -> print("float"); - case ITEM_LONG -> + case LONG -> print("long"); - case ITEM_DOUBLE -> + case DOUBLE -> print("double"); - case ITEM_NULL -> + case NULL -> print("null"); - case ITEM_UNINITIALIZED_THIS -> + case UNINITIALIZED_THIS -> print("uninit_this"); } } diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java index 4edc90a97b7be..9b9e7ad1ce893 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java @@ -33,6 +33,8 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; + +import static java.lang.classfile.constantpool.PoolEntry.*; import static java.util.ResourceBundle.Control; import java.util.Set; import java.util.function.IntUnaryOperator; @@ -41,7 +43,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; -import static java.lang.classfile.ClassFile.*; + import jdk.tools.jlink.internal.ResourcePrevisitor; import jdk.tools.jlink.internal.StringTable; import jdk.tools.jlink.plugin.ResourcePoolModule; @@ -300,18 +302,18 @@ private boolean stripUnsupportedLocales(byte[] bytes) { } case TAG_CLASS, TAG_STRING, - TAG_METHODTYPE, + TAG_METHOD_TYPE, TAG_MODULE, TAG_PACKAGE -> offset += 3; - case TAG_METHODHANDLE -> offset += 4; + case TAG_METHOD_HANDLE -> offset += 4; case TAG_INTEGER, TAG_FLOAT, TAG_FIELDREF, TAG_METHODREF, - TAG_INTERFACEMETHODREF, - TAG_NAMEANDTYPE, - TAG_CONSTANTDYNAMIC, - TAG_INVOKEDYNAMIC -> offset += 5; + TAG_INTERFACE_METHODREF, + TAG_NAME_AND_TYPE, + TAG_DYNAMIC, + TAG_INVOKE_DYNAMIC -> offset += 5; case TAG_LONG, TAG_DOUBLE -> {offset += 9; cpSlot++;} //additional slot for double and long entries default -> throw new IllegalArgumentException("Unknown constant pool entry: 0x" diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StringSharingPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StringSharingPlugin.java index 6f8bc9b7779bf..71c509e7deafd 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StringSharingPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StringSharingPlugin.java @@ -51,6 +51,8 @@ import jdk.tools.jlink.internal.ResourcePrevisitor; import jdk.tools.jlink.internal.StringTable; +import static java.lang.classfile.constantpool.PoolEntry.*; + /** * * A Plugin that stores the image classes constant pool UTF_8 entries into the @@ -214,7 +216,7 @@ private byte[] optimize(ResourcePoolEntry resource, ResourcePoolBuilder resource int tag = stream.readUnsignedByte(); byte[] arr; switch (tag) { - case ClassFile.TAG_UTF8: { + case TAG_UTF8: { String original = stream.readUTF(); // 2 cases, a Descriptor or a simple String if (descriptorIndexes.contains(i)) { @@ -238,8 +240,8 @@ private byte[] optimize(ResourcePoolEntry resource, ResourcePoolBuilder resource break; } - case ClassFile.TAG_LONG: - case ClassFile.TAG_DOUBLE: + case TAG_LONG: + case TAG_DOUBLE: i++; default: { out.write(tag); diff --git a/test/jdk/jdk/classfile/LimitsTest.java b/test/jdk/jdk/classfile/LimitsTest.java index 9c7b8d9e72d4a..a1899ac1c842b 100644 --- a/test/jdk/jdk/classfile/LimitsTest.java +++ b/test/jdk/jdk/classfile/LimitsTest.java @@ -28,6 +28,7 @@ * @run junit LimitsTest */ import java.lang.classfile.Attributes; +import java.lang.classfile.constantpool.PoolEntry; import java.lang.constant.ClassDesc; import java.lang.constant.ConstantDescs; import java.lang.constant.MethodTypeDesc; @@ -36,12 +37,10 @@ import java.lang.classfile.attribute.CodeAttribute; import java.lang.classfile.attribute.LineNumberInfo; import java.lang.classfile.attribute.LineNumberTableAttribute; -import java.lang.classfile.attribute.LocalVariableInfo; import java.lang.classfile.attribute.LocalVariableTableAttribute; import java.lang.classfile.constantpool.ConstantPoolBuilder; import java.lang.classfile.constantpool.ConstantPoolException; import java.lang.classfile.constantpool.IntegerEntry; -import java.lang.classfile.instruction.LocalVariable; import java.util.List; import jdk.internal.classfile.impl.BufWriterImpl; @@ -113,13 +112,13 @@ void testReadingOutOfBounds() { @Test void testInvalidClassEntry() { assertThrows(ConstantPoolException.class, () -> ClassFile.of().parse(new byte[]{(byte)0xCA, (byte)0xFE, (byte)0xBA, (byte)0xBE, - 0, 0, 0, 0, 0, 2, ClassFile.TAG_METHODREF, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}).thisClass()); + 0, 0, 0, 0, 0, 2, PoolEntry.TAG_METHODREF, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}).thisClass()); } @Test void testInvalidUtf8Entry() { var cp = ClassFile.of().parse(new byte[]{(byte)0xCA, (byte)0xFE, (byte)0xBA, (byte)0xBE, - 0, 0, 0, 0, 0, 3, ClassFile.TAG_INTEGER, 0, 0, 0, 0, ClassFile.TAG_NAMEANDTYPE, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}).constantPool(); + 0, 0, 0, 0, 0, 3, PoolEntry.TAG_INTEGER, 0, 0, 0, 0, PoolEntry.TAG_NAME_AND_TYPE, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}).constantPool(); assertTrue(cp.entryByIndex(1) instanceof IntegerEntry); //parse valid int entry first assertThrows(ConstantPoolException.class, () -> cp.entryByIndex(2)); } diff --git a/test/jdk/jdk/classfile/StackMapsTest.java b/test/jdk/jdk/classfile/StackMapsTest.java index 09be56f0de2a1..1ccd7255ed4b9 100644 --- a/test/jdk/jdk/classfile/StackMapsTest.java +++ b/test/jdk/jdk/classfile/StackMapsTest.java @@ -385,9 +385,9 @@ void testDeadCodeCountersWithCustomSMTA() { StackMapTableAttribute.of(List.of( StackMapFrameInfo.of(f2, List.of(), - List.of(StackMapFrameInfo.SimpleVerificationTypeInfo.ITEM_LONG)), + List.of(StackMapFrameInfo.SimpleVerificationTypeInfo.LONG)), StackMapFrameInfo.of(f3, - List.of(StackMapFrameInfo.SimpleVerificationTypeInfo.ITEM_LONG), + List.of(StackMapFrameInfo.SimpleVerificationTypeInfo.LONG), List.of())))); } )); diff --git a/test/jdk/jdk/classfile/VerifierSelfTest.java b/test/jdk/jdk/classfile/VerifierSelfTest.java index d0943d2eee9f5..b6a2f08c9ecd7 100644 --- a/test/jdk/jdk/classfile/VerifierSelfTest.java +++ b/test/jdk/jdk/classfile/VerifierSelfTest.java @@ -29,6 +29,7 @@ * @run junit VerifierSelfTest */ import java.io.IOException; +import java.lang.classfile.constantpool.PoolEntry; import java.lang.constant.ClassDesc; import static java.lang.constant.ConstantDescs.*; import java.lang.invoke.MethodHandleInfo; @@ -116,7 +117,7 @@ public void writeBody(BufWriterImpl b) { void testInvalidClassNameEntry() { var cc = ClassFile.of(); var bytes = cc.parse(new byte[]{(byte)0xCA, (byte)0xFE, (byte)0xBA, (byte)0xBE, - 0, 0, 0, 0, 0, 2, ClassFile.TAG_INTEGER, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}); + 0, 0, 0, 0, 0, 2, PoolEntry.TAG_INTEGER, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}); assertTrue(cc.verify(bytes).stream().anyMatch(e -> e.getMessage().contains("expected ClassEntry"))); } diff --git a/test/jdk/jdk/classfile/helpers/ClassRecord.java b/test/jdk/jdk/classfile/helpers/ClassRecord.java index 329e41fa0f484..e7a239015f605 100644 --- a/test/jdk/jdk/classfile/helpers/ClassRecord.java +++ b/test/jdk/jdk/classfile/helpers/ClassRecord.java @@ -22,21 +22,13 @@ */ package helpers; -import java.io.IOException; -import java.io.StringWriter; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.RecordComponent; import java.math.BigInteger; import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.NoSuchElementException; import java.util.Objects; import java.util.Set; import java.util.function.Function; @@ -53,9 +45,10 @@ import static java.util.stream.Collectors.toMap; import static java.util.stream.Collectors.toSet; -import static java.lang.classfile.ClassFile.*; import static java.lang.classfile.Attributes.*; +import static java.lang.classfile.constantpool.PoolEntry.*; import static helpers.ClassRecord.CompatibilityFilter.By_ClassBuilder; +import static jdk.internal.classfile.impl.RawBytecodeHelper.*; /** * ClassRecord @@ -916,17 +909,17 @@ public static ConstantPoolEntryRecord ofCPEntry(PoolEntry cpInfo) { CpFieldRefRecord.ofFieldRefEntry((FieldRefEntry) cpInfo); case TAG_METHODREF -> CpMethodRefRecord.ofMethodRefEntry((MethodRefEntry) cpInfo); - case TAG_INTERFACEMETHODREF -> + case TAG_INTERFACE_METHODREF -> CpInterfaceMethodRefRecord.ofInterfaceMethodRefEntry((InterfaceMethodRefEntry) cpInfo); - case TAG_NAMEANDTYPE -> + case TAG_NAME_AND_TYPE -> CpNameAndTypeRecord.ofNameAndTypeEntry((NameAndTypeEntry) cpInfo); - case TAG_METHODHANDLE -> + case TAG_METHOD_HANDLE -> CpMethodHandleRecord.ofMethodHandleEntry((MethodHandleEntry) cpInfo); - case TAG_METHODTYPE -> + case TAG_METHOD_TYPE -> new CpMethodTypeRecord(((MethodTypeEntry) cpInfo).descriptor().stringValue()); - case TAG_CONSTANTDYNAMIC -> + case TAG_DYNAMIC -> CpConstantDynamicRecord.ofConstantDynamicEntry((ConstantDynamicEntry) cpInfo); - case TAG_INVOKEDYNAMIC -> + case TAG_INVOKE_DYNAMIC -> CpInvokeDynamicRecord.ofInvokeDynamicEntry((InvokeDynamicEntry) cpInfo); case TAG_MODULE -> new CpModuleRecord(((ModuleEntry) cpInfo).name().stringValue()); From 10da2c21a19affe93a3f5d67a70db5d9cd37181c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Sj=C3=B6len?= Date: Thu, 26 Sep 2024 08:47:32 +0000 Subject: [PATCH 197/307] 8340923: The class LogSelection copies uninitialized memory Reviewed-by: mbaesken, jwaters, stefank --- src/hotspot/share/logging/logSelection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/logging/logSelection.cpp b/src/hotspot/share/logging/logSelection.cpp index aea5719b36d4f..1e7ba3a887848 100644 --- a/src/hotspot/share/logging/logSelection.cpp +++ b/src/hotspot/share/logging/logSelection.cpp @@ -33,11 +33,11 @@ const LogSelection LogSelection::Invalid; -LogSelection::LogSelection() : _ntags(0), _wildcard(false), _level(LogLevel::Invalid), _tag_sets_selected(0) { +LogSelection::LogSelection() : _ntags(0), _tags(), _wildcard(false), _level(LogLevel::Invalid), _tag_sets_selected(0) { } LogSelection::LogSelection(const LogTagType tags[LogTag::MaxTags], bool wildcard, LogLevelType level) - : _ntags(0), _wildcard(wildcard), _level(level), _tag_sets_selected(0) { + : _ntags(0), _tags(), _wildcard(wildcard), _level(level), _tag_sets_selected(0) { while (_ntags < LogTag::MaxTags && tags[_ntags] != LogTag::__NO_TAG) { _tags[_ntags] = tags[_ntags]; _ntags++; From e2626db2f00d0cc9f3ff8ea374a1ccc89373e398 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Thu, 26 Sep 2024 11:34:30 +0000 Subject: [PATCH 198/307] 8340899: Remove wildcard bound in PositionWindows.positionTestWindows Reviewed-by: azvegint, prr --- test/jdk/java/awt/regtesthelpers/PassFailJFrame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index 3a142c716b199..a6c11ad5f5df1 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -587,7 +587,7 @@ public interface PositionWindows { * @param testWindows the list of test windows * @param instructionUI information about the instruction frame */ - void positionTestWindows(List testWindows, + void positionTestWindows(List testWindows, InstructionUI instructionUI); } From 3762ec3978bfe9910929ab22aaf238e9f4c84630 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Thu, 26 Sep 2024 11:36:42 +0000 Subject: [PATCH 199/307] 8340466: Add description for PassFailJFrame constructors Reviewed-by: prr, honkar --- .../awt/regtesthelpers/PassFailJFrame.java | 196 +++++++++++++----- 1 file changed, 139 insertions(+), 57 deletions(-) diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index a6c11ad5f5df1..45cd191ae39db 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -213,90 +213,172 @@ public final class PassFailJFrame { public enum Position {HORIZONTAL, VERTICAL, TOP_LEFT_CORNER} - public PassFailJFrame(String instructions) throws InterruptedException, - InvocationTargetException { + /** + * Constructs a frame which displays test instructions and + * the Pass / Fail buttons with the given instructions, and + * the default timeout of {@value #TEST_TIMEOUT} minutes, + * the default title of {@value #TITLE} and + * the default values of {@value #ROWS} and {@value #COLUMNS} + * for rows and columns. + *

      + * See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for + * more details. + * + * @param instructions the instructions for the tester + * + * @throws InterruptedException if the current thread is interrupted + * while waiting for EDT to finish creating UI components + * @throws InvocationTargetException if an exception is thrown while + * creating UI components on EDT + */ + public PassFailJFrame(String instructions) + throws InterruptedException, InvocationTargetException { this(instructions, TEST_TIMEOUT); } - public PassFailJFrame(String instructions, long testTimeOut) throws - InterruptedException, InvocationTargetException { + /** + * Constructs a frame which displays test instructions and + * the Pass / Fail buttons + * with the given instructions and timeout as well as + * the default title of {@value #TITLE} + * and the default values of {@value #ROWS} and {@value #COLUMNS} + * for rows and columns. + *

      + * See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for + * more details. + * + * @param instructions the instructions for the tester + * @param testTimeOut the test timeout in minutes + * + * @throws InterruptedException if the current thread is interrupted + * while waiting for EDT to finish creating UI components + * @throws InvocationTargetException if an exception is thrown while + * creating UI components on EDT + */ + public PassFailJFrame(String instructions, long testTimeOut) + throws InterruptedException, InvocationTargetException { this(TITLE, instructions, testTimeOut); } + /** + * Constructs a frame which displays test instructions and + * the Pass / Fail buttons + * with the given title, instructions and timeout as well as + * the default values of {@value #ROWS} and {@value #COLUMNS} + * for rows and columns. + * The screenshot feature is not enabled, if you use this constructor. + *

      + * See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for + * more details. + * + * @param title the title of the instruction frame + * @param instructions the instructions for the tester + * @param testTimeOut the test timeout in minutes + * + * @throws InterruptedException if the current thread is interrupted + * while waiting for EDT to finish creating UI components + * @throws InvocationTargetException if an exception is thrown while + * creating UI components on EDT + */ public PassFailJFrame(String title, String instructions, - long testTimeOut) throws InterruptedException, - InvocationTargetException { + long testTimeOut) + throws InterruptedException, InvocationTargetException { this(title, instructions, testTimeOut, ROWS, COLUMNS); } /** - * Constructs a JFrame with a given title & serves as test instructional - * frame where the user follows the specified test instruction in order - * to test the test case & mark the test pass or fail. If the expected - * result is seen then the user click on the 'Pass' button else click - * on the 'Fail' button and the reason for the failure should be - * specified in the JDialog JTextArea. + * Constructs a frame which displays test instructions and + * the Pass / Fail buttons + * with the given title, instructions, timeout, number of rows and columns. + * The screenshot feature is not enabled, if you use this constructor. + *

      + * See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for + * more details. * - * @param title title of the Frame. - * @param instructions the instruction for the tester on how to test - * and what is expected (pass) and what is not - * expected (fail). - * @param testTimeOut test timeout where time is specified in minutes. - * @param rows number of visible rows of the JTextArea where the - * instruction is show. - * @param columns Number of columns of the instructional - * JTextArea - * @throws InterruptedException exception thrown when thread is - * interrupted + * @param title the title of the instruction frame + * @param instructions the instructions for the tester + * @param testTimeOut the test timeout in minutes + * @param rows the number of rows for the text component + * which displays test instructions + * @param columns the number of columns for the text component + * which displays test instructions + * + * @throws InterruptedException if the current thread is interrupted + * while waiting for EDT to finish creating UI components * @throws InvocationTargetException if an exception is thrown while - * creating the test instruction frame on - * EDT + * creating UI components on EDT */ - public PassFailJFrame(String title, String instructions, long testTimeOut, - int rows, int columns) throws InterruptedException, - InvocationTargetException { + public PassFailJFrame(String title, String instructions, + long testTimeOut, + int rows, int columns) + throws InterruptedException, InvocationTargetException { this(title, instructions, testTimeOut, rows, columns, false); } /** - * Constructs a JFrame with a given title & serves as test instructional - * frame where the user follows the specified test instruction in order - * to test the test case & mark the test pass or fail. If the expected - * result is seen then the user click on the 'Pass' button else click - * on the 'Fail' button and the reason for the failure should be - * specified in the JDialog JTextArea. + * Constructs a frame which displays test instructions and + * the Pass / Fail buttons + * as well as supporting UI components with the given title, instructions, + * timeout, number of rows and columns, + * and screen capture functionality. + * All the UI components are created on the EDT, so it is safe to call + * the constructor on the main thread. *

      - * The test instruction frame also provides a way for the tester to take - * a screenshot (full screen or individual frame) if this feature - * is enabled by passing {@code true} as {@code enableScreenCapture} - * parameter. + * After you create a test UI window, register the window using + * {@link #addTestWindow(Window) addTestWindow} for disposal, and + * position it close to the instruction frame using + * {@link #positionTestWindow(Window, Position) positionTestWindow}. + * As the last step, make your test UI window visible. + *

      + * Call the {@link #awaitAndCheck() awaitAndCheck} method on the instance + * of {@code PassFailJFrame} when you set up the testing environment. + *

      + * If the tester clicks the Fail button, a dialog prompting for + * a description of the problem is displayed, and then an exception + * is thrown which fails the test. + * If the tester clicks the Pass button, the test completes + * successfully. + * If the timeout occurs or the instruction frame is closed, + * the test fails. + *

      + * The {@code rows} and {@code columns} parameters control + * the size of a text component which displays the instructions. + * The preferred size of the instructions is calculated by + * creating {@code new JTextArea(rows, columns)}. + *

      + * If you enable screenshots by setting the {@code screenCapture} + * parameter to {@code true}, a Screenshot button is added. + * Clicking the Screenshot button takes screenshots of + * all the monitors or all the windows registered with + * {@code PassFailJFrame}. * - * @param title title of the Frame. - * @param instructions the instruction for the tester on how to test - * and what is expected (pass) and what is not - * expected (fail). - * @param testTimeOut test timeout where time is specified in minutes. - * @param rows number of visible rows of the JTextArea where the - * instruction is show. - * @param columns Number of columns of the instructional - * JTextArea - * @param enableScreenCapture if set to true, 'Capture Screen' button & its - * associated UIs are added to test instruction - * frame - * @throws InterruptedException exception thrown when thread is - * interrupted + * @param title the title of the instruction frame + * @param instructions the instructions for the tester + * @param testTimeOut the test timeout in minutes + * @param rows the number of rows for the text component + * which displays test instructions + * @param columns the number of columns for the text component + * which displays test instructions + * @param screenCapture if set to {@code true}, enables screen capture + * functionality + * + * @throws InterruptedException if the current thread is interrupted + * while waiting for EDT to finish creating UI components * @throws InvocationTargetException if an exception is thrown while - * creating the test instruction frame on - * EDT + * creating UI components on EDT + * + * @see JTextArea#JTextArea(int,int) JTextArea(int rows, int columns) + * @see Builder Builder */ - public PassFailJFrame(String title, String instructions, long testTimeOut, + public PassFailJFrame(String title, String instructions, + long testTimeOut, int rows, int columns, - boolean enableScreenCapture) + boolean screenCapture) throws InterruptedException, InvocationTargetException { invokeOnEDT(() -> createUI(title, instructions, testTimeOut, rows, columns, - enableScreenCapture)); + screenCapture)); } /** From 777c20cb14010b6726834246ae4c61bc4ccb3f9b Mon Sep 17 00:00:00 2001 From: Lutz Schmidt Date: Thu, 26 Sep 2024 11:45:09 +0000 Subject: [PATCH 200/307] 8339542: compiler/codecache/CheckSegmentedCodeCache.java fails Reviewed-by: mdoerr, shade --- .../jtreg/compiler/codecache/CheckSegmentedCodeCache.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java b/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java index d0b45333fb8b3..ecdb415843bf0 100644 --- a/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java +++ b/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java @@ -179,7 +179,9 @@ public static void main(String[] args) throws Exception { // Fails if code heap sizes do not add up pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", "-XX:ReservedCodeCacheSize=10M", - "-XX:NonNMethodCodeHeapSize=5M", + // After fixing a round_down issue with large page sizes (JDK-8334564), + // 5M is a bit too small for NonNMethodCodeHeap + "-XX:NonNMethodCodeHeapSize=6M", "-XX:ProfiledCodeHeapSize=5M", "-XX:NonProfiledCodeHeapSize=5M", "-version"); From 47fcf5a3b0796ffeb6407be961ceb552ca2a40f8 Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Thu, 26 Sep 2024 12:33:23 +0000 Subject: [PATCH 201/307] 8340687: Open source closed frame tests #1 Reviewed-by: aivanov --- .../java/awt/Frame/DefaultFrameIconTest.java | 77 ++++++++ test/jdk/java/awt/Frame/DisposeTest.java | 112 +++++++++++ test/jdk/java/awt/Frame/FramePaintTest.java | 91 +++++++++ test/jdk/java/awt/Frame/MenuCrash.java | 178 ++++++++++++++++++ 4 files changed, 458 insertions(+) create mode 100644 test/jdk/java/awt/Frame/DefaultFrameIconTest.java create mode 100644 test/jdk/java/awt/Frame/DisposeTest.java create mode 100644 test/jdk/java/awt/Frame/FramePaintTest.java create mode 100644 test/jdk/java/awt/Frame/MenuCrash.java diff --git a/test/jdk/java/awt/Frame/DefaultFrameIconTest.java b/test/jdk/java/awt/Frame/DefaultFrameIconTest.java new file mode 100644 index 0000000000000..3ca3b70dbd1a1 --- /dev/null +++ b/test/jdk/java/awt/Frame/DefaultFrameIconTest.java @@ -0,0 +1,77 @@ +/* + * 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.Dialog; +import java.awt.Frame; +import java.awt.Window; +import java.util.List; + +/* + * @test + * @bug 4240766 8259023 + * @summary Frame Icon is wrong - should be Coffee Cup or Duke image icon + * @requires (os.family == "windows") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual DefaultFrameIconTest +*/ + +public class DefaultFrameIconTest { + + private static final String INSTRUCTIONS = """ + You should see a dialog and a frame. + If both have Coffee Cup or Duke image icon in the upper left corner, + the test passes, otherwise it fails. + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("DefaultFrameIconTest Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .testUI(DefaultFrameIconTest::createAndShowUI) + .positionTestUI(DefaultFrameIconTest::positionTestWindows) + .build() + .awaitAndCheck(); + } + + private static void positionTestWindows(List testWindows, + PassFailJFrame.InstructionUI instructionUI) { + int gap = 5; + int x = instructionUI.getLocation().x + instructionUI.getSize().width + gap; + for (Window w : testWindows) { + w.setLocation(x, instructionUI.getLocation().y); + x += w.getWidth() + gap; + } + } + + private static List createAndShowUI() { + Frame testFrame = new Frame("Frame DefaultFrameIconTest"); + Dialog testDialog = new Dialog(testFrame, "Dialog DefaultFrameIconTest"); + + testDialog.setSize(250, 100); + + testFrame.setSize(250, 100); + return List.of(testFrame, testDialog); + } +} diff --git a/test/jdk/java/awt/Frame/DisposeTest.java b/test/jdk/java/awt/Frame/DisposeTest.java new file mode 100644 index 0000000000000..08c0def638e69 --- /dev/null +++ b/test/jdk/java/awt/Frame/DisposeTest.java @@ -0,0 +1,112 @@ +/* + * 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 javax.imageio.ImageIO; +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +/* + * @test + * @key headful + * @bug 4127271 + * @summary Tests that disposing of a Frame with MenuBar removes all traces + * of the Frame from the screen. + */ + +public class DisposeTest { + private static Frame backgroundFrame; + private static Frame testedFrame; + + private static final Rectangle backgroundFrameBounds = + new Rectangle(100, 100, 200, 200); + private static final Rectangle testedFrameBounds = + new Rectangle(150, 150, 100, 100); + + private static Robot robot; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + try { + EventQueue.invokeAndWait(DisposeTest::initAndShowGui); + robot.waitForIdle(); + robot.delay(500); + EventQueue.invokeAndWait(testedFrame::dispose); + robot.waitForIdle(); + robot.delay(500); + test(); + } finally { + EventQueue.invokeAndWait(() -> { + backgroundFrame.dispose(); + testedFrame.dispose(); + }); + } + } + + private static void test() { + BufferedImage bi = robot.createScreenCapture(backgroundFrameBounds); + int redPix = Color.RED.getRGB(); + + for (int x = 0; x < bi.getWidth(); x++) { + for (int y = 0; y < bi.getHeight(); y++) { + if (bi.getRGB(x, y) != redPix) { + try { + ImageIO.write(bi, "png", + new File("failure.png")); + } catch (IOException ignored) {} + throw new RuntimeException("Test failed"); + } + } + } + } + + private static void initAndShowGui() { + backgroundFrame = new Frame("DisposeTest background"); + backgroundFrame.setUndecorated(true); + backgroundFrame.setBackground(Color.RED); + backgroundFrame.setBounds(backgroundFrameBounds); + backgroundFrame.setVisible(true); + + testedFrame = new UglyFrame(); + } + + static class UglyFrame extends Frame { + public UglyFrame() { + super("DisposeTest"); + MenuBar mb = new MenuBar(); + Menu m = new Menu("menu"); + mb.add(m); + setMenuBar(mb); + setBounds(testedFrameBounds); + setVisible(true); + } + } +} + diff --git a/test/jdk/java/awt/Frame/FramePaintTest.java b/test/jdk/java/awt/Frame/FramePaintTest.java new file mode 100644 index 0000000000000..aaa14893b34a2 --- /dev/null +++ b/test/jdk/java/awt/Frame/FramePaintTest.java @@ -0,0 +1,91 @@ +/* + * 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.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Graphics; + +/* + * @test + * @bug 4023385 + * @summary resizing a frame causes too many repaints + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual FramePaintTest +*/ + +public class FramePaintTest { + private static final String INSTRUCTIONS = """ + You should see a Frame titled "Repaint Test", filled with colored blocks. + + Resize the frame several times, both inward as well as outward. + + The blocks should move to fill the window without any flashes or + glitches which ensures that repaint is not done excessively + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("FramePaintTest Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .testUI(ResizeLW::new) + .build() + .awaitAndCheck(); + } + + static class ResizeLW extends Frame { + + public ResizeLW() { + super("Repaint Test"); + setBackground(Color.red); + setLayout(new FlowLayout()); + setSize(300, 300); + + for (int i = 0; i < 10; i++) { + add(new ColorComp(Color.blue)); + add(new ColorComp(Color.green)); + } + } + + private static class ColorComp extends Component { + public ColorComp(Color c) { + super(); + setBackground(c); + } + + public void paint(Graphics g) { + g.setColor(getBackground()); + g.fillRect(0, 0, getWidth(), getHeight()); + } + + public Dimension getPreferredSize() { + return new Dimension(50, 50); + } + } + } +} diff --git a/test/jdk/java/awt/Frame/MenuCrash.java b/test/jdk/java/awt/Frame/MenuCrash.java new file mode 100644 index 0000000000000..f41408ecdadfb --- /dev/null +++ b/test/jdk/java/awt/Frame/MenuCrash.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.CheckboxMenuItem; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.TextField; +import java.awt.Window; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.List; + +/* + * @test + * @bug 4133279 + * @summary Clicking in menu in inactive frame crashes application + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MenuCrash + */ +public class MenuCrash { + + private static final String INSTRUCTIONS = """ + Two frames will appear, alternate between frames by clicking on the + menubar of the currently deactivated frame and verify no crash occurs. + + Try mousing around the menus and choosing various items to see the menu + item name reflected in the text field. Note that CheckBoxMenuItems do + not fire action events so the check menu item (Item 03) will not change + the field. + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("MenuCrash Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .testUI(MenuCrash::createAndShowUI) + .positionTestUI(MenuCrash::positionTestWindows) + .build() + .awaitAndCheck(); + } + + + private static List createAndShowUI() { + Frame frame1 = new MenuFrame("Frame 1 MenuCrash"); + Frame frame2 = new MenuFrame("Frame 2 MenuCrash"); + + frame1.setSize(300, 200); + frame2.setSize(300, 200); + + frame1.validate(); + frame2.validate(); + + return List.of(frame1, frame2); + } + + private static void positionTestWindows(List testWindows, + PassFailJFrame.InstructionUI instructionUI) { + int gap = 5; + int x = instructionUI.getLocation().x + instructionUI.getSize().width + gap; + for (Window w : testWindows) { + w.setLocation(x, instructionUI.getLocation().y); + x += w.getWidth() + gap; + } + } + + static class MenuFrame extends Frame { + private final TextField field; + + MenuFrame(String name) { + super(name); + setLayout(new FlowLayout()); + + Button removeMenus = new Button("Remove Menus"); + removeMenus.addActionListener(ev -> remove(getMenuBar())); + + Button addMenus = new Button("Add Menus"); + addMenus.addActionListener(ev -> setupMenus()); + + add(removeMenus); + add(addMenus); + field = new TextField(20); + add(field); + + addWindowListener( + new WindowAdapter() { + public void windowActivated(WindowEvent e) { + setupMenus(); + } + } + ); + + addComponentListener( + new ComponentAdapter() { + public void componentResized(ComponentEvent e) { + System.out.println(MenuFrame.this); + } + } + ); + + pack(); + } + + private void addMenuListeners() { + MenuBar menuBar = getMenuBar(); + + for (int nMenu = 0; nMenu < menuBar.getMenuCount(); nMenu++) { + Menu menu = menuBar.getMenu(nMenu); + for (int nMenuItem = 0; nMenuItem < menu.getItemCount(); nMenuItem++) { + MenuItem item = menu.getItem(nMenuItem); + item.addActionListener(ev -> field.setText(ev.getActionCommand())); + } + } + } + + private void setupMenus() { + MenuItem miSetLabel = new MenuItem("Item 01"); + MenuItem miSetEnabled = new MenuItem("Item 02"); + CheckboxMenuItem miSetState = new CheckboxMenuItem("Item 03"); + MenuItem miAdded = new MenuItem("Item 04 Added"); + + MenuBar menuBar = new MenuBar(); + Menu menu1 = new Menu("Menu 01"); + menu1.add(miSetLabel); + menu1.add(miSetEnabled); + menu1.add(miSetState); + menuBar.add(menu1); + setMenuBar(menuBar); + + // now that the peers are created, screw + // around with the menu items + miSetLabel.setLabel("Menu 01 - SetLabel"); + miSetEnabled.setEnabled(false); + miSetState.setState(true); + menu1.add(miAdded); + menu1.remove(miAdded); + menu1.addSeparator(); + menu1.add(miAdded); + + Menu menu2 = new Menu("Menu 02"); + menuBar.add(menu2); + menuBar.remove(menu2); + menuBar.add(menu2); + menu2.add(new MenuItem("Foo")); + menu1.setLabel("Menu Number 1"); + menu2.setLabel("Menu Number 2"); + + addMenuListeners(); + } + } +} From 95d3e9d199600bac0284f9151b99aef152e027ac Mon Sep 17 00:00:00 2001 From: Fernando Guallini Date: Thu, 26 Sep 2024 13:20:14 +0000 Subject: [PATCH 202/307] 8339560: Unaddressed comments during code review of JDK-8337664 Reviewed-by: mullan --- .../Symantec/Distrust.java | 292 ------------------ .../{Entrust => distrust}/Distrust.java | 181 +++++------ .../distrust/Entrust.java | 68 ++++ .../distrust/Symantec.java | 95 ++++++ .../affirmtrustcommercialca-chain.pem | 0 .../affirmtrustnetworkingca-chain.pem | 0 .../entrust}/affirmtrustpremiumca-chain.pem | 0 .../affirmtrustpremiumeccca-chain.pem | 0 .../chains/entrust}/entrust2048ca-chain.pem | 0 .../chains/entrust}/entrustevca-chain.pem | 0 .../entrust}/entrustrootcaec1-chain.pem | 0 .../chains/entrust}/entrustrootcag2-chain.pem | 0 .../chains/entrust}/entrustrootcag4-chain.pem | 0 .../chains/symantec}/appleistca8g1-chain.pem | 0 .../symantec}/geotrustprimarycag2-chain.pem | 0 .../symantec}/geotrustprimarycag3-chain.pem | 0 .../symantec}/geotrustuniversalca-chain.pem | 0 .../symantec}/thawteprimaryrootca-chain.pem | 0 .../symantec}/thawteprimaryrootcag2-chain.pem | 0 .../symantec}/thawteprimaryrootcag3-chain.pem | 0 .../symantec}/verisignclass3g3ca-chain.pem | 0 .../symantec}/verisignclass3g4ca-chain.pem | 0 .../symantec}/verisignclass3g5ca-chain.pem | 0 .../verisignclass3g5ca-codesigning-chain.pem | 0 .../verisignuniversalrootca-chain.pem | 0 25 files changed, 243 insertions(+), 393 deletions(-) delete mode 100644 test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Entrust => distrust}/Distrust.java (54%) create mode 100644 test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java create mode 100644 test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Symantec.java rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Entrust => distrust/chains/entrust}/affirmtrustcommercialca-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Entrust => distrust/chains/entrust}/affirmtrustnetworkingca-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Entrust => distrust/chains/entrust}/affirmtrustpremiumca-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Entrust => distrust/chains/entrust}/affirmtrustpremiumeccca-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Entrust => distrust/chains/entrust}/entrust2048ca-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Entrust => distrust/chains/entrust}/entrustevca-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Entrust => distrust/chains/entrust}/entrustrootcaec1-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Entrust => distrust/chains/entrust}/entrustrootcag2-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Entrust => distrust/chains/entrust}/entrustrootcag4-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/appleistca8g1-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/geotrustprimarycag2-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/geotrustprimarycag3-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/geotrustuniversalca-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/thawteprimaryrootca-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/thawteprimaryrootcag2-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/thawteprimaryrootcag3-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/verisignclass3g3ca-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/verisignclass3g4ca-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/verisignclass3g5ca-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/verisignclass3g5ca-codesigning-chain.pem (100%) rename test/jdk/sun/security/ssl/X509TrustManagerImpl/{Symantec => distrust/chains/symantec}/verisignuniversalrootca-chain.pem (100%) diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java b/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java deleted file mode 100644 index ba008c68cdc10..0000000000000 --- a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import java.math.BigInteger; -import java.security.*; -import java.security.cert.*; -import java.time.*; -import java.util.*; -import javax.net.ssl.*; -import sun.security.validator.Validator; -import sun.security.validator.ValidatorException; - -import jdk.test.lib.security.SecurityUtils; - -/** - * @test - * @bug 8207258 8216280 - * @summary Check that TLS Server certificates chaining back to distrusted - * Symantec roots are invalid - * @library /test/lib - * @modules java.base/sun.security.validator - * @run main/othervm Distrust after policyOn invalid - * @run main/othervm Distrust after policyOff valid - * @run main/othervm Distrust before policyOn valid - * @run main/othervm Distrust before policyOff valid - */ - -public class Distrust { - - private static final String TEST_SRC = System.getProperty("test.src", "."); - private static CertificateFactory cf; - - // Each of the roots have a test certificate chain stored in a file - // named "-chain.pem". - private static String[] rootsToTest = new String[] { - "geotrustprimarycag2", "geotrustprimarycag3", - "geotrustuniversalca", "thawteprimaryrootca", "thawteprimaryrootcag2", - "thawteprimaryrootcag3", "verisignclass3g3ca", "verisignclass3g4ca", - "verisignclass3g5ca", "verisignuniversalrootca" }; - - // Each of the subCAs with a delayed distrust date have a test certificate - // chain stored in a file named "-chain.pem". - private static String[] subCAsToTest = new String[]{"appleistca8g1"}; - - // A date that is after the restrictions take affect - private static final Date APRIL_17_2019 = - Date.from(LocalDate.of(2019, 4, 17) - .atStartOfDay(ZoneOffset.UTC) - .toInstant()); - - // A date that is a second before the restrictions take affect - private static final Date BEFORE_APRIL_17_2019 = - Date.from(LocalDate.of(2019, 4, 17) - .atStartOfDay(ZoneOffset.UTC) - .minusSeconds(1) - .toInstant()); - - // A date that is after the subCA restrictions take affect - private static final Date JANUARY_1_2020 = - Date.from(LocalDate.of(2020, 1, 1) - .atStartOfDay(ZoneOffset.UTC) - .toInstant()); - - // A date that is a second before the subCA restrictions take affect - private static final Date BEFORE_JANUARY_1_2020 = - Date.from(LocalDate.of(2020, 1, 1) - .atStartOfDay(ZoneOffset.UTC) - .minusSeconds(1) - .toInstant()); - - public static void main(String[] args) throws Exception { - - cf = CertificateFactory.getInstance("X.509"); - - boolean before = args[0].equals("before"); - boolean policyOn = args[1].equals("policyOn"); - boolean isValid = args[2].equals("valid"); - - if (!policyOn) { - // disable policy (default is on) - Security.setProperty("jdk.security.caDistrustPolicies", ""); - } - - Date notBefore = before ? BEFORE_APRIL_17_2019 : APRIL_17_2019; - - X509TrustManager pkixTM = getTMF("PKIX", null); - X509TrustManager sunX509TM = getTMF("SunX509", null); - for (String test : rootsToTest) { - System.err.println("Testing " + test); - X509Certificate[] chain = loadCertificateChain(test); - - testTM(sunX509TM, chain, notBefore, isValid); - testTM(pkixTM, chain, notBefore, isValid); - } - - // test chain if params are passed to TrustManager - System.err.println("Testing verisignuniversalrootca with params"); - testTM(getTMF("PKIX", getParams()), - loadCertificateChain("verisignuniversalrootca"), - notBefore, isValid); - - // test code-signing chain (should be valid as restrictions don't apply) - System.err.println("Testing verisignclass3g5ca code-signing chain"); - Validator v = Validator.getInstance(Validator.TYPE_PKIX, - Validator.VAR_CODE_SIGNING, - getParams()); - // set validation date so this will still pass when cert expires - v.setValidationDate(new Date(1544197375493l)); - v.validate(loadCertificateChain("verisignclass3g5ca-codesigning")); - - // test chains issued through subCAs - notBefore = before ? BEFORE_JANUARY_1_2020 : JANUARY_1_2020; - for (String test : subCAsToTest) { - System.err.println("Testing " + test); - X509Certificate[] chain = loadCertificateChain(test); - - testTM(sunX509TM, chain, notBefore, isValid); - testTM(pkixTM, chain, notBefore, isValid); - } - } - - private static X509TrustManager getTMF(String type, - PKIXBuilderParameters params) throws Exception { - TrustManagerFactory tmf = TrustManagerFactory.getInstance(type); - if (params == null) { - tmf.init((KeyStore)null); - } else { - tmf.init(new CertPathTrustManagerParameters(params)); - } - TrustManager[] tms = tmf.getTrustManagers(); - for (TrustManager tm : tms) { - X509TrustManager xtm = (X509TrustManager)tm; - return xtm; - } - throw new Exception("No TrustManager for " + type); - } - - private static PKIXBuilderParameters getParams() throws Exception { - PKIXBuilderParameters pbp = - new PKIXBuilderParameters(SecurityUtils.getCacertsKeyStore(), - new X509CertSelector()); - pbp.setRevocationEnabled(false); - return pbp; - } - - private static void testTM(X509TrustManager xtm, X509Certificate[] chain, - Date notBefore, boolean valid) throws Exception { - // Check if TLS Server certificate (the first element of the chain) - // is issued after the specified notBefore date (should be rejected - // unless distrust property is false). To do this, we need to - // fake the notBefore date since none of the test certs are issued - // after then. - chain[0] = new DistrustedTLSServerCert(chain[0], notBefore); - - try { - xtm.checkServerTrusted(chain, "ECDHE_RSA"); - if (!valid) { - throw new Exception("chain should be invalid"); - } - } catch (CertificateException ce) { - // expired TLS certificates should not be treated as failure - if (expired(ce)) { - System.err.println("Test is N/A, chain is expired"); - return; - } - if (valid) { - throw new Exception("Unexpected exception, chain " + - "should be valid", ce); - } - if (ce instanceof ValidatorException) { - ValidatorException ve = (ValidatorException)ce; - if (ve.getErrorType() != ValidatorException.T_UNTRUSTED_CERT) { - ce.printStackTrace(System.err); - throw new Exception("Unexpected exception: " + ce); - } - } else { - throw new Exception("Unexpected exception: " + ce); - } - } - } - - // check if a cause of exception is an expired cert - private static boolean expired(CertificateException ce) { - if (ce instanceof CertificateExpiredException) { - return true; - } - Throwable t = ce.getCause(); - while (t != null) { - if (t instanceof CertificateExpiredException) { - return true; - } - t = t.getCause(); - } - return false; - } - - private static X509Certificate[] loadCertificateChain(String name) - throws Exception { - try (InputStream in = new FileInputStream(TEST_SRC + File.separator + - name + "-chain.pem")) { - Collection certs = - (Collection)cf.generateCertificates(in); - return certs.toArray(new X509Certificate[0]); - } - } - - private static class DistrustedTLSServerCert extends X509Certificate { - private final X509Certificate cert; - private final Date notBefore; - DistrustedTLSServerCert(X509Certificate cert, Date notBefore) { - this.cert = cert; - this.notBefore = notBefore; - } - public Set getCriticalExtensionOIDs() { - return cert.getCriticalExtensionOIDs(); - } - public byte[] getExtensionValue(String oid) { - return cert.getExtensionValue(oid); - } - public Set getNonCriticalExtensionOIDs() { - return cert.getNonCriticalExtensionOIDs(); - } - public boolean hasUnsupportedCriticalExtension() { - return cert.hasUnsupportedCriticalExtension(); - } - public void checkValidity() throws CertificateExpiredException, - CertificateNotYetValidException { - // always pass - } - public void checkValidity(Date date) throws CertificateExpiredException, - CertificateNotYetValidException { - // always pass - } - public int getVersion() { return cert.getVersion(); } - public BigInteger getSerialNumber() { return cert.getSerialNumber(); } - public Principal getIssuerDN() { return cert.getIssuerDN(); } - public Principal getSubjectDN() { return cert.getSubjectDN(); } - public Date getNotBefore() { return notBefore; } - public Date getNotAfter() { return cert.getNotAfter(); } - public byte[] getTBSCertificate() throws CertificateEncodingException { - return cert.getTBSCertificate(); - } - public byte[] getSignature() { return cert.getSignature(); } - public String getSigAlgName() { return cert.getSigAlgName(); } - public String getSigAlgOID() { return cert.getSigAlgOID(); } - public byte[] getSigAlgParams() { return cert.getSigAlgParams(); } - public boolean[] getIssuerUniqueID() { - return cert.getIssuerUniqueID(); - } - public boolean[] getSubjectUniqueID() { - return cert.getSubjectUniqueID(); - } - public boolean[] getKeyUsage() { return cert.getKeyUsage(); } - public int getBasicConstraints() { return cert.getBasicConstraints(); } - public byte[] getEncoded() throws CertificateEncodingException { - return cert.getEncoded(); - } - public void verify(PublicKey key) throws CertificateException, - InvalidKeyException, NoSuchAlgorithmException, - NoSuchProviderException, SignatureException { - cert.verify(key); - } - public void verify(PublicKey key, String sigProvider) throws - CertificateException, InvalidKeyException, NoSuchAlgorithmException, - NoSuchProviderException, SignatureException { - cert.verify(key, sigProvider); - } - public PublicKey getPublicKey() { return cert.getPublicKey(); } - public String toString() { return cert.toString(); } - } -} diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/Distrust.java b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Distrust.java similarity index 54% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/Distrust.java rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Distrust.java index a9a47bf834cc1..18178f65ec116 100644 --- a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/Distrust.java +++ b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Distrust.java @@ -25,7 +25,7 @@ import java.math.BigInteger; import java.security.*; import java.security.cert.*; -import java.time.*; +import java.time.ZonedDateTime; import java.util.*; import javax.net.ssl.*; import sun.security.validator.Validator; @@ -34,95 +34,80 @@ import jdk.test.lib.security.SecurityUtils; /** - * @test - * @bug 8337664 - * @summary Check that TLS Server certificates chaining back to distrusted - * Entrust roots are invalid - * @library /test/lib - * @modules java.base/sun.security.validator - * @run main/othervm Distrust after policyOn invalid - * @run main/othervm Distrust after policyOff valid - * @run main/othervm Distrust before policyOn valid - * @run main/othervm Distrust before policyOff valid + * Helper class that provides methods to facilitate testing of distrusted roots. */ - -public class Distrust { +public final class Distrust { private static final String TEST_SRC = System.getProperty("test.src", "."); private static CertificateFactory cf; - // Each of the roots have a test certificate chain stored in a file - // named "-chain.pem". - private static String[] rootsToTest = new String[] { - "entrustevca", "entrustrootcaec1", "entrustrootcag2", "entrustrootcag4", - "entrust2048ca", "affirmtrustcommercialca", "affirmtrustnetworkingca", - "affirmtrustpremiumca", "affirmtrustpremiumeccca" }; - - // A date that is after the restrictions take effect - private static final Date NOVEMBER_1_2024 = - Date.from(LocalDate.of(2024, 11, 1) - .atStartOfDay(ZoneOffset.UTC) - .toInstant()); - - // A date that is a second before the restrictions take effect - private static final Date BEFORE_NOVEMBER_1_2024 = - Date.from(LocalDate.of(2024, 11, 1) - .atStartOfDay(ZoneOffset.UTC) - .minusSeconds(1) - .toInstant()); - - public static void main(String[] args) throws Exception { + private final boolean before; + private final boolean policyOn; + private final boolean isValid; - cf = CertificateFactory.getInstance("X.509"); - - boolean before = args[0].equals("before"); - boolean policyOn = args[1].equals("policyOn"); - boolean isValid = args[2].equals("valid"); + public Distrust(String[] args) { + before = args[0].equals("before"); + policyOn = args[1].equals("policyOn"); + isValid = args[2].equals("valid"); if (!policyOn) { // disable policy (default is on) Security.setProperty("jdk.security.caDistrustPolicies", ""); } + } + + public Date getNotBefore(ZonedDateTime distrustDate) { + ZonedDateTime notBefore = before ? distrustDate.minusSeconds(1) : distrustDate; + return Date.from(notBefore.toInstant()); + } - Date notBefore = before ? BEFORE_NOVEMBER_1_2024 : NOVEMBER_1_2024; + public void testCodeSigningChain(String certPath, String name, Date validationDate) + throws Exception { + System.err.println("Testing " + name + " code-signing chain"); + Validator v = Validator.getInstance(Validator.TYPE_PKIX, + Validator.VAR_CODE_SIGNING, + getParams()); + // set validation date so this will still pass when cert expires + v.setValidationDate(validationDate); + v.validate(loadCertificateChain(certPath, name)); + } - X509TrustManager pkixTM = getTMF("PKIX", null); - X509TrustManager sunX509TM = getTMF("SunX509", null); - for (String test : rootsToTest) { + public void testCertificateChain(String certPath, Date notBefore, X509TrustManager[] tms, + String... tests) throws Exception { + for (String test : tests) { System.err.println("Testing " + test); - X509Certificate[] chain = loadCertificateChain(test); + X509Certificate[] chain = loadCertificateChain(certPath, test); - testTM(sunX509TM, chain, notBefore, isValid); - testTM(pkixTM, chain, notBefore, isValid); + for (X509TrustManager tm : tms) { + testTM(tm, chain, notBefore, isValid); + } } } - private static X509TrustManager getTMF(String type, - PKIXBuilderParameters params) throws Exception { + public X509TrustManager getTMF(String type, PKIXBuilderParameters params) throws Exception { TrustManagerFactory tmf = TrustManagerFactory.getInstance(type); if (params == null) { - tmf.init((KeyStore)null); + tmf.init((KeyStore) null); } else { tmf.init(new CertPathTrustManagerParameters(params)); } TrustManager[] tms = tmf.getTrustManagers(); for (TrustManager tm : tms) { - X509TrustManager xtm = (X509TrustManager)tm; - return xtm; + return (X509TrustManager) tm; } - throw new Exception("No TrustManager for " + type); + throw new RuntimeException("No TrustManager for " + type); } - private static PKIXBuilderParameters getParams() throws Exception { + public PKIXBuilderParameters getParams() throws Exception { PKIXBuilderParameters pbp = - new PKIXBuilderParameters(SecurityUtils.getCacertsKeyStore(), - new X509CertSelector()); + new PKIXBuilderParameters(SecurityUtils.getCacertsKeyStore(), + new X509CertSelector()); pbp.setRevocationEnabled(false); return pbp; } - private static void testTM(X509TrustManager xtm, X509Certificate[] chain, - Date notBefore, boolean valid) throws Exception { + public void testTM(X509TrustManager xtm, X509Certificate[] chain, + Date notBefore, boolean valid) { // Check if TLS Server certificate (the first element of the chain) // is issued after the specified notBefore date (should be rejected // unless distrust property is false). To do this, we need to @@ -130,67 +115,54 @@ private static void testTM(X509TrustManager xtm, X509Certificate[] chain, // after then. chain[0] = new DistrustedTLSServerCert(chain[0], notBefore); + // Wrap the intermediate and root CA certs in NonExpiringTLSServerCert + // so it will never throw a CertificateExpiredException + for (int i = 1; i < chain.length; i++) { + chain[i] = new NonExpiringTLSServerCert(chain[i]); + } + try { xtm.checkServerTrusted(chain, "ECDHE_RSA"); if (!valid) { - throw new Exception("chain should be invalid"); + throw new RuntimeException("chain should be invalid"); } } catch (CertificateException ce) { - // expired TLS certificates should not be treated as failure - if (expired(ce)) { - System.err.println("Test is N/A, chain is expired"); - return; - } if (valid) { - throw new Exception("Unexpected exception, chain " + - "should be valid", ce); + throw new RuntimeException("Unexpected exception, chain " + + "should be valid", ce); } if (ce instanceof ValidatorException) { - ValidatorException ve = (ValidatorException)ce; + ValidatorException ve = (ValidatorException) ce; if (ve.getErrorType() != ValidatorException.T_UNTRUSTED_CERT) { ce.printStackTrace(System.err); - throw new Exception("Unexpected exception: " + ce); + throw new RuntimeException("Unexpected exception: " + ce); } } else { - throw new Exception("Unexpected exception: " + ce); + throw new RuntimeException(ce); } } } - // check if a cause of exception is an expired cert - private static boolean expired(CertificateException ce) { - if (ce instanceof CertificateExpiredException) { - return true; - } - Throwable t = ce.getCause(); - while (t != null) { - if (t instanceof CertificateExpiredException) { - return true; - } - t = t.getCause(); - } - return false; - } - - private static X509Certificate[] loadCertificateChain(String name) + private X509Certificate[] loadCertificateChain(String certPath, String name) throws Exception { - try (InputStream in = new FileInputStream(TEST_SRC + File.separator + - name + "-chain.pem")) { + if (cf == null) { + cf = CertificateFactory.getInstance("X.509"); + } + try (InputStream in = new FileInputStream(TEST_SRC + File.separator + certPath + + File.separator + name + "-chain.pem")) { Collection certs = - (Collection)cf.generateCertificates(in); + (Collection) cf.generateCertificates(in); return certs.toArray(new X509Certificate[0]); } } - private static class DistrustedTLSServerCert extends X509Certificate { + private static class NonExpiringTLSServerCert extends X509Certificate { private final X509Certificate cert; - private final Date notBefore; - DistrustedTLSServerCert(X509Certificate cert, Date notBefore) { + NonExpiringTLSServerCert(X509Certificate cert) { this.cert = cert; - this.notBefore = notBefore; } public Set getCriticalExtensionOIDs() { - return cert.getCriticalExtensionOIDs(); + return cert.getCriticalExtensionOIDs(); } public byte[] getExtensionValue(String oid) { return cert.getExtensionValue(oid); @@ -201,19 +173,17 @@ public Set getNonCriticalExtensionOIDs() { public boolean hasUnsupportedCriticalExtension() { return cert.hasUnsupportedCriticalExtension(); } - public void checkValidity() throws CertificateExpiredException, - CertificateNotYetValidException { + public void checkValidity() { // always pass } - public void checkValidity(Date date) throws CertificateExpiredException, - CertificateNotYetValidException { + public void checkValidity(Date date) { // always pass } public int getVersion() { return cert.getVersion(); } public BigInteger getSerialNumber() { return cert.getSerialNumber(); } public Principal getIssuerDN() { return cert.getIssuerDN(); } public Principal getSubjectDN() { return cert.getSubjectDN(); } - public Date getNotBefore() { return notBefore; } + public Date getNotBefore() { return cert.getNotBefore(); } public Date getNotAfter() { return cert.getNotAfter(); } public byte[] getTBSCertificate() throws CertificateEncodingException { return cert.getTBSCertificate(); @@ -234,16 +204,25 @@ public byte[] getEncoded() throws CertificateEncodingException { return cert.getEncoded(); } public void verify(PublicKey key) throws CertificateException, - InvalidKeyException, NoSuchAlgorithmException, - NoSuchProviderException, SignatureException { + InvalidKeyException, NoSuchAlgorithmException, + NoSuchProviderException, SignatureException { cert.verify(key); } public void verify(PublicKey key, String sigProvider) throws - CertificateException, InvalidKeyException, NoSuchAlgorithmException, - NoSuchProviderException, SignatureException { + CertificateException, InvalidKeyException, NoSuchAlgorithmException, + NoSuchProviderException, SignatureException { cert.verify(key, sigProvider); } public PublicKey getPublicKey() { return cert.getPublicKey(); } public String toString() { return cert.toString(); } } + + private static class DistrustedTLSServerCert extends NonExpiringTLSServerCert { + private final Date notBefore; + DistrustedTLSServerCert(X509Certificate cert, Date notBefore) { + super(cert); + this.notBefore = notBefore; + } + public Date getNotBefore() { return notBefore; } + } } diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java new file mode 100644 index 0000000000000..07127742ff6c4 --- /dev/null +++ b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java @@ -0,0 +1,68 @@ +/* + * 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. + */ + +import java.io.File; +import java.time.*; +import java.util.*; +import javax.net.ssl.*; + +/** + * @test + * @bug 8337664 + * @summary Check that TLS Server certificates chaining back to distrusted + * Entrust roots are invalid + * @library /test/lib + * @modules java.base/sun.security.validator + * @run main/othervm Entrust after policyOn invalid + * @run main/othervm Entrust after policyOff valid + * @run main/othervm Entrust before policyOn valid + * @run main/othervm Entrust before policyOff valid + */ + +public class Entrust { + + private static final String certPath = "chains" + File.separator + "entrust"; + + // Each of the roots have a test certificate chain stored in a file + // named "-chain.pem". + private static String[] rootsToTest = new String[]{ + "entrustevca", "entrustrootcaec1", "entrustrootcag2", "entrustrootcag4", + "entrust2048ca", "affirmtrustcommercialca", "affirmtrustnetworkingca", + "affirmtrustpremiumca", "affirmtrustpremiumeccca"}; + + // Date when the restrictions take effect + private static final ZonedDateTime DISTRUST_DATE = + LocalDate.of(2024, 11, 1).atStartOfDay(ZoneOffset.UTC); + + public static void main(String[] args) throws Exception { + Distrust distrust = new Distrust(args); + + X509TrustManager[] tms = new X509TrustManager[]{ + distrust.getTMF("PKIX", null), + distrust.getTMF("SunX509", null) + }; + + Date notBefore = distrust.getNotBefore(DISTRUST_DATE); + distrust.testCertificateChain(certPath, notBefore, tms, rootsToTest); + } +} diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Symantec.java b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Symantec.java new file mode 100644 index 0000000000000..4e099a8de8de6 --- /dev/null +++ b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Symantec.java @@ -0,0 +1,95 @@ +/* + * 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 + * 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 javax.net.ssl.X509TrustManager; +import java.io.File; +import java.time.*; +import java.util.*; + + +/** + * @test + * @bug 8207258 8216280 + * @summary Check that TLS Server certificates chaining back to distrusted + * Symantec roots are invalid + * @library /test/lib + * @modules java.base/sun.security.validator + * @run main/othervm Symantec after policyOn invalid + * @run main/othervm Symantec after policyOff valid + * @run main/othervm Symantec before policyOn valid + * @run main/othervm Symantec before policyOff valid + */ + +public class Symantec { + + private static final String certPath = "chains" + File.separator + "symantec"; + + // Each of the roots have a test certificate chain stored in a file + // named "-chain.pem". + private static final String[] rootsToTest = new String[]{ + "geotrustprimarycag2", "geotrustprimarycag3", "geotrustuniversalca", + "thawteprimaryrootca", "thawteprimaryrootcag2", "thawteprimaryrootcag3", + "verisignclass3g3ca", "verisignclass3g4ca", "verisignclass3g5ca", + "verisignuniversalrootca" + }; + + // Each of the subCAs with a delayed distrust date have a test certificate + // chain stored in a file named "-chain.pem". + private static String[] subCAsToTest = new String[]{"appleistca8g1"}; + + // Date when the restrictions take effect + private static final ZonedDateTime ROOTS_DISTRUST_DATE = + LocalDate.of(2019, 4, 17).atStartOfDay(ZoneOffset.UTC); + + // Date when the subCA restrictions take effect + private static final ZonedDateTime SUBCA_DISTRUST_DATE = + LocalDate.of(2020, 1, 1).atStartOfDay(ZoneOffset.UTC); + + public static void main(String[] args) throws Exception { + Distrust distrust = new Distrust(args); + X509TrustManager[] tms = new X509TrustManager[]{ + distrust.getTMF("PKIX", null), + distrust.getTMF("SunX509", null) + }; + + // test chains issued through roots + Date notBefore = distrust.getNotBefore(ROOTS_DISTRUST_DATE); + distrust.testCertificateChain(certPath, notBefore, tms, rootsToTest); + + // test chain if params are passed to TrustManager + System.err.println("Testing verisignuniversalrootca with params"); + X509TrustManager[] tmsParams = new X509TrustManager[]{ + distrust.getTMF("PKIX", distrust.getParams()) + }; + distrust.testCertificateChain(certPath, notBefore, tmsParams, + "verisignuniversalrootca"); + + // test code-signing chain (should be valid as restrictions don't apply) + Date validationDate = new Date(1544197375493L); + distrust.testCodeSigningChain(certPath, "verisignclass3g5ca-codesigning", validationDate); + + // test chains issued through subCAs + notBefore = distrust.getNotBefore(SUBCA_DISTRUST_DATE); + distrust.testCertificateChain(certPath, notBefore, tms, subCAsToTest); + } +} diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustcommercialca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustcommercialca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustcommercialca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustcommercialca-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustnetworkingca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustnetworkingca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustnetworkingca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustnetworkingca-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumca-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumeccca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumeccca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/affirmtrustpremiumeccca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumeccca-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrust2048ca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrust2048ca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrust2048ca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrust2048ca-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustevca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustevca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustevca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustevca-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcaec1-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcaec1-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcaec1-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcaec1-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag2-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag2-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag2-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag2-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag4-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag4-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Entrust/entrustrootcag4-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/entrustrootcag4-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca8g1-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/appleistca8g1-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca8g1-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/appleistca8g1-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag2-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag2-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag2-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag2-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag3-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag3-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag3-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustprimarycag3-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustuniversalca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustuniversalca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustuniversalca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/geotrustuniversalca-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootca-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag2-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag2-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag2-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag2-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag3-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag3-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag3-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/thawteprimaryrootcag3-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g3ca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g3ca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g3ca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g3ca-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g4ca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g4ca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g4ca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g4ca-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-codesigning-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-codesigning-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-codesigning-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignclass3g5ca-codesigning-chain.pem diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignuniversalrootca-chain.pem b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignuniversalrootca-chain.pem similarity index 100% rename from test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/verisignuniversalrootca-chain.pem rename to test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/symantec/verisignuniversalrootca-chain.pem From e36ce5f0341e8d0ec06cb12d0b2c0aa084401021 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Thu, 26 Sep 2024 15:11:03 +0000 Subject: [PATCH 203/307] 8336942: Improve test coverage for class loading elements with annotations of different retentions Reviewed-by: vromero --- .../processing/model/type/BasicAnnoTests.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java b/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java index acd91eac8c785..904e4e78cad1f 100644 --- a/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java +++ b/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java @@ -41,6 +41,8 @@ import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Repeatable; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.reflect.Method; import java.util.ArrayList; @@ -93,13 +95,15 @@ public class BasicAnnoTests extends JavacTestingAbstractProcessor { private static final Map> nameToAnnotation = Map.ofEntries(new NameToAnnotationEntry("java.lang.Override", Override.class), new NameToAnnotationEntry("java.lang.annotation.Repeatable", Repeatable.class), + new NameToAnnotationEntry("java.lang.annotation.Retention", Target.class), new NameToAnnotationEntry("java.lang.annotation.Target", Target.class), new NameToAnnotationEntry("BasicAnnoTests.Test", BasicAnnoTests.Test.class), new NameToAnnotationEntry("BasicAnnoTests.Tests",BasicAnnoTests.Tests.class), new NameToAnnotationEntry("BasicAnnoTests.TA", BasicAnnoTests.TA.class), new NameToAnnotationEntry("BasicAnnoTests.TB", BasicAnnoTests.TB.class), new NameToAnnotationEntry("BasicAnnoTests.TC", BasicAnnoTests.TC.class), - new NameToAnnotationEntry("BasicAnnoTests.TCs", BasicAnnoTests.TCs.class)); + new NameToAnnotationEntry("BasicAnnoTests.TCs", BasicAnnoTests.TCs.class), + new NameToAnnotationEntry("BasicAnnoTests.TD", BasicAnnoTests.TD.class)); static class NameToAnnotationEntry extends AbstractMap.SimpleEntry> { public NameToAnnotationEntry(String key, Class entry) { @@ -520,6 +524,12 @@ R scan(Iterable iter, P p) { TC[] value(); } + @Target(ElementType.TYPE_USE) + @Retention(RetentionPolicy.RUNTIME) + public @interface TD { + int value(); + } + // Test cases // TODO: add more cases for arrays @@ -657,6 +667,10 @@ public class Inner6 {} @Test(posn=1, annoType=TA.class, expect="23") public Set<@TA(23) ? super Object> f9; + @Test(posn=0, annoType=TA.class, expect="1") + @Test(posn=0, annoType=TD.class, expect="2") + public @TA(1) @TD(2) int f10; + // Test type use annotations on uses of type variables @Test(posn=6, annoType = TA.class, expect = "25") @Test(posn=6, annoType = TB.class, expect = "26") From 376056ca48fb5dbe3d57cea01a9fbf2ea4c35616 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 26 Sep 2024 15:14:21 +0000 Subject: [PATCH 204/307] 8336468: Reflection and MethodHandles should use more precise initializer checks Reviewed-by: liach, coleenp --- src/hotspot/share/classfile/javaClasses.cpp | 3 +- src/hotspot/share/prims/jni.cpp | 4 ++- src/hotspot/share/prims/jvm.cpp | 35 +++++++++++---------- src/hotspot/share/prims/methodHandles.cpp | 3 +- src/hotspot/share/runtime/reflection.cpp | 10 +++--- 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp index b6ef682ae0965..0ad36cd21dbf3 100644 --- a/src/hotspot/share/classfile/javaClasses.cpp +++ b/src/hotspot/share/classfile/javaClasses.cpp @@ -3052,9 +3052,10 @@ void java_lang_ClassFrameInfo::serialize_offsets(SerializeClosure* f) { static int get_flags(const methodHandle& m) { int flags = (jushort)( m->access_flags().as_short() & JVM_RECOGNIZED_METHOD_MODIFIERS ); - if (m->is_initializer()) { + if (m->is_object_initializer()) { flags |= java_lang_invoke_MemberName::MN_IS_CONSTRUCTOR; } else { + // Note: Static initializers can be here. Record them as plain methods. flags |= java_lang_invoke_MemberName::MN_IS_METHOD; } if (m->caller_sensitive()) { diff --git a/src/hotspot/share/prims/jni.cpp b/src/hotspot/share/prims/jni.cpp index 1f115c783e6d7..a869e9821a0b2 100644 --- a/src/hotspot/share/prims/jni.cpp +++ b/src/hotspot/share/prims/jni.cpp @@ -444,9 +444,11 @@ JNI_ENTRY(jobject, jni_ToReflectedMethod(JNIEnv *env, jclass cls, jmethodID meth methodHandle m (THREAD, Method::resolve_jmethod_id(method_id)); assert(m->is_static() == (isStatic != 0), "jni_ToReflectedMethod access flags doesn't match"); oop reflection_method; - if (m->is_initializer()) { + if (m->is_object_initializer()) { reflection_method = Reflection::new_constructor(m, CHECK_NULL); } else { + // Note: Static initializers can theoretically be here, if JNI users manage + // to get their jmethodID. Record them as plain methods. reflection_method = Reflection::new_method(m, false, CHECK_NULL); } ret = JNIHandles::make_local(THREAD, reflection_method); diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp index bf9874956bae2..a246c2c50d674 100644 --- a/src/hotspot/share/prims/jvm.cpp +++ b/src/hotspot/share/prims/jvm.cpp @@ -1826,14 +1826,6 @@ JVM_ENTRY(jobjectArray, JVM_GetRecordComponents(JNIEnv* env, jclass ofClass)) } JVM_END -static bool select_method(const methodHandle& method, bool want_constructor) { - if (want_constructor) { - return (method->is_initializer() && !method->is_static()); - } else { - return (!method->is_initializer() && !method->is_overpass()); - } -} - static jobjectArray get_class_declared_methods_helper( JNIEnv *env, jclass ofClass, jboolean publicOnly, @@ -1866,14 +1858,22 @@ static jobjectArray get_class_declared_methods_helper( GrowableArray* idnums = new GrowableArray(methods_length); int num_methods = 0; + // Select methods matching the criteria. for (int i = 0; i < methods_length; i++) { - methodHandle method(THREAD, methods->at(i)); - if (select_method(method, want_constructor)) { - if (!publicOnly || method->is_public()) { - idnums->push(method->method_idnum()); - ++num_methods; - } + Method* method = methods->at(i); + if (want_constructor && !method->is_object_initializer()) { + continue; + } + if (!want_constructor && + (method->is_object_initializer() || method->is_static_initializer() || + method->is_overpass())) { + continue; } + if (publicOnly && !method->is_public()) { + continue; + } + idnums->push(method->method_idnum()); + ++num_methods; } // Allocate result @@ -2175,10 +2175,11 @@ static jobject get_method_at_helper(const constantPoolHandle& cp, jint index, bo THROW_MSG_NULL(vmSymbols::java_lang_RuntimeException(), "Unable to look up method in target class"); } oop method; - if (!m->is_initializer() || m->is_static()) { - method = Reflection::new_method(m, true, CHECK_NULL); - } else { + if (m->is_object_initializer()) { method = Reflection::new_constructor(m, CHECK_NULL); + } else { + // new_method accepts as Method here + method = Reflection::new_method(m, true, CHECK_NULL); } return JNIHandles::make_local(THREAD, method); } diff --git a/src/hotspot/share/prims/methodHandles.cpp b/src/hotspot/share/prims/methodHandles.cpp index 4f33055d6a3fe..498da559cf526 100644 --- a/src/hotspot/share/prims/methodHandles.cpp +++ b/src/hotspot/share/prims/methodHandles.cpp @@ -313,8 +313,9 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { case CallInfo::direct_call: vmindex = Method::nonvirtual_vtable_index; if (m->is_static()) { + assert(!m->is_static_initializer(), "Cannot be static initializer"); flags |= IS_METHOD | (JVM_REF_invokeStatic << REFERENCE_KIND_SHIFT); - } else if (m->is_initializer()) { + } else if (m->is_object_initializer()) { flags |= IS_CONSTRUCTOR | (JVM_REF_invokeSpecial << REFERENCE_KIND_SHIFT); } else { // "special" reflects that this is a direct call, not that it diff --git a/src/hotspot/share/runtime/reflection.cpp b/src/hotspot/share/runtime/reflection.cpp index ab3d82ad7e2a4..15172b7f4c3d8 100644 --- a/src/hotspot/share/runtime/reflection.cpp +++ b/src/hotspot/share/runtime/reflection.cpp @@ -766,10 +766,10 @@ static Handle new_type(Symbol* signature, Klass* k, TRAPS) { } oop Reflection::new_method(const methodHandle& method, bool for_constant_pool_access, TRAPS) { - // Allow sun.reflect.ConstantPool to refer to methods as java.lang.reflect.Methods. - assert(!method()->is_initializer() || - (for_constant_pool_access && method()->is_static()), - "should call new_constructor instead"); + // Allow jdk.internal.reflect.ConstantPool to refer to methods as java.lang.reflect.Methods. + assert(!method()->is_object_initializer() && + (for_constant_pool_access || !method()->is_static_initializer()), + "Should not be the initializer"); InstanceKlass* holder = method->method_holder(); int slot = method->method_idnum(); @@ -817,7 +817,7 @@ oop Reflection::new_method(const methodHandle& method, bool for_constant_pool_ac oop Reflection::new_constructor(const methodHandle& method, TRAPS) { - assert(method()->is_initializer(), "should call new_method instead"); + assert(method()->is_object_initializer(), "Should be the initializer"); InstanceKlass* holder = method->method_holder(); int slot = method->method_idnum(); From aeaa4f78ebd634c2020d0f0dd100fcb55d5130af Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Thu, 26 Sep 2024 15:20:51 +0000 Subject: [PATCH 205/307] 8336895: BufferedReader doesn't read full \r\n line ending when it doesn't fit in buffer Reviewed-by: jpai, alanb --- .../classes/java/io/BufferedInputStream.java | 5 +++ .../classes/java/io/BufferedOutputStream.java | 7 +++- .../share/classes/java/io/BufferedReader.java | 23 ++++++++----- .../share/classes/java/io/BufferedWriter.java | 34 +++++++++++-------- 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/src/java.base/share/classes/java/io/BufferedInputStream.java b/src/java.base/share/classes/java/io/BufferedInputStream.java index cfc2a3d2c75b9..c401873ce12e4 100644 --- a/src/java.base/share/classes/java/io/BufferedInputStream.java +++ b/src/java.base/share/classes/java/io/BufferedInputStream.java @@ -50,6 +50,11 @@ * reread before new bytes are taken from * the contained input stream. * + * @apiNote + * Once wrapped in a {@code BufferedInputStream}, the underlying + * {@code InputStream} should not be used directly nor wrapped with + * another stream. + * * @author Arthur van Hoff * @since 1.0 */ diff --git a/src/java.base/share/classes/java/io/BufferedOutputStream.java b/src/java.base/share/classes/java/io/BufferedOutputStream.java index ecc1e8a8a4845..687f0c91bc4f7 100644 --- a/src/java.base/share/classes/java/io/BufferedOutputStream.java +++ b/src/java.base/share/classes/java/io/BufferedOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved. * 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,6 +35,11 @@ * output stream without necessarily causing a call to the underlying * system for each byte written. * + * @apiNote + * Once wrapped in a {@code BufferedOutputStream}, the underlying + * {@code OutputStream} should not be used directly nor wrapped with + * another stream. + * * @author Arthur van Hoff * @since 1.0 */ diff --git a/src/java.base/share/classes/java/io/BufferedReader.java b/src/java.base/share/classes/java/io/BufferedReader.java index 2cd027c8bd8a2..c2f6b89e08622 100644 --- a/src/java.base/share/classes/java/io/BufferedReader.java +++ b/src/java.base/share/classes/java/io/BufferedReader.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 @@ -43,8 +43,9 @@ * *

      In general, each read request made of a Reader causes a corresponding * read request to be made of the underlying character or byte stream. It is - * therefore advisable to wrap a BufferedReader around any Reader whose read() - * operations may be costly, such as FileReaders and InputStreamReaders. For + * therefore advisable to wrap a {@code BufferedReader} around any + * {@code Reader} whose {@code read()} operations may be costly, such as + * {@code FileReader}s and {@code InputStreamReader}s. For * example, * * {@snippet lang=java : @@ -52,12 +53,18 @@ * } * * will buffer the input from the specified file. Without buffering, each - * invocation of read() or readLine() could cause bytes to be read from the - * file, converted into characters, and then returned, which can be very - * inefficient. + * invocation of {@code read()} or {@code readLine()} could cause bytes to be + * read from the file, converted into characters, and then returned, which can + * be very inefficient. * - *

      Programs that use DataInputStreams for textual input can be localized by - * replacing each DataInputStream with an appropriate BufferedReader. + *

      Programs that use {@code DataInputStream}s for textual input can be + * localized by replacing each {@code DataInputStream} with an appropriate + * {@code BufferedReader}. + * + * @apiNote + * Once wrapped in a {@code BufferedReader}, the underlying + * {@code Reader} should not be used directly nor wrapped with + * another reader. * * @see FileReader * @see InputStreamReader diff --git a/src/java.base/share/classes/java/io/BufferedWriter.java b/src/java.base/share/classes/java/io/BufferedWriter.java index 4904f7180724a..17862a265ae82 100644 --- a/src/java.base/share/classes/java/io/BufferedWriter.java +++ b/src/java.base/share/classes/java/io/BufferedWriter.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 @@ -37,25 +37,31 @@ *

      The buffer size may be specified, or the default size may be accepted. * The default is large enough for most purposes. * - *

      A newLine() method is provided, which uses the platform's own notion of - * line separator as defined by the system property {@code line.separator}. - * Not all platforms use the newline character ('\n') to terminate lines. - * Calling this method to terminate each output line is therefore preferred to - * writing a newline character directly. + *

      A {@code newLine()} method is provided, which uses the platform's own + * notion of line separator as defined by the system property + * {@linkplain System#lineSeparator() line.separator}. Not all platforms use the newline character ('\n') + * to terminate lines. Calling this method to terminate each output line is + * therefore preferred to writing a newline character directly. * - *

      In general, a Writer sends its output immediately to the underlying - * character or byte stream. Unless prompt output is required, it is advisable - * to wrap a BufferedWriter around any Writer whose write() operations may be - * costly, such as FileWriters and OutputStreamWriters. For example, + *

      In general, a {@code Writer} sends its output immediately to the + * underlying character or byte stream. Unless prompt output is required, it + * is advisable to wrap a {@code BufferedWriter} around any {@code Writer} whose + * {@code write()} operations may be costly, such as {@code FileWriter}s and + * {@code OutputStreamWriter}s. For example, * * {@snippet lang=java : * PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("foo.out"))); * } * - * will buffer the PrintWriter's output to the file. Without buffering, each - * invocation of a print() method would cause characters to be converted into - * bytes that would then be written immediately to the file, which can be very - * inefficient. + * will buffer the {@code PrintWriter}'s output to the file. Without buffering, + * each invocation of a {@code print()} method would cause characters to be + * converted into bytes that would then be written immediately to the file, + * which can be very inefficient. + * + * @apiNote + * Once wrapped in a {@code BufferedWriter}, the underlying + * {@code Writer} should not be used directly nor wrapped with + * another writer. * * @see PrintWriter * @see FileWriter From aceae76fb5853ab65851225aeb35a425af8f7af8 Mon Sep 17 00:00:00 2001 From: Maxim Kartashev Date: Thu, 26 Sep 2024 15:40:31 +0000 Subject: [PATCH 206/307] 8339460: CDS error when module is located in a directory with space in the name Reviewed-by: ccheung, iklam --- src/hotspot/share/cds/classListParser.cpp | 4 +- src/hotspot/share/cds/classListWriter.cpp | 2 + src/hotspot/share/cds/filemap.cpp | 2 +- src/hotspot/share/classfile/classLoader.cpp | 48 ++++- src/hotspot/share/classfile/classLoader.hpp | 2 +- .../share/classfile/classLoaderExt.cpp | 10 +- test/hotspot/jtreg/TEST.groups | 1 + .../cds/appcds/complexURI/ComplexURITest.java | 167 ++++++++++++++++++ .../appcds/complexURI/mypackage/Another.java | 27 +++ .../cds/appcds/complexURI/mypackage/Main.java | 37 ++++ 10 files changed, 289 insertions(+), 11 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/complexURI/ComplexURITest.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/complexURI/mypackage/Another.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/complexURI/mypackage/Main.java diff --git a/src/hotspot/share/cds/classListParser.cpp b/src/hotspot/share/cds/classListParser.cpp index f8d24295a12e5..694a179d7ee6c 100644 --- a/src/hotspot/share/cds/classListParser.cpp +++ b/src/hotspot/share/cds/classListParser.cpp @@ -508,7 +508,9 @@ InstanceKlass* ClassListParser::load_class_from_source(Symbol* class_name, TRAPS THROW_NULL(vmSymbols::java_lang_ClassNotFoundException()); } - InstanceKlass* k = UnregisteredClasses::load_class(class_name, _source, CHECK_NULL); + ResourceMark rm; + char * source_path = os::strdup_check_oom(ClassLoader::uri_to_path(_source)); + InstanceKlass* k = UnregisteredClasses::load_class(class_name, source_path, CHECK_NULL); if (k->local_interfaces()->length() != _interfaces->length()) { print_specified_interfaces(); print_actual_interfaces(k); diff --git a/src/hotspot/share/cds/classListWriter.cpp b/src/hotspot/share/cds/classListWriter.cpp index 78cd092445b70..1b9f589f1c5e5 100644 --- a/src/hotspot/share/cds/classListWriter.cpp +++ b/src/hotspot/share/cds/classListWriter.cpp @@ -174,6 +174,8 @@ void ClassListWriter::write_to_stream(const InstanceKlass* k, outputStream* stre } } + // NB: the string following "source: " is not really a proper file name, but rather + // a truncated URI referring to a file. It must be decoded after reading. #ifdef _WINDOWS // "file:/C:/dir/foo.jar" -> "C:/dir/foo.jar" stream->print(" source: %s", cfs->source() + 6); diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index c935541d7cf0a..78613ae4b36c4 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -581,7 +581,7 @@ int FileMapInfo::get_module_shared_path_index(Symbol* location) { // skip_uri_protocol was also called during dump time -- see ClassLoaderExt::process_module_table() ResourceMark rm; - const char* file = ClassLoader::skip_uri_protocol(location->as_C_string()); + const char* file = ClassLoader::uri_to_path(location->as_C_string()); for (int i = ClassLoaderExt::app_module_paths_start_index(); i < get_number_of_shared_paths(); i++) { SharedClassPathEntry* ent = shared_path(i); if (!ent->is_non_existent()) { diff --git a/src/hotspot/share/classfile/classLoader.cpp b/src/hotspot/share/classfile/classLoader.cpp index 5309fcd20a8be..487d69a6f4fc9 100644 --- a/src/hotspot/share/classfile/classLoader.cpp +++ b/src/hotspot/share/classfile/classLoader.cpp @@ -81,6 +81,9 @@ #include "utilities/ostream.hpp" #include "utilities/utf8.hpp" +#include +#include + // Entry point in java.dll for path canonicalization typedef int (*canonicalize_fn_t)(const char *orig, char *out, int len); @@ -1209,7 +1212,7 @@ InstanceKlass* ClassLoader::load_class(Symbol* name, PackageEntry* pkg_entry, bo } #if INCLUDE_CDS -char* ClassLoader::skip_uri_protocol(char* source) { +static const char* skip_uri_protocol(const char* source) { if (strncmp(source, "file:", 5) == 0) { // file: protocol path could start with file:/ or file:/// // locate the char after all the forward slashes @@ -1228,6 +1231,47 @@ char* ClassLoader::skip_uri_protocol(char* source) { return source; } +static char decode_percent_encoded(const char *str, size_t& index) { + if (str[index] == '%' + && isxdigit(str[index + 1]) + && isxdigit(str[index + 2])) { + char hex[3]; + hex[0] = str[index + 1]; + hex[1] = str[index + 2]; + hex[2] = '\0'; + index += 2; + return (char) strtol(hex, NULL, 16); + } + return str[index]; +} + +char* ClassLoader::uri_to_path(const char* uri) { + const size_t len = strlen(uri) + 1; + char* path = NEW_RESOURCE_ARRAY(char, len); + + uri = skip_uri_protocol(uri); + + if (strncmp(uri, "//", 2) == 0) { + // Skip the empty "authority" part + uri += 2; + } + +#ifdef _WINDOWS + if (uri[0] == '/') { + // Absolute path name on Windows does not begin with a slash + uri += 1; + } +#endif + + size_t path_index = 0; + for (size_t i = 0; i < strlen(uri); ++i) { + char decoded = decode_percent_encoded(uri, i); + path[path_index++] = decoded; + } + path[path_index] = '\0'; + return path; +} + // Record the shared classpath index and loader type for classes loaded // by the builtin loaders at dump time. void ClassLoader::record_result(JavaThread* current, InstanceKlass* ik, @@ -1261,7 +1305,7 @@ void ClassLoader::record_result(JavaThread* current, InstanceKlass* ik, // Save the path from the file: protocol or the module name from the jrt: protocol // if no protocol prefix is found, path is the same as stream->source(). This path // must be valid since the class has been successfully parsed. - char* path = skip_uri_protocol(src); + const char* path = ClassLoader::uri_to_path(src); assert(path != nullptr, "sanity"); for (int i = 0; i < FileMapInfo::get_number_of_shared_paths(); i++) { SharedClassPathEntry* ent = FileMapInfo::shared_path(i); diff --git a/src/hotspot/share/classfile/classLoader.hpp b/src/hotspot/share/classfile/classLoader.hpp index af625082ddabf..e44059b724769 100644 --- a/src/hotspot/share/classfile/classLoader.hpp +++ b/src/hotspot/share/classfile/classLoader.hpp @@ -382,7 +382,7 @@ class ClassLoader: AllStatic { // entries during shared classpath setup time. static int num_module_path_entries(); static void exit_with_path_failure(const char* error, const char* message); - static char* skip_uri_protocol(char* source); + static char* uri_to_path(const char* uri); static void record_result(JavaThread* current, InstanceKlass* ik, const ClassFileStream* stream, bool redefined); #endif diff --git a/src/hotspot/share/classfile/classLoaderExt.cpp b/src/hotspot/share/classfile/classLoaderExt.cpp index 3cd7dd7cd3ba6..997f9d76676fa 100644 --- a/src/hotspot/share/classfile/classLoaderExt.cpp +++ b/src/hotspot/share/classfile/classLoaderExt.cpp @@ -100,12 +100,10 @@ void ClassLoaderExt::process_module_table(JavaThread* current, ModuleEntryTable* ModulePathsGatherer(JavaThread* current, GrowableArray* module_paths) : _current(current), _module_paths(module_paths) {} void do_module(ModuleEntry* m) { - char* path = m->location()->as_C_string(); - if (strncmp(path, "file:", 5) == 0) { - path = ClassLoader::skip_uri_protocol(path); - char* path_copy = NEW_RESOURCE_ARRAY(char, strlen(path) + 1); - strcpy(path_copy, path); - _module_paths->append(path_copy); + char* uri = m->location()->as_C_string(); + if (strncmp(uri, "file:", 5) == 0) { + char* path = ClassLoader::uri_to_path(uri); + _module_paths->append(path); } } }; diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index 101cbe76afdda..4ab4ba68692c1 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -435,6 +435,7 @@ hotspot_cds_only = \ hotspot_appcds_dynamic = \ runtime/cds/appcds/ \ -runtime/cds/appcds/cacheObject \ + -runtime/cds/appcds/complexURI \ -runtime/cds/appcds/customLoader \ -runtime/cds/appcds/dynamicArchive \ -runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java \ diff --git a/test/hotspot/jtreg/runtime/cds/appcds/complexURI/ComplexURITest.java b/test/hotspot/jtreg/runtime/cds/appcds/complexURI/ComplexURITest.java new file mode 100644 index 0000000000000..409e37e10a164 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/complexURI/ComplexURITest.java @@ -0,0 +1,167 @@ +/* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024 JetBrains s.r.o. + * 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 Verifies that CDS works with jar located in directories + * with names that need escaping + * @bug 8339460 + * @requires vm.cds + * @requires vm.cds.custom.loaders + * @requires vm.flagless + * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds + * @compile mypackage/Main.java mypackage/Another.java + * @run main/othervm ComplexURITest + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.Platform; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; + +public class ComplexURITest { + final static String moduleName = "mymodule"; + + public static void main(String[] args) throws Exception { + System.setProperty("test.noclasspath", "true"); + String jarFile = JarBuilder.build(moduleName, "mypackage/Main", "mypackage/Another"); + + Path subDir = Path.of(".", "dir with space"); + Files.createDirectory(subDir); + Path newJarFilePath = subDir.resolve(moduleName + ".jar"); + Files.move(Path.of(jarFile), newJarFilePath); + jarFile = newJarFilePath.toString(); + + final String listFileName = "test-classlist.txt"; + final String staticArchiveName = "test-static.jsa"; + final String dynamicArchiveName = "test-dynamic.jsa"; + + // Verify static archive creation and use + File fileList = new File(listFileName); + delete(fileList.toPath()); + File staticArchive = new File(staticArchiveName); + delete(staticArchive.toPath()); + + createClassList(jarFile, listFileName); + if (!fileList.exists()) { + throw new RuntimeException("No class list created at " + fileList); + } + + createArchive(jarFile, listFileName, staticArchiveName); + if (!staticArchive.exists()) { + throw new RuntimeException("No shared classes archive created at " + staticArchive); + } + + useArchive(jarFile, staticArchiveName); + + // Verify dynamic archive creation and use + File dynamicArchive = new File(dynamicArchiveName); + delete(dynamicArchive.toPath()); + + createDynamicArchive(jarFile, dynamicArchiveName); + if (!dynamicArchive.exists()) { + throw new RuntimeException("No dynamic archive created at " + dynamicArchive); + } + + testDynamicArchive(jarFile, dynamicArchiveName); + } + + private static void delete(Path path) throws Exception { + if (Files.exists(path)) { + if (Platform.isWindows()) { + Files.setAttribute(path, "dos:readonly", false); + } + Files.delete(path); + } + } + + private static void createClassList(String jarFile, String list) throws Exception { + String[] launchArgs = { + "-XX:DumpLoadedClassList=" + list, + "--module-path", + jarFile, + "--module", + moduleName + "/mypackage.Main"}; + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); + OutputAnalyzer output = TestCommon.executeAndLog(pb, "create-list"); + output.shouldHaveExitValue(0); + } + + private static void createArchive(String jarFile, String list, String archive) throws Exception { + String[] launchArgs = { + "-Xshare:dump", + "-XX:SharedClassListFile=" + list, + "-XX:SharedArchiveFile=" + archive, + "--module-path", + jarFile, + "--module", + moduleName + "/mypackage.Main"}; + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); + OutputAnalyzer output = TestCommon.executeAndLog(pb, "dump-archive"); + output.shouldHaveExitValue(0); + } + + private static void useArchive(String jarFile, String archive) throws Exception { + String[] launchArgs = { + "-Xshare:on", + "-XX:SharedArchiveFile=" + archive, + "--module-path", + jarFile, + "--module", + moduleName + "/mypackage.Main"}; + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); + OutputAnalyzer output = TestCommon.executeAndLog(pb, "use-archive"); + output.shouldHaveExitValue(0); + } + + private static void createDynamicArchive(String jarFile, String archive) throws Exception { + String[] launchArgs = { + "-XX:ArchiveClassesAtExit=" + archive, + "--module-path", + jarFile, + "--module", + moduleName + "/mypackage.Main"}; + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); + OutputAnalyzer output = TestCommon.executeAndLog(pb, "dynamic-archive"); + output.shouldHaveExitValue(0); + } + + private static void testDynamicArchive(String jarFile, String archive) throws Exception { + String[] launchArgs = { + "-XX:SharedArchiveFile=" + archive, + "-XX:+PrintSharedArchiveAndExit", + "--module-path", + jarFile, + "--module", + moduleName + "/mypackage.Main"}; + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); + OutputAnalyzer output = TestCommon.executeAndLog(pb, "dynamic-archive"); + output.shouldHaveExitValue(0); + output.shouldContain("archive is valid"); + output.shouldContain(": mypackage.Main app_loader"); + output.shouldContain(": mypackage.Another unregistered_loader"); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/complexURI/mypackage/Another.java b/test/hotspot/jtreg/runtime/cds/appcds/complexURI/mypackage/Another.java new file mode 100644 index 0000000000000..106dfd4904c7d --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/complexURI/mypackage/Another.java @@ -0,0 +1,27 @@ +/* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024 JetBrains s.r.o. + * 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 mypackage; + +public class Another { +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/complexURI/mypackage/Main.java b/test/hotspot/jtreg/runtime/cds/appcds/complexURI/mypackage/Main.java new file mode 100644 index 0000000000000..fdb79e895d240 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/complexURI/mypackage/Main.java @@ -0,0 +1,37 @@ +/* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024 JetBrains s.r.o. + * 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 mypackage; + +import java.net.URL; +import java.net.URLClassLoader; + +public class Main { + public static void main(String[] args) throws Exception { + URL url1 = Main.class.getProtectionDomain().getCodeSource().getLocation(); + System.out.println("Will load Another from " + url1); + ClassLoader cl = URLClassLoader.newInstance(new URL[] { url1 }, null); + var anotherClass = cl.loadClass("mypackage.Another"); + System.out.println("Class " + anotherClass + " loaded successfully"); + } +} From 8225a5f58a62ddf4acbb879bfcb53cf7bfd8542f Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 26 Sep 2024 16:03:04 +0000 Subject: [PATCH 207/307] 8340981: Update citations to "Hacker's Delight" Reviewed-by: bpb, iris, liach, jwaters --- src/java.base/share/classes/java/lang/Integer.java | 9 +++++---- src/java.base/share/classes/java/lang/Long.java | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Integer.java b/src/java.base/share/classes/java/lang/Integer.java index 7a65046181f00..fccdd697c7238 100644 --- a/src/java.base/share/classes/java/lang/Integer.java +++ b/src/java.base/share/classes/java/lang/Integer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved. * 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,8 +63,9 @@ *

      Implementation note: The implementations of the "bit twiddling" * methods (such as {@link #highestOneBit(int) highestOneBit} and * {@link #numberOfTrailingZeros(int) numberOfTrailingZeros}) are - * based on material from Henry S. Warren, Jr.'s Hacker's - * Delight, (Addison Wesley, 2002). + * based on material from Henry S. Warren, Jr.'s Hacker's + * Delight, (Addison Wesley, 2002) and Hacker's + * Delight, Second Edition, (Pearson Education, 2013). * * @author Lee Boynton * @author Arthur van Hoff @@ -1736,7 +1737,7 @@ public static int reverse(int i) { * compress(expand(x, m), m) == x & compress(m, m) * } *

      - * The Sheep And Goats (SAG) operation (see Hacker's Delight, section 7.7) + * The Sheep And Goats (SAG) operation (see Hacker's Delight, Second Edition, section 7.7) * can be implemented as follows: * {@snippet lang="java" : * int compressLeft(int i, int mask) { diff --git a/src/java.base/share/classes/java/lang/Long.java b/src/java.base/share/classes/java/lang/Long.java index ee9533b29eb53..ff34da232f9ab 100644 --- a/src/java.base/share/classes/java/lang/Long.java +++ b/src/java.base/share/classes/java/lang/Long.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved. * 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,8 +63,9 @@ *

      Implementation note: The implementations of the "bit twiddling" * methods (such as {@link #highestOneBit(long) highestOneBit} and * {@link #numberOfTrailingZeros(long) numberOfTrailingZeros}) are - * based on material from Henry S. Warren, Jr.'s Hacker's - * Delight, (Addison Wesley, 2002). + * based on material from Henry S. Warren, Jr.'s Hacker's + * Delight, (Addison Wesley, 2002) and Hacker's + * Delight, Second Edition, (Pearson Education, 2013). * * @author Lee Boynton * @author Arthur van Hoff @@ -1749,7 +1750,7 @@ public static long reverse(long i) { * compress(expand(x, m), m) == x & compress(m, m) * } *

      - * The Sheep And Goats (SAG) operation (see Hacker's Delight, section 7.7) + * The Sheep And Goats (SAG) operation (see Hacker's Delight, Second Edition, section 7.7) * can be implemented as follows: * {@snippet lang="java" : * long compressLeft(long i, long mask) { From bb040ef4cc2b626f282cbf6af5b359d1c2505385 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 26 Sep 2024 16:04:45 +0000 Subject: [PATCH 208/307] 8340983: Use index and definition tags in Object and Double Reviewed-by: bpb, liach --- src/java.base/share/classes/java/lang/Double.java | 6 +++--- src/java.base/share/classes/java/lang/Object.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Double.java b/src/java.base/share/classes/java/lang/Double.java index 9b11964d9e6fa..e789a6777175e 100644 --- a/src/java.base/share/classes/java/lang/Double.java +++ b/src/java.base/share/classes/java/lang/Double.java @@ -148,7 +148,7 @@ * relations that can be defined over floating-point values: * *

      - *
      numerical equality ({@code ==} + *
      {@index "numerical equality"} ({@code ==} * operator): (Not an equivalence relation)
      *
      Two floating-point values represent the same extended real * number. The extended real numbers are the real numbers augmented @@ -158,7 +158,7 @@ * number and is not equal to any value, including itself. *
      * - *
      bit-wise equivalence:
      + *
      {@index "bit-wise equivalence"}:
      *
      The bits of the two floating-point values are the same. This * equivalence relation for {@code double} values {@code a} and {@code * b} is implemented by the expression @@ -168,7 +168,7 @@ * is distinguished from every other bit pattern encoding a NaN. *
      * - *
      representation equivalence:
      + *
      {@index "representation equivalence"}:
      *
      The two floating-point values represent the same IEEE 754 * datum. In particular, for {@linkplain #isFinite(double) * finite} values, the sign, {@linkplain Math#getExponent(double) diff --git a/src/java.base/share/classes/java/lang/Object.java b/src/java.base/share/classes/java/lang/Object.java index d9813df57a4f0..7909f05304268 100644 --- a/src/java.base/share/classes/java/lang/Object.java +++ b/src/java.base/share/classes/java/lang/Object.java @@ -109,7 +109,7 @@ public Object() {} /** * Indicates whether some other object is "equal to" this one. *

      - * The {@code equals} method implements an equivalence relation + * The {@code equals} method implements an {@index "equivalence relation"} * on non-null object references: *

        *
      • It is reflexive: for any non-null reference value From a02d895f7ad59fe33f8a761dbd7bceb0b8dfefc0 Mon Sep 17 00:00:00 2001 From: Ravi Gupta Date: Thu, 26 Sep 2024 16:31:31 +0000 Subject: [PATCH 209/307] 8333403: Write a test to check various components events are triggered properly Reviewed-by: aivanov --- .../awt/Component/ComponentEventTest.java | 357 ++++++++++++++++++ 1 file changed, 357 insertions(+) create mode 100644 test/jdk/java/awt/Component/ComponentEventTest.java diff --git a/test/jdk/java/awt/Component/ComponentEventTest.java b/test/jdk/java/awt/Component/ComponentEventTest.java new file mode 100644 index 0000000000000..bfbfed336a017 --- /dev/null +++ b/test/jdk/java/awt/Component/ComponentEventTest.java @@ -0,0 +1,357 @@ +/* + * 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. + */ + +import java.awt.Button; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Label; +import java.awt.List; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Scrollbar; +import java.awt.TextArea; +import java.awt.TextField; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.awt.event.InputEvent; +import java.lang.reflect.InvocationTargetException; + +import jdk.test.lib.Platform; + +/* + * @test + * @key headful + * @bug 8333403 + * @summary Test performs various operations to check components events are triggered properly. + * @library /test/lib + * @build jdk.test.lib.Platform + * @run main ComponentEventTest + */ +public class ComponentEventTest { + + private static final int DELAY = 500; + + private static Frame frame; + private static Robot robot; + + private static Component[] components; + + private static volatile Point centerPoint; + + private static volatile boolean componentHidden; + private static volatile boolean componentShown; + private static volatile boolean componentMoved; + private static volatile boolean componentResized; + + private static final ComponentListener componentListener = + new ComponentListener() { + + @Override + public void componentShown(ComponentEvent e) { + System.out.println("ComponentShown: " + e.getSource()); + componentShown = true; + } + + @Override + public void componentResized(ComponentEvent e) { + System.out.println("ComponentResized: " + e.getSource()); + componentResized = true; + } + + @Override + public void componentMoved(ComponentEvent e) { + System.out.println("ComponentMoved: " + e.getSource()); + componentMoved = true; + } + + @Override + public void componentHidden(ComponentEvent e) { + System.out.println("ComponentHidden: " + e.getSource()); + componentHidden = true; + } + }; + + private static void initializeGUI() { + frame = new Frame("Component Event Test"); + frame.setLayout(new FlowLayout()); + + Panel panel = new Panel(); + Button button = new Button("Button"); + Label label = new Label("Label"); + List list = new List(); + list.add("One"); + list.add("Two"); + list.add("Three"); + Choice choice = new Choice(); + choice.add("Red"); + choice.add("Orange"); + choice.add("Yellow"); + Checkbox checkbox = new Checkbox("Checkbox"); + Scrollbar scrollbar = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, 255); + TextField textfield = new TextField(15); + TextArea textarea = new TextArea(5, 15); + + components = new Component[] { panel, button, label, list, choice, + checkbox, scrollbar, textfield, textarea, frame }; + + for (int i = 0; i < components.length - 1; i++) { + components[i].addComponentListener(componentListener); + frame.add(components[i]); + } + frame.addComponentListener(componentListener); + + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + public static void main(String[] args) throws Exception { + try { + robot = new Robot(); + robot.setAutoWaitForIdle(true); + + EventQueue.invokeAndWait(ComponentEventTest::initializeGUI); + robot.waitForIdle(); + robot.delay(DELAY); + + doTest(); + + System.out.println("Test PASSED"); + } finally { + EventQueue.invokeAndWait(ComponentEventTest::disposeFrame); + } + } + + private static void doTest() + throws InvocationTargetException, InterruptedException { + // Click the frame to ensure it gains focus + clickFrame(); + + robot.delay(DELAY); + + for (int i = 0; i < components.length; i++) { + for (boolean state : new boolean[] { true, false }) { + doTest(components[i], state); + } + } + + robot.delay(DELAY); + + System.out.println("Iconify frame"); + resetValues(); + testIconifyFrame(); + + System.out.println("Deiconify frame"); + resetValues(); + testDeiconifyFrame(); + } + + private static void clickFrame() + throws InvocationTargetException, InterruptedException { + EventQueue.invokeAndWait(() -> { + Point location = frame.getLocationOnScreen(); + Dimension size = frame.getSize(); + centerPoint = new Point(location.x + size.width / 2, + location.y + size.height / 2); + }); + + robot.mouseMove(centerPoint.x, centerPoint.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + } + + private static void testIconifyFrame() + throws InvocationTargetException, InterruptedException { + EventQueue.invokeAndWait(() -> frame.setExtendedState(Frame.ICONIFIED)); + + robot.waitForIdle(); + robot.delay(DELAY); + if (componentShown || componentHidden || componentMoved + || componentResized) { + throw new RuntimeException( + "ComponentEvent triggered when frame is iconified"); + } + } + + private static void testDeiconifyFrame() + throws InvocationTargetException, InterruptedException { + EventQueue.invokeAndWait(() -> frame.setExtendedState(Frame.NORMAL)); + + robot.waitForIdle(); + robot.delay(DELAY); + + /* + * Because of the different behavior between MS Windows and other OS, we + * receive native events WM_SIZE and WM_MOVE on Windows when the frame + * state changes from iconified to normal. AWT sends these events to + * components when it receives the events from the native system. See + * JDK-6754618 for more information. + */ + + if (componentShown || componentHidden) { + throw new RuntimeException( + "FAIL: componentShown or componentHidden triggered " + + "when frame set to normal"); + } + + if (Platform.isWindows() && (!componentMoved || !componentResized)) { + throw new RuntimeException( + "FAIL: componentMoved or componentResized wasn't triggered " + + "when frame set to normal"); + } + if (!Platform.isWindows() && (componentMoved || componentResized)) { + throw new RuntimeException( + "FAIL: componentMoved or componentResized triggered " + + "when frame set to normal"); + } + } + + private static void doTest(final Component currentComponent, boolean enable) + throws InvocationTargetException, InterruptedException { + + System.out.println("Component " + currentComponent); + System.out.println(" enabled " + enable); + + EventQueue.invokeAndWait(() -> { + currentComponent.setEnabled(enable); + revalidateFrame(); + }); + + robot.delay(DELAY); + + resetValues(); + EventQueue.invokeAndWait(() -> { + currentComponent.setVisible(false); + revalidateFrame(); + }); + + robot.delay(DELAY); + if (!componentHidden) { + throw new RuntimeException("FAIL: ComponentHidden not triggered for" + + currentComponent.getClass()); + } + + resetValues(); + EventQueue.invokeAndWait(() -> { + currentComponent.setVisible(false); + revalidateFrame(); + }); + + robot.delay(DELAY); + if (componentHidden) { + throw new RuntimeException("FAIL: ComponentHidden triggered when " + + "setVisible(false) called for a hidden " + + currentComponent.getClass()); + } + + resetValues(); + EventQueue.invokeAndWait(() -> { + currentComponent.setVisible(true); + revalidateFrame(); + }); + + robot.delay(DELAY); + if (!componentShown) { + throw new RuntimeException("FAIL: ComponentShown not triggered for " + + currentComponent.getClass()); + } + + resetValues(); + EventQueue.invokeAndWait(() -> { + currentComponent.setVisible(true); + revalidateFrame(); + }); + + robot.delay(DELAY); + if (componentShown) { + throw new RuntimeException("FAIL: ComponentShown triggered when " + + "setVisible(true) called for a shown " + + currentComponent.getClass()); + } + + resetValues(); + EventQueue.invokeAndWait(() -> { + currentComponent.setLocation(currentComponent.getLocation().x + 1, + currentComponent.getLocation().y); + revalidateFrame(); + }); + + robot.delay(DELAY); + if (!componentMoved) { + throw new RuntimeException("FAIL: ComponentMoved not triggered for " + + currentComponent.getClass()); + } + + resetValues(); + EventQueue.invokeAndWait(() -> { + currentComponent.setSize(currentComponent.getSize().width + 1, + currentComponent.getSize().height); + revalidateFrame(); + }); + + robot.delay(DELAY); + if (!componentResized) { + throw new RuntimeException("FAIL: ComponentResized not triggered " + + "when size increases for " + currentComponent.getClass()); + } + + resetValues(); + EventQueue.invokeAndWait(() -> { + currentComponent.setSize(currentComponent.getSize().width - 1, + currentComponent.getSize().height); + revalidateFrame(); + }); + + robot.delay(DELAY); + if (!componentResized) { + throw new RuntimeException("FAIL: ComponentResized not triggered " + + "when size decreases for " + currentComponent.getClass()); + } + + System.out.println("\n"); + } + + private static void revalidateFrame() { + frame.invalidate(); + frame.validate(); + } + + private static void resetValues() { + componentShown = false; + componentHidden = false; + componentMoved = false; + componentResized = false; + } + + private static void disposeFrame() { + if (frame != null) { + frame.dispose(); + } + } +} From 1447967f53fe27f67e4bb766464f941e39506d41 Mon Sep 17 00:00:00 2001 From: Fernando Guallini Date: Thu, 26 Sep 2024 16:47:49 +0000 Subject: [PATCH 210/307] 8339261: Logs truncated in test javax/net/ssl/DTLS/DTLSRehandshakeTest.java Reviewed-by: rhalade, hchao --- test/jdk/javax/net/ssl/DTLS/TEST.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/javax/net/ssl/DTLS/TEST.properties b/test/jdk/javax/net/ssl/DTLS/TEST.properties index ceb6c8c9c42c7..a50cba09c0f81 100644 --- a/test/jdk/javax/net/ssl/DTLS/TEST.properties +++ b/test/jdk/javax/net/ssl/DTLS/TEST.properties @@ -6,3 +6,4 @@ modules = \ java.security.jgss/sun.security.krb5.internal:+open \ java.security.jgss/sun.security.krb5.internal.ktab \ java.base/sun.security.util +maxOutputSize = 2500000 From 5d062e248ec4be7b35f85c341e76aa6d8d6d8b2b Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Thu, 26 Sep 2024 19:36:26 +0000 Subject: [PATCH 211/307] 8340576: Some JVMCI flags are inconsistent Reviewed-by: never --- src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp | 2 +- src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp | 2 +- src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp | 2 +- src/hotspot/share/compiler/oopMap.inline.hpp | 6 ++---- src/hotspot/share/jvmci/jvmci_globals.cpp | 4 ++-- src/hotspot/share/jvmci/jvmci_globals.hpp | 6 +++--- src/hotspot/share/runtime/deoptimization.cpp | 2 +- src/hotspot/share/runtime/escapeBarrier.hpp | 4 ++-- src/hotspot/share/runtime/sharedRuntime.cpp | 2 +- 9 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp index 1b02108b00f94..52996f4c4a503 100644 --- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp @@ -2234,7 +2234,7 @@ void SharedRuntime::generate_deopt_blob() { int reexecute_offset = __ pc() - start; #if INCLUDE_JVMCI && !defined(COMPILER1) - if (EnableJVMCI && UseJVMCICompiler) { + if (UseJVMCICompiler) { // JVMCI does not use this kind of deoptimization __ should_not_reach_here(); } diff --git a/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp b/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp index 879fd92272279..27da26d404cc0 100644 --- a/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp +++ b/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp @@ -2110,7 +2110,7 @@ void SharedRuntime::generate_deopt_blob() { int reexecute_offset = __ pc() - start; #if INCLUDE_JVMCI && !defined(COMPILER1) - if (EnableJVMCI && UseJVMCICompiler) { + if (UseJVMCICompiler) { // JVMCI does not use this kind of deoptimization __ should_not_reach_here(); } diff --git a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp index 4bd91f640fca7..174e2e0277903 100644 --- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp +++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp @@ -2674,7 +2674,7 @@ void SharedRuntime::generate_deopt_blob() { int reexecute_offset = __ pc() - start; #if INCLUDE_JVMCI && !defined(COMPILER1) - if (EnableJVMCI && UseJVMCICompiler) { + if (UseJVMCICompiler) { // JVMCI does not use this kind of deoptimization __ should_not_reach_here(); } diff --git a/src/hotspot/share/compiler/oopMap.inline.hpp b/src/hotspot/share/compiler/oopMap.inline.hpp index f2a3b3ba834df..05ef53f823142 100644 --- a/src/hotspot/share/compiler/oopMap.inline.hpp +++ b/src/hotspot/share/compiler/oopMap.inline.hpp @@ -66,12 +66,10 @@ void OopMapDo::iterate_oops_do(const frame continue; #ifndef COMPILER2 - COMPILER1_PRESENT(ShouldNotReachHere();) #if INCLUDE_JVMCI - if (UseJVMCICompiler) { - ShouldNotReachHere(); - } + if (!EnableJVMCI) #endif + ShouldNotReachHere(); #endif // !COMPILER2 address loc = fr->oopmapreg_to_location(omv.reg(), reg_map); diff --git a/src/hotspot/share/jvmci/jvmci_globals.cpp b/src/hotspot/share/jvmci/jvmci_globals.cpp index 36740560dd23f..2ae38044df0ff 100644 --- a/src/hotspot/share/jvmci/jvmci_globals.cpp +++ b/src/hotspot/share/jvmci/jvmci_globals.cpp @@ -26,6 +26,7 @@ #include "compiler/compilerDefinitions.hpp" #include "gc/shared/gcConfig.hpp" #include "jvm.h" +#include "jvmci/jvmci.hpp" #include "jvmci/jvmci_globals.hpp" #include "logging/log.hpp" #include "runtime/arguments.hpp" @@ -90,8 +91,7 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() { 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)) { + if (JVMCI::shared_library_exists()) { // If a JVMCI native library is present, // we enable UseJVMCINativeLibrary by default. FLAG_SET_DEFAULT(UseJVMCINativeLibrary, true); diff --git a/src/hotspot/share/jvmci/jvmci_globals.hpp b/src/hotspot/share/jvmci/jvmci_globals.hpp index 30f2e6c2c73e0..d6f9ddd6739d4 100644 --- a/src/hotspot/share/jvmci/jvmci_globals.hpp +++ b/src/hotspot/share/jvmci/jvmci_globals.hpp @@ -45,7 +45,7 @@ class fileStream; constraint) \ \ product(bool, EnableJVMCI, false, EXPERIMENTAL, \ - "Enable JVMCI") \ + "Enable JVMCI. Defaults to true if UseJVMCICompiler is true.") \ \ product(bool, UseGraalJIT, false, EXPERIMENTAL, \ "Select the Graal JVMCI compiler. This is an alias for: " \ @@ -140,8 +140,8 @@ 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 EnableJVMCI is " \ - "true and a JVMCI native library is available.") \ + "on the HotSpot heap. Defaults to true if UseJVMCICompiler or " \ + "EnableJVMCI is true and a JVMCI native library is available.") \ \ product(double, JVMCINativeLibraryThreadFraction, 0.33, EXPERIMENTAL, \ "The fraction of compiler threads used by libjvmci. " \ diff --git a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp index 7961e56598f25..2006f340450e5 100644 --- a/src/hotspot/share/runtime/deoptimization.cpp +++ b/src/hotspot/share/runtime/deoptimization.cpp @@ -447,7 +447,7 @@ bool Deoptimization::deoptimize_objects_internal(JavaThread* thread, GrowableArr RegisterMap map(chunk->at(0)->register_map()); bool deoptimized_objects = false; - bool const jvmci_enabled = JVMCI_ONLY(UseJVMCICompiler) NOT_JVMCI(false); + bool const jvmci_enabled = JVMCI_ONLY(EnableJVMCI) NOT_JVMCI(false); // Reallocate the non-escaping objects and restore their fields. if (jvmci_enabled COMPILER2_PRESENT(|| (DoEscapeAnalysis && EliminateAllocations) diff --git a/src/hotspot/share/runtime/escapeBarrier.hpp b/src/hotspot/share/runtime/escapeBarrier.hpp index df32deef98639..454e0b555e118 100644 --- a/src/hotspot/share/runtime/escapeBarrier.hpp +++ b/src/hotspot/share/runtime/escapeBarrier.hpp @@ -71,7 +71,7 @@ class EscapeBarrier : StackObj { // Revert ea based optimizations for given deoptee thread EscapeBarrier(bool barrier_active, JavaThread* calling_thread, JavaThread* deoptee_thread) : _calling_thread(calling_thread), _deoptee_thread(deoptee_thread), - _barrier_active(barrier_active && (JVMCI_ONLY(UseJVMCICompiler) NOT_JVMCI(false) + _barrier_active(barrier_active && (JVMCI_ONLY(EnableJVMCI) NOT_JVMCI(false) COMPILER2_PRESENT(|| DoEscapeAnalysis))) { if (_barrier_active) sync_and_suspend_one(); @@ -80,7 +80,7 @@ class EscapeBarrier : StackObj { // Revert ea based optimizations for all java threads EscapeBarrier(bool barrier_active, JavaThread* calling_thread) : _calling_thread(calling_thread), _deoptee_thread(nullptr), - _barrier_active(barrier_active && (JVMCI_ONLY(UseJVMCICompiler) NOT_JVMCI(false) + _barrier_active(barrier_active && (JVMCI_ONLY(EnableJVMCI) NOT_JVMCI(false) COMPILER2_PRESENT(|| DoEscapeAnalysis))) { if (_barrier_active) sync_and_suspend_all(); diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index d9b38133f9944..6ca7f42e038f5 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -651,7 +651,7 @@ void SharedRuntime::throw_and_post_jvmti_exception(JavaThread* current, Handle h } #if INCLUDE_JVMCI - if (EnableJVMCI && UseJVMCICompiler) { + if (EnableJVMCI) { vframeStream vfst(current, true); methodHandle method = methodHandle(current, vfst.method()); int bci = vfst.bci(); From 2349bb7ace0c40c0f19dee81b4a86bed0e855043 Mon Sep 17 00:00:00 2001 From: "Todd V. Jonker" Date: Thu, 26 Sep 2024 21:38:08 +0000 Subject: [PATCH 212/307] 8340974: Ambiguous name of jtreg property vm.libgraal.enabled Reviewed-by: dnsimon, phh --- test/hotspot/jtreg/TEST.ROOT | 2 +- test/jtreg-ext/requires/VMProps.java | 7 +++---- test/lib/jdk/test/whitebox/code/Compiler.java | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT index 74540b6ad45dc..5ed0227068cf6 100644 --- a/test/hotspot/jtreg/TEST.ROOT +++ b/test/hotspot/jtreg/TEST.ROOT @@ -81,7 +81,7 @@ requires.properties= \ vm.jvmti \ vm.graal.enabled \ jdk.hasLibgraal \ - vm.libgraal.enabled \ + vm.libgraal.jit \ vm.compiler1.enabled \ vm.compiler2.enabled \ vm.musl \ diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index 5aa703c5b26c2..539a1f23208c3 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -128,8 +128,7 @@ public Map call() { map.put("vm.graal.enabled", this::isGraalEnabled); // jdk.hasLibgraal is true if the libgraal shared library file is present map.put("jdk.hasLibgraal", this::hasLibgraal); - // vm.libgraal.enabled is true if libgraal is used as JIT - map.put("vm.libgraal.enabled", this::isLibgraalEnabled); + map.put("vm.libgraal.jit", this::isLibgraalJIT); map.put("vm.compiler1.enabled", this::isCompiler1Enabled); map.put("vm.compiler2.enabled", this::isCompiler2Enabled); map.put("docker.support", this::dockerSupport); @@ -560,8 +559,8 @@ protected String hasLibgraal() { * * @return true if libgraal is used as JIT compiler. */ - protected String isLibgraalEnabled() { - return "" + Compiler.isLibgraalEnabled(); + protected String isLibgraalJIT() { + return "" + Compiler.isLibgraalJIT(); } /** diff --git a/test/lib/jdk/test/whitebox/code/Compiler.java b/test/lib/jdk/test/whitebox/code/Compiler.java index 2f8447700d57d..69d79ab9d7104 100644 --- a/test/lib/jdk/test/whitebox/code/Compiler.java +++ b/test/lib/jdk/test/whitebox/code/Compiler.java @@ -91,12 +91,12 @@ public static boolean isGraalEnabled() { /** * Check if libgraal is used as JIT compiler. * - * libraal is enabled if isGraalEnabled is true and: + * libraal JIT is enabled if isGraalEnabled is true and: * - UseJVMCINativeLibrary flag is true * * @return true if libgraal is used as JIT compiler. */ - public static boolean isLibgraalEnabled() { + public static boolean isLibgraalJIT() { if (!isGraalEnabled()) { return false; } From e6373b52380b35ed13b5ea308dfd5ade454f0e99 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 26 Sep 2024 21:54:30 +0000 Subject: [PATCH 213/307] 8340679: Misc tests fail assert(!set || SafepointSynchronize::is_at_safepoint()) failed: set once or at safepoint Reviewed-by: matsaave, iklam --- .../share/classfile/systemDictionary.cpp | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp index bcddddc0c7c78..7b307a0b8a37c 100644 --- a/src/hotspot/share/classfile/systemDictionary.cpp +++ b/src/hotspot/share/classfile/systemDictionary.cpp @@ -1069,7 +1069,7 @@ bool SystemDictionary::check_shared_class_super_type(InstanceKlass* klass, Insta } Klass *found = resolve_with_circularity_detection(klass->name(), super_type->name(), - class_loader, protection_domain, is_superclass, CHECK_0); + class_loader, protection_domain, is_superclass, CHECK_false); if (found == super_type) { return true; } else { @@ -1088,16 +1088,21 @@ bool SystemDictionary::check_shared_class_super_types(InstanceKlass* ik, Handle // If unexpected superclass or interfaces are found, we cannot // load from the shared archive. - if (ik->super() != nullptr && - !check_shared_class_super_type(ik, InstanceKlass::cast(ik->super()), - class_loader, protection_domain, true, THREAD)) { - return false; + if (ik->super() != nullptr) { + bool check_super = check_shared_class_super_type(ik, InstanceKlass::cast(ik->super()), + class_loader, protection_domain, true, + CHECK_false); + if (!check_super) { + return false; + } } Array* interfaces = ik->local_interfaces(); int num_interfaces = interfaces->length(); for (int index = 0; index < num_interfaces; index++) { - if (!check_shared_class_super_type(ik, interfaces->at(index), class_loader, protection_domain, false, THREAD)) { + bool check_interface = check_shared_class_super_type(ik, interfaces->at(index), class_loader, protection_domain, false, + CHECK_false); + if (!check_interface) { return false; } } @@ -1153,7 +1158,8 @@ InstanceKlass* SystemDictionary::load_shared_class(InstanceKlass* ik, return nullptr; } - if (!check_shared_class_super_types(ik, class_loader, protection_domain, THREAD)) { + bool check = check_shared_class_super_types(ik, class_loader, protection_domain, CHECK_NULL); + if (!check) { ik->set_shared_loading_failed(); return nullptr; } From 1bc13a1c10a580f84f1b7686c95344ec2633f611 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 26 Sep 2024 22:37:45 +0000 Subject: [PATCH 214/307] 8340552: Harden TzdbZoneRulesCompiler against missing zone names Reviewed-by: andrew, jlu, naoto --- .../build/tools/tzdb/TzdbZoneRulesCompiler.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java b/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java index 630d3a390d18a..426d0bb10ede1 100644 --- a/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java +++ b/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, 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 @@ -273,7 +273,7 @@ private void outputFile(Path dstFile, String version, // link version-region-rules out.writeShort(builtZones.size()); for (Map.Entry entry : builtZones.entrySet()) { - int regionIndex = Arrays.binarySearch(regionArray, entry.getKey()); + int regionIndex = findRegionIndex(regionArray, entry.getKey()); int rulesIndex = rulesList.indexOf(entry.getValue()); out.writeShort(regionIndex); out.writeShort(rulesIndex); @@ -281,8 +281,8 @@ private void outputFile(Path dstFile, String version, // alias-region out.writeShort(links.size()); for (Map.Entry entry : links.entrySet()) { - int aliasIndex = Arrays.binarySearch(regionArray, entry.getKey()); - int regionIndex = Arrays.binarySearch(regionArray, entry.getValue()); + int aliasIndex = findRegionIndex(regionArray, entry.getKey()); + int regionIndex = findRegionIndex(regionArray, entry.getValue()); out.writeShort(aliasIndex); out.writeShort(regionIndex); } @@ -294,6 +294,14 @@ private void outputFile(Path dstFile, String version, } } + private static int findRegionIndex(String[] regionArray, String region) { + int index = Arrays.binarySearch(regionArray, region); + if (index < 0) { + throw new IllegalArgumentException("Unknown region: " + region); + } + return index; + } + /** Whether to output verbose messages. */ private boolean verbose; From 85dba479256a59ea66997d5c408f290e6b5ad384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Fri, 27 Sep 2024 06:34:02 +0000 Subject: [PATCH 215/307] 8325090: javadoc fails when -subpackages option is used with non-modular -source Reviewed-by: liach, jjg --- .../javadoc/internal/tool/ElementsTable.java | 12 +-- .../SubpackageNoModules.java | 74 +++++++++++++++++++ 2 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 test/langtools/jdk/javadoc/tool/subpackageNoModules/SubpackageNoModules.java diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java index a531a987f0d40..0ec72e4ae1cf3 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java @@ -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 @@ -870,10 +870,12 @@ private List getFiles(ModulePackage modpkg, private ModuleSymbol findModuleOfPackageName(String packageName) { Name pack = names.fromString(packageName); - for (ModuleSymbol msym : modules.allModules()) { - PackageSymbol p = syms.getPackage(msym, pack); - if (p != null && !p.members().isEmpty()) { - return msym; + if (modules.modulesInitialized()) { + for (ModuleSymbol msym : modules.allModules()) { + PackageSymbol p = syms.getPackage(msym, pack); + if (p != null && !p.members().isEmpty()) { + return msym; + } } } return null; diff --git a/test/langtools/jdk/javadoc/tool/subpackageNoModules/SubpackageNoModules.java b/test/langtools/jdk/javadoc/tool/subpackageNoModules/SubpackageNoModules.java new file mode 100644 index 0000000000000..164ec1f19e494 --- /dev/null +++ b/test/langtools/jdk/javadoc/tool/subpackageNoModules/SubpackageNoModules.java @@ -0,0 +1,74 @@ +/* + * 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 8325090 + * @summary javadoc fails when -subpackages option is used with non-modular -source + * @modules jdk.javadoc/jdk.javadoc.internal.api + * jdk.javadoc/jdk.javadoc.internal.tool + * @library /tools/lib + * @build toolbox.TestRunner toolbox.ToolBox + * @run main SubpackageNoModules + */ + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import toolbox.*; +import toolbox.Task.Expect; + +public class SubpackageNoModules extends TestRunner { + + final ToolBox tb = new ToolBox(); + + public SubpackageNoModules() { + super(System.err); + } + + public static void main(String[] args) throws Exception { + SubpackageNoModules t = new SubpackageNoModules(); + t.runTests(m -> new Object[] { Paths.get(m.getName()) }); + } + + @Test + public void testSubpackageNoModules(Path base) throws Exception { + Files.createDirectories(base); + tb.writeFile(base.resolve("pkg/A.java"), "package pkg;\npublic class A {}\n"); + + Path outDir = base.resolve("out"); + Files.createDirectory(outDir); + // Combine -subpackages option with -source release that doesn't support modules + new JavadocTask(tb) + .outdir(outDir) + .sourcepath(base) + .options("-source", "8", + "-subpackages", "pkg") + .run(Expect.SUCCESS); + // Check for presence of generated docs + if (!Files.isRegularFile(outDir.resolve("pkg/A.html"))) { + error("File not found: " + outDir.resolve("pkg/A.html")); + } + } +} From 2a2ecc994e02049d6d84f083b8e92a51368577bf Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Fri, 27 Sep 2024 07:27:29 +0000 Subject: [PATCH 216/307] 8339475: Clean up return code handling for pthread calls in library coding Reviewed-by: clanger, jwaters --- src/java.base/macosx/native/libjli/java_md_macosx.m | 11 +++++++---- src/java.base/unix/native/libjli/java_md_common.c | 8 +------- .../macosx/native/libsplashscreen/splashscreen_sys.m | 6 ++++-- .../unix/native/libsplashscreen/splashscreen_sys.c | 5 ++++- 4 files changed, 16 insertions(+), 14 deletions(-) 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 c5e7ba580a503..d8742aa1204d5 100644 --- a/src/java.base/macosx/native/libjli/java_md_macosx.m +++ b/src/java.base/macosx/native/libjli/java_md_macosx.m @@ -297,6 +297,7 @@ static void ParkEventLoop() { static void MacOSXStartup(int argc, char *argv[]) { // Thread already started? static jboolean started = false; + int rc; if (started) { return; } @@ -309,12 +310,14 @@ static void MacOSXStartup(int argc, char *argv[]) { // Fire up the main thread pthread_t main_thr; - if (pthread_create(&main_thr, NULL, &apple_main, &args) != 0) { - JLI_ReportErrorMessageSys("Could not create main thread: %s\n", strerror(errno)); + rc = pthread_create(&main_thr, NULL, &apple_main, &args); + if (rc != 0) { + JLI_ReportErrorMessageSys("Could not create main thread, return code: %s\n", rc); exit(1); } - if (pthread_detach(main_thr)) { - JLI_ReportErrorMessageSys("pthread_detach() failed: %s\n", strerror(errno)); + rc = pthread_detach(main_thr); + if (rc != 0) { + JLI_ReportErrorMessage("pthread_detach() failed, return code: %s\n", rc); exit(1); } diff --git a/src/java.base/unix/native/libjli/java_md_common.c b/src/java.base/unix/native/libjli/java_md_common.c index 511519ae362ff..453d605f71082 100644 --- a/src/java.base/unix/native/libjli/java_md_common.c +++ b/src/java.base/unix/native/libjli/java_md_common.c @@ -243,13 +243,7 @@ JLI_ReportErrorMessage(const char* fmt, ...) { JNIEXPORT void JNICALL JLI_ReportErrorMessageSys(const char* fmt, ...) { va_list vl; - char *emsg; - - /* - * TODO: its safer to use strerror_r but is not available on - * Solaris 8. Until then.... - */ - emsg = strerror(errno); + char *emsg = strerror(errno); if (emsg != NULL) { fprintf(stderr, "%s\n", emsg); } diff --git a/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m b/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m index 66e0c362318d7..e74f8ee50fb04 100644 --- a/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m +++ b/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m @@ -271,11 +271,13 @@ static int isInAquaSession() { SplashCreateThread(Splash * splash) { pthread_t thr; pthread_attr_t attr; - int rc; int rslt = pthread_attr_init(&attr); if (rslt != 0) return; - rc = pthread_create(&thr, &attr, SplashScreenThread, (void *) splash); + rslt = pthread_create(&thr, &attr, SplashScreenThread, (void *) splash); + if (rslt != 0) { + fprintf(stderr, "Could not create SplashScreen thread, error number:%d\n", rslt); + } pthread_attr_destroy(&attr); } diff --git a/src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c b/src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c index 5a008d10a482c..e89d813fff460 100644 --- a/src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c +++ b/src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c @@ -741,7 +741,10 @@ SplashCreateThread(Splash * splash) { int rslt = pthread_attr_init(&attr); if (rslt != 0) return; - pthread_create(&thr, &attr, SplashScreenThread, (void *) splash); + rslt = pthread_create(&thr, &attr, SplashScreenThread, (void *) splash); + if (rslt != 0) { + fprintf(stderr, "Could not create SplashScreen thread, error number:%d\n", rslt); + } pthread_attr_destroy(&attr); } From 9003e2c519e63fa547e2f072e47f74057094efa2 Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Fri, 27 Sep 2024 08:28:59 +0000 Subject: [PATCH 217/307] 8341027: Crash in java/runtime/Unsafe/InternalErrorTest when running with -XX:-UseCompressedClassPointers Reviewed-by: aboldtch, coleenp --- test/hotspot/jtreg/runtime/Unsafe/InternalErrorTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/runtime/Unsafe/InternalErrorTest.java b/test/hotspot/jtreg/runtime/Unsafe/InternalErrorTest.java index fcf48a7a2d775..01b051af8e550 100644 --- a/test/hotspot/jtreg/runtime/Unsafe/InternalErrorTest.java +++ b/test/hotspot/jtreg/runtime/Unsafe/InternalErrorTest.java @@ -147,7 +147,8 @@ public static void test(MappedByteBuffer buffer, Unsafe unsafe, long mapAddr, lo break; case 1: // testing Unsafe.copySwapMemory, trying to access next page after truncation. - unsafe.copySwapMemory(null, mapAddr + pageSize, new byte[4000], 16, 2000, 2); + int destOffset = Unsafe.ARRAY_BYTE_BASE_OFFSET; + unsafe.copySwapMemory(null, mapAddr + pageSize, new byte[4000], destOffset, 2000, 2); break; case 2: // testing Unsafe.copySwapMemory, trying to access next page after truncation. From 6587909c7db6482bda92d314096a2a1795900ffd Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 27 Sep 2024 09:44:00 +0000 Subject: [PATCH 218/307] 8341015: OopStorage location decoder crashes accessing non-initalized OopStorage Reviewed-by: kbarrett, tschatzl --- src/hotspot/share/gc/shared/oopStorageSet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shared/oopStorageSet.cpp b/src/hotspot/share/gc/shared/oopStorageSet.cpp index c6947590d96fb..e3a9fccbad3dc 100644 --- a/src/hotspot/share/gc/shared/oopStorageSet.cpp +++ b/src/hotspot/share/gc/shared/oopStorageSet.cpp @@ -86,7 +86,9 @@ 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)) { + // Check for null for extra safety: might get here while handling error + // before storage initialization. + if ((storage != nullptr) && storage->print_containing((oop*) aligned_addr, st)) { if (aligned_addr != addr) { st->print_cr(" (unaligned)"); } else { From 25e892911dabe32cc0d13b0d4322c5d89585b8f1 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Fri, 27 Sep 2024 10:58:10 +0000 Subject: [PATCH 219/307] 8340620: Fix -Wzero-as-null-pointer-constant warnings for CompressedOops Reviewed-by: shade, stefank, mli, amitkumar --- src/hotspot/cpu/ppc/ppc.ad | 8 ++++---- src/hotspot/cpu/s390/s390.ad | 4 ++-- src/hotspot/share/oops/compressedOops.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index 612b7bf898c08..ca9abfa3719b4 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -6598,7 +6598,7 @@ instruct encodeP_not_null_Ex(iRegNdst dst, iRegPsrc src) %{ instruct encodeP_not_null_base_null(iRegNdst dst, iRegPsrc src) %{ match(Set dst (EncodeP src)); predicate(CompressedOops::shift() != 0 && - CompressedOops::base() ==0); + CompressedOops::base() == nullptr); format %{ "SRDI $dst, $src, #3 \t// encodeP, $src != nullptr" %} size(4); @@ -6695,7 +6695,7 @@ instruct decodeN_Ex(iRegPdst dst, iRegNsrc src, flagsReg crx) %{ predicate((n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull && n->bottom_type()->is_oopptr()->ptr() != TypePtr::Constant) && CompressedOops::shift() != 0 && - CompressedOops::base() != 0); + CompressedOops::base() != nullptr); ins_cost(4 * DEFAULT_COST); // Should be more expensive than decodeN_Disjoint_isel_Ex. effect(TEMP crx); @@ -6707,7 +6707,7 @@ instruct decodeN_Ex(iRegPdst dst, iRegNsrc src, flagsReg crx) %{ instruct decodeN_nullBase(iRegPdst dst, iRegNsrc src) %{ match(Set dst (DecodeN src)); predicate(CompressedOops::shift() != 0 && - CompressedOops::base() == 0); + CompressedOops::base() == nullptr); format %{ "SLDI $dst, $src, #3 \t// DecodeN (zerobased)" %} size(4); @@ -6825,7 +6825,7 @@ instruct decodeN_notNull_addBase_Ex(iRegPdst dst, iRegNsrc src) %{ predicate((n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull || n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant) && CompressedOops::shift() != 0 && - CompressedOops::base() != 0); + CompressedOops::base() != nullptr); ins_cost(2 * DEFAULT_COST); format %{ "DecodeN $dst, $src \t// $src != nullptr, postalloc expanded" %} diff --git a/src/hotspot/cpu/s390/s390.ad b/src/hotspot/cpu/s390/s390.ad index 4de1a4e7b7f35..1bc9484215005 100644 --- a/src/hotspot/cpu/s390/s390.ad +++ b/src/hotspot/cpu/s390/s390.ad @@ -4628,7 +4628,7 @@ instruct encodeP(iRegN dst, iRegP src, flagsReg cr) %{ match(Set dst (EncodeP src)); effect(KILL cr); predicate((n->bottom_type()->make_ptr()->ptr() != TypePtr::NotNull) && - (CompressedOops::base() == 0 || + (CompressedOops::base() == nullptr || CompressedOops::base_disjoint() || !ExpandLoadingBaseEncode)); ins_cost(MEMORY_REF_COST+3 * DEFAULT_COST); @@ -4651,7 +4651,7 @@ instruct encodeP_NN(iRegN dst, iRegP src, flagsReg cr) %{ match(Set dst (EncodeP src)); effect(KILL cr); predicate((n->bottom_type()->make_ptr()->ptr() == TypePtr::NotNull) && - (CompressedOops::base() == 0 || + (CompressedOops::base() == nullptr || CompressedOops::base_disjoint() || !ExpandLoadingBaseEncode_NN)); ins_cost(MEMORY_REF_COST+3 * DEFAULT_COST); diff --git a/src/hotspot/share/oops/compressedOops.cpp b/src/hotspot/share/oops/compressedOops.cpp index 98a4438383a79..ec41dd8521918 100644 --- a/src/hotspot/share/oops/compressedOops.cpp +++ b/src/hotspot/share/oops/compressedOops.cpp @@ -61,7 +61,7 @@ void CompressedOops::initialize(const ReservedHeapSpace& heap_space) { } if ((uint64_t)heap_space.end() <= OopEncodingHeapMax) { // Did reserve heap below 32Gb. Can use base == 0; - set_base(0); + set_base(nullptr); } else { set_base((address)heap_space.compressed_oop_base()); } @@ -115,7 +115,7 @@ CompressedOops::Mode CompressedOops::mode() { return DisjointBaseNarrowOop; } - if (base() != 0) { + if (base() != nullptr) { return HeapBasedNarrowOop; } @@ -166,7 +166,7 @@ void CompressedOops::print_mode(outputStream* st) { st->print(", Compressed Oops mode: %s", mode_to_string(mode())); - if (base() != 0) { + if (base() != nullptr) { st->print(": " PTR_FORMAT, p2i(base())); } From 12de4fbce7a314a1c5c84340526cd65b9a4a29d1 Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Fri, 27 Sep 2024 15:02:01 +0000 Subject: [PATCH 220/307] 8340826: Should not send unload notification for scratch classes Reviewed-by: sspitsyn, coleenp --- src/hotspot/share/code/dependencyContext.cpp | 6 +++++- src/hotspot/share/code/dependencyContext.hpp | 3 ++- .../share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp | 3 +++ src/hotspot/share/oops/instanceKlass.cpp | 7 +++++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/code/dependencyContext.cpp b/src/hotspot/share/code/dependencyContext.cpp index d7ce8e92acf37..0e6b99d172dcb 100644 --- a/src/hotspot/share/code/dependencyContext.cpp +++ b/src/hotspot/share/code/dependencyContext.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 @@ -227,6 +227,10 @@ void DependencyContext::remove_and_mark_for_deoptimization_all_dependents(Deopti } #ifndef PRODUCT +bool DependencyContext::is_empty() { + return dependencies() == nullptr; +} + void DependencyContext::print_dependent_nmethods(bool verbose) { int idx = 0; for (nmethodBucket* b = dependencies_not_unloading(); b != nullptr; b = b->next_not_unloading()) { diff --git a/src/hotspot/share/code/dependencyContext.hpp b/src/hotspot/share/code/dependencyContext.hpp index e8d2ac41d0d1d..13b845cb59dde 100644 --- a/src/hotspot/share/code/dependencyContext.hpp +++ b/src/hotspot/share/code/dependencyContext.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 @@ -124,6 +124,7 @@ class DependencyContext : public StackObj { #ifndef PRODUCT void print_dependent_nmethods(bool verbose); + bool is_empty(); #endif //PRODUCT bool is_dependent_nmethod(nmethod* nm); }; diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp index 279b871d8181a..a53eaa474f3f0 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp @@ -484,6 +484,9 @@ static void do_primitives() { static void do_unloading_klass(Klass* klass) { assert(klass != nullptr, "invariant"); assert(_subsystem_callback != nullptr, "invariant"); + if (klass->is_instance_klass() && InstanceKlass::cast(klass)->is_scratch_class()) { + return; + } if (JfrKlassUnloading::on_unload(klass)) { _subsystem_callback->do_artifact(klass); } diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index fd198f54fc957..5e226a90764ee 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -2721,6 +2721,13 @@ static void clear_all_breakpoints(Method* m) { #endif void InstanceKlass::unload_class(InstanceKlass* ik) { + + if (ik->is_scratch_class()) { + assert(ik->dependencies().is_empty(), "dependencies should be empty for scratch classes"); + return; + } + assert(ik->is_loaded(), "class should be loaded " PTR_FORMAT, p2i(ik)); + // Release dependencies. ik->dependencies().remove_all_dependents(); From 68c4f36857a8ce62731cc73e251e969d48e526ef Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Fri, 27 Sep 2024 16:21:05 +0000 Subject: [PATCH 221/307] 8340024: In ClassReader, extract a constant for the superclass supertype_index Reviewed-by: vromero --- .../classes/com/sun/tools/javac/jvm/ClassReader.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java index 2373f869b0a34..6abf9f057b043 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java @@ -2352,6 +2352,12 @@ private TypeAnnotationSymbolVisitor(List attributes) { this.attributes = attributes; } + /** + * A supertype_index value of 65535 specifies that the annotation appears on the superclass + * in an extends clause of a class declaration, see JVMS 4.7.20.1 + */ + public static final int SUPERCLASS_INDEX = 65535; + @Override public Void visitClassSymbol(Symbol.ClassSymbol s, Void unused) { ClassType t = (ClassType) s.type; @@ -2361,7 +2367,7 @@ public Void visitClassSymbol(Symbol.ClassSymbol s, Void unused) { interfaces.add(addTypeAnnotations(itf, classExtends(i++))); } t.interfaces_field = interfaces.toList(); - t.supertype_field = addTypeAnnotations(t.supertype_field, classExtends(65535)); + t.supertype_field = addTypeAnnotations(t.supertype_field, classExtends(SUPERCLASS_INDEX)); if (t.typarams_field != null) { t.typarams_field = rewriteTypeParameters( From 5aae3d40856d92e1e0ff744cb1a0d3421c3dfd5b Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Fri, 27 Sep 2024 16:26:30 +0000 Subject: [PATCH 222/307] 8341096: ProblemList compiler/cha/TypeProfileFinalMethod.java in Xcomp mode Reviewed-by: azvegint --- test/hotspot/jtreg/ProblemList-Xcomp.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/hotspot/jtreg/ProblemList-Xcomp.txt b/test/hotspot/jtreg/ProblemList-Xcomp.txt index 384374b4f76ce..cb6bb2b4cca58 100644 --- a/test/hotspot/jtreg/ProblemList-Xcomp.txt +++ b/test/hotspot/jtreg/ProblemList-Xcomp.txt @@ -50,6 +50,8 @@ vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/TestDescription.java 829 vmTestbase/nsk/stress/thread/thread006.java 8321476 linux-all +compiler/cha/TypeProfileFinalMethod.java 8341039 generic-all + gc/arguments/TestNewSizeFlags.java 8299116 macosx-aarch64 runtime/condy/escapeAnalysis/TestEscapeCondy.java 8339694 generic-all From 824a297aae15ba16cf6d7aded4b95fc9d6bf55e5 Mon Sep 17 00:00:00 2001 From: Rajan Halade Date: Fri, 27 Sep 2024 16:57:02 +0000 Subject: [PATCH 223/307] 8341057: Add 2 SSL.com TLS roots Reviewed-by: mullan --- .../share/data/cacerts/ssltlsrootecc2022 | 21 ++++++++++ .../share/data/cacerts/ssltlsrootrsa2022 | 39 +++++++++++++++++++ .../certification/CAInterop.java | 29 ++++++++++++++ .../security/lib/cacerts/VerifyCACerts.java | 13 ++++--- 4 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 src/java.base/share/data/cacerts/ssltlsrootecc2022 create mode 100644 src/java.base/share/data/cacerts/ssltlsrootrsa2022 diff --git a/src/java.base/share/data/cacerts/ssltlsrootecc2022 b/src/java.base/share/data/cacerts/ssltlsrootecc2022 new file mode 100644 index 0000000000000..706e6aefb4ee0 --- /dev/null +++ b/src/java.base/share/data/cacerts/ssltlsrootecc2022 @@ -0,0 +1,21 @@ +Owner: CN=SSL.com TLS ECC Root CA 2022, O=SSL Corporation, C=US +Issuer: CN=SSL.com TLS ECC Root CA 2022, O=SSL Corporation, C=US +Serial number: 1403f5abfb378b17405be243b2a5d1c4 +Valid from: Thu Aug 25 16:33:48 GMT 2022 until: Sun Aug 19 16:33:47 GMT 2046 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICOjCCAcCgAwIBAgIQFAP1q/s3ixdAW+JDsqXRxDAKBggqhkjOPQQDAzBOMQsw +CQYDVQQGEwJVUzEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMSUwIwYDVQQDDBxT +U0wuY29tIFRMUyBFQ0MgUm9vdCBDQSAyMDIyMB4XDTIyMDgyNTE2MzM0OFoXDTQ2 +MDgxOTE2MzM0N1owTjELMAkGA1UEBhMCVVMxGDAWBgNVBAoMD1NTTCBDb3Jwb3Jh +dGlvbjElMCMGA1UEAwwcU1NMLmNvbSBUTFMgRUNDIFJvb3QgQ0EgMjAyMjB2MBAG +ByqGSM49AgEGBSuBBAAiA2IABEUpNXP6wrgjzhR9qLFNoFs27iosU8NgCTWyJGYm +acCzldZdkkAZDsalE3D07xJRKF3nzL35PIXBz5SQySvOkkJYWWf9lCcQZIxPBLFN +SeR7T5v15wj4A4j3p8OSSxlUgaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSME +GDAWgBSJjy+j6CugFFR781a4Jl9nOAuc0DAdBgNVHQ4EFgQUiY8vo+groBRUe/NW +uCZfZzgLnNAwDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMDA2gAMGUCMFXjIlbp +15IkWE8elDIPDAI2wv2sdDJO4fscgIijzPvX6yv/N33w7deedWo1dlJF4AIxAMeN +b0Igj762TVntd00pxCAgRWSGOlDGxK0tk/UYfXLtqc/ErFc2KAhl3zx5Zn6g6g== +-----END CERTIFICATE----- diff --git a/src/java.base/share/data/cacerts/ssltlsrootrsa2022 b/src/java.base/share/data/cacerts/ssltlsrootrsa2022 new file mode 100644 index 0000000000000..ad456b0b5f472 --- /dev/null +++ b/src/java.base/share/data/cacerts/ssltlsrootrsa2022 @@ -0,0 +1,39 @@ +Owner: CN=SSL.com TLS RSA Root CA 2022, O=SSL Corporation, C=US +Issuer: CN=SSL.com TLS RSA Root CA 2022, O=SSL Corporation, C=US +Serial number: 6fbedaad73bd0840e28b4dbed4f75b91 +Valid from: Thu Aug 25 16:34:22 GMT 2022 until: Sun Aug 19 16:34:21 GMT 2046 +Signature algorithm name: SHA256withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFiTCCA3GgAwIBAgIQb77arXO9CEDii02+1PdbkTANBgkqhkiG9w0BAQsFADBO +MQswCQYDVQQGEwJVUzEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMSUwIwYDVQQD +DBxTU0wuY29tIFRMUyBSU0EgUm9vdCBDQSAyMDIyMB4XDTIyMDgyNTE2MzQyMloX +DTQ2MDgxOTE2MzQyMVowTjELMAkGA1UEBhMCVVMxGDAWBgNVBAoMD1NTTCBDb3Jw +b3JhdGlvbjElMCMGA1UEAwwcU1NMLmNvbSBUTFMgUlNBIFJvb3QgQ0EgMjAyMjCC +AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANCkCXJPQIgSYT41I57u9nTP +L3tYPc48DRAokC+X94xI2KDYJbFMsBFMF3NQ0CJKY7uB0ylu1bUJPiYYf7ISf5OY +t6/wNr/y7hienDtSxUcZXXTzZGbVXcdotL8bHAajvI9AI7YexoS9UcQbOcGV0ins +S657Lb85/bRi3pZ7QcacoOAGcvvwB5cJOYF0r/c0WRFXCsJbwST0MXMwgsadugL3 +PnxEX4MN8/HdIGkWCVDi1FW24IBydm5MR7d1VVm0U3TZlMZBrViKMWYPHqIbKUBO +L9975hYsLfy/7PO0+r4Y9ptJ1O4Fbtk085zx7AGL0SDGD6C1vBdOSHtRwvzpXGk3 +R2azaPgVKPC506QVzFpPulJwoxJF3ca6TvvC0PeoUidtbnm1jPx7jMEWTO6Af77w +dr5BUxIzrlo4QqvXDz5BjXYHMtWrifZOZ9mxQnUjbvPNQrL8VfVThxc7wDNY8VLS ++YCk8OjwO4s4zKTGkH8PnP2L0aPP2oOnaclQNtVcBdIKQXTbYxE3waWglksejBYS +d66UNHsef8JmAOSqg+qKkK3ONkRN0VHpvB/zagX9wHQfJRlAUW7qglFA35u5CCoG +AtUjHBPW6dvbxrB6y3snm/vg1UYk7RBLY0ulBY+6uB0rpvqR4pJSvezrZ5dtmi2f +gTIFZzL7SAg/2SW4BCUvAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j +BBgwFoAU+y437uOEeicuzRk1sTN8/9REQrkwHQYDVR0OBBYEFPsuN+7jhHonLs0Z +NbEzfP/UREK5MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAjYlt +hEUY8U+zoO9opMAdrDC8Z2awms22qyIZZtM7QbUQnRC6cm4pJCAcAZli05bg4vsM +QtfhWsSWTVTNj8pDU/0quOr4ZcoBwq1gaAafORpR2eCNJvkLTqVTJXojpBzOCBvf +R4iyrT7gJ4eLSYwfqUdYe5byiB0YrrPRpgqU+tvT5TgKa3kSM/tKWTcWQA673vWJ +DPFs0/dRa1419dvAJuoSc06pkZCmF8NsLzjUo3KUQyxi4U5cMj29TH0ZR6LDSeeW +P4+a0zvkEdiLA9z2tmBVGKaBUfPhqBVq6+AL8BQx1rmMRTqoENjwuSfr98t67wVy +lrXEj5ZzxOhWc5y8aVFjvO9nHEMaX3cZHxj4HCUp+UmZKbaSPaKDN7EgkaibMOlq +bLQjk2UEqxHzDh1TJElTHaE/nUiSEeJ9DU/1172iWD54nR4fK/4huxoTtrEoZP2w +AgDHbICivRZQIA9ygV/MlP+7mea6kMvq+cYMwq7FGc4zoWtcu358NFcXrfA/rs3q +r5nsLFR+jM4uElZI7xc7P0peYNLcdDa8pUNjyw9bowJWCZ4kLOGGgYz+qxcs+sji +Mho6/4UIyYOf8kpIEFR3N+2ivEC+5BB09+Rbu7nzifmPQdjH5FCQNYA+HLhNkNPU +98OwoX6EyneSMSy4kLGCenROmxMmtNVQZlR4rmA= +-----END CERTIFICATE----- diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java index ab04391b1f385..924f58cc80f25 100644 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java @@ -535,6 +535,28 @@ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop globalsigne46 CRL */ +/* + * @test id=ssltlsrootecc2022 + * @bug 8341057 + * @summary Interoperability tests with SSL TLS 2022 root CAs + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop ssltlsrootecc2022 DEFAULT + * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop ssltlsrootecc2022 DEFAULT + * @run main/othervm/manual -Djava.security.debug=certpath CAInterop ssltlsrootecc2022 CRL + */ + +/* + * @test id=ssltlsrootrsa2022 + * @bug 8341057 + * @summary Interoperability tests with SSL TLS 2022 root CAs + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop ssltlsrootrsa2022 DEFAULT + * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop ssltlsrootrsa2022 DEFAULT + * @run main/othervm/manual -Djava.security.debug=certpath CAInterop ssltlsrootrsa2022 CRL + */ + /** * Collection of certificate validation tests for interoperability with external CAs. * These tests are marked as manual as they depend on external infrastructure and may fail @@ -713,6 +735,13 @@ private CATestURLs getTestURLs(String alias) { new CATestURLs("https://valid.e46.roots.globalsign.com", "https://revoked.e46.roots.globalsign.com"); + case "ssltlsrootecc2022" -> + new CATestURLs("https://test-root-2022-ecc.ssl.com", + "https://revoked-root-2022-ecc.ssl.com"); + case "ssltlsrootrsa2022" -> + new CATestURLs("https://test-root-2022-rsa.ssl.com", + "https://revoked-root-2022-rsa.ssl.com"); + default -> throw new RuntimeException("No test setup found for: " + alias); }; } diff --git a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java index 83427f1a33aba..d64c5d7c52b0b 100644 --- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java +++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java @@ -19,17 +19,16 @@ * 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 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774 8199779 * 8209452 8209506 8210432 8195793 8216577 8222089 8222133 8222137 8222136 * 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320 * 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654 * 8305975 8304760 8307134 8295894 8314960 8317373 8317374 8318759 8319187 - * 8321408 8316138 + * 8321408 8316138 8341057 * @summary Check root CA entries in cacerts file */ import java.io.ByteArrayInputStream; @@ -48,12 +47,12 @@ public class VerifyCACerts { + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 110; + private static final int COUNT = 112; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "BD:80:65:81:68:E5:6C:51:64:ED:B9:08:53:9F:BB:2F:D9:6C:5D:D4:06:D4:16:59:39:10:8E:F8:24:81:8B:78"; + = "21:68:E7:16:5B:94:23:D2:60:5C:BB:F2:AF:C1:66:5C:EC:36:BC:20:FF:5C:54:AF:91:D1:2C:38:AE:55:D3:27"; // Hex formatter to upper case with ":" delimiter private static final HexFormat HEX = HexFormat.ofDelimiter(":").withUpperCase(); @@ -282,6 +281,10 @@ public class VerifyCACerts { "4F:A3:12:6D:8D:3A:11:D1:C4:85:5A:4F:80:7C:BA:D6:CF:91:9D:3A:5A:88:B0:3B:EA:2C:63:72:D9:3C:40:C9"); put("globalsigne46 [jdk]", "CB:B9:C4:4D:84:B8:04:3E:10:50:EA:31:A6:9F:51:49:55:D7:BF:D2:E2:C6:B4:93:01:01:9A:D6:1D:9F:50:58"); + put("ssltlsrootecc2022 [jdk]", + "C3:2F:FD:9F:46:F9:36:D1:6C:36:73:99:09:59:43:4B:9A:D6:0A:AF:BB:9E:7C:F3:36:54:F1:44:CC:1B:A1:43"); + put("ssltlsrootrsa2022 [jdk]", + "8F:AF:7D:2E:2C:B4:70:9B:B8:E0:B3:36:66:BF:75:A5:DD:45:B5:DE:48:0F:8E:A8:D4:BF:E6:BE:BC:17:F2:ED"); } }; From 65200a9589e46956a2194b20c4c90d003351a539 Mon Sep 17 00:00:00 2001 From: Xiaolong Peng Date: Fri, 27 Sep 2024 17:06:18 +0000 Subject: [PATCH 224/307] 8340490: Shenandoah: Optimize ShenandoahPacer Reviewed-by: shade, kdnilsen --- .../share/gc/shenandoah/shenandoahHeap.cpp | 2 +- .../share/gc/shenandoah/shenandoahPacer.cpp | 52 ++++++++----------- .../share/gc/shenandoah/shenandoahPacer.hpp | 4 +- 3 files changed, 25 insertions(+), 33 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp index 4ab17aabcc5ea..7ae4a1cf8b3dc 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -693,7 +693,7 @@ void ShenandoahHeap::notify_mutator_alloc_words(size_t words, bool waste) { if (ShenandoahPacing) { control_thread()->pacing_notify_alloc(words); if (waste) { - pacer()->claim_for_alloc(words, true); + pacer()->claim_for_alloc(words); } } } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp b/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp index 0fc6744c15ae7..e67d3d197d42d 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp @@ -189,7 +189,8 @@ void ShenandoahPacer::restart_with(size_t non_taxable_bytes, double tax_rate) { _need_notify_waiters.try_set(); } -bool ShenandoahPacer::claim_for_alloc(size_t words, bool force) { +template +bool ShenandoahPacer::claim_for_alloc(size_t words) { assert(ShenandoahPacing, "Only be here when pacing is enabled"); intptr_t tax = MAX2(1, words * Atomic::load(&_tax_rate)); @@ -198,7 +199,7 @@ bool ShenandoahPacer::claim_for_alloc(size_t words, bool force) { intptr_t new_val = 0; do { cur = Atomic::load(&_budget); - if (cur < tax && !force) { + if (cur < tax && !FORCE) { // Progress depleted, alas. return false; } @@ -207,6 +208,9 @@ bool ShenandoahPacer::claim_for_alloc(size_t words, bool force) { return true; } +template bool ShenandoahPacer::claim_for_alloc(size_t words); +template bool ShenandoahPacer::claim_for_alloc(size_t words); + void ShenandoahPacer::unpace_for_alloc(intptr_t epoch, size_t words) { assert(ShenandoahPacing, "Only be here when pacing is enabled"); @@ -227,18 +231,11 @@ void ShenandoahPacer::pace_for_alloc(size_t words) { assert(ShenandoahPacing, "Only be here when pacing is enabled"); // Fast path: try to allocate right away - bool claimed = claim_for_alloc(words, false); + bool claimed = claim_for_alloc(words); if (claimed) { return; } - // Forcefully claim the budget: it may go negative at this point, and - // GC should replenish for this and subsequent allocations. After this claim, - // we would wait a bit until our claim is matched by additional progress, - // or the time budget depletes. - claimed = claim_for_alloc(words, true); - assert(claimed, "Should always succeed"); - // Threads that are attaching should not block at all: they are not // fully initialized yet. Blocking them would be awkward. // This is probably the path that allocates the thread oop itself. @@ -249,32 +246,25 @@ void ShenandoahPacer::pace_for_alloc(size_t words) { JavaThread* current = JavaThread::current(); if (current->is_attaching_via_jni() || !current->is_active_Java_thread()) { + claim_for_alloc(words); return; } - double start = os::elapsedTime(); - - size_t max_ms = ShenandoahPacingMaxDelay; - size_t total_ms = 0; - - while (true) { + jlong const max_delay = ShenandoahPacingMaxDelay * NANOSECS_PER_MILLISEC; + jlong const start_time = os::elapsed_counter(); + while (!claimed && (os::elapsed_counter() - start_time) < max_delay) { // We could instead assist GC, but this would suffice for now. - size_t cur_ms = (max_ms > total_ms) ? (max_ms - total_ms) : 1; - wait(cur_ms); - - double end = os::elapsedTime(); - total_ms = (size_t)((end - start) * 1000); - - if (total_ms > max_ms || Atomic::load(&_budget) >= 0) { - // Exiting if either: - // a) Spent local time budget to wait for enough GC progress. - // Breaking out and allocating anyway, which may mean we outpace GC, - // and start Degenerated GC cycle. - // b) The budget had been replenished, which means our claim is satisfied. - ShenandoahThreadLocalData::add_paced_time(JavaThread::current(), end - start); - break; - } + wait(1); + claimed = claim_for_alloc(words); + } + if (!claimed) { + // Spent local time budget to wait for enough GC progress. + // Force allocating anyway, which may mean we outpace GC, + // and start Degenerated GC cycle. + claimed = claim_for_alloc(words); + assert(claimed, "Should always succeed"); } + ShenandoahThreadLocalData::add_paced_time(current, (double)(os::elapsed_counter() - start_time) / NANOSECS_PER_SEC); } void ShenandoahPacer::wait(size_t time_ms) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp b/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp index 1c2bf00eb56ba..44ad2700f8704 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp @@ -107,7 +107,9 @@ class ShenandoahPacer : public CHeapObj { inline void report_alloc(size_t words); - bool claim_for_alloc(size_t words, bool force); + template + bool claim_for_alloc(size_t words); + void pace_for_alloc(size_t words); void unpace_for_alloc(intptr_t epoch, size_t words); From f554c3ffce7599fdb535b03db4a6ea96870b3c2d Mon Sep 17 00:00:00 2001 From: Rajan Halade Date: Fri, 27 Sep 2024 17:16:13 +0000 Subject: [PATCH 225/307] 8341059: Change Entrust TLS distrust date to November 12, 2024 Reviewed-by: mullan --- .../classes/sun/security/validator/CADistrustPolicy.java | 2 +- .../classes/sun/security/validator/EntrustTLSPolicy.java | 8 ++++---- src/java.base/share/conf/security/java.security | 2 +- .../ssl/X509TrustManagerImpl/distrust/Entrust.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/java.base/share/classes/sun/security/validator/CADistrustPolicy.java b/src/java.base/share/classes/sun/security/validator/CADistrustPolicy.java index 0b27a13e17f58..17b9e7248c06c 100644 --- a/src/java.base/share/classes/sun/security/validator/CADistrustPolicy.java +++ b/src/java.base/share/classes/sun/security/validator/CADistrustPolicy.java @@ -57,7 +57,7 @@ void checkDistrust(String variant, X509Certificate[] chain) /** * Distrust TLS Server certificates anchored by an Entrust root CA and - * issued after October 31, 2024. If enabled, this policy is currently + * issued after November 11, 2024. If enabled, this policy is currently * enforced by the PKIX and SunX509 TrustManager implementations * of the SunJSSE provider implementation. */ diff --git a/src/java.base/share/classes/sun/security/validator/EntrustTLSPolicy.java b/src/java.base/share/classes/sun/security/validator/EntrustTLSPolicy.java index 49b75627fd880..4c4906d8eb398 100644 --- a/src/java.base/share/classes/sun/security/validator/EntrustTLSPolicy.java +++ b/src/java.base/share/classes/sun/security/validator/EntrustTLSPolicy.java @@ -88,8 +88,8 @@ final class EntrustTLSPolicy { // Any TLS Server certificate that is anchored by one of the Entrust // roots above and is issued after this date will be distrusted. - private static final LocalDate OCTOBER_31_2024 = - LocalDate.of(2024, Month.OCTOBER, 31); + private static final LocalDate NOVEMBER_11_2024 = + LocalDate.of(2024, Month.NOVEMBER, 11); /** * This method assumes the eeCert is a TLS Server Cert and chains back to @@ -111,8 +111,8 @@ static void checkDistrust(X509Certificate[] chain) Date notBefore = chain[0].getNotBefore(); LocalDate ldNotBefore = LocalDate.ofInstant(notBefore.toInstant(), ZoneOffset.UTC); - // reject if certificate is issued after October 31, 2024 - checkNotBefore(ldNotBefore, OCTOBER_31_2024, anchor); + // reject if certificate is issued after November 11, 2024 + checkNotBefore(ldNotBefore, NOVEMBER_11_2024, anchor); } } diff --git a/src/java.base/share/conf/security/java.security b/src/java.base/share/conf/security/java.security index 9651ae2d373d4..9d07cb85a47ca 100644 --- a/src/java.base/share/conf/security/java.security +++ b/src/java.base/share/conf/security/java.security @@ -1358,7 +1358,7 @@ jdk.sasl.disabledMechanisms= # Distrust after December 31, 2019. # # ENTRUST_TLS : Distrust TLS Server certificates anchored by -# an Entrust root CA and issued after October 31, 2024. +# an Entrust root CA and issued after November 11, 2024. # # Leading and trailing whitespace surrounding each value are ignored. # Unknown values are ignored. If the property is commented out or set to the diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java index 07127742ff6c4..809674e8f209c 100644 --- a/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java +++ b/test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java @@ -28,7 +28,7 @@ /** * @test - * @bug 8337664 + * @bug 8337664 8341059 * @summary Check that TLS Server certificates chaining back to distrusted * Entrust roots are invalid * @library /test/lib @@ -52,7 +52,7 @@ public class Entrust { // Date when the restrictions take effect private static final ZonedDateTime DISTRUST_DATE = - LocalDate.of(2024, 11, 1).atStartOfDay(ZoneOffset.UTC); + LocalDate.of(2024, 11, 12).atStartOfDay(ZoneOffset.UTC); public static void main(String[] args) throws Exception { Distrust distrust = new Distrust(args); From a7bfced60540fe8d4fa7360bff512337ea47b890 Mon Sep 17 00:00:00 2001 From: Yagmur Eren Date: Fri, 27 Sep 2024 17:36:48 +0000 Subject: [PATCH 226/307] 8337679: Memset warning in src/hotspot/share/adlc/adlArena.cpp Reviewed-by: stefank, thartmann, jwaters --- src/hotspot/share/adlc/adlArena.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/hotspot/share/adlc/adlArena.cpp b/src/hotspot/share/adlc/adlArena.cpp index d5a1dd500fa66..ebd1f74911d57 100644 --- a/src/hotspot/share/adlc/adlArena.cpp +++ b/src/hotspot/share/adlc/adlArena.cpp @@ -63,8 +63,6 @@ void AdlChunk::chop() { AdlChunk *k = this; while( k ) { AdlChunk *tmp = k->_next; - // clear out this chunk (to detect allocation bugs) - memset(k, 0xBE, k->_len); free(k); // Free chunk (was malloc'd) k = tmp; } From 082125d61e4b7e0fd53528c0271ca8be621f242b Mon Sep 17 00:00:00 2001 From: Justin Lu Date: Fri, 27 Sep 2024 18:26:08 +0000 Subject: [PATCH 227/307] 8340404: CharsetProvider specification updates Reviewed-by: alanb, naoto --- .../java/nio/charset/spi/CharsetProvider.java | 32 ++++++--- .../spi/CharsetProviderAsModuleTest.java | 60 ++++++++++++++++ .../nio/charset/spi/provider/module-info.java | 25 +++++++ .../charset/spi/provider/spi/BazProvider.java | 71 +++++++++++++++++++ 4 files changed, 178 insertions(+), 10 deletions(-) create mode 100644 test/jdk/java/nio/charset/spi/CharsetProviderAsModuleTest.java create mode 100644 test/jdk/java/nio/charset/spi/provider/module-info.java create mode 100644 test/jdk/java/nio/charset/spi/provider/spi/BazProvider.java 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 11d36ee242d56..114558d93927f 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 @@ -33,17 +33,29 @@ * Charset service-provider class. * *

        A charset provider is a concrete subclass of this class that has a - * 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 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}. + * zero-argument constructor and some number of associated {@code Charset} + * implementation classes. Charset providers are deployed on the application + * module path or the application class path. In order to be looked up, charset + * providers must be visible to the {@link ClassLoader#getSystemClassLoader() system + * class loader}. See {@link java.util.ServiceLoader##developing-service-providers + * Deploying Service Providers} for further detail on deploying a charset + * provider as a module or on the class path. * - *

        A charset provider identifies itself with a provider-configuration file - * named {@code java.nio.charset.spi.CharsetProvider} in the resource - * directory {@code META-INF/services}. The file should contain a list of + *

        For a charset provider deployed in a module, the provides + * directive must be specified in the module declaration. The provides directive + * specifies both the service and the service provider. In this case, the service + * is {@code java.nio.charset.spi.CharsetProvider}. + * + *

        As an example, a charset provider deployed as a module might specify the + * following directive: + *

        {@code
        + *     provides java.nio.charset.spi.CharsetProvider with com.example.ExternalCharsetProvider;
        + * }
        + * + *

        For a charset provider deployed on the class path, it identifies itself + * with a provider-configuration file named {@code + * java.nio.charset.spi.CharsetProvider} in the resource directory + * {@code META-INF/services}. The file should contain a list of * fully-qualified concrete charset-provider class names, one per line. A line * is terminated by any one of a line feed ({@code '\n'}), a carriage return * ({@code '\r'}), or a carriage return followed immediately by a line feed. diff --git a/test/jdk/java/nio/charset/spi/CharsetProviderAsModuleTest.java b/test/jdk/java/nio/charset/spi/CharsetProviderAsModuleTest.java new file mode 100644 index 0000000000000..ba6aae234c6dc --- /dev/null +++ b/test/jdk/java/nio/charset/spi/CharsetProviderAsModuleTest.java @@ -0,0 +1,60 @@ +/* + * 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 8340404 + * @summary Check that a CharsetProvider SPI can be deployed as a module + * @build provider/* + * @run main/othervm CharsetProviderAsModuleTest + */ + +import java.nio.charset.Charset; + +public class CharsetProviderAsModuleTest { + + // Basic test ensures that our BAZ charset is loaded via the BazProvider + public static void main(String[] args) { + var cs = Charset.availableCharsets(); + Charset bazCs; + // check provider is providing BAZ via charsets() + if (!cs.containsKey("BAZ")) { + throw new RuntimeException("SPI BazProvider did not provide BAZ Charset"); + } else { + bazCs = cs.get("BAZ"); + // check provider is in a named module + if (!bazCs.getClass().getModule().isNamed()) { + throw new RuntimeException("BazProvider is not a named module"); + } + var aliases = bazCs.aliases(); + // check BAZ cs aliases were loaded correctly + if (!aliases.contains("BAZ-1") || !aliases.contains("BAZ-2")) { + throw new RuntimeException("BAZ Charset did not provide correct aliases"); + } + // check provider implements charsetForName() + if (!bazCs.equals(Charset.forName("BAZ"))) { + throw new RuntimeException("SPI BazProvider provides bad charsetForName()"); + } + } + } +} diff --git a/test/jdk/java/nio/charset/spi/provider/module-info.java b/test/jdk/java/nio/charset/spi/provider/module-info.java new file mode 100644 index 0000000000000..5cfe6db92db9f --- /dev/null +++ b/test/jdk/java/nio/charset/spi/provider/module-info.java @@ -0,0 +1,25 @@ +/* + * 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. + */ +module provider { + provides java.nio.charset.spi.CharsetProvider with spi.BazProvider; +} diff --git a/test/jdk/java/nio/charset/spi/provider/spi/BazProvider.java b/test/jdk/java/nio/charset/spi/provider/spi/BazProvider.java new file mode 100644 index 0000000000000..7def239e64c0f --- /dev/null +++ b/test/jdk/java/nio/charset/spi/provider/spi/BazProvider.java @@ -0,0 +1,71 @@ +/* + * 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 spi; + +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CharsetEncoder; +import java.nio.charset.spi.CharsetProvider; +import java.util.Collections; +import java.util.Iterator; + +// Provides some simple BAZ related attributes to our provider +public class BazProvider extends CharsetProvider { + + @Override + public Iterator charsets() { + return Collections.singleton(new BazCharset()).iterator(); + } + + @Override + public Charset charsetForName(String charsetName) { + if (charsetName.equals("BAZ")) { + return new BazCharset(); + } else { + return null; + } + } + + public static class BazCharset extends Charset { + + public BazCharset() { + super("BAZ", new String[] { "BAZ-1", "BAZ-2" }); + } + + // Overrides to satisfy Charset + @Override + public boolean contains(Charset cs) { + return false; + } + + @Override + public CharsetDecoder newDecoder() { + return null; + } + + @Override + public CharsetEncoder newEncoder() { + return null; + } + } +} From ed140f5d5e2dec1217e2efbee815d84306de0563 Mon Sep 17 00:00:00 2001 From: Boris Ulasevich Date: Fri, 27 Sep 2024 23:11:41 +0000 Subject: [PATCH 228/307] 8341101: [ARM32] Error: ShouldNotReachHere() in TemplateInterpreterGenerator::generate_math_entry after 8338694 Reviewed-by: shade --- src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp b/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp index 679f07a028e2c..ec9d237e50da0 100644 --- a/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp +++ b/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp @@ -175,6 +175,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M break; case Interpreter::java_lang_math_fmaD: case Interpreter::java_lang_math_fmaF: + case Interpreter::java_lang_math_tanh: // TODO: Implement intrinsic break; default: From 73ebb848fdb66861e912ea747c039ddd1f7a5f48 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Fri, 27 Sep 2024 23:34:04 +0000 Subject: [PATCH 229/307] 8340721: Clarify special case handling of unboxedType and getWildcardType Reviewed-by: prappo, mcimadamore --- .../classes/javax/lang/model/util/Types.java | 14 +- .../model/util/types/TestInvalidInputs.java | 184 ++++++++++++++++++ 2 files changed, 196 insertions(+), 2 deletions(-) create mode 100644 test/langtools/tools/javac/processing/model/util/types/TestInvalidInputs.java 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 266d63178ba08..232e15a84bd6a 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 @@ -50,6 +50,11 @@ *

        Compatibility Note: Methods may be added to this interface * in future releases of the platform. * + * @apiNote + * In the reference implementation, handling {@linkplain ErrorType + * error types} generally does not cause an {@code + * IllegalArgumentException} from the methods in this interface. + * * @see javax.annotation.processing.ProcessingEnvironment#getTypeUtils * @since 1.6 */ @@ -198,8 +203,10 @@ public interface Types { * * @param t the type to be unboxed * @return the type of an unboxed value of type {@code t} + * * @throws IllegalArgumentException if the given type has no - * unboxing conversion + * unboxing conversion. Only types for the wrapper classes + * have an unboxing conversion. * @jls 5.1.8 Unboxing Conversion */ PrimitiveType unboxedType(TypeMirror t); @@ -268,7 +275,10 @@ public interface Types { * * @param extendsBound the extends (upper) bound, or {@code null} if none * @param superBound the super (lower) bound, or {@code null} if none - * @throws IllegalArgumentException if bounds are not valid + * + * @throws IllegalArgumentException if bounds are not valid. Invalid bounds + * include all types that are not {@linkplain ReferenceType + * reference types}. * @jls 4.5.1 Type Arguments of Parameterized Types */ WildcardType getWildcardType(TypeMirror extendsBound, diff --git a/test/langtools/tools/javac/processing/model/util/types/TestInvalidInputs.java b/test/langtools/tools/javac/processing/model/util/types/TestInvalidInputs.java new file mode 100644 index 0000000000000..3cc1e246e41d9 --- /dev/null +++ b/test/langtools/tools/javac/processing/model/util/types/TestInvalidInputs.java @@ -0,0 +1,184 @@ +/* + * 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 8340721 + * @summary Test invalid inputs to javax.lang.model.util.Types methods + * @library /tools/javac/lib + * @modules java.compiler + * @build JavacTestingAbstractProcessor TestInvalidInputs + * @compile -processor TestInvalidInputs -proc:only TestInvalidInputs.java + */ + +import java.util.*; +import javax.annotation.processing.*; +import javax.lang.model.element.*; +import javax.lang.model.type.*; +import javax.lang.model.util.*; + +/** + * Test if exceptions are thrown for invalid arguments as expected. + */ +public class TestInvalidInputs extends JavacTestingAbstractProcessor { + + // Reference types are ArrayType, DeclaredType, ErrorType, NullType, and TypeVariable + + private TypeMirror objectType; // Notable DeclaredType + private TypeMirror stringType; // Another notable DeclaredType + private ArrayType arrayType; + // private ErrorType errorType; // skip for now + private ExecutableType executableType; + private IntersectionType intersectionType; + + private NoType noTypeVoid; + private NoType noTypeNone; + private NoType noTypePackage; + private NoType noTypeModule; + + private NullType nullType; + private PrimitiveType primitiveType; + private UnionType unionType; + private WildcardType wildcardType; + + /** + * Check expected behavior on classes and packages. + */ + public boolean process(Set annotations, + RoundEnvironment roundEnv) { + if (!roundEnv.processingOver()) { + initializeTypes(); + testUnboxedType(); + testGetWildcardType(); + } + return true; + } + + void initializeTypes() { + objectType = elements.getTypeElement("java.lang.Object").asType(); + stringType = elements.getTypeElement("java.lang.String").asType(); + + arrayType = types.getArrayType(objectType); // Object[] + executableType = extractExecutableType(); + intersectionType = extractIntersectionType(); + + noTypeVoid = types.getNoType(TypeKind.VOID); + noTypeNone = types.getNoType(TypeKind.NONE); + noTypePackage = (NoType)(elements.getPackageElement("java.lang").asType()); + noTypeModule = (NoType)(elements.getModuleElement("java.base").asType()); + + nullType = types.getNullType(); + primitiveType = types.getPrimitiveType(TypeKind.DOUBLE); + // unionType; // more work here + wildcardType = types.getWildcardType(objectType, null); + + return; + } + + ExecutableType extractExecutableType() { + var typeElement = elements.getTypeElement("TestInvalidInputs.InvalidInputsHost"); + for (var method : ElementFilter.methodsIn(typeElement.getEnclosedElements())) { + if ("foo7".equals(method.getSimpleName().toString())) { + return (ExecutableType)method.asType(); + } + } + throw new RuntimeException("Expected method not found"); + } + + IntersectionType extractIntersectionType() { + var typeElement = elements.getTypeElement("TestInvalidInputs.InvalidInputsHost"); + for (var method : ElementFilter.methodsIn(typeElement.getEnclosedElements())) { + if ("foo9".equals(method.getSimpleName().toString())) { + return (IntersectionType) ((TypeVariable)method.getReturnType()).getUpperBound(); + } + } + throw new RuntimeException("Expected method not found"); + } + + /* + * Class to host inputs for testing. + */ + class InvalidInputsHost { + // Use a method to get an ExecutableType + public static String foo7(int arg) {return null;} + + // Type variable with intersection type + public static S foo9() {return null;} + } + + /** + * @throws IllegalArgumentException if the given type has no + * unboxing conversion, including for types that are not + * {@linkplain ReferenceType reference types} + */ + void testUnboxedType() { + // Only DeclaredType's for wrapper classes should have unboxing conversions defined. + + // Reference types are ArrayType, DeclaredType, ErrorType, NullType, TypeVariable + // non-reference: ExecutableType, IntersectionType, NoType, PrimitiveType, UnionType, WildcardType + var invalidInputs = List.of(objectType, stringType, arrayType, + executableType, intersectionType, + noTypeVoid, noTypeNone, noTypePackage, noTypeModule, nullType, + primitiveType, /*unionType, */ wildcardType); + + for (TypeMirror tm : invalidInputs) { + try { + PrimitiveType pt = types.unboxedType(tm); + throw new RuntimeException("Should not reach " + tm); + } catch(IllegalArgumentException iae) { + ; // Expected + } + } + return; + } + + /** + * @throws IllegalArgumentException if bounds are not valid, + * including for types that are not {@linkplain ReferenceType + * reference types} + */ + void testGetWildcardType() { + // Reference types are ArrayType, DeclaredType, ErrorType, NullType, TypeVariable + // non-reference: ExecutableType, IntersectionType, NoType, PrimitiveType, UnionType, WildcardType + var invalidInputs = List.of(executableType, intersectionType, + noTypeVoid, noTypeNone, noTypePackage, noTypeModule, nullType, + primitiveType, /*unionType, */ wildcardType); + + for (TypeMirror tm : invalidInputs) { + try { + WildcardType wc1 = types.getWildcardType(tm, null); + throw new RuntimeException("Should not reach " + tm); + } catch(IllegalArgumentException iae) { + ; // Expected + } + + try { + WildcardType wc2 = types.getWildcardType(null, tm); + throw new RuntimeException("Should not reach " + tm); + } catch(IllegalArgumentException iae) { + ; // Expected + } + } + return; + } +} From ade17ecb6cb5125d048401a878b557e5afefc08c Mon Sep 17 00:00:00 2001 From: Phil Race Date: Sun, 29 Sep 2024 17:05:01 +0000 Subject: [PATCH 230/307] 8340560: Open Source several AWT/2D font and rendering tests Reviewed-by: kizune --- test/jdk/sun/awt/font/CacheFlushTest.java | 106 ++++++++++ test/jdk/sun/awt/font/TestArabicHebrew.java | 215 ++++++++++++++++++++ test/jdk/sun/awt/font/TestDevTransform.java | 155 ++++++++++++++ test/jdk/sun/awt/windows/TestPen.java | 102 ++++++++++ 4 files changed, 578 insertions(+) create mode 100644 test/jdk/sun/awt/font/CacheFlushTest.java create mode 100644 test/jdk/sun/awt/font/TestArabicHebrew.java create mode 100644 test/jdk/sun/awt/font/TestDevTransform.java create mode 100644 test/jdk/sun/awt/windows/TestPen.java diff --git a/test/jdk/sun/awt/font/CacheFlushTest.java b/test/jdk/sun/awt/font/CacheFlushTest.java new file mode 100644 index 0000000000000..f3b3293127530 --- /dev/null +++ b/test/jdk/sun/awt/font/CacheFlushTest.java @@ -0,0 +1,106 @@ +/* + * 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 4286726 + * @summary Java2D raster printing: large text may overflow glyph cache. + * Draw a large glyphvector, the 'A' glyph should appear and not get flushed. +*/ + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.Point2D; +import java.awt.image.BufferedImage; +import java.util.HashMap; + +/** + * Draw a very large glyphvector on a surface. + * If the cache was flushed the first glyph is not rendered. + * Note: the implementation no longer uses glyphs for rendering large text, + * but in principle the test is still useful. + */ +public class CacheFlushTest { + + static final int WIDTH = 400, HEIGHT = 600; + static final int FONTSIZE = 250; + static final String TEST = "ABCDEFGHIJKLMNOP"; + static final HashMap HINTS = new HashMap<>(); + + static { + HINTS.put(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + HINTS.put(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + HINTS.put(RenderingHints.KEY_FRACTIONALMETRICS, + RenderingHints.VALUE_FRACTIONALMETRICS_ON); + } + + public static void main(String args[]) { + BufferedImage bi = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); + + Graphics2D g2d = bi.createGraphics(); + g2d.addRenderingHints(HINTS); + g2d.setColor(Color.white); + g2d.fillRect(0, 0, WIDTH, HEIGHT); + g2d.setColor(Color.black); + + FontRenderContext frc = g2d.getFontRenderContext(); + Font font = new Font(Font.DIALOG, Font.PLAIN, 250); + GlyphVector gv = font.createGlyphVector(frc, TEST); + + /* Set the positions of all but the first glyph to be offset vertically but + * FONTSIZE pixels. So if the first glyph "A" is not flushed we can tell this + * by checking for non-white pixels in the range for the default y offset of 0 + * from the specified y location. + */ + Point2D.Float pt = new Point2D.Float(20f, FONTSIZE); + for (int i = 1; i < gv.getNumGlyphs(); ++i) { + gv.setGlyphPosition(i, pt); + pt.x += 25f; + pt.y = FONTSIZE; + } + g2d.drawGlyphVector(gv, 20, FONTSIZE); + /* Now expect to find at least one black pixel in the rect (0,0) -> (WIDTH, FONTSIZE) */ + boolean found = false; + int blackPixel = Color.black.getRGB(); + for (int y = 0; y < FONTSIZE; y++) { + for (int x = 0; x < WIDTH; x++) { + if (bi.getRGB(x, y) == blackPixel) { + found = true; + break; + } + } + if (found == true) { + break; + } + } + if (!found) { + throw new RuntimeException("NO BLACK PIXELS"); + } + } +} diff --git a/test/jdk/sun/awt/font/TestArabicHebrew.java b/test/jdk/sun/awt/font/TestArabicHebrew.java new file mode 100644 index 0000000000000..61cbe931c32c4 --- /dev/null +++ b/test/jdk/sun/awt/font/TestArabicHebrew.java @@ -0,0 +1,215 @@ +/* + * 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 4198081 + * @key headful + * @summary Arabic characters should appear instead of boxes and be correctly shaped. + * Hebrew characters should appear instead of boxes. + * Test is made headful so there's no excuse for test systems not having the fonts. + */ + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GridLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.Rectangle2D; + +public class TestArabicHebrew extends Panel { + + static volatile Frame frame; + static volatile Font font = new Font(Font.DIALOG, Font.PLAIN, 36); + + static void createUI() { + frame = new Frame("Test Arabic/Hebrew"); + frame.setLayout(new BorderLayout()); + TestArabicHebrew panel = new TestArabicHebrew(); + frame.add(panel, BorderLayout.CENTER); + frame.pack(); + frame.setVisible(true); + } + + public static void main(String args[]) throws Exception { + EventQueue.invokeAndWait(TestArabicHebrew::createUI); + try { + checkStrings(); + } finally { + if (frame != null && args.length == 0) { + EventQueue.invokeAndWait(frame::dispose); + } + } + } + + static void checkString(String script, String str) { + int index = font.canDisplayUpTo(str); + if (index != -1) { + throw new RuntimeException("Cannot display char " + index + " for " + script); + } + } + + static void checkStrings() { + checkString("Arabic", arabic); + checkString("Hebrew", hebrew); + checkString("Latin-1 Supplement", latin1sup); + } + + // Table of arabic unicode characters - minimal support level + // Includes arabic chars from basic block up to 0652 and + // corresponding shaped characters from the arabic + // extended-B block from fe80 to fefc (does include lam-alef + // ligatures). + // Does not include arabic-indic digits nor "arabic extended" + // range. + + static final String arabic = + "\u060c\u061b\u061f\u0621\u0622\u0623\u0624\u0625\u0626\u0627" + + "\u0628\u0629\u062a\u062b\u062c\u062d\u062e\u062f\u0630\u0631" + + "\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063a\u0640" + + "\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064a" + + "\u064b\u064c\u064d\u064e\u064f\u0650\u0651\u0652\ufe80\ufe81" + + "\ufe82\ufe83\ufe84\ufe85\ufe86\ufe87\ufe88\ufe89\ufe8a\ufe8b" + + "\ufe8c\ufe8d\ufe8e\ufe8f\ufe90\ufe91\ufe92\ufe93\ufe94\ufe95" + + "\ufe96\ufe97\ufe98\ufe99\ufe9a\ufe9b\ufe9c\ufe9d\ufe9e\ufe9f" + + "\ufea0\ufea1\ufea2\ufea3\ufea4\ufea5\ufea6\ufea7\ufea8\ufea9" + + "\ufeaa\ufeab\ufeac\ufead\ufeae\ufeaf\ufeb0\ufeb1\ufeb2\ufeb3" + + "\ufeb4\ufeb5\ufeb6\ufeb7\ufeb8\ufeb9\ufeba\ufebb\ufebc\ufebd" + + "\ufebe\ufebf\ufec0\ufec1\ufec2\ufec3\ufec4\ufec5\ufec6\ufec7" + + "\ufec8\ufec9\ufeca\ufecb\ufecc\ufecd\ufece\ufecf\ufed0\ufed1" + + "\ufed2\ufed3\ufed4\ufed5\ufed6\ufed7\ufed8\ufed9\ufeda\ufedb" + + "\ufedc\ufedd\ufede\ufedf\ufee0\ufee1\ufee2\ufee3\ufee4\ufee5" + + "\ufee6\ufee7\ufee8\ufee9\ufeea\ufeeb\ufeec\ufeed\ufeee\ufeef" + + "\ufef0\ufef1\ufef2\ufef3\ufef4\ufef5\ufef6\ufef7\ufef8\ufef9" + + "\ufefa\ufefb\ufefc"; + + // hebrew table includes all characters in hebrew block + + static final String hebrew = + "\u0591\u0592\u0593\u0594\u0595\u0596\u0597\u0598\u0599\u059a" + + "\u059b\u059c\u059d\u059e\u059f\u05a0\u05a1\u05a3\u05a4\u05a5" + + "\u05a6\u05a7\u05a8\u05a9\u05aa\u05ab\u05ac\u05ad\u05ae\u05af" + + "\u05b0\u05b1\u05b2\u05b3\u05b4\u05b5\u05b6\u05b7\u05b8\u05b9" + + "\u05bb\u05bc\u05bd\u05be\u05bf\u05c0\u05c1\u05c2\u05c3\u05c4" + + "\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9" + + "\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3" + + "\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\u05f0\u05f1\u05f2" + + "\u05f3\u05f4"; + + // latin 1 supplement table includes all non-control characters + // in this range. Included because of comment in code that claims + // some problems displaying this range with some SJIS fonts. + + static final String latin1sup = + "\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7" + + "\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1" + + "\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb" + + "\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5" + + "\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf" + + "\u00d0\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9" + + "\u00da\u00db\u00dc\u00dd\u00de\u00df\u00e0\u00e1\u00e2\u00e3" + + "\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed" + + "\u00ee\u00ef\u00f0\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7" + + "\u00f8\u00f9\u00fa\u00fb\u00fc\u00fd\u00fe\u00ff"; + + public TestArabicHebrew() { + setLayout(new GridLayout(3, 1)); + + FontRenderContext frc = new FontRenderContext(null, false, false); + add(new SubGlyphPanel("Arabic", arabic, font, frc)); + add(new SubGlyphPanel("Hebrew", hebrew, font, frc)); + add(new SubGlyphPanel("Latin-1 Supplement", latin1sup, font, frc)); + } + + static class SubGlyphPanel extends Panel { + String title; + Dimension extent; + GlyphVector[] vectors; + + static final int kGlyphsPerLine = 20; + + SubGlyphPanel(String title, String chars, Font font, FontRenderContext frc) { + + this.title = title; + setBackground(Color.white); + + double width = 0; + double height = 0; + + int max = chars.length(); + vectors = new GlyphVector[(max + kGlyphsPerLine - 1) / kGlyphsPerLine]; + for (int i = 0; i < vectors.length; i++) { + int start = i * 20; + int limit = Math.min(max, (i + 1) * kGlyphsPerLine); + String substr = ""; + for (int j = start; j < limit; ++j) { + substr = substr.concat(chars.charAt(j) + " "); + } + GlyphVector gv = font.createGlyphVector(frc, substr); + vectors[i] = gv; + Rectangle2D bounds = gv.getLogicalBounds(); + + width = Math.max(width, bounds.getWidth()); + height += bounds.getHeight(); + } + + extent = new Dimension((int)(width + 1), (int)(height + 1 + 30)); // room for title + + setSize(getPreferredSize()); + } + + public Dimension getPreferredSize() { + return new Dimension(extent); + } + + public Dimension getMinimumSize() { + return getPreferredSize(); + } + + public Dimension getMaximumSize() { + return getPreferredSize(); + } + + public void paint(Graphics g) { + Graphics2D g2d = (Graphics2D)g; + + g.drawString(title, 10, 20); + + float x = 10; + float y = 30; + for (int i = 0; i < vectors.length; ++i) { + GlyphVector gv = vectors[i]; + Rectangle2D bounds = gv.getLogicalBounds(); + g2d.drawGlyphVector(gv, x, (float)(y - bounds.getY())); + y += bounds.getHeight(); + } + } + } +} diff --git a/test/jdk/sun/awt/font/TestDevTransform.java b/test/jdk/sun/awt/font/TestDevTransform.java new file mode 100644 index 0000000000000..035cb0b13d73a --- /dev/null +++ b/test/jdk/sun/awt/font/TestDevTransform.java @@ -0,0 +1,155 @@ +/* + * 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 4269775 + * @summary Check that different text rendering APIs agree + */ + +/** + * Draw into an image rendering the same text string nine different + * ways: as a TextLayout, a simple String, and a GlyphVector, each + * with three different x scale factors. The expectation is that each + * set of three strings would appear the same although offset in y to + * avoid overlap. The bug was that the y positions of the individual characters + * of the TextLayout and GlyphVector were wrong, so the strings appeared + * to be rendered at different angles. + */ + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.font.TextLayout; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.util.HashMap; + +public class TestDevTransform { + + static HashMap hints = new HashMap<>(); + + static { + hints.put(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + hints.put(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + hints.put(RenderingHints.KEY_FRACTIONALMETRICS, + RenderingHints.VALUE_FRACTIONALMETRICS_ON); + } + + static String test = "This is only a test"; + static double angle = Math.PI / 6.0; // Rotate 30 degrees + static final int W = 400, H = 400; + + static void draw(Graphics2D g2d, TextLayout layout, + float x, float y, float scalex) { + AffineTransform saveTransform = g2d.getTransform(); + g2d.translate(x, y); + g2d.rotate(angle); + g2d.scale(scalex, 1f); + layout.draw(g2d, 0f, 0f); + g2d.setTransform(saveTransform); + } + + static void draw(Graphics2D g2d, String string, + float x, float y, float scalex) { + AffineTransform saveTransform = g2d.getTransform(); + g2d.translate(x, y); + g2d.rotate(angle); + g2d.scale(scalex, 1f); + g2d.drawString(string, 0f, 0f); + g2d.setTransform(saveTransform); + } + + static void draw(Graphics2D g2d, GlyphVector gv, + float x, float y, float scalex) { + AffineTransform saveTransform = g2d.getTransform(); + g2d.translate(x, y); + g2d.rotate(angle); + g2d.scale(scalex, 1f); + g2d.drawGlyphVector(gv, 0f, 0f); + g2d.setTransform(saveTransform); + } + + static void init(Graphics2D g2d) { + g2d.setColor(Color.white); + g2d.fillRect(0, 0, W, H); + g2d.setColor(Color.black); + g2d.scale(1.481f, 1.481); // Convert to 108 dpi + g2d.addRenderingHints(hints); + Font font = new Font(Font.DIALOG, Font.PLAIN, 12); + g2d.setFont(font); + } + + static void compare(BufferedImage bi1, BufferedImage bi2) { + for (int x = 0; x < bi1.getWidth(); x++) { + for (int y = 0; y < bi1.getHeight(); y++) { + if (bi1.getRGB(x, y) != bi2.getRGB(x, y)) { + throw new RuntimeException("Different rendering"); + } + } + } + } + + public static void main(String args[]) { + + BufferedImage tl_Image = new BufferedImage(W, H, BufferedImage.TYPE_INT_RGB); + { + Graphics2D tl_g2d = tl_Image.createGraphics(); + init(tl_g2d); + FontRenderContext frc = tl_g2d.getFontRenderContext(); + // Specify font from graphics to be sure it is the same as the other cases. + TextLayout tl = new TextLayout(test, tl_g2d.getFont(), frc); + draw(tl_g2d, tl, 10f, 12f, 3.0f); + draw(tl_g2d, tl, 10f, 24f, 1.0f); + draw(tl_g2d, tl, 10f, 36f, 0.33f); + } + + BufferedImage st_Image = new BufferedImage(400, 400, BufferedImage.TYPE_INT_RGB); + { + Graphics2D st_g2d = st_Image.createGraphics(); + init(st_g2d); + draw(st_g2d, test, 10f, 12f, 3.0f); + draw(st_g2d, test, 10f, 24f, 1.0f); + draw(st_g2d, test, 10f, 36f, .33f); + } + + BufferedImage gv_Image = new BufferedImage(400, 400, BufferedImage.TYPE_INT_RGB); + { + Graphics2D gv_g2d = gv_Image.createGraphics(); + init(gv_g2d); + FontRenderContext frc = gv_g2d.getFontRenderContext(); + GlyphVector gv = gv_g2d.getFont().createGlyphVector(frc, test); + draw(gv_g2d, gv, 10f, 12f, 3.0f); + draw(gv_g2d, gv, 10f, 24f, 1.0f); + draw(gv_g2d, gv, 10f, 36f, .33f); + } + + compare(tl_Image, st_Image); + compare(gv_Image, st_Image); + } +} diff --git a/test/jdk/sun/awt/windows/TestPen.java b/test/jdk/sun/awt/windows/TestPen.java new file mode 100644 index 0000000000000..25b7304bdc862 --- /dev/null +++ b/test/jdk/sun/awt/windows/TestPen.java @@ -0,0 +1,102 @@ +/* + * 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 4277201 + * @summary verifies that invoking a fill on a brand new Graphics object + * does not stroke the shape in addition to filling it + * @key headful + */ + +/* + * This test case tests for a problem with initializing GDI graphics + * contexts (HDCs) where a pen is left installed in the graphics object + * even though the AWT believes that there is no Pen installed. The + * result is that when you try to fill a shape, GDI will both fill and + * stroke it. +*/ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.image.BufferedImage; + +public class TestPen extends Panel { + + static volatile TestPen pen; + static volatile Frame frame; + + public TestPen() { + setForeground(Color.black); + setBackground(Color.white); + } + + public Dimension getPreferredSize() { + return new Dimension(200, 200); + } + + public void paint(Graphics g) { + g.setColor(Color.green); + g.fillOval(50, 50, 100, 100); + } + + static void createUI() { + frame = new Frame(); + pen = new TestPen(); + frame.add(pen); + frame.pack(); + frame.setVisible(true); + } + + public static void main(String argv[]) throws Exception { + try { + EventQueue.invokeAndWait(TestPen::createUI); + Robot robot = new Robot(); + robot.waitForIdle(); + robot.delay(2000); + Point p = pen.getLocationOnScreen(); + Dimension d = pen.getSize(); + Rectangle r = new Rectangle(p.x + 1, p.y + 1, d.width - 2, d.height - 2); + BufferedImage bi = robot.createScreenCapture(r); + int blackPixel = Color.black.getRGB(); + for (int y = 0; y < bi.getHeight(); y++ ) { + for (int x = 0; x < bi.getWidth(); x++ ) { + if (bi.getRGB(x, y) == blackPixel) { + throw new RuntimeException("Black pixel !"); + } + } + } + } finally { + if (frame != null) { + EventQueue.invokeAndWait(frame::dispose); + } + } + } +} From dd56990962d58e4f482773f67bc43383d7748536 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Mon, 30 Sep 2024 02:43:32 +0000 Subject: [PATCH 231/307] 8340639: Open source few more AWT List tests Reviewed-by: prr --- .../java/awt/List/HorizScrollWorkTest.java | 69 +++++++++ .../awt/List/HorizScrollbarEraseTest.java | 139 ++++++++++++++++++ .../java/awt/List/ScrollbarPresenceTest.java | 71 +++++++++ test/jdk/java/awt/List/SetForegroundTest.java | 109 ++++++++++++++ 4 files changed, 388 insertions(+) create mode 100644 test/jdk/java/awt/List/HorizScrollWorkTest.java create mode 100644 test/jdk/java/awt/List/HorizScrollbarEraseTest.java create mode 100644 test/jdk/java/awt/List/ScrollbarPresenceTest.java create mode 100644 test/jdk/java/awt/List/SetForegroundTest.java diff --git a/test/jdk/java/awt/List/HorizScrollWorkTest.java b/test/jdk/java/awt/List/HorizScrollWorkTest.java new file mode 100644 index 0000000000000..6de1de1a4f264 --- /dev/null +++ b/test/jdk/java/awt/List/HorizScrollWorkTest.java @@ -0,0 +1,69 @@ +/* + * 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 6355467 + * @summary Horizontal scroll bar thumb of a List does not stay at the end + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @requires (os.family == "linux") + * @run main/manual HorizScrollWorkTest +*/ + +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.List; + +public class HorizScrollWorkTest { + + private static final String INSTRUCTIONS = """ + This is a linux only test. + Drag and drop the horizontal scroll bar thumb at the right end. + If the thumb does not stay at the right end, then the test failed. Otherwise passed."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("HorizScrollWorkTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int)INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(HorizScrollWorkTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame frame = new Frame("HorizScrollWorkTest Frame"); + List list = new List(4); + + frame.setLayout (new FlowLayout()); + + list.add("veryyyyyyyyyyyyyyyyyyyyyyyyyy longgggggggggggggggggggggg stringggggggggggggggggggggg"); + + frame.add(list); + frame.pack(); + + return frame; + } +} diff --git a/test/jdk/java/awt/List/HorizScrollbarEraseTest.java b/test/jdk/java/awt/List/HorizScrollbarEraseTest.java new file mode 100644 index 0000000000000..2601a7ed0b2e6 --- /dev/null +++ b/test/jdk/java/awt/List/HorizScrollbarEraseTest.java @@ -0,0 +1,139 @@ +/* + * 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 4895367 + * @summary List scrolling w/ down arrow keys obscures horizontal scrollbar + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @requires (os.family == "linux") + * @run main/manual HorizScrollbarEraseTest + */ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.List; +import java.awt.Panel; +import java.awt.TextArea; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +public class HorizScrollbarEraseTest { + + private static final String INSTRUCTIONS = """ + This is a Unix-only test. + Do the four mini-tests below. + If the horizontal scrollbar is ever erased by a rectangle + of the background color, the test FAILS. + If the horizontal scrollbars remain painted, test passes."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("HorizScrollbarEraseTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(HorizScrollbarEraseTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame frame = new Frame("HorizScrollbarEraseTest"); + Panel borderPanel = new Panel(); + borderPanel.setLayout(new BorderLayout()); + Button focusedButton = new Button("Focus starts here"); + borderPanel.add(focusedButton, BorderLayout.NORTH); + + Panel gridPanel = new Panel(); + gridPanel.setLayout(new GridLayout(0, 4)); + borderPanel.add(gridPanel, BorderLayout.CENTER); + + InstructionList il1 = new InstructionList("Tab to Item 2, then \n" + + "press the down" + + "arrow key to scroll down"); + il1.list.select(2); + il1.list.makeVisible(0); + gridPanel.add(il1); + + InstructionList il2 = new InstructionList("Tab to the next List,\n" + + "then press the down\n" + + "arrow key to select\n" + + "the last item."); + il2.list.select(3); + il2.list.makeVisible(0); + gridPanel.add(il2); + + InstructionList il3 = new InstructionList("Click the button to\n" + + "programmatically\n" + + "select item 3 (not showing)"); + Button selectBtn = new Button("Click Me"); + final List selectList = il3.list; + selectBtn.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + selectList.select(3); + } + }); + il3.add(selectBtn, BorderLayout.CENTER); + gridPanel.add(il3); + + InstructionList il4 = new InstructionList("Click the button to\nprogrammatically\ndeselect item 3\n(not showing)"); + Button deselectBtn = new Button("Click Me"); + final List deselectList = il4.list; + deselectBtn.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + deselectList.deselect(3); + } + }); + il4.add(deselectBtn, BorderLayout.CENTER); + il4.list.select(3); + il4.list.makeVisible(0); + gridPanel.add(il4); + + frame.add(borderPanel); + frame.pack(); + return frame; + + } +} + +class InstructionList extends Panel { + TextArea ta; + public List list; + + public InstructionList(String instructions) { + super(); + setLayout(new BorderLayout()); + ta = new TextArea(instructions, 6, 25, TextArea.SCROLLBARS_NONE); + ta.setFocusable(false); + list = new List(); + for (int i = 0; i < 5; i++) { + list.add("Item " + i + ", a long, long, long, long item"); + } + add(ta, BorderLayout.NORTH); + add(list, BorderLayout.SOUTH); + } +} diff --git a/test/jdk/java/awt/List/ScrollbarPresenceTest.java b/test/jdk/java/awt/List/ScrollbarPresenceTest.java new file mode 100644 index 0000000000000..d82cbb80060ca --- /dev/null +++ b/test/jdk/java/awt/List/ScrollbarPresenceTest.java @@ -0,0 +1,71 @@ +/* + * 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 6336384 + * @summary ScrollBar does not show up correctly + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ScrollbarPresenceTest +*/ + +import java.awt.Font; +import java.awt.Frame; +import java.awt.List; + +public class ScrollbarPresenceTest { + + private static final String INSTRUCTIONS = """ + You will see a list, + If a vertical scrollbar appears on the list and the list is big enough + to show all items then the test failed else the test passed."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("ScrollbarPresenceTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(ScrollbarPresenceTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame frame = new Frame("ScrollbarPresenceTest Frame"); + List list = new List(); + + for (int i = 0; i < 6; i++) { + list.addItem("Row " + i); + } + + list.setFont(new Font("MonoSpaced", Font.PLAIN, 12)); + list.setBounds(30, 30, 128, 104); + frame.add(list); + + frame.pack(); + return frame; + } + +} diff --git a/test/jdk/java/awt/List/SetForegroundTest.java b/test/jdk/java/awt/List/SetForegroundTest.java new file mode 100644 index 0000000000000..7b22e5385088b --- /dev/null +++ b/test/jdk/java/awt/List/SetForegroundTest.java @@ -0,0 +1,109 @@ +/* + * 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. + */ + +/* + * @test + * @bug 6246467 + * @summary Tests that list works correctly if user specified foreground colors on XToolkit/Motif + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual SetForegroundTest + */ + +import java.awt.Button; +import java.awt.Component; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Label; +import java.awt.List; +import java.awt.Panel; +import java.awt.TextArea; +import java.awt.TextField; +import java.awt.ScrollPane; + +public class SetForegroundTest { + + private static final String INSTRUCTIONS = """ + To make sure, that for each component + (Button, Checkbox, Label, List, TextArea, TextField, Choice) + in the frame, + the title exist and the color of the title is red. + If not, the test failed."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("SetForegroundTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(SetForegroundTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame frame = new Frame(); + ScrollPane sp = new ScrollPane() { + public Dimension getPreferredSize() { + return new Dimension(180, 180); + } + }; + Panel p = new Panel(); + Component childs[] = new Component[] {new Button("button"), + new Checkbox("checkbox"), + new Label("label"), + new List(3, false), + new TextArea("text area"), + new TextField("text field"), + new Choice()}; + + p.setLayout (new FlowLayout ()); + + sp.add(p); + + sp.validate(); + + frame.add(sp); + for (int i = 0; i < childs.length; i++){ + childs[i].setForeground(Color.red); + } + + for (int i = 0; i < childs.length; i++) { + p.add(childs[i]); + if (childs[i] instanceof List) { + ((List)childs[i]).add("list1"); + ((List)childs[i]).add("list2"); + } else if (childs[i] instanceof Choice) { + ((Choice)childs[i]).add("choice1"); + ((Choice)childs[i]).add("choice2"); + } + } + frame.pack(); + return frame; + } +} From ae4d2f15901bf02efceaac26ee4aa3ae666bf467 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Mon, 30 Sep 2024 02:43:49 +0000 Subject: [PATCH 232/307] 8340621: Open source several AWT List tests Reviewed-by: prr --- .../java/awt/List/DisabledListIsGreyTest.java | 75 ++++++++++ .../java/awt/List/ListFrameResizeTest.java | 104 ++++++++++++++ .../awt/List/MultiSelectionListCrashTest.java | 89 ++++++++++++ .../java/awt/List/ScrollbarPositionTest.java | 104 ++++++++++++++ .../awt/List/SelectedItemVisibilityTest.java | 128 ++++++++++++++++++ 5 files changed, 500 insertions(+) create mode 100644 test/jdk/java/awt/List/DisabledListIsGreyTest.java create mode 100644 test/jdk/java/awt/List/ListFrameResizeTest.java create mode 100644 test/jdk/java/awt/List/MultiSelectionListCrashTest.java create mode 100644 test/jdk/java/awt/List/ScrollbarPositionTest.java create mode 100644 test/jdk/java/awt/List/SelectedItemVisibilityTest.java diff --git a/test/jdk/java/awt/List/DisabledListIsGreyTest.java b/test/jdk/java/awt/List/DisabledListIsGreyTest.java new file mode 100644 index 0000000000000..ec1a257066606 --- /dev/null +++ b/test/jdk/java/awt/List/DisabledListIsGreyTest.java @@ -0,0 +1,75 @@ +/* + * 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 6354810 + * @summary Items in the list are not grayed out when disabled, XToolkit + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual DisabledListIsGreyTest +*/ + +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.List; + +public class DisabledListIsGreyTest { + + private static final String INSTRUCTIONS = """ + 1) After the test started you will see two lists. + 2) One of them is enabled, and the second is disabled. + 3) Check that the items of the disabled list are grayed. + 4) If so, the test passed. Otherwise, failed."""; + + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("DisabledListIsGreyTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(DisabledListIsGreyTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame frame = new Frame("DisabledListIsGreyTest Frame"); + frame.setLayout(new FlowLayout()); + + List list1 = new List(3); + List list2 = new List(3); + for (int i = 0; i < 5; i++) { + list1.addItem("Item " + i); + list2.addItem("Item " + i); + } + frame.add(list1); + + list2.setEnabled(false); + frame.add(list2); + frame.pack(); + return frame; + } + +} diff --git a/test/jdk/java/awt/List/ListFrameResizeTest.java b/test/jdk/java/awt/List/ListFrameResizeTest.java new file mode 100644 index 0000000000000..4655e817da581 --- /dev/null +++ b/test/jdk/java/awt/List/ListFrameResizeTest.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 4085379 + * @summary List component not properly "resized" with GridBagLayout + * @requires (os.family == "windows") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ListFrameResizeTest + */ + +import java.awt.Color; +import java.awt.Frame; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.List; + +public class ListFrameResizeTest { + + private static final String INSTRUCTIONS = """ + This test is for windows only. + + 1. A Frame will appear with a List + (the List occupies the whole Frame) + 2. Minimize the Frame, the Frame is now in the Task Bar (ie.,iconified) + 3. Right click (right mouse button) the icon in the task bar + and click on the 'maximize' menuitem to maximize the Frame + 4. If you notice the List has not been resized + (ie.,if it partly occupies the Frame), then press FAIL else press PASS"."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("ListFrameResizeTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(ListFrameResizeTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + wintest client = new wintest("ListFrameResizeTest Frame"); + client.resize(500, 300); + client.setBackground(Color.blue); + return client; + } + +} + +class wintest extends Frame { + private List msg; + + public wintest(String title) { + super(title); + msg = new List(); + for (int i = 0; i < 100; i++) { + msg.add("" + i); + } + + GridBagLayout gridbag = new GridBagLayout(); + GridBagConstraints constraints = new GridBagConstraints(); + + setLayout(gridbag); + + constraints.fill = GridBagConstraints.BOTH; + + constraints.anchor = GridBagConstraints.CENTER; + constraints.insets = new Insets(10, 10, 10, 10); + constraints.ipadx = 0; + constraints.ipady = 0; + constraints.weightx = 1; + constraints.weighty = 1; + constraints.gridx = 0; + constraints.gridy = 0; + constraints.gridwidth = GridBagConstraints.REMAINDER; + constraints.gridheight = GridBagConstraints.REMAINDER; + gridbag.setConstraints(msg, constraints); + add(msg); + } +} diff --git a/test/jdk/java/awt/List/MultiSelectionListCrashTest.java b/test/jdk/java/awt/List/MultiSelectionListCrashTest.java new file mode 100644 index 0000000000000..b408a12ebbac7 --- /dev/null +++ b/test/jdk/java/awt/List/MultiSelectionListCrashTest.java @@ -0,0 +1,89 @@ +/* + * 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 4201967 + * @summary tests that a multiselection list doesn't causes crash when FileDialog is invoked + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MultiSelectionListCrashTest + */ + +import java.awt.Button; +import java.awt.FileDialog; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.List; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +public class MultiSelectionListCrashTest { + + private static final String INSTRUCTIONS = """ + Press "Invoke dialog" button to invoke a FileDialog. + When it appears close it by pressing cancel button. + If all remaining frames are enabled and + page fault didn't occur the test passed. Otherwise the test failed. + + Try to invoke a FileDialog several times to verify that the bug doesn't exist."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("MultiSelectionListCrashTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(MultiSelectionListCrashTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + + Frame frame = new Frame("MultiSelectionListCrashTest frame"); + Button button = new Button("Invoke dialog"); + button.addActionListener(new FileDialogInvoker(frame)); + List list = new List(4, true); + list.add("Item1"); + list.add("Item2"); + frame.setLayout(new FlowLayout()); + frame.add(button); + frame.add(list); + frame.setSize(200, 200); + return frame; + } +} + +class FileDialogInvoker implements ActionListener { + FileDialog fileDialog; + + public FileDialogInvoker(Frame frame) { + fileDialog = new FileDialog(frame); + } + + public void actionPerformed(ActionEvent e) { + fileDialog.setVisible(true); + } + +} diff --git a/test/jdk/java/awt/List/ScrollbarPositionTest.java b/test/jdk/java/awt/List/ScrollbarPositionTest.java new file mode 100644 index 0000000000000..25167fa56278c --- /dev/null +++ b/test/jdk/java/awt/List/ScrollbarPositionTest.java @@ -0,0 +1,104 @@ +/* + * 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 4024943 + * @summary Test for position of List scrollbar when it is added + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ScrollbarPositionTest + */ + +import java.awt.Button; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.List; +import java.awt.Panel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +public class ScrollbarPositionTest { + static int item = 0; + static List list; + static Button addButton, delButton; + + private static final String INSTRUCTIONS = """ + Click on the "Add List Item" button many times + until the vertical scrollbar appears. + Verify that the displayed vertical scrollbar does not take the space + that was occupied by buttons before the scrollbar is shown."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("ScrollbarPositionTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(ScrollbarPositionTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Panel pan; + + Frame frame = new Frame("ScrollbarPositionTest Frame"); + frame.setLayout(new GridLayout(1, 2)); + list = new List(); + frame.add(list); + frame.add(pan = new Panel()); + pan.setLayout(new GridLayout(4, 1)); + + MyListener listener = new MyListener(); + addButton = new Button("Add List Item"); + addButton.addActionListener(listener); + pan.add(addButton); + + delButton = new Button("Delete List Item"); + delButton.addActionListener(listener); + pan.add(delButton); + + frame.pack(); + return frame; + } + + static class MyListener implements ActionListener { + public void actionPerformed(ActionEvent evt) { + if (evt.getSource() == addButton) { + String s = "item"; + for (int i = 0; i <= item; i++) { + s = s +" "+Integer.toString(i); + } + item++; + list.addItem(s); + } else if (evt.getSource() == delButton) { + int i; + if ((i = list.countItems()) > 0) { + list.delItem(i - 1); + --item; + } + } + } + } +} diff --git a/test/jdk/java/awt/List/SelectedItemVisibilityTest.java b/test/jdk/java/awt/List/SelectedItemVisibilityTest.java new file mode 100644 index 0000000000000..53364e937713c --- /dev/null +++ b/test/jdk/java/awt/List/SelectedItemVisibilityTest.java @@ -0,0 +1,128 @@ +/* + * 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 4676536 + * @summary REGRESSION: makeVisible() method of List Component does not perform + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual SelectedItemVisibilityTest + */ + +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Label; +import java.awt.List; + +public class SelectedItemVisibilityTest { + + static List list1, list2; + static int visibleItem = 4; + static int selectedItems[] = {6, 7, 8}; + static String selectedItemsStr = ""; + + static { + for (int i = 0 ; i < selectedItems.length ; i++) { + selectedItemsStr += ""+selectedItems[i]+" "; + } + } + + private static final String INSTRUCTIONS = + "You should see two lists.\n" + + "\n" + + "list1: \n" + + "\t1. the first visible item should be " + visibleItem + + "\n\t2. the selected item should be " + selectedItems[0] + + "\n" + + "list2:\n" + + "\t1. the first visible item should be " + visibleItem + + "\n\t2. the selected items should be " + selectedItemsStr + + "\n" + + "\nIf it is so the test passed else failed."; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("SelectedItemVisibilityTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(SelectedItemVisibilityTest::createTestUI) + .logArea() + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + + Frame frame = new Frame("SelectedItemVisibilityTest Frame"); + frame.setLayout(new FlowLayout()); + + // list1 + list1 = new List(4); + for (int i = 0; i < 20; i++) { + list1.add(""+i); + } + list1.makeVisible(visibleItem); + list1.select(selectedItems[0]); + frame.add(new Label("list1:")); + frame.add(list1); + + // list2 + list2 = new List(4); + list2.setMultipleMode(true); + for (int i = 0; i < 20; i++) { + list2.add(""+i); + } + list2.makeVisible(visibleItem); + for (int i = 0 ; i < selectedItems.length ; i++) { + list2.select(selectedItems[i]); + } + frame.add(new Label("list2:")); + frame.add(list2); + frame.setSize(200, 200); + + // common output + String s; + int sel[]; + + PassFailJFrame.log("list1: "); + PassFailJFrame.log("\tgetVisibleIndex="+list1.getVisibleIndex()); + sel = list1.getSelectedIndexes(); + s = "\tgetSelectedIndexes="; + for (int i = 0 ; i < sel.length ; i++) { + s += "" + sel[i] + " "; + } + PassFailJFrame.log(s); + + PassFailJFrame.log("list2: "); + PassFailJFrame.log("\tgetVisibleIndex="+list2.getVisibleIndex()); + sel = list2.getSelectedIndexes(); + s = "\tgetSelectedIndexes="; + for (int i = 0 ; i < sel.length ; i++) { + s += "" + sel[i] + " "; + } + PassFailJFrame.log(s); + return frame; + } +} From 6514aef8403fa5fc09e5c064a783ff0f1fccd0cf Mon Sep 17 00:00:00 2001 From: Axel Boldt-Christmas Date: Mon, 30 Sep 2024 06:20:08 +0000 Subject: [PATCH 233/307] 8340419: ZGC: Create an UseLargePages adaptation of TestAllocateHeapAt.java Reviewed-by: stefank, sjohanss, jsikstro --- .../gc/z/TestAllocateHeapAtWithHugeTLBFS.java | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 test/hotspot/jtreg/gc/z/TestAllocateHeapAtWithHugeTLBFS.java diff --git a/test/hotspot/jtreg/gc/z/TestAllocateHeapAtWithHugeTLBFS.java b/test/hotspot/jtreg/gc/z/TestAllocateHeapAtWithHugeTLBFS.java new file mode 100644 index 0000000000000..ac647bbd013fd --- /dev/null +++ b/test/hotspot/jtreg/gc/z/TestAllocateHeapAtWithHugeTLBFS.java @@ -0,0 +1,91 @@ +/* + * 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 gc.z; + +/* + * @test TestAllocateHeapAtWithHugeTLBFS + * @requires vm.gc.ZGenerational & os.family == "linux" + * @summary Test ZGC with -XX:AllocateHeapAt and -XX:+UseLargePages + * @library /test/lib + * @run driver gc.z.TestAllocateHeapAtWithHugeTLBFS true + * @run driver gc.z.TestAllocateHeapAtWithHugeTLBFS false + */ + +import jdk.test.lib.process.ProcessTools; +import jtreg.SkippedException; + +import java.io.File; +import java.io.FileNotFoundException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.Path; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.Scanner; + +public class TestAllocateHeapAtWithHugeTLBFS { + static String find_hugetlbfs_mountpoint() { + Pattern pat = Pattern.compile("\\d+ \\d+ \\d+:\\d+ \\S+ (\\S+) [^-]*- hugetlbfs (.+)"); + try (Scanner scanner = new Scanner(new File("/proc/self/mountinfo"))) { + while (scanner.hasNextLine()) { + final Matcher mat = pat.matcher(scanner.nextLine()); + if (mat.matches() && mat.group(2).contains("pagesize=2M")) { + final Path path = Paths.get(mat.group(1)); + if (Files.isReadable(path) && + Files.isWritable(path) && + Files.isExecutable(path)) { + // Found a usable mount point. + return path.toString(); + } + } + } + } catch (FileNotFoundException e) { + System.out.println("Could not open /proc/self/mountinfo"); + } + return null; + } + public static void main(String[] args) throws Exception { + final boolean exists = Boolean.parseBoolean(args[0]); + final String directory = exists ? find_hugetlbfs_mountpoint() + : "non-existing-directory"; + if (directory == null) { + throw new SkippedException("No valid hugetlbfs mount point found"); + } + final String heapBackingFile = "Heap Backing File: " + directory; + final String failedToCreateFile = "Failed to create file " + directory; + + ProcessTools.executeTestJava( + "-XX:+UseZGC", + "-XX:+ZGenerational", + "-Xlog:gc*", + "-Xms32M", + "-Xmx32M", + "-XX:+UseLargePages", + "-XX:AllocateHeapAt=" + directory, + "-version") + .shouldContain(exists ? heapBackingFile : failedToCreateFile) + .shouldNotContain(exists ? failedToCreateFile : heapBackingFile) + .shouldHaveExitValue(exists ? 0 : 1); + } +} From 822a773873c42ea27a6be90da92b2b2c9fb8caee Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 30 Sep 2024 06:38:42 +0000 Subject: [PATCH 234/307] 8340605: Open source several AWT PopupMenu tests Reviewed-by: tr --- .../java/awt/PopupMenu/PeripheryOfScreen.java | 82 ++++++++++++++ .../PopupMenu/PopupLeadingSeparatorTest.java | 81 ++++++++++++++ .../java/awt/PopupMenu/PopupMenuShowTest.java | 77 +++++++++++++ .../awt/PopupMenu/PopupMenuWithMenuBar.java | 103 ++++++++++++++++++ .../jdk/java/awt/PopupMenu/PopupOnButton.java | 88 +++++++++++++++ 5 files changed, 431 insertions(+) create mode 100644 test/jdk/java/awt/PopupMenu/PeripheryOfScreen.java create mode 100644 test/jdk/java/awt/PopupMenu/PopupLeadingSeparatorTest.java create mode 100644 test/jdk/java/awt/PopupMenu/PopupMenuShowTest.java create mode 100644 test/jdk/java/awt/PopupMenu/PopupMenuWithMenuBar.java create mode 100644 test/jdk/java/awt/PopupMenu/PopupOnButton.java diff --git a/test/jdk/java/awt/PopupMenu/PeripheryOfScreen.java b/test/jdk/java/awt/PopupMenu/PeripheryOfScreen.java new file mode 100644 index 0000000000000..b169a7d9692a7 --- /dev/null +++ b/test/jdk/java/awt/PopupMenu/PeripheryOfScreen.java @@ -0,0 +1,82 @@ +/* + * 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.Frame; +import java.awt.MenuItem; +import java.awt.PopupMenu; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/* + * @test + * @bug 6267162 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Popup Menu gets hidden below the screen when opened near the periphery + * of the screen, XToolkit Test if popup menu window is adjusted on screen + * when trying to show outside + * @run main/manual PeripheryOfScreen + */ + +public class PeripheryOfScreen { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + Click on the button to show popup menu in the center of + frame. Move frame beyond the edge of screen and click on + button to show the popup menu and see if popup menu is + adjusted to the edge. + + Press Pass if popup menu behaves as per instruction, otherwise + press Fail. + """; + + PassFailJFrame.builder() + .title("PeripheryOfScreen Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(PeripheryOfScreen::createUI) + .build() + .awaitAndCheck(); + } + + private static Frame createUI () { + Frame f = new Frame("PeripheryOfScreen Test frame"); + Button b = new Button("Click to show popup menu"); + PopupMenu pm = new PopupMenu("Test menu"); + MenuItem i = new MenuItem("Click me"); + pm.add(i); + b.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + pm.show(f, 100, 100); + } + }); + f.add(b); + f.add(pm); + f.setSize(300, 200); + f.toFront(); + return f; + } +} diff --git a/test/jdk/java/awt/PopupMenu/PopupLeadingSeparatorTest.java b/test/jdk/java/awt/PopupMenu/PopupLeadingSeparatorTest.java new file mode 100644 index 0000000000000..c9274e9b807f0 --- /dev/null +++ b/test/jdk/java/awt/PopupMenu/PopupLeadingSeparatorTest.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. + */ + +import java.awt.Component; +import java.awt.Frame; +import java.awt.Font; +import java.awt.MenuItem; +import java.awt.PopupMenu; + +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/* + * @test + * @bug 4169155 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Popup menus get a leading separator on Motif system + * @run main/manual PopupLeadingSeparatorTest + */ + +public class PopupLeadingSeparatorTest { + public static void main(String[] args) throws Exception { + PopupLeadingSeparatorTest obj = new PopupLeadingSeparatorTest(); + String INSTRUCTIONS = """ + Press mouse button on the frame. Popup menu without leading + separator should appear. + If a PopupMenu behaves same, press Pass, else press Fail. + """; + + PassFailJFrame.builder() + .title("PopupLeadingSeparatorTest Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(obj::createUI) + .build() + .awaitAndCheck(); + } + + private Frame createUI() { + Frame f = new Frame("PopupLeadingSeparatorTest Test"); + PopupMenu popupMenu = new PopupMenu("Popup Menu Title"); + popupMenu.add(new MenuItem("Item1")); + PopupMenu cascadeMenu = new PopupMenu("Multifont menu"); + cascadeMenu.add(new MenuItem("Item1")); + MenuItem item2 = new MenuItem("Item2"); + item2.setFont(new Font("Serif", Font.BOLD, 36)); + cascadeMenu.add(item2); + + popupMenu.add(cascadeMenu); + f.add(popupMenu); + f.setSize(300, 150); + f.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent evt) { + popupMenu.show((Component) evt.getSource(), evt.getX(), evt.getY()); + } + }); + return f; + } +} diff --git a/test/jdk/java/awt/PopupMenu/PopupMenuShowTest.java b/test/jdk/java/awt/PopupMenu/PopupMenuShowTest.java new file mode 100644 index 0000000000000..b36fdc5d19c22 --- /dev/null +++ b/test/jdk/java/awt/PopupMenu/PopupMenuShowTest.java @@ -0,0 +1,77 @@ +/* + * 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.FlowLayout; +import java.awt.Frame; +import java.awt.Label; +import java.awt.MenuItem; +import java.awt.PopupMenu; + +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/* + * @test + * @bug 4168006 4196790 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Popup menu test fails on x86/Solaris 2.6 combination. + * @run main/manual PopupMenuShowTest + */ + +public class PopupMenuShowTest { + public static void main(String[] args) throws Exception { + PopupMenuShowTest obj = new PopupMenuShowTest(); + String INSTRUCTIONS = """ + Press the right mouse button in the PopupTest window. + If a PopupMenu appears, press Pass, else press Fail. + """; + + PassFailJFrame.builder() + .title("PopupMenuShowTest Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(obj::createUI) + .build() + .awaitAndCheck(); + } + + private Frame createUI() { + Frame f = new Frame("PopupMenuShowTest Test"); + f.setLayout(new FlowLayout()); + f.add(new Label("Press right mouse button inside this frame.")); + f.add(new Label("A pop-up menu should appear.")); + PopupMenu popupMenu = new PopupMenu("Popup Menu Title"); + MenuItem mi = new MenuItem("Menu Item"); + popupMenu.add(mi); + f.add(popupMenu); + f.setSize(400, 350); + f.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + popupMenu.show(e.getComponent(), e.getX(), e.getY()); + } + }); + return f; + } +} diff --git a/test/jdk/java/awt/PopupMenu/PopupMenuWithMenuBar.java b/test/jdk/java/awt/PopupMenu/PopupMenuWithMenuBar.java new file mode 100644 index 0000000000000..1a927e29f84bc --- /dev/null +++ b/test/jdk/java/awt/PopupMenu/PopupMenuWithMenuBar.java @@ -0,0 +1,103 @@ +/* + * 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.PopupMenu; + +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/* + * @test + * @bug 4038140 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Test for functionality of PopupMenuWithMenuBar + * @run main/manual PopupMenuWithMenuBar + */ + +public class PopupMenuWithMenuBar { + public static void main(String[] args) throws Exception { + PopupMenuWithMenuBar obj = new PopupMenuWithMenuBar(); + String INSTRUCTIONS = """ + There was a bug that prevented the popup menu from appearing properly + (if even at all) for a frame window when there is also a menu bar. + + Right click inside the frame window to display the popup window. If + the popup menu appears normally, then the test is successful and the + bug has been fixed."""; + + PassFailJFrame.builder() + .title("PopupMenuWithMenuBar Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(obj::createUI) + .build() + .awaitAndCheck(); + } + + private Frame createUI() { + Frame f = new Frame("PopupMenuWithMenuBar Test"); + f.setBounds(10, 10, 300, 250); + MenuBar menuBar = new MenuBar(); + Menu fileMenu = createFileMenu(); + menuBar.add(fileMenu); + f.setMenuBar(menuBar); + PopupMenu popupMenu = createPopupMenu(); + f.add(popupMenu); + f.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + popupMenu.show(f, e.getX(), e.getY()); + } + }); + return f; + } + + private Menu createFileMenu() { + String[] menu1Labels = new String[] + {"Save As", "Save As", "Quit"}; + MenuItem menuItem; + Menu returnMenu = new Menu("File"); + for (int menu1Index = 0; menu1Index < menu1Labels.length; menu1Index++) { + menuItem = new MenuItem(menu1Labels[menu1Index]); + returnMenu.add(menuItem); + } + return returnMenu; + } + + private PopupMenu createPopupMenu() { + String[] popupLabels = new String[] + {"Popup 1", "Popup 2", "Quit"}; + MenuItem menuItem; + PopupMenu returnMenu = new PopupMenu("Popups"); + for (int popupIndex = 0; popupIndex < popupLabels.length; popupIndex++) { + menuItem = new MenuItem(popupLabels[popupIndex]); + returnMenu.add(menuItem); + } + return returnMenu; + } +} diff --git a/test/jdk/java/awt/PopupMenu/PopupOnButton.java b/test/jdk/java/awt/PopupMenu/PopupOnButton.java new file mode 100644 index 0000000000000..581714bf76a85 --- /dev/null +++ b/test/jdk/java/awt/PopupMenu/PopupOnButton.java @@ -0,0 +1,88 @@ +/* + * 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.Component; +import java.awt.Frame; +import java.awt.MenuItem; +import java.awt.PopupMenu; + +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/* + * @test + * @bug 4181790 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Tests a popup menu on a button. + * @run main/manual PopupOnButton + */ + +public class PopupOnButton { + public static void main(String[] args) throws Exception { + PopupOnButton obj = new PopupOnButton(); + String INSTRUCTIONS = """ + Right-click on the button. + Popup Menu should appear and behave fine. + If a PopupMenu appears, press Pass, else press Fail. + """; + + PassFailJFrame.builder() + .title("PopupOnButton Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(obj::createUI) + .build() + .awaitAndCheck(); + } + + private Frame createUI() { + Frame f = new Frame("PopupOnButton Test"); + Button b = new Button("button with popup menu"); + PopupMenu m = new PopupMenu("popup"); + m.add(new MenuItem("item1")); + m.add(new MenuItem("item2")); + m.add(new MenuItem("item3")); + b.add(m); + b.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + if (e.isPopupTrigger()) { + m.show((Component) e.getSource(), e.getX(), e.getY()); + } + } + + @Override + public void mouseReleased(MouseEvent e) { + if (e.isPopupTrigger()) { + m.show((Component) e.getSource(), e.getX(), e.getY()); + } + } + }); + + f.add(b); + f.setSize(200, 150); + return f; + } + } From 988a531b097ccbd699d233059d73f41cae24dc5b Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 30 Sep 2024 07:02:55 +0000 Subject: [PATCH 235/307] 8340181: Shenandoah: Cleanup ShenandoahRuntime stubs Reviewed-by: adinn, phh, wkemper --- .../shenandoahBarrierSetAssembler_aarch64.cpp | 10 ++--- .../shenandoahBarrierSetAssembler_ppc.cpp | 8 ++-- .../shenandoahBarrierSetAssembler_riscv.cpp | 10 ++--- .../shenandoahBarrierSetAssembler_x86.cpp | 10 ++--- .../shenandoah/c2/shenandoahBarrierSetC2.cpp | 29 ++++++------- .../shenandoah/c2/shenandoahBarrierSetC2.hpp | 6 +-- .../gc/shenandoah/c2/shenandoahSupport.cpp | 2 +- .../share/gc/shenandoah/shenandoahRuntime.cpp | 41 ++++++++----------- .../share/gc/shenandoah/shenandoahRuntime.hpp | 8 ++-- 9 files changed, 60 insertions(+), 64 deletions(-) diff --git a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp index 06f4382015603..84d06dbcc7bfd 100644 --- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp @@ -67,9 +67,9 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec __ push(saved_regs, sp); if (UseCompressedOops) { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_narrow_oop_entry), src, dst, count); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_narrow_oop), src, dst, count); } else { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_oop_entry), src, dst, count); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_oop), src, dst, count); } __ pop(saved_regs, sp); __ bind(done); @@ -164,9 +164,9 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_pre(MacroAssembler* masm, if (expand_call) { assert(pre_val != c_rarg1, "smashed arg"); - __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), pre_val, thread); + __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), pre_val, thread); } else { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), pre_val, thread); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), pre_val, thread); } __ pop(saved, sp); @@ -698,7 +698,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss __ bind(runtime); __ push_call_clobbered_registers(); __ load_parameter(0, pre_val); - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), pre_val, thread); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), pre_val, thread); __ pop_call_clobbered_registers(); __ bind(done); diff --git a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp index 3cb5c5a628f39..5315080721249 100644 --- a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp @@ -144,9 +144,9 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler *masm, Dec // Invoke runtime. address jrt_address = nullptr; if (UseCompressedOops) { - jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_narrow_oop_entry); + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_narrow_oop); } else { - jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_oop_entry); + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_oop); } assert(jrt_address != nullptr, "jrt routine cannot be found"); @@ -302,7 +302,7 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_impl(MacroAssembler *masm } // Invoke runtime. - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), pre_val, R16_thread); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), pre_val, R16_thread); // Restore to-be-preserved registers. if (!preserve_gp_registers && preloaded_mode && pre_val->is_volatile()) { @@ -906,7 +906,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss __ push_frame_reg_args(nbytes_save, R11_tmp1); // Invoke runtime. - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), R0_pre_val, R16_thread); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), R0_pre_val, R16_thread); // Restore to-be-preserved registers. __ pop_frame(); diff --git a/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp index 9a79a92327723..cc73d14a756f2 100644 --- a/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp @@ -70,10 +70,10 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec __ push_reg(saved_regs, sp); if (UseCompressedOops) { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_narrow_oop_entry), + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_narrow_oop), src, dst, count); } else { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_oop_entry), src, dst, count); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_oop), src, dst, count); } __ pop_reg(saved_regs, sp); __ bind(done); @@ -165,9 +165,9 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_pre(MacroAssembler* masm, // expand_call should be passed true. if (expand_call) { assert(pre_val != c_rarg1, "smashed arg"); - __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), pre_val, thread); + __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), pre_val, thread); } else { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), pre_val, thread); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), pre_val, thread); } __ pop_reg(saved, sp); @@ -645,7 +645,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss __ bind(runtime); __ push_call_clobbered_registers(); __ load_parameter(0, pre_val); - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), pre_val, thread); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), pre_val, thread); __ pop_call_clobbered_registers(); __ bind(done); diff --git a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp index 47078dff90738..a7682fe0c3879 100644 --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp @@ -163,12 +163,12 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec assert(dst == rsi, "expected"); assert(count == rdx, "expected"); if (UseCompressedOops) { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_narrow_oop_entry), + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_narrow_oop), src, dst, count); } else #endif { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_oop_entry), + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_oop), src, dst, count); } @@ -296,9 +296,9 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_pre(MacroAssembler* masm, __ push(thread); __ push(pre_val); #endif - __ MacroAssembler::call_VM_leaf_base(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), 2); + __ MacroAssembler::call_VM_leaf_base(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), 2); } else { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), LP64_ONLY(c_rarg0) NOT_LP64(pre_val), thread); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), LP64_ONLY(c_rarg0) NOT_LP64(pre_val), thread); } NOT_LP64( __ pop(thread); ) @@ -925,7 +925,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss // load the pre-value __ load_parameter(0, rcx); - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), rcx, thread); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), rcx, thread); __ restore_live_registers(true); diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp index 71174d11a6214..10b80b6802942 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp @@ -249,8 +249,9 @@ void ShenandoahBarrierSetC2::satb_write_barrier_pre(GraphKit* kit, } __ else_(); { // logging buffer is full, call the runtime - const TypeFunc *tf = ShenandoahBarrierSetC2::write_ref_field_pre_entry_Type(); - __ make_leaf_call(tf, CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), "shenandoah_wb_pre", pre_val, tls); + const TypeFunc *tf = ShenandoahBarrierSetC2::write_ref_field_pre_Type(); + __ make_leaf_call(tf, CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), "shenandoah_wb_pre", + pre_val, tls); } __ end_if(); // (!index) } __ end_if(); // (pre_val != nullptr) } __ end_if(); // (!marking) @@ -268,12 +269,12 @@ void ShenandoahBarrierSetC2::satb_write_barrier_pre(GraphKit* kit, bool ShenandoahBarrierSetC2::is_shenandoah_wb_pre_call(Node* call) { return call->is_CallLeaf() && - call->as_CallLeaf()->entry_point() == CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry); + call->as_CallLeaf()->entry_point() == CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre); } 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); + call->as_CallLeaf()->entry_point() == CAST_FROM_FN_PTR(address, ShenandoahRuntime::clone_barrier); } bool ShenandoahBarrierSetC2::is_shenandoah_lrb_call(Node* call) { @@ -433,7 +434,7 @@ void ShenandoahBarrierSetC2::insert_pre_barrier(GraphKit* kit, Node* base_oop, N #undef __ -const TypeFunc* ShenandoahBarrierSetC2::write_ref_field_pre_entry_Type() { +const TypeFunc* ShenandoahBarrierSetC2::write_ref_field_pre_Type() { const Type **fields = TypeTuple::fields(2); fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // original field value fields[TypeFunc::Parms+1] = TypeRawPtr::NOTNULL; // thread @@ -446,7 +447,7 @@ const TypeFunc* ShenandoahBarrierSetC2::write_ref_field_pre_entry_Type() { return TypeFunc::make(domain, range); } -const TypeFunc* ShenandoahBarrierSetC2::shenandoah_clone_barrier_Type() { +const TypeFunc* ShenandoahBarrierSetC2::clone_barrier_Type() { const Type **fields = TypeTuple::fields(1); fields[TypeFunc::Parms+0] = TypeOopPtr::NOTNULL; // src oop const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1, fields); @@ -458,7 +459,7 @@ const TypeFunc* ShenandoahBarrierSetC2::shenandoah_clone_barrier_Type() { return TypeFunc::make(domain, range); } -const TypeFunc* ShenandoahBarrierSetC2::shenandoah_load_reference_barrier_Type() { +const TypeFunc* ShenandoahBarrierSetC2::load_reference_barrier_Type() { const Type **fields = TypeTuple::fields(2); fields[TypeFunc::Parms+0] = TypeOopPtr::BOTTOM; // original field value fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // original load address @@ -797,11 +798,11 @@ void ShenandoahBarrierSetC2::clone_at_expansion(PhaseMacroExpand* phase, ArrayCo // Heap is unstable, call into clone barrier stub Node* call = phase->make_leaf_call(unstable_ctrl, mem, - ShenandoahBarrierSetC2::shenandoah_clone_barrier_Type(), - CAST_FROM_FN_PTR(address, ShenandoahRuntime::shenandoah_clone_barrier), - "shenandoah_clone", - TypeRawPtr::BOTTOM, - src_base); + ShenandoahBarrierSetC2::clone_barrier_Type(), + CAST_FROM_FN_PTR(address, ShenandoahRuntime::clone_barrier), + "shenandoah_clone", + TypeRawPtr::BOTTOM, + src_base); call = phase->transform_later(call); ctrl = phase->transform_later(new ProjNode(call, TypeFunc::Control)); @@ -976,7 +977,7 @@ void ShenandoahBarrierSetC2::verify_gc_barriers(Compile* compile, CompilePhase p Node* ShenandoahBarrierSetC2::ideal_node(PhaseGVN* phase, Node* n, bool can_reshape) const { if (is_shenandoah_wb_pre_call(n)) { - uint cnt = ShenandoahBarrierSetC2::write_ref_field_pre_entry_Type()->domain()->cnt(); + uint cnt = ShenandoahBarrierSetC2::write_ref_field_pre_Type()->domain()->cnt(); if (n->req() > cnt) { Node* addp = n->in(cnt); if (has_only_shenandoah_wb_pre_uses(addp)) { @@ -1062,7 +1063,7 @@ bool ShenandoahBarrierSetC2::final_graph_reshaping(Compile* compile, Node* n, ui assert (n->is_Call(), ""); CallNode *call = n->as_Call(); if (ShenandoahBarrierSetC2::is_shenandoah_wb_pre_call(call)) { - uint cnt = ShenandoahBarrierSetC2::write_ref_field_pre_entry_Type()->domain()->cnt(); + uint cnt = ShenandoahBarrierSetC2::write_ref_field_pre_Type()->domain()->cnt(); if (call->req() > cnt) { assert(call->req() == cnt + 1, "only one extra input"); Node *addp = call->in(cnt); diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp index cbfacea31ab7a..6e241b39ce967 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp @@ -93,9 +93,9 @@ class ShenandoahBarrierSetC2 : public BarrierSetC2 { ShenandoahBarrierSetC2State* state() const; - static const TypeFunc* write_ref_field_pre_entry_Type(); - static const TypeFunc* shenandoah_clone_barrier_Type(); - static const TypeFunc* shenandoah_load_reference_barrier_Type(); + static const TypeFunc* write_ref_field_pre_Type(); + static const TypeFunc* clone_barrier_Type(); + static const TypeFunc* load_reference_barrier_Type(); virtual bool has_load_barrier_nodes() const { return true; } // This is the entry-point for the backend to perform accesses through the Access API. diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp index 7526f895f2f7f..efa0ced603cda 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp @@ -995,7 +995,7 @@ void ShenandoahBarrierC2Support::call_lrb_stub(Node*& ctrl, Node*& val, Node* lo name = "load_reference_barrier_phantom"; } } - Node* call = new CallLeafNode(ShenandoahBarrierSetC2::shenandoah_load_reference_barrier_Type(), calladdr, name, TypeRawPtr::BOTTOM); + Node* call = new CallLeafNode(ShenandoahBarrierSetC2::load_reference_barrier_Type(), calladdr, name, TypeRawPtr::BOTTOM); call->init_req(TypeFunc::Control, ctrl); call->init_req(TypeFunc::I_O, phase->C->top()); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp index 2c727de585799..b217c641824c2 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp @@ -31,22 +31,19 @@ #include "oops/oop.inline.hpp" #include "utilities/copy.hpp" -void ShenandoahRuntime::arraycopy_barrier_oop_entry(oop* src, oop* dst, size_t length) { - ShenandoahBarrierSet *bs = ShenandoahBarrierSet::barrier_set(); - bs->arraycopy_barrier(src, dst, length); -} +JRT_LEAF(void, ShenandoahRuntime::arraycopy_barrier_oop(oop* src, oop* dst, size_t length)) + ShenandoahBarrierSet::barrier_set()->arraycopy_barrier(src, dst, length); +JRT_END -void ShenandoahRuntime::arraycopy_barrier_narrow_oop_entry(narrowOop* src, narrowOop* dst, size_t length) { - ShenandoahBarrierSet *bs = ShenandoahBarrierSet::barrier_set(); - bs->arraycopy_barrier(src, dst, length); -} +JRT_LEAF(void, ShenandoahRuntime::arraycopy_barrier_narrow_oop(narrowOop* src, narrowOop* dst, size_t length)) + ShenandoahBarrierSet::barrier_set()->arraycopy_barrier(src, dst, length); +JRT_END -// Shenandoah pre write barrier slowpath -JRT_LEAF(void, ShenandoahRuntime::write_ref_field_pre_entry(oopDesc* orig, JavaThread *thread)) +JRT_LEAF(void, ShenandoahRuntime::write_ref_field_pre(oopDesc * orig, JavaThread * thread)) assert(thread == JavaThread::current(), "pre-condition"); assert(orig != nullptr, "should be optimized out"); shenandoah_assert_correct(nullptr, orig); - // store the original value that was in the field reference + // Capture the original value that was in the field reference. assert(ShenandoahThreadLocalData::satb_mark_queue(thread).is_active(), "Shouldn't be here otherwise"); SATBMarkQueue& queue = ShenandoahThreadLocalData::satb_mark_queue(thread); ShenandoahBarrierSet::satb_mark_queue_set().enqueue_known_active(queue, orig); @@ -60,26 +57,24 @@ JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_strong_narrow(oopDe return ShenandoahBarrierSet::barrier_set()->load_reference_barrier_mutator(src, load_addr); JRT_END -// Shenandoah clone barrier: makes sure that references point to to-space -// in cloned objects. -JRT_LEAF(void, ShenandoahRuntime::shenandoah_clone_barrier(oopDesc* src)) - oop s = oop(src); - shenandoah_assert_correct(nullptr, s); - ShenandoahBarrierSet::barrier_set()->clone_barrier(s); -JRT_END - -JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_weak(oopDesc * src, oop* load_addr)) +JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_weak(oopDesc* src, oop* load_addr)) return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier(ON_WEAK_OOP_REF, oop(src), load_addr); JRT_END -JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_weak_narrow(oopDesc * src, narrowOop* load_addr)) +JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_weak_narrow(oopDesc* src, narrowOop* load_addr)) return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier(ON_WEAK_OOP_REF, oop(src), load_addr); JRT_END -JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_phantom(oopDesc * src, oop* load_addr)) +JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_phantom(oopDesc* src, oop* load_addr)) return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier(ON_PHANTOM_OOP_REF, oop(src), load_addr); JRT_END -JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_phantom_narrow(oopDesc * src, narrowOop* load_addr)) +JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_phantom_narrow(oopDesc* src, narrowOop* load_addr)) return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier(ON_PHANTOM_OOP_REF, oop(src), load_addr); JRT_END + +JRT_LEAF(void, ShenandoahRuntime::clone_barrier(oopDesc* src)) + oop s = oop(src); + shenandoah_assert_correct(nullptr, s); + ShenandoahBarrierSet::barrier_set()->clone_barrier(s); +JRT_END diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp index e187e4360b16b..4ad8fc997ea76 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp @@ -33,10 +33,10 @@ class oopDesc; class ShenandoahRuntime : public AllStatic { public: - static void arraycopy_barrier_oop_entry(oop* src, oop* dst, size_t length); - static void arraycopy_barrier_narrow_oop_entry(narrowOop* src, narrowOop* dst, size_t length); + static void arraycopy_barrier_oop(oop* src, oop* dst, size_t length); + static void arraycopy_barrier_narrow_oop(narrowOop* src, narrowOop* dst, size_t length); - static void write_ref_field_pre_entry(oopDesc* orig, JavaThread* thread); + static void write_ref_field_pre(oopDesc* orig, JavaThread* thread); static oopDesc* load_reference_barrier_strong(oopDesc* src, oop* load_addr); static oopDesc* load_reference_barrier_strong_narrow(oopDesc* src, narrowOop* load_addr); @@ -47,7 +47,7 @@ class ShenandoahRuntime : public AllStatic { static oopDesc* load_reference_barrier_phantom(oopDesc* src, oop* load_addr); static oopDesc* load_reference_barrier_phantom_narrow(oopDesc* src, narrowOop* load_addr); - static void shenandoah_clone_barrier(oopDesc* src); + static void clone_barrier(oopDesc* src); }; #endif // SHARE_GC_SHENANDOAH_SHENANDOAHRUNTIME_HPP From 52ba72823be0c969ab873ead2863ec48f883210b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20L=C3=B6vdahl?= Date: Mon, 30 Sep 2024 08:33:12 +0000 Subject: [PATCH 236/307] 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) Co-authored-by: Larry Cable Reviewed-by: kevinw, sgehwolf --- .../sun/tools/attach/VirtualMachineImpl.java | 150 +++++++++++++----- .../docker/TestJcmdWithSideCar.java | 135 +++++++++++----- 2 files changed, 210 insertions(+), 75 deletions(-) diff --git a/src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java b/src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java index 4eb29482e29ec..35ce808c18756 100644 --- a/src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java +++ b/src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java @@ -28,12 +28,13 @@ import com.sun.tools.attach.AttachNotSupportedException; import com.sun.tools.attach.spi.AttachProvider; -import java.io.InputStream; -import java.io.IOException; import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.nio.file.Files; +import java.util.Optional; import static java.nio.charset.StandardCharsets.UTF_8; @@ -47,13 +48,35 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine { // location is the same for all processes, otherwise the tools // will not be able to find all Hotspot processes. // Any changes to this needs to be synchronized with HotSpot. - private static final String tmpdir = "/tmp"; + private static final Path TMPDIR = Path.of("/tmp"); + + private static final Path PROC = Path.of("/proc"); + private static final Path NS_MNT = Path.of("ns/mnt"); + private static final Path NS_PID = Path.of("ns/pid"); + private static final Path SELF = PROC.resolve("self"); + private static final Path STATUS = Path.of("status"); + private static final Path ROOT_TMP = Path.of("root/tmp"); + + private static final Optional SELF_MNT_NS; + + static { + Path nsPath = null; + + try { + nsPath = Files.readSymbolicLink(SELF.resolve(NS_MNT)); + } catch (IOException _) { + // do nothing + } finally { + SELF_MNT_NS = Optional.ofNullable(nsPath); + } + } + String socket_path; + /** * Attaches to the target VM */ - VirtualMachineImpl(AttachProvider provider, String vmid) - throws AttachNotSupportedException, IOException + VirtualMachineImpl(AttachProvider provider, String vmid) throws AttachNotSupportedException, IOException { super(provider, vmid); @@ -64,12 +87,12 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine { } // Try to resolve to the "inner most" pid namespace - int ns_pid = getNamespacePid(pid); + final long ns_pid = getNamespacePid(pid); // Find the socket file. If not found then we attempt to start the // attach mechanism in the target VM by sending it a QUIT signal. // Then we attempt to find the socket file again. - File socket_file = findSocketFile(pid, ns_pid); + final File socket_file = findSocketFile(pid, ns_pid); socket_path = socket_file.getPath(); if (!socket_file.exists()) { // Keep canonical version of File, to delete, in case target process ends and /proc link has gone: @@ -211,49 +234,102 @@ protected void close(long fd) throws IOException { } // Return the socket file for the given process. - private File findSocketFile(int pid, int ns_pid) throws IOException { - String root = findTargetProcessTmpDirectory(pid, ns_pid); - return new File(root, ".java_pid" + ns_pid); + private File findSocketFile(long pid, long ns_pid) throws AttachNotSupportedException, IOException { + return new File(findTargetProcessTmpDirectory(pid, ns_pid), ".java_pid" + ns_pid); } // On Linux a simple handshake is used to start the attach mechanism // if not already started. The client creates a .attach_pid file in the // target VM's working directory (or temp directory), and the SIGQUIT handler // checks for the file. - private File createAttachFile(int pid, int ns_pid) throws IOException { - String fn = ".attach_pid" + ns_pid; - String path = "/proc/" + pid + "/cwd/" + fn; - File f = new File(path); + private File createAttachFile(long pid, long ns_pid) throws AttachNotSupportedException, IOException { + Path fn = Path.of(".attach_pid" + ns_pid); + Path path = PROC.resolve(Path.of(Long.toString(pid), "cwd")).resolve(fn); + File f = new File(path.toString()); try { // Do not canonicalize the file path, or we will fail to attach to a VM in a container. f.createNewFile(); - } catch (IOException x) { - String root = findTargetProcessTmpDirectory(pid, ns_pid); - f = new File(root, fn); + } catch (IOException _) { + f = new File(findTargetProcessTmpDirectory(pid, ns_pid), fn.toString()); f.createNewFile(); } return f; } - private String findTargetProcessTmpDirectory(int pid, int ns_pid) throws IOException { - String root; - if (pid != ns_pid) { - // A process may not exist in the same mount namespace as the caller, e.g. - // if we are trying to attach to a JVM process inside a container. - // Instead, attach relative to the target root filesystem as exposed by - // procfs regardless of namespaces. - String procRootDirectory = "/proc/" + pid + "/root"; - if (!Files.isReadable(Path.of(procRootDirectory))) { - throw new IOException( - String.format("Unable to access root directory %s " + - "of target process %d", procRootDirectory, pid)); + private String findTargetProcessTmpDirectory(long pid, long ns_pid) throws AttachNotSupportedException, IOException { + // We need to handle at least 4 different cases: + // 1. Caller and target processes share PID namespace and root filesystem (host to host or container to + // container with both /tmp mounted between containers). + // 2. Caller and target processes share PID namespace and root filesystem but the target process has elevated + // privileges (host to host). + // 3. Caller and target processes share PID namespace but NOT root filesystem (container to container). + // 4. Caller and target processes share neither PID namespace nor root filesystem (host to container). + + Optional target = ProcessHandle.of(pid); + Optional ph = target; + long nsPid = ns_pid; + Optional prevPidNS = Optional.empty(); + + while (ph.isPresent()) { + final var curPid = ph.get().pid(); + final var procPidPath = PROC.resolve(Long.toString(curPid)); + Optional targetMountNS = Optional.empty(); + + try { + // attempt to read the target's mnt ns id + targetMountNS = Optional.ofNullable(Files.readSymbolicLink(procPidPath.resolve(NS_MNT))); + } catch (IOException _) { + // if we fail to read the target's mnt ns id then we either don't have access or it no longer exists! + if (!Files.exists(procPidPath)) { + throw new IOException(String.format("unable to attach, %s non-existent! process: %d terminated", procPidPath, pid)); + } + // the process still exists, but we don't have privileges to read its procfs } - root = procRootDirectory + "/" + tmpdir; + final var sameMountNS = SELF_MNT_NS.isPresent() && SELF_MNT_NS.equals(targetMountNS); + + if (sameMountNS) { + return TMPDIR.toString(); // we share TMPDIR in common! + } else { + // we could not read the target's mnt ns + final var procPidRootTmp = procPidPath.resolve(ROOT_TMP); + if (Files.isReadable(procPidRootTmp)) { + return procPidRootTmp.toString(); // not in the same mnt ns but tmp is accessible via /proc + } + } + + // let's attempt to obtain the pid ns, best efforts to avoid crossing pid ns boundaries (as with a container) + Optional curPidNS = Optional.empty(); + + try { + // attempt to read the target's pid ns id + curPidNS = Optional.ofNullable(Files.readSymbolicLink(procPidPath.resolve(NS_PID))); + } catch (IOException _) { + // if we fail to read the target's pid ns id then we either don't have access or it no longer exists! + if (!Files.exists(procPidPath)) { + throw new IOException(String.format("unable to attach, %s non-existent! process: %d terminated", procPidPath, pid)); + } + // the process still exists, but we don't have privileges to read its procfs + } + + // recurse "up" the process hierarchy if appropriate. PID 1 cannot have a parent in the same namespace + final var havePidNSes = prevPidNS.isPresent() && curPidNS.isPresent(); + final var ppid = ph.get().parent(); + + if (ppid.isPresent() && (havePidNSes && curPidNS.equals(prevPidNS)) || (!havePidNSes && nsPid > 1)) { + ph = ppid; + nsPid = getNamespacePid(ph.get().pid()); // get the ns pid of the parent + prevPidNS = curPidNS; + } else { + ph = Optional.empty(); + } + } + + if (target.orElseThrow(AttachNotSupportedException::new).isAlive()) { + return TMPDIR.toString(); // fallback... } else { - root = tmpdir; + throw new IOException(String.format("unable to attach, process: %d terminated", pid)); } - return root; } /* @@ -270,13 +346,12 @@ private void writeString(int fd, String s) throws IOException { write(fd, b, 0, 1); } - // Return the inner most namespaced PID if there is one, // otherwise return the original PID. - private int getNamespacePid(int pid) throws AttachNotSupportedException, IOException { + private long getNamespacePid(long pid) throws AttachNotSupportedException, IOException { // Assuming a real procfs sits beneath, reading this doesn't block // nor will it consume a lot of memory. - String statusFile = "/proc/" + pid + "/status"; + final var statusFile = PROC.resolve(Long.toString(pid)).resolve(STATUS).toString(); File f = new File(statusFile); if (!f.exists()) { return pid; // Likely a bad pid, but this is properly handled later. @@ -292,8 +367,7 @@ private int getNamespacePid(int pid) throws AttachNotSupportedException, IOExcep // The last entry represents the PID the JVM "thinks" it is. // Even in non-namespaced pids these entries should be // valid. You could refer to it as the inner most pid. - int ns_pid = Integer.parseInt(parts[parts.length - 1]); - return ns_pid; + return Long.parseLong(parts[parts.length - 1]); } } // Old kernels may not have NSpid field (i.e. 3.10). diff --git a/test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java b/test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java index 0aa16e8479bd2..2088398834702 100644 --- a/test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java +++ b/test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java @@ -38,12 +38,19 @@ * @build EventGeneratorLoop * @run driver TestJcmdWithSideCar */ +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; import java.nio.file.Paths; import java.util.Arrays; import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumSet; import java.util.List; +import java.util.Optional; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; +import java.util.regex.Pattern; import java.util.stream.Collectors; import jdk.test.lib.Container; import jdk.test.lib.Utils; @@ -60,6 +67,31 @@ public class TestJcmdWithSideCar { private static final long TIME_TO_WAIT_FOR_MAIN_METHOD_START = 50 * 1000; // milliseconds private static final String MAIN_CONTAINER_NAME = "test-container-main"; + private static final String UID = "uid"; + private static final String GID = "gid"; + + private static final Pattern ID_PATTERN = Pattern.compile("uid=(?<" + UID + ">\\d+)\\([^\\)]+\\)\\s+gid=(?<" + GID + ">\\d+).*"); + + private static final Optional USER = ProcessHandle.current().info().user().map( + user -> { + try (var br = new BufferedReader(new InputStreamReader(new ProcessBuilder("id", user).start().getInputStream()))) { + for (final var line : br.lines().toList()) { + final var m = ID_PATTERN.matcher(line); + + if (m.matches()) { + return "--user=" + m.group(UID) + ":" + m.group(GID); + } + } + } catch (IOException e) { + // do nothing... + } + + return null; + } + ); + + private static final String NET_BIND_SERVICE = "--cap-add=NET_BIND_SERVICE"; + public static void main(String[] args) throws Exception { if (!DockerTestUtils.canTestDocker()) { return; @@ -68,24 +100,28 @@ public static void main(String[] args) throws Exception { DockerTestUtils.buildJdkContainerImage(IMAGE_NAME); try { - // Start the loop process in the "main" container, then run test cases - // using a sidecar container. - MainContainer mainContainer = new MainContainer(); - mainContainer.start(); - mainContainer.waitForMainMethodStart(TIME_TO_WAIT_FOR_MAIN_METHOD_START); - - long mainProcPid = testCase01(); - - // Excluding the test case below until JDK-8228850 is fixed - // JDK-8228850: jhsdb jinfo fails with ClassCastException: - // s.j.h.oops.TypeArray cannot be cast to s.j.h.oops.Instance - // mainContainer.assertIsAlive(); - // testCase02(mainProcPid); - - mainContainer.assertIsAlive(); - testCase03(mainProcPid); + for (final boolean elevated : USER.isPresent() ? new Boolean[] { false, true } : new Boolean[] { false }) { + // Start the loop process in the "main" container, then run test cases + // using a sidecar container. + MainContainer mainContainer = new MainContainer(); + mainContainer.start(elevated); + mainContainer.waitForMainMethodStart(TIME_TO_WAIT_FOR_MAIN_METHOD_START); + + for (AttachStrategy attachStrategy : EnumSet.allOf(AttachStrategy.class)) { + long mainProcPid = testCase01(attachStrategy, elevated); + + // Excluding the test case below until JDK-8228850 is fixed + // JDK-8228850: jhsdb jinfo fails with ClassCastException: + // s.j.h.oops.TypeArray cannot be cast to s.j.h.oops.Instance + // mainContainer.assertIsAlive(); + // testCase02(mainProcPid, attachStrategy, elevated); + + mainContainer.assertIsAlive(); + testCase03(mainProcPid, attachStrategy, elevated); + } - mainContainer.waitForAndCheck(TIME_TO_RUN_MAIN_PROCESS * 1000); + mainContainer.waitForAndCheck(TIME_TO_RUN_MAIN_PROCESS * 1000); + } } finally { DockerTestUtils.removeDockerImage(IMAGE_NAME); } @@ -93,21 +129,21 @@ public static void main(String[] args) throws Exception { // Run "jcmd -l" in a sidecar container, find a target process. - private static long testCase01() throws Exception { - OutputAnalyzer out = runSideCar(MAIN_CONTAINER_NAME, "/jdk/bin/jcmd", "-l") + private static long testCase01(AttachStrategy attachStrategy, boolean elevated) throws Exception { + OutputAnalyzer out = runSideCar(MAIN_CONTAINER_NAME, attachStrategy, elevated, "/jdk/bin/jcmd", "-l") .shouldHaveExitValue(0) .shouldContain("sun.tools.jcmd.JCmd"); long pid = findProcess(out, "EventGeneratorLoop"); if (pid == -1) { - throw new RuntimeException("Could not find specified process"); + throw new RuntimeException(attachStrategy + ": Could not find specified process"); } return pid; } // run jhsdb jinfo (jhsdb uses PTRACE) - private static void testCase02(long pid) throws Exception { - runSideCar(MAIN_CONTAINER_NAME, "/jdk/bin/jhsdb", "jinfo", "--pid", "" + pid) + private static void testCase02(long pid, AttachStrategy attachStrategy, boolean elevated) throws Exception { + runSideCar(MAIN_CONTAINER_NAME, attachStrategy, elevated, "/jdk/bin/jhsdb", "jinfo", "--pid", "" + pid) .shouldHaveExitValue(0) .shouldContain("Java System Properties") .shouldContain("VM Flags"); @@ -115,11 +151,11 @@ private static void testCase02(long pid) throws Exception { // test jcmd with some commands (help, start JFR recording) // JCMD will use signal mechanism and Unix Socket - private static void testCase03(long pid) throws Exception { - runSideCar(MAIN_CONTAINER_NAME, "/jdk/bin/jcmd", "" + pid, "help") + private static void testCase03(long pid, AttachStrategy attachStrategy, boolean elevated) throws Exception { + runSideCar(MAIN_CONTAINER_NAME, attachStrategy, elevated, "/jdk/bin/jcmd", "" + pid, "help") .shouldHaveExitValue(0) .shouldContain("VM.version"); - runSideCar(MAIN_CONTAINER_NAME, "/jdk/bin/jcmd", "" + pid, "JFR.start") + runSideCar(MAIN_CONTAINER_NAME, attachStrategy, elevated, "/jdk/bin/jcmd", "" + pid, "JFR.start") .shouldHaveExitValue(0) .shouldContain("Started recording"); } @@ -127,21 +163,36 @@ private static void testCase03(long pid) throws Exception { // JCMD relies on the attach mechanism (com.sun.tools.attach), // which in turn relies on JVMSTAT mechanism, which puts its mapped - // buffers in /tmp directory (hsperfdata_). Thus, in sidecar - // we mount /tmp via --volumes-from from the main container. - private static OutputAnalyzer runSideCar(String mainContainerName, String whatToRun, - String... args) throws Exception { - List cmd = new ArrayList<>(); - String[] command = new String[] { + // buffers in /tmp directory (hsperfdata_). Thus, in the sidecar + // we have two options: + // 1. mount /tmp from the main container using --volumes-from. + // 2. access /tmp from the main container via /proc//root/tmp. + private static OutputAnalyzer runSideCar(String mainContainerName, AttachStrategy attachStrategy, boolean elevated, String whatToRun, String... args) throws Exception { + System.out.println("Attach strategy " + attachStrategy); + + List initialCommands = List.of( Container.ENGINE_COMMAND, "run", "--tty=true", "--rm", "--cap-add=SYS_PTRACE", "--sig-proxy=true", - "--pid=container:" + mainContainerName, - "--volumes-from", mainContainerName, - IMAGE_NAME, whatToRun + "--pid=container:" + mainContainerName + ); + + List attachStrategyCommands = switch (attachStrategy) { + case TMP_MOUNTED_INTO_SIDECAR -> List.of("--volumes-from", mainContainerName); + case ACCESS_TMP_VIA_PROC_ROOT -> List.of(); }; - cmd.addAll(Arrays.asList(command)); + List elevatedOpts = elevated && USER.isPresent() ? List.of(NET_BIND_SERVICE, USER.get()) : Collections.emptyList(); + + List imageAndCommand = List.of( + IMAGE_NAME, whatToRun + ); + + List cmd = new ArrayList<>(); + cmd.addAll(initialCommands); + cmd.addAll(elevatedOpts); + cmd.addAll(attachStrategyCommands); + cmd.addAll(imageAndCommand); cmd.addAll(Arrays.asList(args)); return DockerTestUtils.execute(cmd); } @@ -188,9 +239,15 @@ static class MainContainer { } }; - public Process start() throws Exception { + public Process start(final boolean elevated) throws Exception { // start "main" container (the observee) DockerRunOptions opts = commonDockerOpts("EventGeneratorLoop"); + + if (elevated && USER.isPresent()) { + opts.addDockerOpts(USER.get()); + opts.addDockerOpts(NET_BIND_SERVICE); + } + opts.addDockerOpts("--cap-add=SYS_PTRACE") .addDockerOpts("--name", MAIN_CONTAINER_NAME) .addDockerOpts("--volume", "/tmp") @@ -241,7 +298,7 @@ public void waitForAndCheck(long timeout) throws Exception { try { exitValue = p.exitValue(); } catch(IllegalThreadStateException ex) { - System.out.println("IllegalThreadStateException occured when calling exitValue()"); + System.out.println("IllegalThreadStateException occurred when calling exitValue()"); retryCount--; } } while (exitValue == -1 && retryCount > 0); @@ -253,4 +310,8 @@ public void waitForAndCheck(long timeout) throws Exception { } + private enum AttachStrategy { + TMP_MOUNTED_INTO_SIDECAR, + ACCESS_TMP_VIA_PROC_ROOT + } } From 475b8943c672349609a4839ce0a02ef995764698 Mon Sep 17 00:00:00 2001 From: Mikhail Ablakatov <164922675+mikabl-arm@users.noreply.github.com> Date: Mon, 30 Sep 2024 09:02:59 +0000 Subject: [PATCH 237/307] 8322770: Implement C2 VectorizedHashCode on AArch64 Reviewed-by: aph, adinn --- src/hotspot/cpu/aarch64/aarch64.ad | 78 ++ src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 68 +- .../cpu/aarch64/c2_MacroAssembler_aarch64.cpp | 91 ++ .../cpu/aarch64/c2_MacroAssembler_aarch64.hpp | 3 + .../cpu/aarch64/stubGenerator_aarch64.cpp | 312 +++++ .../cpu/aarch64/stubRoutines_aarch64.cpp | 7 +- .../cpu/aarch64/stubRoutines_aarch64.hpp | 26 +- .../cpu/aarch64/vm_version_aarch64.cpp | 4 + src/hotspot/share/utilities/intpow.hpp | 46 + test/hotspot/gtest/aarch64/aarch64-asmtest.py | 111 ++ test/hotspot/gtest/aarch64/asmtest.out.h | 1189 +++++++++-------- 11 files changed, 1355 insertions(+), 580 deletions(-) create mode 100644 src/hotspot/share/utilities/intpow.hpp diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 39eae43a287e7..0a93c27c2686b 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -4931,6 +4931,60 @@ operand vRegD_V7() interface(REG_INTER); %} +operand vRegD_V12() +%{ + constraint(ALLOC_IN_RC(v12_reg)); + match(RegD); + op_cost(0); + format %{ %} + interface(REG_INTER); +%} + +operand vRegD_V13() +%{ + constraint(ALLOC_IN_RC(v13_reg)); + match(RegD); + op_cost(0); + format %{ %} + interface(REG_INTER); +%} + +operand vRegD_V14() +%{ + constraint(ALLOC_IN_RC(v14_reg)); + match(RegD); + op_cost(0); + format %{ %} + interface(REG_INTER); +%} + +operand vRegD_V15() +%{ + constraint(ALLOC_IN_RC(v15_reg)); + match(RegD); + op_cost(0); + format %{ %} + interface(REG_INTER); +%} + +operand vRegD_V16() +%{ + constraint(ALLOC_IN_RC(v16_reg)); + match(RegD); + op_cost(0); + format %{ %} + interface(REG_INTER); +%} + +operand vRegD_V17() +%{ + constraint(ALLOC_IN_RC(v17_reg)); + match(RegD); + op_cost(0); + format %{ %} + interface(REG_INTER); +%} + operand pReg() %{ constraint(ALLOC_IN_RC(pr_reg)); @@ -16551,6 +16605,30 @@ instruct array_equalsC(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, ins_pipe(pipe_class_memory); %} +instruct arrays_hashcode(iRegP_R1 ary, iRegI_R2 cnt, iRegI_R0 result, immI basic_type, + vRegD_V0 vtmp0, vRegD_V1 vtmp1, vRegD_V2 vtmp2, vRegD_V3 vtmp3, + vRegD_V4 vtmp4, vRegD_V5 vtmp5, vRegD_V6 vtmp6, vRegD_V7 vtmp7, + vRegD_V12 vtmp8, vRegD_V13 vtmp9, vRegD_V14 vtmp10, + vRegD_V15 vtmp11, vRegD_V16 vtmp12, vRegD_V17 vtmp13, + rFlagsReg cr) +%{ + match(Set result (VectorizedHashCode (Binary ary cnt) (Binary result basic_type))); + effect(TEMP vtmp0, TEMP vtmp1, TEMP vtmp2, TEMP vtmp3, TEMP vtmp4, TEMP vtmp5, TEMP vtmp6, + TEMP vtmp7, TEMP vtmp8, TEMP vtmp9, TEMP vtmp10, TEMP vtmp11, TEMP vtmp12, TEMP vtmp13, + USE_KILL ary, USE_KILL cnt, USE basic_type, KILL cr); + + format %{ "Array HashCode array[] $ary,$cnt,$result,$basic_type -> $result // KILL all" %} + ins_encode %{ + address tpc = __ arrays_hashcode($ary$$Register, $cnt$$Register, $result$$Register, + (BasicType)$basic_type$$constant); + if (tpc == nullptr) { + ciEnv::current()->record_failure("CodeCache is full"); + return; + } + %} + ins_pipe(pipe_class_memory); +%} + instruct count_positives(iRegP_R1 ary1, iRegI_R2 len, iRegI_R0 result, rFlagsReg cr) %{ match(Set result (CountPositives ary1 len)); diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index 28a0cc2c7d940..a5e0e2665af92 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.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. * Copyright (c) 2014, 2024, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -287,6 +287,11 @@ class Instruction_aarch64 { f(r->raw_encoding(), lsb + 4, lsb); } + //<0-15>reg: As `rf(FloatRegister)`, but only the lower 16 FloatRegisters are allowed. + void lrf(FloatRegister r, int lsb) { + f(r->raw_encoding(), lsb + 3, lsb); + } + void prf(PRegister r, int lsb) { f(r->raw_encoding(), lsb + 3, lsb); } @@ -765,6 +770,7 @@ class Assembler : public AbstractAssembler { #define f current_insn.f #define sf current_insn.sf #define rf current_insn.rf +#define lrf current_insn.lrf #define srf current_insn.srf #define zrf current_insn.zrf #define prf current_insn.prf @@ -1590,6 +1596,16 @@ class Assembler : public AbstractAssembler { #undef INSN + // Load/store a register, but with a BasicType parameter. Loaded signed integer values are + // extended to 64 bits. + void load(Register Rt, const Address &adr, BasicType bt) { + int op = (is_signed_subword_type(bt) || bt == T_INT) ? 0b10 : 0b01; + ld_st2(Rt, adr, exact_log2(type2aelembytes(bt)), op); + } + void store(Register Rt, const Address &adr, BasicType bt) { + ld_st2(Rt, adr, exact_log2(type2aelembytes(bt)), 0b00); + } + /* SIMD extensions * * We just use FloatRegister in the following. They are exactly the same @@ -2587,6 +2603,7 @@ template INSN(addpv, 0, 0b101111, true); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D INSN(smullv, 0, 0b110000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S INSN(umullv, 1, 0b110000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S + INSN(smlalv, 0, 0b100000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S INSN(umlalv, 1, 0b100000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S INSN(maxv, 0, 0b011001, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S INSN(minv, 0, 0b011011, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S @@ -2860,6 +2877,28 @@ template // FMULX - Vector - Scalar INSN(fmulxvs, 1, 0b1001); +#undef INSN + +#define INSN(NAME, op1, op2) \ + void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm, int index) { \ + starti; \ + assert(T == T4H || T == T8H || T == T2S || T == T4S, "invalid arrangement"); \ + assert(index >= 0 && \ + ((T == T2S && index <= 1) || (T != T2S && index <= 3) || (T == T8H && index <= 7)), \ + "invalid index"); \ + assert((T != T4H && T != T8H) || Vm->encoding() < 16, "invalid source SIMD&FP register"); \ + f(0, 31), f((int)T & 1, 30), f(op1, 29), f(0b01111, 28, 24); \ + if (T == T4H || T == T8H) { \ + f(0b01, 23, 22), f(index & 0b11, 21, 20), lrf(Vm, 16), f(index >> 2 & 1, 11); \ + } else { \ + f(0b10, 23, 22), f(index & 1, 21), rf(Vm, 16), f(index >> 1, 11); \ + } \ + f(op2, 15, 12), f(0, 10), rf(Vn, 5), rf(Vd, 0); \ + } + + // MUL - Vector - Scalar + INSN(mulvs, 0, 0b1000); + #undef INSN // Floating-point Reciprocal Estimate @@ -3023,6 +3062,33 @@ template umov(Xd, Vn, T, index); } + protected: + void _xaddwv(bool is_unsigned, FloatRegister Vd, FloatRegister Vn, SIMD_Arrangement Ta, + FloatRegister Vm, SIMD_Arrangement Tb) { + starti; + assert((Tb >> 1) + 1 == (Ta >> 1), "Incompatible arrangement"); + f(0, 31), f((int)Tb & 1, 30), f(is_unsigned ? 1 : 0, 29), f(0b01110, 28, 24); + f((int)(Ta >> 1) - 1, 23, 22), f(1, 21), rf(Vm, 16), f(0b000100, 15, 10), rf(Vn, 5), rf(Vd, 0); + } + + public: +#define INSN(NAME, assertion, is_unsigned) \ + void NAME(FloatRegister Vd, FloatRegister Vn, SIMD_Arrangement Ta, FloatRegister Vm, \ + SIMD_Arrangement Tb) { \ + assert((assertion), "invalid arrangement"); \ + _xaddwv(is_unsigned, Vd, Vn, Ta, Vm, Tb); \ + } + +public: + + INSN(uaddwv, Tb == T8B || Tb == T4H || Tb == T2S, /*is_unsigned*/true) + INSN(uaddwv2, Tb == T16B || Tb == T8H || Tb == T4S, /*is_unsigned*/true) + INSN(saddwv, Tb == T8B || Tb == T4H || Tb == T2S, /*is_unsigned*/false) + INSN(saddwv2, Tb == T16B || Tb == T8H || Tb == T4S, /*is_unsigned*/false) + +#undef INSN + + private: void _pmull(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) { starti; diff --git a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp index b4c12ecd4a849..ab2bd7d782c04 100644 --- a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp @@ -33,6 +33,7 @@ #include "opto/subnode.hpp" #include "runtime/stubRoutines.hpp" #include "utilities/globalDefinitions.hpp" +#include "utilities/powerOfTwo.hpp" #ifdef PRODUCT #define BLOCK_COMMENT(str) /* nothing */ @@ -46,6 +47,96 @@ typedef void (MacroAssembler::* chr_insn)(Register Rt, const Address &adr); +// jdk.internal.util.ArraysSupport.vectorizedHashCode +address C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register result, + BasicType eltype) { + assert_different_registers(ary, cnt, result, rscratch1, rscratch2); + + Register tmp1 = rscratch1, tmp2 = rscratch2; + + Label TAIL, STUB_SWITCH, STUB_SWITCH_OUT, LOOP, BR_BASE, LARGE, DONE; + + // Vectorization factor. Number of array elements loaded to one SIMD&FP registers by the stubs. We + // use 8H load arrangements for chars and shorts and 8B for booleans and bytes. It's possible to + // use 4H for chars and shorts instead, but using 8H gives better performance. + const size_t vf = eltype == T_BOOLEAN || eltype == T_BYTE ? 8 + : eltype == T_CHAR || eltype == T_SHORT ? 8 + : eltype == T_INT ? 4 + : 0; + guarantee(vf, "unsupported eltype"); + + // Unroll factor for the scalar loop below. The value is chosen based on performance analysis. + const size_t unroll_factor = 4; + + switch (eltype) { + case T_BOOLEAN: + BLOCK_COMMENT("arrays_hashcode(unsigned byte) {"); + break; + case T_CHAR: + BLOCK_COMMENT("arrays_hashcode(char) {"); + break; + case T_BYTE: + BLOCK_COMMENT("arrays_hashcode(byte) {"); + break; + case T_SHORT: + BLOCK_COMMENT("arrays_hashcode(short) {"); + break; + case T_INT: + BLOCK_COMMENT("arrays_hashcode(int) {"); + break; + default: + ShouldNotReachHere(); + } + + // large_arrays_hashcode(T_INT) performs worse than the scalar loop below when the Neon loop + // implemented by the stub executes just once. Call the stub only if at least two iterations will + // be executed. + const size_t large_threshold = eltype == T_INT ? vf * 2 : vf; + cmpw(cnt, large_threshold); + br(Assembler::HS, LARGE); + + bind(TAIL); + + // The andr performs cnt % uf where uf = unroll_factor. The subtract shifted by 3 offsets past + // uf - (cnt % uf) pairs of load + madd insns i.e. it only executes cnt % uf load + madd pairs. + // Iteration eats up the remainder, uf elements at a time. + assert(is_power_of_2(unroll_factor), "can't use this value to calculate the jump target PC"); + andr(tmp2, cnt, unroll_factor - 1); + adr(tmp1, BR_BASE); + sub(tmp1, tmp1, tmp2, ext::sxtw, 3); + movw(tmp2, 0x1f); + br(tmp1); + + bind(LOOP); + for (size_t i = 0; i < unroll_factor; ++i) { + load(tmp1, Address(post(ary, type2aelembytes(eltype))), eltype); + maddw(result, result, tmp2, tmp1); + } + bind(BR_BASE); + subsw(cnt, cnt, unroll_factor); + br(Assembler::HS, LOOP); + + b(DONE); + + bind(LARGE); + + RuntimeAddress stub = RuntimeAddress(StubRoutines::aarch64::large_arrays_hashcode(eltype)); + assert(stub.target() != nullptr, "array_hashcode stub has not been generated"); + address tpc = trampoline_call(stub); + if (tpc == nullptr) { + DEBUG_ONLY(reset_labels(TAIL, BR_BASE)); + postcond(pc() == badAddress); + return nullptr; + } + + bind(DONE); + + BLOCK_COMMENT("} // arrays_hashcode"); + + postcond(pc() != badAddress); + return pc(); +} + void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg, Register tmpReg, Register tmp2Reg, Register tmp3Reg) { Register oop = objectReg; diff --git a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp index 43e60ae5a48f8..28cc401a1b2c8 100644 --- a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp @@ -35,6 +35,9 @@ enum shift_kind kind = Assembler::LSL, unsigned shift = 0); public: + // jdk.internal.util.ArraysSupport.vectorizedHashCode + address arrays_hashcode(Register ary, Register cnt, Register result, BasicType eltype); + // Code used by cmpFastLock and cmpFastUnlock mach instructions in .ad file. void fast_lock(Register object, Register box, Register tmp, Register tmp2, Register tmp3); void fast_unlock(Register object, Register box, Register tmp, Register tmp2); diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index b3513a586de35..ac88b427459c0 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -53,7 +53,9 @@ #include "runtime/stubRoutines.hpp" #include "utilities/align.hpp" #include "utilities/checkedCast.hpp" +#include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" +#include "utilities/intpow.hpp" #include "utilities/powerOfTwo.hpp" #ifdef COMPILER2 #include "opto/runtime.hpp" @@ -5311,6 +5313,309 @@ class StubGenerator: public StubCodeGenerator { return entry; } + // result = r0 - return value. Contains initial hashcode value on entry. + // ary = r1 - array address + // cnt = r2 - elements count + // Clobbers: v0-v13, rscratch1, rscratch2 + address generate_large_arrays_hashcode(BasicType eltype) { + const Register result = r0, ary = r1, cnt = r2; + const FloatRegister vdata0 = v3, vdata1 = v2, vdata2 = v1, vdata3 = v0; + const FloatRegister vmul0 = v4, vmul1 = v5, vmul2 = v6, vmul3 = v7; + const FloatRegister vpow = v8; // powers of 31: <31^3, ..., 31^0> + const FloatRegister vpowm = v9; + + assert_different_registers(ary, cnt, result); + assert_different_registers(vdata0, vdata1, vdata2, vdata3, vmul0, vmul1, vmul2, vmul3, vpow, + vpowm); + + Label SMALL_LOOP, LARGE_LOOP_PREHEADER, LARGE_LOOP, TAIL, TAIL_SHORTCUT, BR_BASE; + + unsigned int vf; // vectorization factor + bool multiply_by_halves; + Assembler::SIMD_Arrangement load_arrangement; + switch (eltype) { + case T_BOOLEAN: + case T_BYTE: + load_arrangement = Assembler::T8B; + multiply_by_halves = true; + vf = 8; + break; + case T_CHAR: + case T_SHORT: + load_arrangement = Assembler::T8H; + multiply_by_halves = true; + vf = 8; + break; + case T_INT: + load_arrangement = Assembler::T4S; + multiply_by_halves = false; + vf = 4; + break; + default: + ShouldNotReachHere(); + } + + // Unroll factor + const unsigned uf = 4; + + // Effective vectorization factor + const unsigned evf = vf * uf; + + __ align(CodeEntryAlignment); + + const char *mark_name = ""; + switch (eltype) { + case T_BOOLEAN: + mark_name = "_large_arrays_hashcode_boolean"; + break; + case T_BYTE: + mark_name = "_large_arrays_hashcode_byte"; + break; + case T_CHAR: + mark_name = "_large_arrays_hashcode_char"; + break; + case T_SHORT: + mark_name = "_large_arrays_hashcode_short"; + break; + case T_INT: + mark_name = "_large_arrays_hashcode_int"; + break; + default: + mark_name = "_large_arrays_hashcode_incorrect_type"; + __ should_not_reach_here(); + }; + + StubCodeMark mark(this, "StubRoutines", mark_name); + + address entry = __ pc(); + __ enter(); + + // Put 0-3'th powers of 31 into a single SIMD register together. The register will be used in + // the SMALL and LARGE LOOPS' epilogues. The initialization is hoisted here and the register's + // value shouldn't change throughout both loops. + __ movw(rscratch1, intpow(31U, 3)); + __ mov(vpow, Assembler::S, 0, rscratch1); + __ movw(rscratch1, intpow(31U, 2)); + __ mov(vpow, Assembler::S, 1, rscratch1); + __ movw(rscratch1, intpow(31U, 1)); + __ mov(vpow, Assembler::S, 2, rscratch1); + __ movw(rscratch1, intpow(31U, 0)); + __ mov(vpow, Assembler::S, 3, rscratch1); + + __ mov(vmul0, Assembler::T16B, 0); + __ mov(vmul0, Assembler::S, 3, result); + + __ andr(rscratch2, cnt, (uf - 1) * vf); + __ cbz(rscratch2, LARGE_LOOP_PREHEADER); + + __ movw(rscratch1, intpow(31U, multiply_by_halves ? vf / 2 : vf)); + __ mov(vpowm, Assembler::S, 0, rscratch1); + + // SMALL LOOP + __ bind(SMALL_LOOP); + + __ ld1(vdata0, load_arrangement, Address(__ post(ary, vf * type2aelembytes(eltype)))); + __ mulvs(vmul0, Assembler::T4S, vmul0, vpowm, 0); + __ subsw(rscratch2, rscratch2, vf); + + if (load_arrangement == Assembler::T8B) { + // Extend 8B to 8H to be able to use vector multiply + // instructions + assert(load_arrangement == Assembler::T8B, "expected to extend 8B to 8H"); + if (is_signed_subword_type(eltype)) { + __ sxtl(vdata0, Assembler::T8H, vdata0, load_arrangement); + } else { + __ uxtl(vdata0, Assembler::T8H, vdata0, load_arrangement); + } + } + + switch (load_arrangement) { + case Assembler::T4S: + __ addv(vmul0, load_arrangement, vmul0, vdata0); + break; + case Assembler::T8B: + case Assembler::T8H: + assert(is_subword_type(eltype), "subword type expected"); + if (is_signed_subword_type(eltype)) { + __ saddwv(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T4H); + } else { + __ uaddwv(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T4H); + } + break; + default: + __ should_not_reach_here(); + } + + // Process the upper half of a vector + if (load_arrangement == Assembler::T8B || load_arrangement == Assembler::T8H) { + __ mulvs(vmul0, Assembler::T4S, vmul0, vpowm, 0); + if (is_signed_subword_type(eltype)) { + __ saddwv2(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T8H); + } else { + __ uaddwv2(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T8H); + } + } + + __ br(Assembler::HI, SMALL_LOOP); + + // SMALL LOOP'S EPILOQUE + __ lsr(rscratch2, cnt, exact_log2(evf)); + __ cbnz(rscratch2, LARGE_LOOP_PREHEADER); + + __ mulv(vmul0, Assembler::T4S, vmul0, vpow); + __ addv(vmul0, Assembler::T4S, vmul0); + __ umov(result, vmul0, Assembler::S, 0); + + // TAIL + __ bind(TAIL); + + // The andr performs cnt % vf. The subtract shifted by 3 offsets past vf - 1 - (cnt % vf) pairs + // of load + madd insns i.e. it only executes cnt % vf load + madd pairs. + assert(is_power_of_2(vf), "can't use this value to calculate the jump target PC"); + __ andr(rscratch2, cnt, vf - 1); + __ bind(TAIL_SHORTCUT); + __ adr(rscratch1, BR_BASE); + __ sub(rscratch1, rscratch1, rscratch2, ext::uxtw, 3); + __ movw(rscratch2, 0x1f); + __ br(rscratch1); + + for (size_t i = 0; i < vf - 1; ++i) { + __ load(rscratch1, Address(__ post(ary, type2aelembytes(eltype))), + eltype); + __ maddw(result, result, rscratch2, rscratch1); + } + __ bind(BR_BASE); + + __ leave(); + __ ret(lr); + + // LARGE LOOP + __ bind(LARGE_LOOP_PREHEADER); + + __ lsr(rscratch2, cnt, exact_log2(evf)); + + if (multiply_by_halves) { + // 31^4 - multiplier between lower and upper parts of a register + __ movw(rscratch1, intpow(31U, vf / 2)); + __ mov(vpowm, Assembler::S, 1, rscratch1); + // 31^28 - remainder of the iteraion multiplier, 28 = 32 - 4 + __ movw(rscratch1, intpow(31U, evf - vf / 2)); + __ mov(vpowm, Assembler::S, 0, rscratch1); + } else { + // 31^16 + __ movw(rscratch1, intpow(31U, evf)); + __ mov(vpowm, Assembler::S, 0, rscratch1); + } + + __ mov(vmul3, Assembler::T16B, 0); + __ mov(vmul2, Assembler::T16B, 0); + __ mov(vmul1, Assembler::T16B, 0); + + __ bind(LARGE_LOOP); + + __ mulvs(vmul3, Assembler::T4S, vmul3, vpowm, 0); + __ mulvs(vmul2, Assembler::T4S, vmul2, vpowm, 0); + __ mulvs(vmul1, Assembler::T4S, vmul1, vpowm, 0); + __ mulvs(vmul0, Assembler::T4S, vmul0, vpowm, 0); + + __ ld1(vdata3, vdata2, vdata1, vdata0, load_arrangement, + Address(__ post(ary, evf * type2aelembytes(eltype)))); + + if (load_arrangement == Assembler::T8B) { + // Extend 8B to 8H to be able to use vector multiply + // instructions + assert(load_arrangement == Assembler::T8B, "expected to extend 8B to 8H"); + if (is_signed_subword_type(eltype)) { + __ sxtl(vdata3, Assembler::T8H, vdata3, load_arrangement); + __ sxtl(vdata2, Assembler::T8H, vdata2, load_arrangement); + __ sxtl(vdata1, Assembler::T8H, vdata1, load_arrangement); + __ sxtl(vdata0, Assembler::T8H, vdata0, load_arrangement); + } else { + __ uxtl(vdata3, Assembler::T8H, vdata3, load_arrangement); + __ uxtl(vdata2, Assembler::T8H, vdata2, load_arrangement); + __ uxtl(vdata1, Assembler::T8H, vdata1, load_arrangement); + __ uxtl(vdata0, Assembler::T8H, vdata0, load_arrangement); + } + } + + switch (load_arrangement) { + case Assembler::T4S: + __ addv(vmul3, load_arrangement, vmul3, vdata3); + __ addv(vmul2, load_arrangement, vmul2, vdata2); + __ addv(vmul1, load_arrangement, vmul1, vdata1); + __ addv(vmul0, load_arrangement, vmul0, vdata0); + break; + case Assembler::T8B: + case Assembler::T8H: + assert(is_subword_type(eltype), "subword type expected"); + if (is_signed_subword_type(eltype)) { + __ saddwv(vmul3, vmul3, Assembler::T4S, vdata3, Assembler::T4H); + __ saddwv(vmul2, vmul2, Assembler::T4S, vdata2, Assembler::T4H); + __ saddwv(vmul1, vmul1, Assembler::T4S, vdata1, Assembler::T4H); + __ saddwv(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T4H); + } else { + __ uaddwv(vmul3, vmul3, Assembler::T4S, vdata3, Assembler::T4H); + __ uaddwv(vmul2, vmul2, Assembler::T4S, vdata2, Assembler::T4H); + __ uaddwv(vmul1, vmul1, Assembler::T4S, vdata1, Assembler::T4H); + __ uaddwv(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T4H); + } + break; + default: + __ should_not_reach_here(); + } + + // Process the upper half of a vector + if (load_arrangement == Assembler::T8B || load_arrangement == Assembler::T8H) { + __ mulvs(vmul3, Assembler::T4S, vmul3, vpowm, 1); + __ mulvs(vmul2, Assembler::T4S, vmul2, vpowm, 1); + __ mulvs(vmul1, Assembler::T4S, vmul1, vpowm, 1); + __ mulvs(vmul0, Assembler::T4S, vmul0, vpowm, 1); + if (is_signed_subword_type(eltype)) { + __ saddwv2(vmul3, vmul3, Assembler::T4S, vdata3, Assembler::T8H); + __ saddwv2(vmul2, vmul2, Assembler::T4S, vdata2, Assembler::T8H); + __ saddwv2(vmul1, vmul1, Assembler::T4S, vdata1, Assembler::T8H); + __ saddwv2(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T8H); + } else { + __ uaddwv2(vmul3, vmul3, Assembler::T4S, vdata3, Assembler::T8H); + __ uaddwv2(vmul2, vmul2, Assembler::T4S, vdata2, Assembler::T8H); + __ uaddwv2(vmul1, vmul1, Assembler::T4S, vdata1, Assembler::T8H); + __ uaddwv2(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T8H); + } + } + + __ subsw(rscratch2, rscratch2, 1); + __ br(Assembler::HI, LARGE_LOOP); + + __ mulv(vmul3, Assembler::T4S, vmul3, vpow); + __ addv(vmul3, Assembler::T4S, vmul3); + __ umov(result, vmul3, Assembler::S, 0); + + __ mov(rscratch2, intpow(31U, vf)); + + __ mulv(vmul2, Assembler::T4S, vmul2, vpow); + __ addv(vmul2, Assembler::T4S, vmul2); + __ umov(rscratch1, vmul2, Assembler::S, 0); + __ maddw(result, result, rscratch2, rscratch1); + + __ mulv(vmul1, Assembler::T4S, vmul1, vpow); + __ addv(vmul1, Assembler::T4S, vmul1); + __ umov(rscratch1, vmul1, Assembler::S, 0); + __ maddw(result, result, rscratch2, rscratch1); + + __ mulv(vmul0, Assembler::T4S, vmul0, vpow); + __ addv(vmul0, Assembler::T4S, vmul0); + __ umov(rscratch1, vmul0, Assembler::S, 0); + __ maddw(result, result, rscratch2, rscratch1); + + __ andr(rscratch2, cnt, vf - 1); + __ cbnz(rscratch2, TAIL_SHORTCUT); + + __ leave(); + __ ret(lr); + + return entry; + } + address generate_dsin_dcos(bool isCos) { __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", isCos ? "libmDcos" : "libmDsin"); @@ -8257,6 +8562,13 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::aarch64::_large_array_equals = generate_large_array_equals(); } + // arrays_hascode stub for large arrays. + StubRoutines::aarch64::_large_arrays_hashcode_boolean = generate_large_arrays_hashcode(T_BOOLEAN); + StubRoutines::aarch64::_large_arrays_hashcode_byte = generate_large_arrays_hashcode(T_BYTE); + StubRoutines::aarch64::_large_arrays_hashcode_char = generate_large_arrays_hashcode(T_CHAR); + StubRoutines::aarch64::_large_arrays_hashcode_int = generate_large_arrays_hashcode(T_INT); + StubRoutines::aarch64::_large_arrays_hashcode_short = generate_large_arrays_hashcode(T_SHORT); + // byte_array_inflate stub for large arrays. StubRoutines::aarch64::_large_byte_array_inflate = generate_large_byte_array_inflate(); diff --git a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp index 80875a3b3cdcf..dee615df5a51f 100644 --- a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.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 (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -48,6 +48,11 @@ address StubRoutines::aarch64::_zero_blocks = nullptr; address StubRoutines::aarch64::_count_positives = nullptr; address StubRoutines::aarch64::_count_positives_long = nullptr; address StubRoutines::aarch64::_large_array_equals = nullptr; +address StubRoutines::aarch64::_large_arrays_hashcode_boolean = nullptr; +address StubRoutines::aarch64::_large_arrays_hashcode_byte = nullptr; +address StubRoutines::aarch64::_large_arrays_hashcode_char = nullptr; +address StubRoutines::aarch64::_large_arrays_hashcode_int = nullptr; +address StubRoutines::aarch64::_large_arrays_hashcode_short = nullptr; address StubRoutines::aarch64::_compare_long_string_LL = nullptr; address StubRoutines::aarch64::_compare_long_string_UU = nullptr; address StubRoutines::aarch64::_compare_long_string_LU = nullptr; diff --git a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp index e6438908ce4c6..7d3b72a88363d 100644 --- a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp @@ -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 (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -62,6 +62,11 @@ class aarch64 { static address _zero_blocks; static address _large_array_equals; + static address _large_arrays_hashcode_boolean; + static address _large_arrays_hashcode_byte; + static address _large_arrays_hashcode_char; + static address _large_arrays_hashcode_int; + static address _large_arrays_hashcode_short; static address _compare_long_string_LL; static address _compare_long_string_LU; static address _compare_long_string_UL; @@ -145,6 +150,25 @@ class aarch64 { return _large_array_equals; } + static address large_arrays_hashcode(BasicType eltype) { + switch (eltype) { + case T_BOOLEAN: + return _large_arrays_hashcode_boolean; + case T_BYTE: + return _large_arrays_hashcode_byte; + case T_CHAR: + return _large_arrays_hashcode_char; + case T_SHORT: + return _large_arrays_hashcode_short; + case T_INT: + return _large_arrays_hashcode_int; + default: + ShouldNotReachHere(); + } + + return nullptr; + } + static address compare_long_string_LL() { return _compare_long_string_LL; } diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp index d71162ac568ea..81e39113afaab 100644 --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp @@ -574,6 +574,10 @@ void VM_Version::initialize() { if (FLAG_IS_DEFAULT(UsePoly1305Intrinsics)) { FLAG_SET_DEFAULT(UsePoly1305Intrinsics, true); } + + if (FLAG_IS_DEFAULT(UseVectorizedHashCodeIntrinsic)) { + FLAG_SET_DEFAULT(UseVectorizedHashCodeIntrinsic, true); + } #endif _spin_wait = get_spin_wait_desc(); diff --git a/src/hotspot/share/utilities/intpow.hpp b/src/hotspot/share/utilities/intpow.hpp new file mode 100644 index 0000000000000..0b441a55c4c96 --- /dev/null +++ b/src/hotspot/share/utilities/intpow.hpp @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2024, Arm 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. + * + */ + +#ifndef SHARE_UTILITIES_INTPOW_HPP +#define SHARE_UTILITIES_INTPOW_HPP + +#include "metaprogramming/enableIf.hpp" +#include +#include + +// Raise v to the power p mod 2**N, where N is the width of the type T. +template ::value && std::is_unsigned::value)> +static constexpr T intpow(T v, unsigned p) { + if (p == 0) { + return 1; + } + + // We use exponentiation by squaring to calculate the required power. + T a = intpow(v, p / 2); + T b = (p % 2) ? v : 1; + + return a * a * b; +} + +#endif // SHARE_UTILITIES_INTPOW_HPP diff --git a/test/hotspot/gtest/aarch64/aarch64-asmtest.py b/test/hotspot/gtest/aarch64/aarch64-asmtest.py index 7e9d557d11cb7..64f3e787356e0 100644 --- a/test/hotspot/gtest/aarch64/aarch64-asmtest.py +++ b/test/hotspot/gtest/aarch64/aarch64-asmtest.py @@ -77,11 +77,29 @@ class FloatRegister(Register): def __str__(self): return self.astr("v") + def generate(self): + self.number = random.randint(0, 31) + return self + def nextReg(self): next = FloatRegister() next.number = (self.number + 1) % 32 return next +class LowFloatRegister(Register): + + def __str__(self): + return self.astr("v") + + def generate(self): + self.number = random.randint(0, 15) + return self + + def nextReg(self): + next = FloatRegister() + next.number = (self.number + 1) % 16 + return next + class GeneralRegister(Register): def __str__(self): @@ -1271,6 +1289,75 @@ def astr(self): def aname(self): return self._name +class VectorScalarNEONInstruction(Instruction): + def __init__(self, args): + self._name, self.insname, self.arrangement = args + + def generate(self): + vectorLength = {"8B" : 8, "16B" : 16, "4H" : 4, "8H" : 8, "2S" : 2, "4S" : 4, "1D" : 1, "2D" : 2} [self.arrangement] + self.elemIndex = random.randrange(0, vectorLength) + self.elemSizeSpecifier = self.arrangement[len(self.arrangement) - 1:] + self._firstSIMDreg = LowFloatRegister().generate() + self.numRegs = 3 + return self + + def cstr(self): + buf = Instruction.cstr(self) + str(self._firstSIMDreg) + buf = '%s, __ T%s' % (buf, self.arrangement) + current = self._firstSIMDreg + for cnt in range(1, self.numRegs - 1): + buf = '%s, %s' % (buf, current.nextReg()) + current = current.nextReg() + buf = '%s, %s, %d' % (buf, current.nextReg(), self.elemIndex) + return '%s);' % (buf) + + def astr(self): + buf = '%s\t%s.%s' % (self.insname, self._firstSIMDreg, self.arrangement) + current = self._firstSIMDreg + for cnt in range(1, self.numRegs - 1): + buf = '%s, %s.%s' % (buf, current.nextReg(), self.arrangement) + current = current.nextReg() + buf = '%s, %s.%s[%d]' % (buf, current.nextReg(), self.elemSizeSpecifier, self.elemIndex) + return buf + + def aname(self): + return self._name + +class WideningNEONInstruction(Instruction): + def __init__(self, args): + self._name, self.insname, self.widerArrangement, self.narrowerArrangement = args + + def generate(self): + self._firstSIMDreg = FloatRegister().generate() + return self + + def cstr(self): + buf = Instruction.cstr(self) + str(self._firstSIMDreg) + current = self._firstSIMDreg + for cnt in range(1, self.numWiderRegs): + buf = '%s, %s' % (buf, current.nextReg()) + current = current.nextReg() + buf = '%s, __ T%s' % (buf, self.widerArrangement) + for cnt in range(0, self.numNarrowerRegs): + buf = '%s, %s' % (buf, current.nextReg()) + current = current.nextReg() + buf = '%s, __ T%s' % (buf, self.narrowerArrangement) + return '%s);' % (buf) + + def astr(self): + buf = '%s\t%s.%s' % (self.insname, self._firstSIMDreg, self.widerArrangement) + current = self._firstSIMDreg + for cnt in range(1, self.numWiderRegs): + buf = '%s, %s.%s' % (buf, current.nextReg(), self.widerArrangement) + current = current.nextReg() + for cnt in range(0, self.numNarrowerRegs): + buf = '%s, %s.%s' % (buf, current.nextReg(), self.narrowerArrangement) + current = current.nextReg() + return buf + + def aname(self): + return self._name + class SHA512SIMDOp(Instruction): def generate(self): @@ -1390,6 +1477,10 @@ class TwoRegNEONOp(CommonNEONInstruction): class ThreeRegNEONOp(TwoRegNEONOp): numRegs = 3 +class AddWideNEONOp(WideningNEONInstruction): + numWiderRegs = 2 + numNarrowerRegs = 1 + class NEONFloatCompareWithZero(TwoRegNEONOp): def __init__(self, args): self._name = 'fcm' @@ -1748,6 +1839,17 @@ def generate(kind, names): ["facgt", "facgt", "2D"], ]) +generate(VectorScalarNEONInstruction, + [["fmlavs", "fmla", "2S"], ["mulvs", "mul", "4S"], + ["fmlavs", "fmla", "2D"], + ["fmlsvs", "fmls", "2S"], ["mulvs", "mul", "4S"], + ["fmlsvs", "fmls", "2D"], + ["fmulxvs", "fmulx", "2S"], ["mulvs", "mul", "4S"], + ["fmulxvs", "fmulx", "2D"], + ["mulvs", "mul", "4H"], ["mulvs", "mul", "8H"], + ["mulvs", "mul", "2S"], ["mulvs", "mul", "4S"], + ]) + neonVectorCompareInstructionPrefix = ['cm', 'fcm'] neonIntegerVectorCompareConditions = ['GT', 'GE', 'EQ', 'HI', 'HS'] neonFloatVectorCompareConditions = ['EQ', 'GT', 'GE'] @@ -2081,6 +2183,15 @@ def generate(kind, names): generate(SVEReductionOp, [["andv", 0], ["orv", 0], ["eorv", 0], ["smaxv", 0], ["sminv", 0], ["fminv", 2], ["fmaxv", 2], ["fadda", 2], ["uaddv", 0]]) +generate(AddWideNEONOp, + [["saddwv", "saddw", "8H", "8B"], ["saddwv2", "saddw2", "8H", "16B"], + ["saddwv", "saddw", "4S", "4H"], ["saddwv2", "saddw2", "4S", "8H"], + ["saddwv", "saddw", "2D", "2S"], ["saddwv2", "saddw2", "2D", "4S"], + ["uaddwv", "uaddw", "8H", "8B"], ["uaddwv2", "uaddw2", "8H", "16B"], + ["uaddwv", "uaddw", "4S", "4H"], ["uaddwv2", "uaddw2", "4S", "8H"], + ["uaddwv", "uaddw", "2D", "2S"], ["uaddwv2", "uaddw2", "2D", "4S"], + ]) + print "\n __ bind(forth);" outfile.write("forth:\n") diff --git a/test/hotspot/gtest/aarch64/asmtest.out.h b/test/hotspot/gtest/aarch64/asmtest.out.h index b8260aaf932d1..9805a05c5c150 100644 --- a/test/hotspot/gtest/aarch64/asmtest.out.h +++ b/test/hotspot/gtest/aarch64/asmtest.out.h @@ -293,9 +293,9 @@ __ ldrshw(r5, Address(r3, 12)); // ldrsh w5, [x3, 12] __ ldrsw(r27, Address(r24, 17)); // ldrsw x27, [x24, 17] __ ldrd(v13, Address(r29, -35)); // ldr d13, [x29, -35] - __ ldrs(v22, Address(r9, -47)); // ldr s22, [x9, -47] + __ ldrs(v23, Address(r9, -47)); // ldr s23, [x9, -47] __ strd(v11, Address(r0, 9)); // str d11, [x0, 9] - __ strs(v20, Address(r0, -127)); // str s20, [x0, -127] + __ strs(v21, Address(r0, -127)); // str s21, [x0, -127] // pre // LoadStoreOp @@ -314,7 +314,7 @@ __ ldrd(v0, Address(__ pre(r14, -54))); // ldr d0, [x14, -54]! __ ldrs(v3, Address(__ pre(r1, 40))); // ldr s3, [x1, 40]! __ strd(v4, Address(__ pre(r14, -94))); // str d4, [x14, -94]! - __ strs(v17, Address(__ pre(r28, -54))); // str s17, [x28, -54]! + __ strs(v18, Address(__ pre(r28, -54))); // str s18, [x28, -54]! // post // LoadStoreOp @@ -331,8 +331,8 @@ __ ldrshw(r3, Address(__ post(r11, -48))); // ldrsh w3, [x11], -48 __ ldrsw(r25, Address(__ post(r23, 22))); // ldrsw x25, [x23], 22 __ ldrd(v0, Address(__ post(r10, -215))); // ldr d0, [x10], -215 - __ ldrs(v17, Address(__ post(r6, 55))); // ldr s17, [x6], 55 - __ strd(v13, Address(__ post(r21, -234))); // str d13, [x21], -234 + __ ldrs(v19, Address(__ post(r6, 55))); // ldr s19, [x6], 55 + __ strd(v14, Address(__ post(r21, -234))); // str d14, [x21], -234 __ strs(v0, Address(__ post(r22, -70))); // str s0, [x22], -70 // base_plus_reg @@ -349,9 +349,9 @@ __ ldrsh(r21, Address(r30, r30, Address::sxtw(1))); // ldrsh x21, [x30, w30, sxtw #1] __ ldrshw(r11, Address(r10, r28, Address::sxtw(1))); // ldrsh w11, [x10, w28, sxtw #1] __ ldrsw(r28, Address(r19, r10, Address::uxtw(0))); // ldrsw x28, [x19, w10, uxtw #0] - __ ldrd(v29, Address(r29, r14, Address::sxtw(0))); // ldr d29, [x29, w14, sxtw #0] + __ ldrd(v30, Address(r29, r14, Address::sxtw(0))); // ldr d30, [x29, w14, sxtw #0] __ ldrs(v8, Address(r5, r5, Address::sxtw(2))); // ldr s8, [x5, w5, sxtw #2] - __ strd(v24, Address(r8, r13, Address::sxtx(0))); // str d24, [x8, x13, sxtx #0] + __ strd(v25, Address(r8, r13, Address::sxtx(0))); // str d25, [x8, x13, sxtx #0] __ strs(v17, Address(r24, r26, Address::lsl(2))); // str s17, [x24, x26, lsl #2] // base_plus_scaled_offset @@ -370,7 +370,7 @@ __ ldrsw(r10, Address(r7, 6372)); // ldrsw x10, [x7, 6372] __ ldrd(v3, Address(r25, 12392)); // ldr d3, [x25, 12392] __ ldrs(v12, Address(r9, 7840)); // ldr s12, [x9, 7840] - __ strd(v23, Address(r1, 12728)); // str d23, [x1, 12728] + __ strd(v24, Address(r1, 12728)); // str d24, [x1, 12728] __ strs(v3, Address(r20, 6924)); // str s3, [x20, 6924] // pcrel @@ -484,63 +484,63 @@ __ umsubl(r13, r10, r7, r5); // umsubl x13, w10, w7, x5 // ThreeRegFloatOp - __ fabds(v29, v15, v3); // fabd s29, s15, s3 - __ fmuls(v11, v12, v15); // fmul s11, s12, s15 - __ fdivs(v30, v30, v17); // fdiv s30, s30, s17 - __ fadds(v19, v20, v15); // fadd s19, s20, s15 - __ fsubs(v15, v9, v21); // fsub s15, s9, s21 - __ fabdd(v2, v9, v27); // fabd d2, d9, d27 - __ fmuld(v7, v29, v30); // fmul d7, d29, d30 - __ fdivd(v17, v1, v2); // fdiv d17, d1, d2 + __ fabds(v30, v15, v3); // fabd s30, s15, s3 + __ fmuls(v12, v12, v16); // fmul s12, s12, s16 + __ fdivs(v31, v31, v18); // fdiv s31, s31, s18 + __ fadds(v19, v21, v16); // fadd s19, s21, s16 + __ fsubs(v15, v10, v21); // fsub s15, s10, s21 + __ fabdd(v2, v10, v28); // fabd d2, d10, d28 + __ fmuld(v7, v30, v31); // fmul d7, d30, d31 + __ fdivd(v18, v1, v2); // fdiv d18, d1, d2 __ faddd(v6, v10, v3); // fadd d6, d10, d3 - __ fsubd(v24, v11, v7); // fsub d24, d11, d7 + __ fsubd(v25, v11, v7); // fsub d25, d11, d7 // FourRegFloatOp - __ fmadds(v1, v11, v0, v3); // fmadd s1, s11, s0, s3 - __ fmsubs(v17, v28, v6, v22); // fmsub s17, s28, s6, s22 - __ fnmadds(v6, v0, v27, v26); // fnmadd s6, s0, s27, s26 - __ fnmadds(v2, v5, v7, v28); // fnmadd s2, s5, s7, s28 - __ fmaddd(v11, v25, v13, v11); // fmadd d11, d25, d13, d11 - __ fmsubd(v23, v19, v8, v17); // fmsub d23, d19, d8, d17 - __ fnmaddd(v21, v25, v20, v19); // fnmadd d21, d25, d20, d19 - __ fnmaddd(v17, v2, v29, v22); // fnmadd d17, d2, d29, d22 + __ fmadds(v1, v12, v0, v3); // fmadd s1, s12, s0, s3 + __ fmsubs(v19, v29, v6, v23); // fmsub s19, s29, s6, s23 + __ fnmadds(v6, v0, v28, v27); // fnmadd s6, s0, s28, s27 + __ fnmadds(v2, v5, v7, v29); // fnmadd s2, s5, s7, s29 + __ fmaddd(v12, v25, v13, v12); // fmadd d12, d25, d13, d12 + __ fmsubd(v24, v19, v8, v18); // fmsub d24, d19, d8, d18 + __ fnmaddd(v22, v26, v21, v20); // fnmadd d22, d26, d21, d20 + __ fnmaddd(v19, v2, v30, v22); // fnmadd d19, d2, d30, d22 // TwoRegFloatOp - __ fmovs(v8, v21); // fmov s8, s21 - __ fabss(v19, v20); // fabs s19, s20 - __ fnegs(v11, v17); // fneg s11, s17 - __ fsqrts(v20, v6); // fsqrt s20, s6 - __ fcvts(v15, v3); // fcvt d15, s3 - __ fcvtsh(v3, v28); // fcvt h3, s28 - __ fcvths(v3, v27); // fcvt s3, h27 - __ fmovd(v14, v14); // fmov d14, d14 - __ fabsd(v10, v12); // fabs d10, d12 - __ fnegd(v11, v17); // fneg d11, d17 - __ fsqrtd(v10, v25); // fsqrt d10, d25 + __ fmovs(v8, v22); // fmov s8, s22 + __ fabss(v19, v21); // fabs s19, s21 + __ fnegs(v12, v18); // fneg s12, s18 + __ fsqrts(v21, v6); // fsqrt s21, s6 + __ fcvts(v16, v3); // fcvt d16, s3 + __ fcvtsh(v3, v29); // fcvt h3, s29 + __ fcvths(v3, v28); // fcvt s3, h28 + __ fmovd(v15, v14); // fmov d15, d14 + __ fabsd(v10, v13); // fabs d10, d13 + __ fnegd(v12, v18); // fneg d12, d18 + __ fsqrtd(v10, v26); // fsqrt d10, d26 __ fcvtd(v7, v7); // fcvt s7, d7 // FloatConvertOp - __ fcvtzsw(r14, v28); // fcvtzs w14, s28 - __ fcvtzs(r0, v22); // fcvtzs x0, s22 + __ fcvtzsw(r14, v29); // fcvtzs w14, s29 + __ fcvtzs(r0, v23); // fcvtzs x0, s23 __ fcvtzdw(r0, v12); // fcvtzs w0, d12 - __ fcvtzd(r23, v13); // fcvtzs x23, d13 + __ fcvtzd(r23, v14); // fcvtzs x23, d14 __ scvtfws(v13, r7); // scvtf s13, w7 - __ scvtfs(v14, r7); // scvtf s14, x7 - __ scvtfwd(v8, r20); // scvtf d8, w20 - __ scvtfd(v17, r28); // scvtf d17, x28 + __ scvtfs(v15, r7); // scvtf s15, x7 + __ scvtfwd(v9, r20); // scvtf d9, w20 + __ scvtfd(v19, r28); // scvtf d19, x28 __ fcvtassw(r30, v16); // fcvtas w30, s16 __ fcvtasd(r2, v9); // fcvtas x2, d9 - __ fcvtmssw(r16, v20); // fcvtms w16, s20 + __ fcvtmssw(r16, v21); // fcvtms w16, s21 __ fcvtmsd(r29, v4); // fcvtms x29, d4 - __ fmovs(r1, v26); // fmov w1, s26 - __ fmovd(r24, v23); // fmov x24, d23 + __ fmovs(r1, v27); // fmov w1, s27 + __ fmovd(r24, v24); // fmov x24, d24 __ fmovs(v14, r21); // fmov s14, w21 - __ fmovd(v12, r5); // fmov d12, x5 + __ fmovd(v13, r5); // fmov d13, x5 // TwoRegFloatOp - __ fcmps(v12, v24); // fcmp s12, s24 - __ fcmpd(v24, v29); // fcmp d24, d29 - __ fcmps(v27, 0.0); // fcmp s27, #0.0 + __ fcmps(v12, v25); // fcmp s12, s25 + __ fcmpd(v25, v30); // fcmp d25, d30 + __ fcmps(v28, 0.0); // fcmp s28, #0.0 __ fcmpd(v21, 0.0); // fcmp d21, #0.0 // LoadStorePairOp @@ -573,250 +573,265 @@ // LdStNEONOp __ ld1(v0, __ T8B, Address(r11)); // ld1 {v0.8B}, [x11] __ ld1(v16, v17, __ T16B, Address(__ post(r26, 32))); // ld1 {v16.16B, v17.16B}, [x26], 32 - __ ld1(v21, v22, v23, __ T1D, Address(__ post(r26, r17))); // ld1 {v21.1D, v22.1D, v23.1D}, [x26], x17 - __ ld1(v26, v27, v28, v29, __ T8H, Address(__ post(r29, 64))); // ld1 {v26.8H, v27.8H, v28.8H, v29.8H}, [x29], 64 - __ ld1r(v21, __ T8B, Address(r6)); // ld1r {v21.8B}, [x6] - __ ld1r(v13, __ T4S, Address(__ post(r29, 4))); // ld1r {v13.4S}, [x29], 4 - __ ld1r(v21, __ T1D, Address(__ post(r12, r16))); // ld1r {v21.1D}, [x12], x16 + __ ld1(v22, v23, v24, __ T1D, Address(__ post(r26, r17))); // ld1 {v22.1D, v23.1D, v24.1D}, [x26], x17 + __ ld1(v27, v28, v29, v30, __ T8H, Address(__ post(r29, 64))); // ld1 {v27.8H, v28.8H, v29.8H, v30.8H}, [x29], 64 + __ ld1r(v22, __ T8B, Address(r6)); // ld1r {v22.8B}, [x6] + __ ld1r(v14, __ T4S, Address(__ post(r29, 4))); // ld1r {v14.4S}, [x29], 4 + __ ld1r(v22, __ T1D, Address(__ post(r12, r16))); // ld1r {v22.1D}, [x12], x16 __ ld2(v1, v2, __ T2D, Address(r0)); // ld2 {v1.2D, v2.2D}, [x0] - __ ld2(v9, v10, __ T4H, Address(__ post(r21, 16))); // ld2 {v9.4H, v10.4H}, [x21], 16 + __ ld2(v10, v11, __ T4H, Address(__ post(r21, 16))); // ld2 {v10.4H, v11.4H}, [x21], 16 __ ld2r(v7, v8, __ T16B, Address(r25)); // ld2r {v7.16B, v8.16B}, [x25] - __ ld2r(v8, v9, __ T2S, Address(__ post(r9, 8))); // ld2r {v8.2S, v9.2S}, [x9], 8 + __ ld2r(v9, v10, __ T2S, Address(__ post(r9, 8))); // ld2r {v9.2S, v10.2S}, [x9], 8 __ ld2r(v9, v10, __ T2D, Address(__ post(r12, r14))); // ld2r {v9.2D, v10.2D}, [x12], x14 __ ld3(v7, v8, v9, __ T4S, Address(__ post(r4, r17))); // ld3 {v7.4S, v8.4S, v9.4S}, [x4], x17 __ ld3(v23, v24, v25, __ T2S, Address(r17)); // ld3 {v23.2S, v24.2S, v25.2S}, [x17] - __ ld3r(v3, v4, v5, __ T8H, Address(r22)); // ld3r {v3.8H, v4.8H, v5.8H}, [x22] - __ ld3r(v12, v13, v14, __ T4S, Address(__ post(r2, 12))); // ld3r {v12.4S, v13.4S, v14.4S}, [x2], 12 - __ ld3r(v15, v16, v17, __ T1D, Address(__ post(r10, r12))); // ld3r {v15.1D, v16.1D, v17.1D}, [x10], x12 + __ ld3r(v4, v5, v6, __ T8H, Address(r22)); // ld3r {v4.8H, v5.8H, v6.8H}, [x22] + __ ld3r(v13, v14, v15, __ T4S, Address(__ post(r2, 12))); // ld3r {v13.4S, v14.4S, v15.4S}, [x2], 12 + __ ld3r(v16, v17, v18, __ T1D, Address(__ post(r10, r12))); // ld3r {v16.1D, v17.1D, v18.1D}, [x10], x12 __ ld4(v4, v5, v6, v7, __ T8H, Address(__ post(r2, 64))); // ld4 {v4.8H, v5.8H, v6.8H, v7.8H}, [x2], 64 __ ld4(v6, v7, v8, v9, __ T8B, Address(__ post(r20, r11))); // ld4 {v6.8B, v7.8B, v8.8B, v9.8B}, [x20], x11 - __ ld4r(v11, v12, v13, v14, __ T8B, Address(r12)); // ld4r {v11.8B, v12.8B, v13.8B, v14.8B}, [x12] - __ ld4r(v15, v16, v17, v18, __ T4H, Address(__ post(r17, 8))); // ld4r {v15.4H, v16.4H, v17.4H, v18.4H}, [x17], 8 + __ ld4r(v12, v13, v14, v15, __ T8B, Address(r12)); // ld4r {v12.8B, v13.8B, v14.8B, v15.8B}, [x12] + __ ld4r(v16, v17, v18, v19, __ T4H, Address(__ post(r17, 8))); // ld4r {v16.4H, v17.4H, v18.4H, v19.4H}, [x17], 8 __ ld4r(v14, v15, v16, v17, __ T2S, Address(__ post(r25, r16))); // ld4r {v14.2S, v15.2S, v16.2S, v17.2S}, [x25], x16 // NEONReduceInstruction __ addv(v20, __ T8B, v21); // addv b20, v21.8B __ addv(v1, __ T16B, v2); // addv b1, v2.16B - __ addv(v22, __ T4H, v23); // addv h22, v23.4H + __ addv(v23, __ T4H, v24); // addv h23, v24.4H __ addv(v30, __ T8H, v31); // addv h30, v31.8H __ addv(v14, __ T4S, v15); // addv s14, v15.4S __ smaxv(v2, __ T8B, v3); // smaxv b2, v3.8B __ smaxv(v6, __ T16B, v7); // smaxv b6, v7.16B __ smaxv(v3, __ T4H, v4); // smaxv h3, v4.4H - __ smaxv(v7, __ T8H, v8); // smaxv h7, v8.8H - __ smaxv(v24, __ T4S, v25); // smaxv s24, v25.4S + __ smaxv(v8, __ T8H, v9); // smaxv h8, v9.8H + __ smaxv(v25, __ T4S, v26); // smaxv s25, v26.4S __ fmaxv(v0, __ T4S, v1); // fmaxv s0, v1.4S __ sminv(v27, __ T8B, v28); // sminv b27, v28.8B - __ uminv(v29, __ T8B, v30); // uminv b29, v30.8B + __ uminv(v30, __ T8B, v31); // uminv b30, v31.8B __ sminv(v5, __ T16B, v6); // sminv b5, v6.16B __ uminv(v5, __ T16B, v6); // uminv b5, v6.16B - __ sminv(v29, __ T4H, v30); // sminv h29, v30.4H + __ sminv(v30, __ T4H, v31); // sminv h30, v31.4H __ uminv(v11, __ T4H, v12); // uminv h11, v12.4H __ sminv(v25, __ T8H, v26); // sminv h25, v26.8H __ uminv(v0, __ T8H, v1); // uminv h0, v1.8H - __ sminv(v30, __ T4S, v31); // sminv s30, v31.4S + __ sminv(v31, __ T4S, v0); // sminv s31, v0.4S __ uminv(v0, __ T4S, v1); // uminv s0, v1.4S - __ fminv(v17, __ T4S, v18); // fminv s17, v18.4S - __ fmaxp(v28, v29, __ S); // fmaxp s28, v29.2S - __ fmaxp(v25, v26, __ D); // fmaxp d25, v26.2D + __ fminv(v19, __ T4S, v20); // fminv s19, v20.4S + __ fmaxp(v29, v30, __ S); // fmaxp s29, v30.2S + __ fmaxp(v26, v27, __ D); // fmaxp d26, v27.2D __ fminp(v9, v10, __ S); // fminp s9, v10.2S - __ fminp(v25, v26, __ D); // fminp d25, v26.2D + __ fminp(v26, v27, __ D); // fminp d26, v27.2D // NEONFloatCompareWithZero __ fcm(Assembler::GT, v12, __ T2S, v13); // fcmgt v12.2S, v13.2S, #0.0 __ fcm(Assembler::GT, v15, __ T4S, v16); // fcmgt v15.4S, v16.4S, #0.0 __ fcm(Assembler::GT, v11, __ T2D, v12); // fcmgt v11.2D, v12.2D, #0.0 - __ fcm(Assembler::GE, v10, __ T2S, v11); // fcmge v10.2S, v11.2S, #0.0 - __ fcm(Assembler::GE, v17, __ T4S, v18); // fcmge v17.4S, v18.4S, #0.0 - __ fcm(Assembler::GE, v24, __ T2D, v25); // fcmge v24.2D, v25.2D, #0.0 - __ fcm(Assembler::EQ, v21, __ T2S, v22); // fcmeq v21.2S, v22.2S, #0.0 - __ fcm(Assembler::EQ, v23, __ T4S, v24); // fcmeq v23.4S, v24.4S, #0.0 + __ fcm(Assembler::GE, v11, __ T2S, v12); // fcmge v11.2S, v12.2S, #0.0 + __ fcm(Assembler::GE, v18, __ T4S, v19); // fcmge v18.4S, v19.4S, #0.0 + __ fcm(Assembler::GE, v25, __ T2D, v26); // fcmge v25.2D, v26.2D, #0.0 + __ fcm(Assembler::EQ, v22, __ T2S, v23); // fcmeq v22.2S, v23.2S, #0.0 + __ fcm(Assembler::EQ, v24, __ T4S, v25); // fcmeq v24.4S, v25.4S, #0.0 __ fcm(Assembler::EQ, v0, __ T2D, v1); // fcmeq v0.2D, v1.2D, #0.0 - __ fcm(Assembler::LT, v16, __ T2S, v17); // fcmlt v16.2S, v17.2S, #0.0 - __ fcm(Assembler::LT, v10, __ T4S, v11); // fcmlt v10.4S, v11.4S, #0.0 + __ fcm(Assembler::LT, v17, __ T2S, v18); // fcmlt v17.2S, v18.2S, #0.0 + __ fcm(Assembler::LT, v11, __ T4S, v12); // fcmlt v11.4S, v12.4S, #0.0 __ fcm(Assembler::LT, v6, __ T2D, v7); // fcmlt v6.2D, v7.2D, #0.0 - __ fcm(Assembler::LE, v28, __ T2S, v29); // fcmle v28.2S, v29.2S, #0.0 + __ fcm(Assembler::LE, v29, __ T2S, v30); // fcmle v29.2S, v30.2S, #0.0 __ fcm(Assembler::LE, v6, __ T4S, v7); // fcmle v6.4S, v7.4S, #0.0 __ fcm(Assembler::LE, v5, __ T2D, v6); // fcmle v5.2D, v6.2D, #0.0 // TwoRegNEONOp __ absr(v5, __ T8B, v6); // abs v5.8B, v6.8B - __ absr(v20, __ T16B, v21); // abs v20.16B, v21.16B - __ absr(v17, __ T4H, v18); // abs v17.4H, v18.4H - __ absr(v15, __ T8H, v16); // abs v15.8H, v16.8H - __ absr(v17, __ T2S, v18); // abs v17.2S, v18.2S - __ absr(v29, __ T4S, v30); // abs v29.4S, v30.4S - __ absr(v26, __ T2D, v27); // abs v26.2D, v27.2D + __ absr(v21, __ T16B, v22); // abs v21.16B, v22.16B + __ absr(v19, __ T4H, v20); // abs v19.4H, v20.4H + __ absr(v16, __ T8H, v17); // abs v16.8H, v17.8H + __ absr(v18, __ T2S, v19); // abs v18.2S, v19.2S + __ absr(v30, __ T4S, v31); // abs v30.4S, v31.4S + __ absr(v27, __ T2D, v28); // abs v27.2D, v28.2D __ fabs(v28, __ T2S, v29); // fabs v28.2S, v29.2S __ fabs(v1, __ T4S, v2); // fabs v1.4S, v2.4S - __ fabs(v27, __ T2D, v28); // fabs v27.2D, v28.2D - __ fneg(v0, __ T2S, v1); // fneg v0.2S, v1.2S + __ fabs(v28, __ T2D, v29); // fabs v28.2D, v29.2D + __ fneg(v1, __ T2S, v2); // fneg v1.2S, v2.2S __ fneg(v20, __ T4S, v21); // fneg v20.4S, v21.4S - __ fneg(v28, __ T2D, v29); // fneg v28.2D, v29.2D - __ fsqrt(v15, __ T2S, v16); // fsqrt v15.2S, v16.2S - __ fsqrt(v12, __ T4S, v13); // fsqrt v12.4S, v13.4S + __ fneg(v29, __ T2D, v30); // fneg v29.2D, v30.2D + __ fsqrt(v16, __ T2S, v17); // fsqrt v16.2S, v17.2S + __ fsqrt(v13, __ T4S, v14); // fsqrt v13.4S, v14.4S __ fsqrt(v10, __ T2D, v11); // fsqrt v10.2D, v11.2D - __ notr(v28, __ T8B, v29); // not v28.8B, v29.8B - __ notr(v28, __ T16B, v29); // not v28.16B, v29.16B + __ notr(v29, __ T8B, v30); // not v29.8B, v30.8B + __ notr(v29, __ T16B, v30); // not v29.16B, v30.16B // ThreeRegNEONOp __ andr(v19, __ T8B, v20, v21); // and v19.8B, v20.8B, v21.8B __ andr(v22, __ T16B, v23, v24); // and v22.16B, v23.16B, v24.16B __ orr(v10, __ T8B, v11, v12); // orr v10.8B, v11.8B, v12.8B __ orr(v4, __ T16B, v5, v6); // orr v4.16B, v5.16B, v6.16B - __ eor(v30, __ T8B, v31, v0); // eor v30.8B, v31.8B, v0.8B - __ eor(v20, __ T16B, v21, v22); // eor v20.16B, v21.16B, v22.16B + __ eor(v31, __ T8B, v0, v1); // eor v31.8B, v0.8B, v1.8B + __ eor(v21, __ T16B, v22, v23); // eor v21.16B, v22.16B, v23.16B __ addv(v8, __ T8B, v9, v10); // add v8.8B, v9.8B, v10.8B - __ addv(v30, __ T16B, v31, v0); // add v30.16B, v31.16B, v0.16B - __ addv(v17, __ T4H, v18, v19); // add v17.4H, v18.4H, v19.4H + __ addv(v31, __ T16B, v0, v1); // add v31.16B, v0.16B, v1.16B + __ addv(v19, __ T4H, v20, v21); // add v19.4H, v20.4H, v21.4H __ addv(v10, __ T8H, v11, v12); // add v10.8H, v11.8H, v12.8H - __ addv(v27, __ T2S, v28, v29); // add v27.2S, v28.2S, v29.2S + __ addv(v28, __ T2S, v29, v30); // add v28.2S, v29.2S, v30.2S __ addv(v2, __ T4S, v3, v4); // add v2.4S, v3.4S, v4.4S - __ addv(v24, __ T2D, v25, v26); // add v24.2D, v25.2D, v26.2D - __ fadd(v4, __ T2S, v5, v6); // fadd v4.2S, v5.2S, v6.2S + __ addv(v25, __ T2D, v26, v27); // add v25.2D, v26.2D, v27.2D + __ fadd(v5, __ T2S, v6, v7); // fadd v5.2S, v6.2S, v7.2S __ fadd(v3, __ T4S, v4, v5); // fadd v3.4S, v4.4S, v5.4S __ fadd(v8, __ T2D, v9, v10); // fadd v8.2D, v9.2D, v10.2D __ subv(v22, __ T8B, v23, v24); // sub v22.8B, v23.8B, v24.8B - __ subv(v17, __ T16B, v18, v19); // sub v17.16B, v18.16B, v19.16B + __ subv(v19, __ T16B, v20, v21); // sub v19.16B, v20.16B, v21.16B __ subv(v13, __ T4H, v14, v15); // sub v13.4H, v14.4H, v15.4H - __ subv(v4, __ T8H, v5, v6); // sub v4.8H, v5.8H, v6.8H - __ subv(v28, __ T2S, v29, v30); // sub v28.2S, v29.2S, v30.2S - __ subv(v23, __ T4S, v24, v25); // sub v23.4S, v24.4S, v25.4S + __ subv(v5, __ T8H, v6, v7); // sub v5.8H, v6.8H, v7.8H + __ subv(v29, __ T2S, v30, v31); // sub v29.2S, v30.2S, v31.2S + __ subv(v24, __ T4S, v25, v26); // sub v24.4S, v25.4S, v26.4S __ subv(v21, __ T2D, v22, v23); // sub v21.2D, v22.2D, v23.2D - __ fsub(v25, __ T2S, v26, v27); // fsub v25.2S, v26.2S, v27.2S + __ fsub(v26, __ T2S, v27, v28); // fsub v26.2S, v27.2S, v28.2S __ fsub(v24, __ T4S, v25, v26); // fsub v24.4S, v25.4S, v26.4S __ fsub(v3, __ T2D, v4, v5); // fsub v3.2D, v4.2D, v5.2D - __ mulv(v23, __ T8B, v24, v25); // mul v23.8B, v24.8B, v25.8B + __ mulv(v24, __ T8B, v25, v26); // mul v24.8B, v25.8B, v26.8B __ mulv(v26, __ T16B, v27, v28); // mul v26.16B, v27.16B, v28.16B __ mulv(v23, __ T4H, v24, v25); // mul v23.4H, v24.4H, v25.4H - __ mulv(v14, __ T8H, v15, v16); // mul v14.8H, v15.8H, v16.8H + __ mulv(v15, __ T8H, v16, v17); // mul v15.8H, v16.8H, v17.8H __ mulv(v21, __ T2S, v22, v23); // mul v21.2S, v22.2S, v23.2S __ mulv(v3, __ T4S, v4, v5); // mul v3.4S, v4.4S, v5.4S - __ fabd(v23, __ T2S, v24, v25); // fabd v23.2S, v24.2S, v25.2S + __ fabd(v24, __ T2S, v25, v26); // fabd v24.2S, v25.2S, v26.2S __ fabd(v8, __ T4S, v9, v10); // fabd v8.4S, v9.4S, v10.4S - __ fabd(v24, __ T2D, v25, v26); // fabd v24.2D, v25.2D, v26.2D - __ faddp(v19, __ T2S, v20, v21); // faddp v19.2S, v20.2S, v21.2S - __ faddp(v15, __ T4S, v16, v17); // faddp v15.4S, v16.4S, v17.4S - __ faddp(v16, __ T2D, v17, v18); // faddp v16.2D, v17.2D, v18.2D + __ fabd(v25, __ T2D, v26, v27); // fabd v25.2D, v26.2D, v27.2D + __ faddp(v20, __ T2S, v21, v22); // faddp v20.2S, v21.2S, v22.2S + __ faddp(v16, __ T4S, v17, v18); // faddp v16.4S, v17.4S, v18.4S + __ faddp(v17, __ T2D, v18, v19); // faddp v17.2D, v18.2D, v19.2D __ fmul(v2, __ T2S, v3, v4); // fmul v2.2S, v3.2S, v4.2S __ fmul(v1, __ T4S, v2, v3); // fmul v1.4S, v2.4S, v3.4S __ fmul(v0, __ T2D, v1, v2); // fmul v0.2D, v1.2D, v2.2D __ mlav(v24, __ T4H, v25, v26); // mla v24.4H, v25.4H, v26.4H __ mlav(v4, __ T8H, v5, v6); // mla v4.8H, v5.8H, v6.8H __ mlav(v3, __ T2S, v4, v5); // mla v3.2S, v4.2S, v5.2S - __ mlav(v11, __ T4S, v12, v13); // mla v11.4S, v12.4S, v13.4S - __ fmla(v30, __ T2S, v31, v0); // fmla v30.2S, v31.2S, v0.2S - __ fmla(v27, __ T4S, v28, v29); // fmla v27.4S, v28.4S, v29.4S - __ fmla(v9, __ T2D, v10, v11); // fmla v9.2D, v10.2D, v11.2D - __ mlsv(v25, __ T4H, v26, v27); // mls v25.4H, v26.4H, v27.4H + __ mlav(v12, __ T4S, v13, v14); // mla v12.4S, v13.4S, v14.4S + __ fmla(v31, __ T2S, v0, v1); // fmla v31.2S, v0.2S, v1.2S + __ fmla(v28, __ T4S, v29, v30); // fmla v28.4S, v29.4S, v30.4S + __ fmla(v10, __ T2D, v11, v12); // fmla v10.2D, v11.2D, v12.2D + __ mlsv(v26, __ T4H, v27, v28); // mls v26.4H, v27.4H, v28.4H __ mlsv(v2, __ T8H, v3, v4); // mls v2.8H, v3.8H, v4.8H __ mlsv(v12, __ T2S, v13, v14); // mls v12.2S, v13.2S, v14.2S - __ mlsv(v17, __ T4S, v18, v19); // mls v17.4S, v18.4S, v19.4S - __ fmls(v30, __ T2S, v31, v0); // fmls v30.2S, v31.2S, v0.2S + __ mlsv(v18, __ T4S, v19, v20); // mls v18.4S, v19.4S, v20.4S + __ fmls(v31, __ T2S, v0, v1); // fmls v31.2S, v0.2S, v1.2S __ fmls(v1, __ T4S, v2, v3); // fmls v1.4S, v2.4S, v3.4S - __ fmls(v12, __ T2D, v13, v14); // fmls v12.2D, v13.2D, v14.2D - __ fdiv(v28, __ T2S, v29, v30); // fdiv v28.2S, v29.2S, v30.2S + __ fmls(v13, __ T2D, v14, v15); // fmls v13.2D, v14.2D, v15.2D + __ fdiv(v29, __ T2S, v30, v31); // fdiv v29.2S, v30.2S, v31.2S __ fdiv(v0, __ T4S, v1, v2); // fdiv v0.4S, v1.4S, v2.4S - __ fdiv(v17, __ T2D, v18, v19); // fdiv v17.2D, v18.2D, v19.2D + __ fdiv(v19, __ T2D, v20, v21); // fdiv v19.2D, v20.2D, v21.2D __ maxv(v12, __ T8B, v13, v14); // smax v12.8B, v13.8B, v14.8B __ maxv(v17, __ T16B, v18, v19); // smax v17.16B, v18.16B, v19.16B - __ maxv(v21, __ T4H, v22, v23); // smax v21.4H, v22.4H, v23.4H - __ maxv(v12, __ T8H, v13, v14); // smax v12.8H, v13.8H, v14.8H - __ maxv(v27, __ T2S, v28, v29); // smax v27.2S, v28.2S, v29.2S - __ maxv(v29, __ T4S, v30, v31); // smax v29.4S, v30.4S, v31.4S - __ smaxp(v30, __ T8B, v31, v0); // smaxp v30.8B, v31.8B, v0.8B + __ maxv(v22, __ T4H, v23, v24); // smax v22.4H, v23.4H, v24.4H + __ maxv(v13, __ T8H, v14, v15); // smax v13.8H, v14.8H, v15.8H + __ maxv(v28, __ T2S, v29, v30); // smax v28.2S, v29.2S, v30.2S + __ maxv(v30, __ T4S, v31, v0); // smax v30.4S, v31.4S, v0.4S + __ smaxp(v31, __ T8B, v0, v1); // smaxp v31.8B, v0.8B, v1.8B __ smaxp(v1, __ T16B, v2, v3); // smaxp v1.16B, v2.16B, v3.16B - __ smaxp(v25, __ T4H, v26, v27); // smaxp v25.4H, v26.4H, v27.4H - __ smaxp(v27, __ T8H, v28, v29); // smaxp v27.8H, v28.8H, v29.8H + __ smaxp(v26, __ T4H, v27, v28); // smaxp v26.4H, v27.4H, v28.4H + __ smaxp(v28, __ T8H, v29, v30); // smaxp v28.8H, v29.8H, v30.8H __ smaxp(v4, __ T2S, v5, v6); // smaxp v4.2S, v5.2S, v6.2S - __ smaxp(v29, __ T4S, v30, v31); // smaxp v29.4S, v30.4S, v31.4S - __ fmax(v3, __ T2S, v4, v5); // fmax v3.2S, v4.2S, v5.2S + __ smaxp(v30, __ T4S, v31, v0); // smaxp v30.4S, v31.4S, v0.4S + __ fmax(v4, __ T2S, v5, v6); // fmax v4.2S, v5.2S, v6.2S __ fmax(v6, __ T4S, v7, v8); // fmax v6.4S, v7.4S, v8.4S - __ fmax(v29, __ T2D, v30, v31); // fmax v29.2D, v30.2D, v31.2D - __ minv(v25, __ T8B, v26, v27); // smin v25.8B, v26.8B, v27.8B - __ minv(v17, __ T16B, v18, v19); // smin v17.16B, v18.16B, v19.16B - __ minv(v8, __ T4H, v9, v10); // smin v8.4H, v9.4H, v10.4H - __ minv(v7, __ T8H, v8, v9); // smin v7.8H, v8.8H, v9.8H + __ fmax(v30, __ T2D, v31, v0); // fmax v30.2D, v31.2D, v0.2D + __ minv(v26, __ T8B, v27, v28); // smin v26.8B, v27.8B, v28.8B + __ minv(v18, __ T16B, v19, v20); // smin v18.16B, v19.16B, v20.16B + __ minv(v9, __ T4H, v10, v11); // smin v9.4H, v10.4H, v11.4H + __ minv(v8, __ T8H, v9, v10); // smin v8.8H, v9.8H, v10.8H __ minv(v12, __ T2S, v13, v14); // smin v12.2S, v13.2S, v14.2S __ minv(v0, __ T4S, v1, v2); // smin v0.4S, v1.4S, v2.4S - __ sminp(v19, __ T8B, v20, v21); // sminp v19.8B, v20.8B, v21.8B + __ sminp(v20, __ T8B, v21, v22); // sminp v20.8B, v21.8B, v22.8B __ sminp(v1, __ T16B, v2, v3); // sminp v1.16B, v2.16B, v3.16B - __ sminp(v23, __ T4H, v24, v25); // sminp v23.4H, v24.4H, v25.4H + __ sminp(v24, __ T4H, v25, v26); // sminp v24.4H, v25.4H, v26.4H __ sminp(v2, __ T8H, v3, v4); // sminp v2.8H, v3.8H, v4.8H __ sminp(v0, __ T2S, v1, v2); // sminp v0.2S, v1.2S, v2.2S - __ sminp(v8, __ T4S, v9, v10); // sminp v8.4S, v9.4S, v10.4S - __ fmin(v23, __ T2S, v24, v25); // fmin v23.2S, v24.2S, v25.2S - __ fmin(v25, __ T4S, v26, v27); // fmin v25.4S, v26.4S, v27.4S - __ fmin(v15, __ T2D, v16, v17); // fmin v15.2D, v16.2D, v17.2D - __ facgt(v29, __ T2S, v30, v31); // facgt v29.2S, v30.2S, v31.2S + __ sminp(v9, __ T4S, v10, v11); // sminp v9.4S, v10.4S, v11.4S + __ fmin(v24, __ T2S, v25, v26); // fmin v24.2S, v25.2S, v26.2S + __ fmin(v26, __ T4S, v27, v28); // fmin v26.4S, v27.4S, v28.4S + __ fmin(v16, __ T2D, v17, v18); // fmin v16.2D, v17.2D, v18.2D + __ facgt(v30, __ T2S, v31, v0); // facgt v30.2S, v31.2S, v0.2S __ facgt(v3, __ T4S, v4, v5); // facgt v3.4S, v4.4S, v5.4S __ facgt(v10, __ T2D, v11, v12); // facgt v10.2D, v11.2D, v12.2D +// VectorScalarNEONInstruction + __ fmlavs(v5, __ T2S, v6, v7, 1); // fmla v5.2S, v6.2S, v7.S[1] + __ mulvs(v9, __ T4S, v10, v11, 0); // mul v9.4S, v10.4S, v11.S[0] + __ fmlavs(v5, __ T2D, v6, v7, 0); // fmla v5.2D, v6.2D, v7.D[0] + __ fmlsvs(v5, __ T2S, v6, v7, 0); // fmls v5.2S, v6.2S, v7.S[0] + __ mulvs(v8, __ T4S, v9, v10, 1); // mul v8.4S, v9.4S, v10.S[1] + __ fmlsvs(v5, __ T2D, v6, v7, 0); // fmls v5.2D, v6.2D, v7.D[0] + __ fmulxvs(v6, __ T2S, v7, v8, 0); // fmulx v6.2S, v7.2S, v8.S[0] + __ mulvs(v6, __ T4S, v7, v8, 1); // mul v6.4S, v7.4S, v8.S[1] + __ fmulxvs(v3, __ T2D, v4, v5, 0); // fmulx v3.2D, v4.2D, v5.D[0] + __ mulvs(v13, __ T4H, v14, v15, 2); // mul v13.4H, v14.4H, v15.H[2] + __ mulvs(v2, __ T8H, v3, v4, 4); // mul v2.8H, v3.8H, v4.H[4] + __ mulvs(v2, __ T2S, v3, v4, 0); // mul v2.2S, v3.2S, v4.S[0] + __ mulvs(v9, __ T4S, v10, v11, 1); // mul v9.4S, v10.4S, v11.S[1] + // NEONVectorCompare - __ cm(Assembler::GT, v22, __ T8B, v23, v24); // cmgt v22.8B, v23.8B, v24.8B - __ cm(Assembler::GT, v10, __ T16B, v11, v12); // cmgt v10.16B, v11.16B, v12.16B - __ cm(Assembler::GT, v4, __ T4H, v5, v6); // cmgt v4.4H, v5.4H, v6.4H - __ cm(Assembler::GT, v17, __ T8H, v18, v19); // cmgt v17.8H, v18.8H, v19.8H - __ cm(Assembler::GT, v1, __ T2S, v2, v3); // cmgt v1.2S, v2.2S, v3.2S - __ cm(Assembler::GT, v11, __ T4S, v12, v13); // cmgt v11.4S, v12.4S, v13.4S - __ cm(Assembler::GT, v7, __ T2D, v8, v9); // cmgt v7.2D, v8.2D, v9.2D - __ cm(Assembler::GE, v10, __ T8B, v11, v12); // cmge v10.8B, v11.8B, v12.8B - __ cm(Assembler::GE, v15, __ T16B, v16, v17); // cmge v15.16B, v16.16B, v17.16B - __ cm(Assembler::GE, v16, __ T4H, v17, v18); // cmge v16.4H, v17.4H, v18.4H - __ cm(Assembler::GE, v2, __ T8H, v3, v4); // cmge v2.8H, v3.8H, v4.8H - __ cm(Assembler::GE, v9, __ T2S, v10, v11); // cmge v9.2S, v10.2S, v11.2S - __ cm(Assembler::GE, v11, __ T4S, v12, v13); // cmge v11.4S, v12.4S, v13.4S - __ cm(Assembler::GE, v12, __ T2D, v13, v14); // cmge v12.2D, v13.2D, v14.2D - __ cm(Assembler::EQ, v14, __ T8B, v15, v16); // cmeq v14.8B, v15.8B, v16.8B - __ cm(Assembler::EQ, v13, __ T16B, v14, v15); // cmeq v13.16B, v14.16B, v15.16B - __ cm(Assembler::EQ, v2, __ T4H, v3, v4); // cmeq v2.4H, v3.4H, v4.4H - __ cm(Assembler::EQ, v6, __ T8H, v7, v8); // cmeq v6.8H, v7.8H, v8.8H - __ cm(Assembler::EQ, v19, __ T2S, v20, v21); // cmeq v19.2S, v20.2S, v21.2S - __ cm(Assembler::EQ, v25, __ T4S, v26, v27); // cmeq v25.4S, v26.4S, v27.4S - __ cm(Assembler::EQ, v15, __ T2D, v16, v17); // cmeq v15.2D, v16.2D, v17.2D - __ cm(Assembler::HI, v4, __ T8B, v5, v6); // cmhi v4.8B, v5.8B, v6.8B - __ cm(Assembler::HI, v2, __ T16B, v3, v4); // cmhi v2.16B, v3.16B, v4.16B - __ cm(Assembler::HI, v4, __ T4H, v5, v6); // cmhi v4.4H, v5.4H, v6.4H - __ cm(Assembler::HI, v11, __ T8H, v12, v13); // cmhi v11.8H, v12.8H, v13.8H - __ cm(Assembler::HI, v17, __ T2S, v18, v19); // cmhi v17.2S, v18.2S, v19.2S - __ cm(Assembler::HI, v20, __ T4S, v21, v22); // cmhi v20.4S, v21.4S, v22.4S - __ cm(Assembler::HI, v16, __ T2D, v17, v18); // cmhi v16.2D, v17.2D, v18.2D - __ cm(Assembler::HS, v17, __ T8B, v18, v19); // cmhs v17.8B, v18.8B, v19.8B - __ cm(Assembler::HS, v10, __ T16B, v11, v12); // cmhs v10.16B, v11.16B, v12.16B - __ cm(Assembler::HS, v20, __ T4H, v21, v22); // cmhs v20.4H, v21.4H, v22.4H - __ cm(Assembler::HS, v22, __ T8H, v23, v24); // cmhs v22.8H, v23.8H, v24.8H - __ cm(Assembler::HS, v12, __ T2S, v13, v14); // cmhs v12.2S, v13.2S, v14.2S - __ cm(Assembler::HS, v25, __ T4S, v26, v27); // cmhs v25.4S, v26.4S, v27.4S - __ cm(Assembler::HS, v23, __ T2D, v24, v25); // cmhs v23.2D, v24.2D, v25.2D - __ fcm(Assembler::EQ, v28, __ T2S, v29, v30); // fcmeq v28.2S, v29.2S, v30.2S - __ fcm(Assembler::EQ, v14, __ T4S, v15, v16); // fcmeq v14.4S, v15.4S, v16.4S - __ fcm(Assembler::EQ, v10, __ T2D, v11, v12); // fcmeq v10.2D, v11.2D, v12.2D - __ fcm(Assembler::GT, v24, __ T2S, v25, v26); // fcmgt v24.2S, v25.2S, v26.2S - __ fcm(Assembler::GT, v1, __ T4S, v2, v3); // fcmgt v1.4S, v2.4S, v3.4S - __ fcm(Assembler::GT, v11, __ T2D, v12, v13); // fcmgt v11.2D, v12.2D, v13.2D - __ fcm(Assembler::GE, v30, __ T2S, v31, v0); // fcmge v30.2S, v31.2S, v0.2S - __ fcm(Assembler::GE, v10, __ T4S, v11, v12); // fcmge v10.4S, v11.4S, v12.4S - __ fcm(Assembler::GE, v15, __ T2D, v16, v17); // fcmge v15.2D, v16.2D, v17.2D + __ cm(Assembler::GT, v21, __ T8B, v22, v23); // cmgt v21.8B, v22.8B, v23.8B + __ cm(Assembler::GT, v16, __ T16B, v17, v18); // cmgt v16.16B, v17.16B, v18.16B + __ cm(Assembler::GT, v18, __ T4H, v19, v20); // cmgt v18.4H, v19.4H, v20.4H + __ cm(Assembler::GT, v11, __ T8H, v12, v13); // cmgt v11.8H, v12.8H, v13.8H + __ cm(Assembler::GT, v21, __ T2S, v22, v23); // cmgt v21.2S, v22.2S, v23.2S + __ cm(Assembler::GT, v23, __ T4S, v24, v25); // cmgt v23.4S, v24.4S, v25.4S + __ cm(Assembler::GT, v12, __ T2D, v13, v14); // cmgt v12.2D, v13.2D, v14.2D + __ cm(Assembler::GE, v26, __ T8B, v27, v28); // cmge v26.8B, v27.8B, v28.8B + __ cm(Assembler::GE, v23, __ T16B, v24, v25); // cmge v23.16B, v24.16B, v25.16B + __ cm(Assembler::GE, v28, __ T4H, v29, v30); // cmge v28.4H, v29.4H, v30.4H + __ cm(Assembler::GE, v14, __ T8H, v15, v16); // cmge v14.8H, v15.8H, v16.8H + __ cm(Assembler::GE, v11, __ T2S, v12, v13); // cmge v11.2S, v12.2S, v13.2S + __ cm(Assembler::GE, v24, __ T4S, v25, v26); // cmge v24.4S, v25.4S, v26.4S + __ cm(Assembler::GE, v1, __ T2D, v2, v3); // cmge v1.2D, v2.2D, v3.2D + __ cm(Assembler::EQ, v12, __ T8B, v13, v14); // cmeq v12.8B, v13.8B, v14.8B + __ cm(Assembler::EQ, v31, __ T16B, v0, v1); // cmeq v31.16B, v0.16B, v1.16B + __ cm(Assembler::EQ, v10, __ T4H, v11, v12); // cmeq v10.4H, v11.4H, v12.4H + __ cm(Assembler::EQ, v16, __ T8H, v17, v18); // cmeq v16.8H, v17.8H, v18.8H + __ cm(Assembler::EQ, v7, __ T2S, v8, v9); // cmeq v7.2S, v8.2S, v9.2S + __ cm(Assembler::EQ, v2, __ T4S, v3, v4); // cmeq v2.4S, v3.4S, v4.4S + __ cm(Assembler::EQ, v3, __ T2D, v4, v5); // cmeq v3.2D, v4.2D, v5.2D + __ cm(Assembler::HI, v13, __ T8B, v14, v15); // cmhi v13.8B, v14.8B, v15.8B + __ cm(Assembler::HI, v19, __ T16B, v20, v21); // cmhi v19.16B, v20.16B, v21.16B + __ cm(Assembler::HI, v17, __ T4H, v18, v19); // cmhi v17.4H, v18.4H, v19.4H + __ cm(Assembler::HI, v16, __ T8H, v17, v18); // cmhi v16.8H, v17.8H, v18.8H + __ cm(Assembler::HI, v3, __ T2S, v4, v5); // cmhi v3.2S, v4.2S, v5.2S + __ cm(Assembler::HI, v1, __ T4S, v2, v3); // cmhi v1.4S, v2.4S, v3.4S + __ cm(Assembler::HI, v11, __ T2D, v12, v13); // cmhi v11.2D, v12.2D, v13.2D + __ cm(Assembler::HS, v30, __ T8B, v31, v0); // cmhs v30.8B, v31.8B, v0.8B + __ cm(Assembler::HS, v5, __ T16B, v6, v7); // cmhs v5.16B, v6.16B, v7.16B + __ cm(Assembler::HS, v8, __ T4H, v9, v10); // cmhs v8.4H, v9.4H, v10.4H + __ cm(Assembler::HS, v15, __ T8H, v16, v17); // cmhs v15.8H, v16.8H, v17.8H + __ cm(Assembler::HS, v29, __ T2S, v30, v31); // cmhs v29.2S, v30.2S, v31.2S + __ cm(Assembler::HS, v30, __ T4S, v31, v0); // cmhs v30.4S, v31.4S, v0.4S + __ cm(Assembler::HS, v0, __ T2D, v1, v2); // cmhs v0.2D, v1.2D, v2.2D + __ fcm(Assembler::EQ, v20, __ T2S, v21, v22); // fcmeq v20.2S, v21.2S, v22.2S + __ fcm(Assembler::EQ, v7, __ T4S, v8, v9); // fcmeq v7.4S, v8.4S, v9.4S + __ fcm(Assembler::EQ, v20, __ T2D, v21, v22); // fcmeq v20.2D, v21.2D, v22.2D + __ fcm(Assembler::GT, v23, __ T2S, v24, v25); // fcmgt v23.2S, v24.2S, v25.2S + __ fcm(Assembler::GT, v28, __ T4S, v29, v30); // fcmgt v28.4S, v29.4S, v30.4S + __ fcm(Assembler::GT, v21, __ T2D, v22, v23); // fcmgt v21.2D, v22.2D, v23.2D + __ fcm(Assembler::GE, v27, __ T2S, v28, v29); // fcmge v27.2S, v28.2S, v29.2S + __ fcm(Assembler::GE, v25, __ T4S, v26, v27); // fcmge v25.4S, v26.4S, v27.4S + __ fcm(Assembler::GE, v5, __ T2D, v6, v7); // fcmge v5.2D, v6.2D, v7.2D // SVEComparisonWithZero - __ sve_fcm(Assembler::EQ, p3, __ S, p3, z2, 0.0); // fcmeq p3.s, p3/z, z2.s, #0.0 - __ sve_fcm(Assembler::GT, p9, __ D, p0, z16, 0.0); // fcmgt p9.d, p0/z, z16.d, #0.0 - __ sve_fcm(Assembler::GE, p0, __ D, p1, z11, 0.0); // fcmge p0.d, p1/z, z11.d, #0.0 - __ sve_fcm(Assembler::LT, p4, __ D, p7, z14, 0.0); // fcmlt p4.d, p7/z, z14.d, #0.0 - __ sve_fcm(Assembler::LE, p0, __ S, p5, z20, 0.0); // fcmle p0.s, p5/z, z20.s, #0.0 - __ sve_fcm(Assembler::NE, p11, __ D, p6, z27, 0.0); // fcmne p11.d, p6/z, z27.d, #0.0 + __ sve_fcm(Assembler::EQ, p0, __ D, p7, z23, 0.0); // fcmeq p0.d, p7/z, z23.d, #0.0 + __ sve_fcm(Assembler::GT, p2, __ S, p7, z12, 0.0); // fcmgt p2.s, p7/z, z12.s, #0.0 + __ sve_fcm(Assembler::GE, p7, __ D, p7, z29, 0.0); // fcmge p7.d, p7/z, z29.d, #0.0 + __ sve_fcm(Assembler::LT, p9, __ S, p3, z31, 0.0); // fcmlt p9.s, p3/z, z31.s, #0.0 + __ sve_fcm(Assembler::LE, p9, __ D, p6, z31, 0.0); // fcmle p9.d, p6/z, z31.d, #0.0 + __ sve_fcm(Assembler::NE, p10, __ S, p2, z16, 0.0); // fcmne p10.s, p2/z, z16.s, #0.0 // SVEComparisonWithImm - __ sve_cmp(Assembler::EQ, p12, __ B, p5, z4, 0); // cmpeq p12.b, p5/z, z4.b, #0 - __ sve_cmp(Assembler::GT, p15, __ H, p2, z5, 12); // cmpgt p15.h, p2/z, z5.h, #12 - __ sve_cmp(Assembler::GE, p7, __ S, p7, z28, 3); // cmpge p7.s, p7/z, z28.s, #3 - __ sve_cmp(Assembler::LT, p15, __ H, p4, z5, 15); // cmplt p15.h, p4/z, z5.h, #15 - __ sve_cmp(Assembler::LE, p9, __ S, p4, z26, -4); // cmple p9.s, p4/z, z26.s, #-4 - __ sve_cmp(Assembler::NE, p5, __ B, p7, z9, 1); // cmpne p5.b, p7/z, z9.b, #1 - __ sve_cmp(Assembler::HS, p13, __ D, p1, z27, 43); // cmphs p13.d, p1/z, z27.d, #43 - __ sve_cmp(Assembler::HI, p10, __ B, p6, z9, 70); // cmphi p10.b, p6/z, z9.b, #70 - __ sve_cmp(Assembler::LS, p8, __ B, p7, z22, 61); // cmpls p8.b, p7/z, z22.b, #61 - __ sve_cmp(Assembler::LO, p11, __ S, p5, z17, 11); // cmplo p11.s, p5/z, z17.s, #11 + __ sve_cmp(Assembler::EQ, p4, __ D, p4, z6, 11); // cmpeq p4.d, p4/z, z6.d, #11 + __ sve_cmp(Assembler::GT, p14, __ B, p2, z30, 4); // cmpgt p14.b, p2/z, z30.b, #4 + __ sve_cmp(Assembler::GE, p5, __ D, p4, z4, 1); // cmpge p5.d, p4/z, z4.d, #1 + __ sve_cmp(Assembler::LT, p11, __ D, p3, z3, 6); // cmplt p11.d, p3/z, z3.d, #6 + __ sve_cmp(Assembler::LE, p9, __ S, p0, z19, -1); // cmple p9.s, p0/z, z19.s, #-1 + __ sve_cmp(Assembler::NE, p3, __ S, p2, z12, -3); // cmpne p3.s, p2/z, z12.s, #-3 + __ sve_cmp(Assembler::HS, p11, __ D, p4, z1, 20); // cmphs p11.d, p4/z, z1.d, #20 + __ sve_cmp(Assembler::HI, p8, __ S, p5, z2, 53); // cmphi p8.s, p5/z, z2.s, #53 + __ sve_cmp(Assembler::LS, p5, __ D, p6, z21, 49); // cmpls p5.d, p6/z, z21.d, #49 + __ sve_cmp(Assembler::LO, p13, __ B, p7, z3, 97); // cmplo p13.b, p7/z, z3.b, #97 // SpecialCases __ ccmn(zr, zr, 3u, Assembler::LE); // ccmn xzr, xzr, #3, LE @@ -1071,215 +1086,229 @@ __ fmovd(v0, -1.0625); // fmov d0, #-1.0625 // LSEOp - __ swp(Assembler::xword, r15, r6, r12); // swp x15, x6, [x12] - __ ldadd(Assembler::xword, r16, r11, r13); // ldadd x16, x11, [x13] - __ ldbic(Assembler::xword, r23, r1, r30); // ldclr x23, x1, [x30] - __ ldeor(Assembler::xword, r19, r5, r17); // ldeor x19, x5, [x17] - __ ldorr(Assembler::xword, r2, r16, r22); // ldset x2, x16, [x22] - __ ldsmin(Assembler::xword, r13, r10, r21); // ldsmin x13, x10, [x21] - __ ldsmax(Assembler::xword, r29, r27, r12); // ldsmax x29, x27, [x12] - __ ldumin(Assembler::xword, r27, r3, r1); // ldumin x27, x3, [x1] - __ ldumax(Assembler::xword, zr, r24, r19); // ldumax xzr, x24, [x19] + __ swp(Assembler::xword, r19, r17, r9); // swp x19, x17, [x9] + __ ldadd(Assembler::xword, r28, r27, r15); // ldadd x28, x27, [x15] + __ ldbic(Assembler::xword, r7, r21, r23); // ldclr x7, x21, [x23] + __ ldeor(Assembler::xword, zr, r25, r2); // ldeor xzr, x25, [x2] + __ ldorr(Assembler::xword, zr, r27, r15); // ldset xzr, x27, [x15] + __ ldsmin(Assembler::xword, r10, r23, r19); // ldsmin x10, x23, [x19] + __ ldsmax(Assembler::xword, r3, r16, r0); // ldsmax x3, x16, [x0] + __ ldumin(Assembler::xword, r25, r26, r23); // ldumin x25, x26, [x23] + __ ldumax(Assembler::xword, r2, r16, r12); // ldumax x2, x16, [x12] // LSEOp - __ swpa(Assembler::xword, r17, r9, r28); // swpa x17, x9, [x28] - __ ldadda(Assembler::xword, r27, r15, r7); // ldadda x27, x15, [x7] - __ ldbica(Assembler::xword, r21, r23, sp); // ldclra x21, x23, [sp] - __ ldeora(Assembler::xword, r25, r2, sp); // ldeora x25, x2, [sp] - __ ldorra(Assembler::xword, r27, r16, r10); // ldseta x27, x16, [x10] - __ ldsmina(Assembler::xword, r23, r19, r3); // ldsmina x23, x19, [x3] - __ ldsmaxa(Assembler::xword, r16, r0, r25); // ldsmaxa x16, x0, [x25] - __ ldumina(Assembler::xword, r26, r23, r2); // ldumina x26, x23, [x2] - __ ldumaxa(Assembler::xword, r16, r12, r4); // ldumaxa x16, x12, [x4] + __ swpa(Assembler::xword, r4, r28, r30); // swpa x4, x28, [x30] + __ ldadda(Assembler::xword, r29, r16, r27); // ldadda x29, x16, [x27] + __ ldbica(Assembler::xword, r6, r9, r29); // ldclra x6, x9, [x29] + __ ldeora(Assembler::xword, r16, r7, r4); // ldeora x16, x7, [x4] + __ ldorra(Assembler::xword, r7, r15, r9); // ldseta x7, x15, [x9] + __ ldsmina(Assembler::xword, r23, r8, r2); // ldsmina x23, x8, [x2] + __ ldsmaxa(Assembler::xword, r28, r21, sp); // ldsmaxa x28, x21, [sp] + __ ldumina(Assembler::xword, r5, r27, r0); // ldumina x5, x27, [x0] + __ ldumaxa(Assembler::xword, r17, r15, r4); // ldumaxa x17, x15, [x4] // LSEOp - __ swpal(Assembler::xword, r28, r30, r29); // swpal x28, x30, [x29] - __ ldaddal(Assembler::xword, r16, r27, r6); // ldaddal x16, x27, [x6] - __ ldbical(Assembler::xword, r9, r29, r15); // ldclral x9, x29, [x15] - __ ldeoral(Assembler::xword, r7, r4, r7); // ldeoral x7, x4, [x7] - __ ldorral(Assembler::xword, r15, r9, r23); // ldsetal x15, x9, [x23] - __ ldsminal(Assembler::xword, r8, r2, r28); // ldsminal x8, x2, [x28] - __ ldsmaxal(Assembler::xword, r21, zr, r5); // ldsmaxal x21, xzr, [x5] - __ lduminal(Assembler::xword, r27, r0, r17); // lduminal x27, x0, [x17] - __ ldumaxal(Assembler::xword, r15, r4, r26); // ldumaxal x15, x4, [x26] + __ swpal(Assembler::xword, r26, r8, r28); // swpal x26, x8, [x28] + __ ldaddal(Assembler::xword, r22, r27, r27); // ldaddal x22, x27, [x27] + __ ldbical(Assembler::xword, r25, r23, r0); // ldclral x25, x23, [x0] + __ ldeoral(Assembler::xword, r4, r6, r15); // ldeoral x4, x6, [x15] + __ ldorral(Assembler::xword, r0, r4, r15); // ldsetal x0, x4, [x15] + __ ldsminal(Assembler::xword, r1, r10, r7); // ldsminal x1, x10, [x7] + __ ldsmaxal(Assembler::xword, r5, r10, r28); // ldsmaxal x5, x10, [x28] + __ lduminal(Assembler::xword, r7, r20, r23); // lduminal x7, x20, [x23] + __ ldumaxal(Assembler::xword, r21, r6, r11); // ldumaxal x21, x6, [x11] // LSEOp - __ swpl(Assembler::xword, r8, r28, r22); // swpl x8, x28, [x22] - __ ldaddl(Assembler::xword, r27, r27, r25); // ldaddl x27, x27, [x25] - __ ldbicl(Assembler::xword, r23, r0, r4); // ldclrl x23, x0, [x4] - __ ldeorl(Assembler::xword, r6, r16, r0); // ldeorl x6, x16, [x0] - __ ldorrl(Assembler::xword, r4, r15, r1); // ldsetl x4, x15, [x1] - __ ldsminl(Assembler::xword, r10, r7, r5); // ldsminl x10, x7, [x5] - __ ldsmaxl(Assembler::xword, r10, r28, r7); // ldsmaxl x10, x28, [x7] - __ lduminl(Assembler::xword, r20, r23, r21); // lduminl x20, x23, [x21] - __ ldumaxl(Assembler::xword, r6, r11, r8); // ldumaxl x6, x11, [x8] + __ swpl(Assembler::xword, r8, r17, sp); // swpl x8, x17, [sp] + __ ldaddl(Assembler::xword, r6, r17, r2); // ldaddl x6, x17, [x2] + __ ldbicl(Assembler::xword, r12, r30, r29); // ldclrl x12, x30, [x29] + __ ldeorl(Assembler::xword, r3, r27, r22); // ldeorl x3, x27, [x22] + __ ldorrl(Assembler::xword, r29, r14, r13); // ldsetl x29, x14, [x13] + __ ldsminl(Assembler::xword, r28, r17, r24); // ldsminl x28, x17, [x24] + __ ldsmaxl(Assembler::xword, r5, r2, r14); // ldsmaxl x5, x2, [x14] + __ lduminl(Assembler::xword, r10, r16, r11); // lduminl x10, x16, [x11] + __ ldumaxl(Assembler::xword, r27, r23, r12); // ldumaxl x27, x23, [x12] // LSEOp - __ swp(Assembler::word, r17, zr, r6); // swp w17, wzr, [x6] - __ ldadd(Assembler::word, r17, r2, r12); // ldadd w17, w2, [x12] - __ ldbic(Assembler::word, r30, r29, r3); // ldclr w30, w29, [x3] - __ ldeor(Assembler::word, r27, r22, r29); // ldeor w27, w22, [x29] - __ ldorr(Assembler::word, r14, r13, r28); // ldset w14, w13, [x28] - __ ldsmin(Assembler::word, r17, r24, r5); // ldsmin w17, w24, [x5] - __ ldsmax(Assembler::word, r2, r14, r10); // ldsmax w2, w14, [x10] - __ ldumin(Assembler::word, r16, r11, r27); // ldumin w16, w11, [x27] - __ ldumax(Assembler::word, r23, r12, r4); // ldumax w23, w12, [x4] + __ swp(Assembler::word, r4, r22, r17); // swp w4, w22, [x17] + __ ldadd(Assembler::word, r4, r1, r19); // ldadd w4, w1, [x19] + __ ldbic(Assembler::word, r16, r16, r13); // ldclr w16, w16, [x13] + __ ldeor(Assembler::word, r14, r12, r2); // ldeor w14, w12, [x2] + __ ldorr(Assembler::word, r17, r3, r21); // ldset w17, w3, [x21] + __ ldsmin(Assembler::word, r23, r5, r6); // ldsmin w23, w5, [x6] + __ ldsmax(Assembler::word, r7, r19, r13); // ldsmax w7, w19, [x13] + __ ldumin(Assembler::word, r28, r17, r16); // ldumin w28, w17, [x16] + __ ldumax(Assembler::word, r6, r2, r29); // ldumax w6, w2, [x29] // LSEOp - __ swpa(Assembler::word, r22, r17, r4); // swpa w22, w17, [x4] - __ ldadda(Assembler::word, r1, r19, r16); // ldadda w1, w19, [x16] - __ ldbica(Assembler::word, r16, r13, r14); // ldclra w16, w13, [x14] - __ ldeora(Assembler::word, r12, r2, r17); // ldeora w12, w2, [x17] - __ ldorra(Assembler::word, r3, r21, r23); // ldseta w3, w21, [x23] - __ ldsmina(Assembler::word, r5, r6, r7); // ldsmina w5, w6, [x7] - __ ldsmaxa(Assembler::word, r19, r13, r28); // ldsmaxa w19, w13, [x28] - __ ldumina(Assembler::word, r17, r16, r6); // ldumina w17, w16, [x6] - __ ldumaxa(Assembler::word, r2, r29, r3); // ldumaxa w2, w29, [x3] + __ swpa(Assembler::word, r3, r4, r6); // swpa w3, w4, [x6] + __ ldadda(Assembler::word, r16, r20, r13); // ldadda w16, w20, [x13] + __ ldbica(Assembler::word, r12, r20, r8); // ldclra w12, w20, [x8] + __ ldeora(Assembler::word, r25, r20, r19); // ldeora w25, w20, [x19] + __ ldorra(Assembler::word, r0, r11, r24); // ldseta w0, w11, [x24] + __ ldsmina(Assembler::word, r6, r20, sp); // ldsmina w6, w20, [sp] + __ ldsmaxa(Assembler::word, r14, r16, r6); // ldsmaxa w14, w16, [x6] + __ ldumina(Assembler::word, r0, r7, r15); // ldumina w0, w7, [x15] + __ ldumaxa(Assembler::word, r19, r26, r9); // ldumaxa w19, w26, [x9] // LSEOp - __ swpal(Assembler::word, r4, r6, r15); // swpal w4, w6, [x15] - __ ldaddal(Assembler::word, r20, r13, r12); // ldaddal w20, w13, [x12] - __ ldbical(Assembler::word, r20, r8, r25); // ldclral w20, w8, [x25] - __ ldeoral(Assembler::word, r20, r19, r0); // ldeoral w20, w19, [x0] - __ ldorral(Assembler::word, r11, r24, r6); // ldsetal w11, w24, [x6] - __ ldsminal(Assembler::word, r20, zr, r14); // ldsminal w20, wzr, [x14] - __ ldsmaxal(Assembler::word, r16, r6, r0); // ldsmaxal w16, w6, [x0] - __ lduminal(Assembler::word, r7, r15, r19); // lduminal w7, w15, [x19] - __ ldumaxal(Assembler::word, r26, r9, r10); // ldumaxal w26, w9, [x10] + __ swpal(Assembler::word, r10, r23, r21); // swpal w10, w23, [x21] + __ ldaddal(Assembler::word, r22, r28, r2); // ldaddal w22, w28, [x2] + __ ldbical(Assembler::word, r3, r15, r19); // ldclral w3, w15, [x19] + __ ldeoral(Assembler::word, r20, r7, r4); // ldeoral w20, w7, [x4] + __ ldorral(Assembler::word, r29, r7, r0); // ldsetal w29, w7, [x0] + __ ldsminal(Assembler::word, r9, r16, r20); // ldsminal w9, w16, [x20] + __ ldsmaxal(Assembler::word, r23, r4, r16); // ldsmaxal w23, w4, [x16] + __ lduminal(Assembler::word, r10, r23, r11); // lduminal w10, w23, [x11] + __ ldumaxal(Assembler::word, r25, r6, sp); // ldumaxal w25, w6, [sp] // LSEOp - __ swpl(Assembler::word, r23, r21, r22); // swpl w23, w21, [x22] - __ ldaddl(Assembler::word, r28, r2, r3); // ldaddl w28, w2, [x3] - __ ldbicl(Assembler::word, r15, r19, r20); // ldclrl w15, w19, [x20] - __ ldeorl(Assembler::word, r7, r4, r29); // ldeorl w7, w4, [x29] - __ ldorrl(Assembler::word, r7, r0, r9); // ldsetl w7, w0, [x9] - __ ldsminl(Assembler::word, r16, r20, r23); // ldsminl w16, w20, [x23] - __ ldsmaxl(Assembler::word, r4, r16, r10); // ldsmaxl w4, w16, [x10] - __ lduminl(Assembler::word, r23, r11, r25); // lduminl w23, w11, [x25] - __ ldumaxl(Assembler::word, r6, zr, r16); // ldumaxl w6, wzr, [x16] + __ swpl(Assembler::word, r16, r13, r23); // swpl w16, w13, [x23] + __ ldaddl(Assembler::word, r12, r1, r14); // ldaddl w12, w1, [x14] + __ ldbicl(Assembler::word, r9, r21, r16); // ldclrl w9, w21, [x16] + __ ldeorl(Assembler::word, r26, r15, r4); // ldeorl w26, w15, [x4] + __ ldorrl(Assembler::word, r4, r16, r8); // ldsetl w4, w16, [x8] + __ ldsminl(Assembler::word, r6, r30, r4); // ldsminl w6, w30, [x4] + __ ldsmaxl(Assembler::word, r29, r17, r29); // ldsmaxl w29, w17, [x29] + __ lduminl(Assembler::word, r26, r9, r15); // lduminl w26, w9, [x15] + __ ldumaxl(Assembler::word, r2, r11, r29); // ldumaxl w2, w11, [x29] // SHA3SIMDOp - __ bcax(v13, __ T16B, v22, v11, v1); // bcax v13.16B, v22.16B, v11.16B, v1.16B - __ eor3(v13, __ T16B, v8, v20, v16); // eor3 v13.16B, v8.16B, v20.16B, v16.16B - __ rax1(v25, __ T2D, v15, v4); // rax1 v25.2D, v15.2D, v4.2D - __ xar(v4, __ T2D, v17, v8, 13); // xar v4.2D, v17.2D, v8.2D, #13 + __ bcax(v3, __ T16B, v7, v1, v27); // bcax v3.16B, v7.16B, v1.16B, v27.16B + __ eor3(v21, __ T16B, v18, v14, v8); // eor3 v21.16B, v18.16B, v14.16B, v8.16B + __ rax1(v18, __ T2D, v22, v25); // rax1 v18.2D, v22.2D, v25.2D + __ xar(v5, __ T2D, v20, v21, 37); // xar v5.2D, v20.2D, v21.2D, #37 // SHA512SIMDOp - __ sha512h(v29, __ T2D, v4, v28); // sha512h q29, q4, v28.2D - __ sha512h2(v16, __ T2D, v29, v26); // sha512h2 q16, q29, v26.2D - __ sha512su0(v9, __ T2D, v14); // sha512su0 v9.2D, v14.2D - __ sha512su1(v2, __ T2D, v11, v28); // sha512su1 v2.2D, v11.2D, v28.2D + __ sha512h(v23, __ T2D, v16, v30); // sha512h q23, q16, v30.2D + __ sha512h2(v20, __ T2D, v20, v0); // sha512h2 q20, q20, v0.2D + __ sha512su0(v4, __ T2D, v19); // sha512su0 v4.2D, v19.2D + __ sha512su1(v24, __ T2D, v4, v20); // sha512su1 v24.2D, v4.2D, v20.2D // SVEBinaryImmOp - __ sve_add(z3, __ B, 10u); // add z3.b, z3.b, #0xa - __ sve_sub(z26, __ S, 150u); // sub z26.s, z26.s, #0x96 - __ sve_and(z14, __ H, 57343u); // and z14.h, z14.h, #0xdfff - __ sve_eor(z24, __ B, 191u); // eor z24.b, z24.b, #0xbf - __ sve_orr(z17, __ S, 4294966791u); // orr z17.s, z17.s, #0xfffffe07 + __ sve_add(z4, __ D, 210u); // add z4.d, z4.d, #0xd2 + __ sve_sub(z19, __ B, 71u); // sub z19.b, z19.b, #0x47 + __ sve_and(z8, __ H, 49663u); // and z8.h, z8.h, #0xc1ff + __ sve_eor(z31, __ S, 4294967231u); // eor z31.s, z31.s, #0xffffffbf + __ sve_orr(z1, __ H, 16368u); // orr z1.h, z1.h, #0x3ff0 // SVEBinaryImmOp - __ sve_add(z20, __ S, 3u); // add z20.s, z20.s, #0x3 - __ sve_sub(z4, __ S, 196u); // sub z4.s, z4.s, #0xc4 - __ sve_and(z4, __ S, 4286578691u); // and z4.s, z4.s, #0xff800003 - __ sve_eor(z25, __ S, 33553408u); // eor z25.s, z25.s, #0x1fffc00 - __ sve_orr(z8, __ H, 49663u); // orr z8.h, z8.h, #0xc1ff + __ sve_add(z0, __ H, 61u); // add z0.h, z0.h, #0x3d + __ sve_sub(z24, __ S, 36u); // sub z24.s, z24.s, #0x24 + __ sve_and(z27, __ B, 243u); // and z27.b, z27.b, #0xf3 + __ sve_eor(z24, __ H, 65534u); // eor z24.h, z24.h, #0xfffe + __ sve_orr(z22, __ S, 4294967293u); // orr z22.s, z22.s, #0xfffffffd // SVEBinaryImmOp - __ sve_add(z30, __ S, 36u); // add z30.s, z30.s, #0x24 - __ sve_sub(z30, __ B, 85u); // sub z30.b, z30.b, #0x55 - __ sve_and(z19, __ H, 4032u); // and z19.h, z19.h, #0xfc0 - __ sve_eor(z7, __ D, 274877904896u); // eor z7.d, z7.d, #0x3ffffff800 - __ sve_orr(z27, __ B, 243u); // orr z27.b, z27.b, #0xf3 + __ sve_add(z29, __ H, 113u); // add z29.h, z29.h, #0x71 + __ sve_sub(z20, __ B, 165u); // sub z20.b, z20.b, #0xa5 + __ sve_and(z28, __ H, 32256u); // and z28.h, z28.h, #0x7e00 + __ sve_eor(z12, __ S, 4287102855u); // eor z12.s, z12.s, #0xff87ff87 + __ sve_orr(z9, __ S, 3825205247u); // orr z9.s, z9.s, #0xe3ffffff // SVEBinaryImmOp - __ sve_add(z23, __ H, 132u); // add z23.h, z23.h, #0x84 - __ sve_sub(z30, __ S, 183u); // sub z30.s, z30.s, #0xb7 - __ sve_and(z20, __ D, 4503599627354112u); // and z20.d, z20.d, #0xfffffffffc000 - __ sve_eor(z13, __ S, 4042322160u); // eor z13.s, z13.s, #0xf0f0f0f0 - __ sve_orr(z28, __ H, 32256u); // orr z28.h, z28.h, #0x7e00 + __ sve_add(z18, __ S, 41u); // add z18.s, z18.s, #0x29 + __ sve_sub(z0, __ B, 98u); // sub z0.b, z0.b, #0x62 + __ sve_and(z8, __ H, 32768u); // and z8.h, z8.h, #0x8000 + __ sve_eor(z4, __ H, 508u); // eor z4.h, z4.h, #0x1fc + __ sve_orr(z0, __ H, 64512u); // orr z0.h, z0.h, #0xfc00 // SVEBinaryImmOp - __ sve_add(z11, __ S, 13u); // add z11.s, z11.s, #0xd - __ sve_sub(z24, __ H, 159u); // sub z24.h, z24.h, #0x9f - __ sve_and(z13, __ S, 2151677951u); // and z13.s, z13.s, #0x803fffff - __ sve_eor(z4, __ B, 124u); // eor z4.b, z4.b, #0x7c - __ sve_orr(z7, __ H, 32768u); // orr z7.h, z7.h, #0x8000 + __ sve_add(z3, __ B, 79u); // add z3.b, z3.b, #0x4f + __ sve_sub(z19, __ D, 84u); // sub z19.d, z19.d, #0x54 + __ sve_and(z24, __ B, 62u); // and z24.b, z24.b, #0x3e + __ sve_eor(z24, __ D, 18428729675200069887u); // eor z24.d, z24.d, #0xffc00000000000ff + __ sve_orr(z11, __ D, 17296056810822168583u); // orr z11.d, z11.d, #0xf007f007f007f007 // SVEBinaryImmOp - __ sve_add(z4, __ H, 243u); // add z4.h, z4.h, #0xf3 - __ sve_sub(z5, __ B, 86u); // sub z5.b, z5.b, #0x56 - __ sve_and(z21, __ D, 8064u); // and z21.d, z21.d, #0x1f80 - __ sve_eor(z9, __ S, 130023424u); // eor z9.s, z9.s, #0x7c00000 - __ sve_orr(z24, __ B, 62u); // orr z24.b, z24.b, #0x3e + __ sve_add(z31, __ S, 115u); // add z31.s, z31.s, #0x73 + __ sve_sub(z3, __ D, 134u); // sub z3.d, z3.d, #0x86 + __ sve_and(z22, __ S, 4042322160u); // and z22.s, z22.s, #0xf0f0f0f0 + __ sve_eor(z3, __ B, 225u); // eor z3.b, z3.b, #0xe1 + __ sve_orr(z9, __ S, 4164941887u); // orr z9.s, z9.s, #0xf83ff83f // SVEVectorOp - __ sve_add(z23, __ S, z28, z13); // add z23.s, z28.s, z13.s - __ sve_sub(z10, __ S, z26, z12); // sub z10.s, z26.s, z12.s - __ sve_fadd(z30, __ S, z17, z14); // fadd z30.s, z17.s, z14.s - __ sve_fmul(z29, __ D, z16, z21); // fmul z29.d, z16.d, z21.d - __ sve_fsub(z7, __ S, z19, z2); // fsub z7.s, z19.s, z2.s - __ sve_abs(z26, __ S, p4, z9); // abs z26.s, p4/m, z9.s - __ sve_add(z17, __ B, p5, z0); // add z17.b, p5/m, z17.b, z0.b - __ sve_and(z2, __ B, p6, z14); // and z2.b, p6/m, z2.b, z14.b - __ sve_asr(z11, __ S, p5, z14); // asr z11.s, p5/m, z11.s, z14.s - __ sve_bic(z29, __ B, p3, z3); // bic z29.b, p3/m, z29.b, z3.b - __ sve_clz(z22, __ D, p2, z3); // clz z22.d, p2/m, z3.d - __ sve_cnt(z27, __ S, p0, z19); // cnt z27.s, p0/m, z19.s - __ sve_eor(z7, __ H, p6, z21); // eor z7.h, p6/m, z7.h, z21.h - __ sve_lsl(z5, __ B, p2, z25); // lsl z5.b, p2/m, z5.b, z25.b - __ sve_lsr(z21, __ B, p4, z17); // lsr z21.b, p4/m, z21.b, z17.b - __ sve_mul(z3, __ H, p2, z19); // mul z3.h, p2/m, z3.h, z19.h - __ sve_neg(z7, __ S, p3, z14); // neg z7.s, p3/m, z14.s - __ sve_not(z17, __ D, p2, z13); // not z17.d, p2/m, z13.d - __ sve_orr(z17, __ H, p7, z17); // orr z17.h, p7/m, z17.h, z17.h - __ sve_rbit(z15, __ S, p3, z26); // rbit z15.s, p3/m, z26.s - __ sve_revb(z27, __ H, p5, z7); // revb z27.h, p5/m, z7.h - __ sve_smax(z5, __ H, p7, z27); // smax z5.h, p7/m, z5.h, z27.h - __ sve_smin(z0, __ S, p3, z24); // smin z0.s, p3/m, z0.s, z24.s - __ sve_sub(z20, __ S, p0, z3); // sub z20.s, p0/m, z20.s, z3.s - __ sve_fabs(z25, __ D, p1, z25); // fabs z25.d, p1/m, z25.d - __ sve_fadd(z17, __ S, p4, z1); // fadd z17.s, p4/m, z17.s, z1.s - __ sve_fdiv(z14, __ S, p7, z13); // fdiv z14.s, p7/m, z14.s, z13.s - __ sve_fmax(z17, __ D, p0, z30); // fmax z17.d, p0/m, z17.d, z30.d - __ sve_fmin(z22, __ S, p5, z29); // fmin z22.s, p5/m, z22.s, z29.s - __ sve_fmul(z8, __ S, p0, z0); // fmul z8.s, p0/m, z8.s, z0.s - __ sve_fneg(z23, __ D, p5, z0); // fneg z23.d, p5/m, z0.d - __ sve_frintm(z25, __ S, p6, z23); // frintm z25.s, p6/m, z23.s - __ sve_frintn(z21, __ S, p5, z1); // frintn z21.s, p5/m, z1.s - __ sve_frintp(z10, __ D, p5, z11); // frintp z10.d, p5/m, z11.d - __ sve_fsqrt(z23, __ D, p6, z8); // fsqrt z23.d, p6/m, z8.d - __ sve_fsub(z17, __ D, p5, z19); // fsub z17.d, p5/m, z17.d, z19.d - __ sve_fmad(z4, __ D, p5, z13, z30); // fmad z4.d, p5/m, z13.d, z30.d - __ sve_fmla(z30, __ D, p7, z25, z17); // fmla z30.d, p7/m, z25.d, z17.d - __ sve_fmls(z14, __ D, p2, z12, z28); // fmls z14.d, p2/m, z12.d, z28.d - __ sve_fmsb(z5, __ S, p0, z13, z13); // fmsb z5.s, p0/m, z13.s, z13.s - __ sve_fnmad(z7, __ S, p2, z11, z19); // fnmad z7.s, p2/m, z11.s, z19.s - __ sve_fnmsb(z25, __ D, p3, z2, z3); // fnmsb z25.d, p3/m, z2.d, z3.d - __ sve_fnmla(z0, __ D, p5, z5, z20); // fnmla z0.d, p5/m, z5.d, z20.d - __ sve_fnmls(z28, __ S, p3, z13, z8); // fnmls z28.s, p3/m, z13.s, z8.s - __ sve_mla(z29, __ B, p0, z14, z27); // mla z29.b, p0/m, z14.b, z27.b - __ sve_mls(z3, __ H, p6, z8, z24); // mls z3.h, p6/m, z8.h, z24.h - __ sve_and(z1, z25, z10); // and z1.d, z25.d, z10.d - __ sve_eor(z1, z20, z25); // eor z1.d, z20.d, z25.d - __ sve_orr(z28, z19, z16); // orr z28.d, z19.d, z16.d - __ sve_bic(z27, z13, z1); // bic z27.d, z13.d, z1.d - __ sve_uzp1(z11, __ B, z9, z1); // uzp1 z11.b, z9.b, z1.b - __ sve_uzp2(z1, __ H, z27, z26); // uzp2 z1.h, z27.h, z26.h - __ sve_fabd(z2, __ D, p1, z29); // fabd z2.d, p1/m, z2.d, z29.d - __ sve_bext(z24, __ D, z2, z2); // bext z24.d, z2.d, z2.d - __ sve_bdep(z3, __ H, z25, z28); // bdep z3.h, z25.h, z28.h - __ sve_eor3(z3, z22, z13); // eor3 z3.d, z3.d, z22.d, z13.d + __ sve_add(z0, __ D, z4, z2); // add z0.d, z4.d, z2.d + __ sve_sub(z14, __ S, z6, z11); // sub z14.s, z6.s, z11.s + __ sve_fadd(z14, __ S, z17, z30); // fadd z14.s, z17.s, z30.s + __ sve_fmul(z3, __ S, z3, z23); // fmul z3.s, z3.s, z23.s + __ sve_fsub(z3, __ S, z24, z28); // fsub z3.s, z24.s, z28.s + __ sve_abs(z19, __ D, p5, z7); // abs z19.d, p5/m, z7.d + __ sve_add(z21, __ H, p3, z5); // add z21.h, p3/m, z21.h, z5.h + __ sve_and(z26, __ S, p1, z22); // and z26.s, p1/m, z26.s, z22.s + __ sve_asr(z17, __ H, p0, z3); // asr z17.h, p0/m, z17.h, z3.h + __ sve_bic(z20, __ H, p3, z8); // bic z20.h, p3/m, z20.h, z8.h + __ sve_clz(z14, __ H, p4, z17); // clz z14.h, p4/m, z17.h + __ sve_cnt(z13, __ D, p6, z18); // cnt z13.d, p6/m, z18.d + __ sve_eor(z19, __ H, p2, z16); // eor z19.h, p2/m, z19.h, z16.h + __ sve_lsl(z27, __ S, p5, z28); // lsl z27.s, p5/m, z27.s, z28.s + __ sve_lsr(z8, __ D, p2, z5); // lsr z8.d, p2/m, z8.d, z5.d + __ sve_mul(z28, __ H, p2, z0); // mul z28.h, p2/m, z28.h, z0.h + __ sve_neg(z25, __ B, p5, z21); // neg z25.b, p5/m, z21.b + __ sve_not(z3, __ B, p5, z26); // not z3.b, p5/m, z26.b + __ sve_orr(z26, __ S, p7, z19); // orr z26.s, p7/m, z26.s, z19.s + __ sve_rbit(z1, __ D, p3, z14); // rbit z1.d, p3/m, z14.d + __ sve_revb(z14, __ H, p0, z18); // revb z14.h, p0/m, z18.h + __ sve_smax(z31, __ S, p5, z23); // smax z31.s, p5/m, z31.s, z23.s + __ sve_smin(z30, __ B, p3, z8); // smin z30.b, p3/m, z30.b, z8.b + __ sve_sub(z0, __ S, p3, z23); // sub z0.s, p3/m, z0.s, z23.s + __ sve_fabs(z0, __ D, p4, z26); // fabs z0.d, p4/m, z26.d + __ sve_fadd(z24, __ D, p3, z22); // fadd z24.d, p3/m, z24.d, z22.d + __ sve_fdiv(z2, __ D, p0, z11); // fdiv z2.d, p0/m, z2.d, z11.d + __ sve_fmax(z12, __ D, p5, z24); // fmax z12.d, p5/m, z12.d, z24.d + __ sve_fmin(z9, __ D, p7, z17); // fmin z9.d, p7/m, z9.d, z17.d + __ sve_fmul(z20, __ D, p5, z4); // fmul z20.d, p5/m, z20.d, z4.d + __ sve_fneg(z13, __ D, p7, z22); // fneg z13.d, p7/m, z22.d + __ sve_frintm(z31, __ D, p6, z18); // frintm z31.d, p6/m, z18.d + __ sve_frintn(z15, __ D, p2, z13); // frintn z15.d, p2/m, z13.d + __ sve_frintp(z20, __ S, p1, z1); // frintp z20.s, p1/m, z1.s + __ sve_fsqrt(z14, __ S, p0, z7); // fsqrt z14.s, p0/m, z7.s + __ sve_fsub(z12, __ D, p4, z4); // fsub z12.d, p4/m, z12.d, z4.d + __ sve_fmad(z15, __ S, p0, z3, z30); // fmad z15.s, p0/m, z3.s, z30.s + __ sve_fmla(z20, __ D, p1, z20, z31); // fmla z20.d, p1/m, z20.d, z31.d + __ sve_fmls(z13, __ D, p3, z9, z14); // fmls z13.d, p3/m, z9.d, z14.d + __ sve_fmsb(z1, __ S, p3, z28, z3); // fmsb z1.s, p3/m, z28.s, z3.s + __ sve_fnmad(z26, __ S, p2, z25, z9); // fnmad z26.s, p2/m, z25.s, z9.s + __ sve_fnmsb(z26, __ D, p2, z14, z1); // fnmsb z26.d, p2/m, z14.d, z1.d + __ sve_fnmla(z26, __ D, p1, z29, z20); // fnmla z26.d, p1/m, z29.d, z20.d + __ sve_fnmls(z6, __ D, p7, z13, z1); // fnmls z6.d, p7/m, z13.d, z1.d + __ sve_mla(z11, __ B, p2, z1, z1); // mla z11.b, p2/m, z1.b, z1.b + __ sve_mls(z27, __ B, p6, z15, z2); // mls z27.b, p6/m, z15.b, z2.b + __ sve_and(z30, z17, z25); // and z30.d, z17.d, z25.d + __ sve_eor(z2, z24, z3); // eor z2.d, z24.d, z3.d + __ sve_orr(z29, z13, z3); // orr z29.d, z13.d, z3.d + __ sve_bic(z14, z16, z28); // bic z14.d, z16.d, z28.d + __ sve_uzp1(z4, __ S, z11, z27); // uzp1 z4.s, z11.s, z27.s + __ sve_uzp2(z2, __ D, z16, z1); // uzp2 z2.d, z16.d, z1.d + __ sve_fabd(z7, __ D, p5, z31); // fabd z7.d, p5/m, z7.d, z31.d + __ sve_bext(z16, __ S, z10, z22); // bext z16.s, z10.s, z22.s + __ sve_bdep(z29, __ B, z7, z22); // bdep z29.b, z7.b, z22.b + __ sve_eor3(z12, z24, z11); // eor3 z12.d, z12.d, z24.d, z11.d // SVEReductionOp - __ sve_andv(v27, __ H, p4, z4); // andv h27, p4, z4.h - __ sve_orv(v26, __ S, p4, z2); // orv s26, p4, z2.s - __ sve_eorv(v1, __ S, p7, z7); // eorv s1, p7, z7.s - __ sve_smaxv(v30, __ H, p7, z16); // smaxv h30, p7, z16.h - __ sve_sminv(v21, __ B, p4, z28); // sminv b21, p4, z28.b - __ sve_fminv(v21, __ D, p1, z12); // fminv d21, p1, z12.d - __ sve_fmaxv(v11, __ S, p2, z10); // fmaxv s11, p2, z10.s - __ sve_fadda(v0, __ D, p1, z22); // fadda d0, p1, d0, z22.d - __ sve_uaddv(v20, __ H, p1, z3); // uaddv d20, p1, z3.h + __ sve_andv(v11, __ B, p2, z0); // andv b11, p2, z0.b + __ sve_orv(v23, __ B, p5, z20); // orv b23, p5, z20.b + __ sve_eorv(v3, __ B, p3, z15); // eorv b3, p3, z15.b + __ sve_smaxv(v30, __ B, p6, z27); // smaxv b30, p6, z27.b + __ sve_sminv(v21, __ D, p6, z10); // sminv d21, p6, z10.d + __ sve_fminv(v3, __ S, p6, z4); // fminv s3, p6, z4.s + __ sve_fmaxv(v6, __ S, p0, z21); // fmaxv s6, p0, z21.s + __ sve_fadda(v25, __ D, p6, z30); // fadda d25, p6, d25, z30.d + __ sve_uaddv(v31, __ H, p4, z1); // uaddv d31, p4, z1.h + +// AddWideNEONOp + __ saddwv(v12, v13, __ T8H, v14, __ T8B); // saddw v12.8H, v13.8H, v14.8B + __ saddwv2(v30, v31, __ T8H, v0, __ T16B); // saddw2 v30.8H, v31.8H, v0.16B + __ saddwv(v13, v14, __ T4S, v15, __ T4H); // saddw v13.4S, v14.4S, v15.4H + __ saddwv2(v8, v9, __ T4S, v10, __ T8H); // saddw2 v8.4S, v9.4S, v10.8H + __ saddwv(v25, v26, __ T2D, v27, __ T2S); // saddw v25.2D, v26.2D, v27.2S + __ saddwv2(v29, v30, __ T2D, v31, __ T4S); // saddw2 v29.2D, v30.2D, v31.4S + __ uaddwv(v1, v2, __ T8H, v3, __ T8B); // uaddw v1.8H, v2.8H, v3.8B + __ uaddwv2(v31, v0, __ T8H, v1, __ T16B); // uaddw2 v31.8H, v0.8H, v1.16B + __ uaddwv(v23, v24, __ T4S, v25, __ T4H); // uaddw v23.4S, v24.4S, v25.4H + __ uaddwv2(v31, v0, __ T4S, v1, __ T8H); // uaddw2 v31.4S, v0.4S, v1.8H + __ uaddwv(v20, v21, __ T2D, v22, __ T2S); // uaddw v20.2D, v21.2D, v22.2S + __ uaddwv2(v0, v1, __ T2D, v2, __ T4S); // uaddw2 v0.2D, v1.2D, v2.4S __ bind(forth); @@ -1298,30 +1327,30 @@ 0x9101a1a0, 0xb10a5cc8, 0xd10810aa, 0xf10fd061, 0x120cb166, 0x321764bc, 0x52174681, 0x720c0227, 0x9241018e, 0xb25a2969, 0xd278b411, 0xf26aad01, - 0x14000000, 0x17ffffd7, 0x14000428, 0x94000000, - 0x97ffffd4, 0x94000425, 0x3400000a, 0x34fffa2a, - 0x3400844a, 0x35000008, 0x35fff9c8, 0x350083e8, - 0xb400000b, 0xb4fff96b, 0xb400838b, 0xb500001d, - 0xb5fff91d, 0xb500833d, 0x10000013, 0x10fff8b3, - 0x100082d3, 0x90000013, 0x36300016, 0x3637f836, - 0x36308256, 0x3758000c, 0x375ff7cc, 0x375881ec, + 0x14000000, 0x17ffffd7, 0x14000441, 0x94000000, + 0x97ffffd4, 0x9400043e, 0x3400000a, 0x34fffa2a, + 0x3400876a, 0x35000008, 0x35fff9c8, 0x35008708, + 0xb400000b, 0xb4fff96b, 0xb40086ab, 0xb500001d, + 0xb5fff91d, 0xb500865d, 0x10000013, 0x10fff8b3, + 0x100085f3, 0x90000013, 0x36300016, 0x3637f836, + 0x36308576, 0x3758000c, 0x375ff7cc, 0x3758850c, 0x128313a0, 0x528a32c7, 0x7289173b, 0x92ab3acc, 0xd2a0bf94, 0xf2c285e8, 0x9358722f, 0x330e652f, 0x53067f3b, 0x93577c53, 0xb34a1aac, 0xd35a4016, 0x13946c63, 0x93c3dbc8, 0x54000000, 0x54fff5a0, - 0x54007fc0, 0x54000001, 0x54fff541, 0x54007f61, - 0x54000002, 0x54fff4e2, 0x54007f02, 0x54000002, - 0x54fff482, 0x54007ea2, 0x54000003, 0x54fff423, - 0x54007e43, 0x54000003, 0x54fff3c3, 0x54007de3, - 0x54000004, 0x54fff364, 0x54007d84, 0x54000005, - 0x54fff305, 0x54007d25, 0x54000006, 0x54fff2a6, - 0x54007cc6, 0x54000007, 0x54fff247, 0x54007c67, - 0x54000008, 0x54fff1e8, 0x54007c08, 0x54000009, - 0x54fff189, 0x54007ba9, 0x5400000a, 0x54fff12a, - 0x54007b4a, 0x5400000b, 0x54fff0cb, 0x54007aeb, - 0x5400000c, 0x54fff06c, 0x54007a8c, 0x5400000d, - 0x54fff00d, 0x54007a2d, 0x5400000e, 0x54ffefae, - 0x540079ce, 0x5400000f, 0x54ffef4f, 0x5400796f, + 0x540082e0, 0x54000001, 0x54fff541, 0x54008281, + 0x54000002, 0x54fff4e2, 0x54008222, 0x54000002, + 0x54fff482, 0x540081c2, 0x54000003, 0x54fff423, + 0x54008163, 0x54000003, 0x54fff3c3, 0x54008103, + 0x54000004, 0x54fff364, 0x540080a4, 0x54000005, + 0x54fff305, 0x54008045, 0x54000006, 0x54fff2a6, + 0x54007fe6, 0x54000007, 0x54fff247, 0x54007f87, + 0x54000008, 0x54fff1e8, 0x54007f28, 0x54000009, + 0x54fff189, 0x54007ec9, 0x5400000a, 0x54fff12a, + 0x54007e6a, 0x5400000b, 0x54fff0cb, 0x54007e0b, + 0x5400000c, 0x54fff06c, 0x54007dac, 0x5400000d, + 0x54fff00d, 0x54007d4d, 0x5400000e, 0x54ffefae, + 0x54007cee, 0x5400000f, 0x54ffef4f, 0x54007c8f, 0xd40658e1, 0xd4014d22, 0xd4046543, 0xd4273f60, 0xd44cad80, 0xd503201f, 0xd503203f, 0xd503205f, 0xd503209f, 0xd50320bf, 0xd503219f, 0xd50323bf, @@ -1346,23 +1375,23 @@ 0xb81b1022, 0x381ea354, 0x79002fd7, 0xf85cf39a, 0xb8580309, 0x385e218c, 0x784051e1, 0x389e11d8, 0x789fa1f8, 0x79c01865, 0xb881131b, 0xfc5dd3ad, - 0xbc5d1136, 0xfc00900b, 0xbc181014, 0xf818ec7d, + 0xbc5d1137, 0xfc00900b, 0xbc181015, 0xf818ec7d, 0xb81b8c91, 0x381efc40, 0x78007c3d, 0xf857beb0, 0xb8413dd4, 0x385fddd6, 0x78409e2f, 0x389eddea, 0x789e7d94, 0x78de3d55, 0xb8805c13, 0xfc5cadc0, - 0xbc428c23, 0xfc1a2dc4, 0xbc1caf91, 0xf81475f6, + 0xbc428c23, 0xfc1a2dc4, 0xbc1caf92, 0xf81475f6, 0xb81f95d1, 0x381e757e, 0x78014561, 0xf8402436, 0xb85896e2, 0x385f4763, 0x785db4f0, 0x3880374f, 0x789e25e7, 0x78dd0563, 0xb88166f9, 0xfc529540, - 0xbc4374d1, 0xfc1166ad, 0xbc1ba6c0, 0xf820ea7b, + 0xbc4374d3, 0xfc1166ae, 0xbc1ba6c0, 0xf820ea7b, 0xb82d68c8, 0x38367a04, 0x782f4b59, 0xf878c8a4, 0xb8674a24, 0x386b78f1, 0x78776bc0, 0x38a15aca, - 0x78bedbd5, 0x78fcd94b, 0xb8aa4a7c, 0xfc6ecbbd, - 0xbc65d8a8, 0xfc2de918, 0xbc3a7b11, 0xf91f1193, + 0x78bedbd5, 0x78fcd94b, 0xb8aa4a7c, 0xfc6ecbbe, + 0xbc65d8a8, 0xfc2de919, 0xbc3a7b11, 0xf91f1193, 0xb91ed5f7, 0x391ec9bd, 0x79182ceb, 0xf95d4b0a, 0xb9581010, 0x395fc034, 0x795fb221, 0x399d8731, 0x799efb3b, 0x79dd1a2e, 0xb998e4ea, 0xfd583723, - 0xbd5ea12c, 0xfd18dc37, 0xbd1b0e83, 0x58ffdaa2, + 0xbd5ea12c, 0xfd18dc38, 0xbd1b0e83, 0x58ffdaa2, 0x1800001d, 0xf885d1c0, 0xd8ffda40, 0xf8a77820, 0xf9980220, 0x1a030301, 0x3a140311, 0x5a0d000b, 0x7a07015c, 0x9a1001e4, 0xba140182, 0xda0d01bd, @@ -1383,187 +1412,193 @@ 0x9ad521f7, 0x9adb263c, 0x9ac0286a, 0x9ac92f27, 0x9bdd7de6, 0x9b427d4f, 0x1b0b2cf1, 0x1b1ddcf7, 0x9b0b2f6e, 0x9b0cbf04, 0x9b2b728e, 0x9b2cdd6d, - 0x9bae275e, 0x9ba7954d, 0x7ea3d5fd, 0x1e2f098b, - 0x1e311bde, 0x1e2f2a93, 0x1e35392f, 0x7efbd522, - 0x1e7e0ba7, 0x1e621831, 0x1e632946, 0x1e673978, - 0x1f000d61, 0x1f06db91, 0x1f3b6806, 0x1f2770a2, - 0x1f4d2f2b, 0x1f48c677, 0x1f744f35, 0x1f7d5851, - 0x1e2042a8, 0x1e20c293, 0x1e21422b, 0x1e21c0d4, - 0x1e22c06f, 0x1e23c383, 0x1ee24363, 0x1e6041ce, - 0x1e60c18a, 0x1e61422b, 0x1e61c32a, 0x1e6240e7, - 0x1e38038e, 0x9e3802c0, 0x1e780180, 0x9e7801b7, - 0x1e2200ed, 0x9e2200ee, 0x1e620288, 0x9e620391, - 0x1e24021e, 0x9e640122, 0x1e300290, 0x9e70009d, - 0x1e260341, 0x9e6602f8, 0x1e2702ae, 0x9e6700ac, - 0x1e382180, 0x1e7d2300, 0x1e202368, 0x1e6022a8, + 0x9bae275e, 0x9ba7954d, 0x7ea3d5fe, 0x1e30098c, + 0x1e321bff, 0x1e302ab3, 0x1e35394f, 0x7efcd542, + 0x1e7f0bc7, 0x1e621832, 0x1e632946, 0x1e673979, + 0x1f000d81, 0x1f06dfb3, 0x1f3c6c06, 0x1f2774a2, + 0x1f4d332c, 0x1f48ca78, 0x1f755356, 0x1f7e5853, + 0x1e2042c8, 0x1e20c2b3, 0x1e21424c, 0x1e21c0d5, + 0x1e22c070, 0x1e23c3a3, 0x1ee24383, 0x1e6041cf, + 0x1e60c1aa, 0x1e61424c, 0x1e61c34a, 0x1e6240e7, + 0x1e3803ae, 0x9e3802e0, 0x1e780180, 0x9e7801d7, + 0x1e2200ed, 0x9e2200ef, 0x1e620289, 0x9e620393, + 0x1e24021e, 0x9e640122, 0x1e3002b0, 0x9e70009d, + 0x1e260361, 0x9e660318, 0x1e2702ae, 0x9e6700ad, + 0x1e392180, 0x1e7e2320, 0x1e202388, 0x1e6022a8, 0x293a1796, 0x29426e73, 0x697c68fc, 0xa93d0486, 0xa97b5eba, 0x29b47934, 0x29c2534d, 0x69f62dbd, 0xa9bd54bb, 0xa9c503c6, 0x28a63e13, 0x28e25d2c, 0x68c469e0, 0xa8b34748, 0xa8f51c59, 0x28264433, 0x285036c0, 0xa8005f7d, 0xa872290b, 0x0c407160, - 0x4cdfa350, 0x0cd16f55, 0x4cdf27ba, 0x0d40c0d5, - 0x4ddfcbad, 0x0dd0cd95, 0x4c408c01, 0x0cdf86a9, - 0x4d60c327, 0x0dffc928, 0x4deecd89, 0x4cd14887, - 0x0c404a37, 0x4d40e6c3, 0x4ddfe84c, 0x0dcced4f, - 0x4cdf0444, 0x0ccb0286, 0x0d60e18b, 0x0dffe62f, - 0x0df0eb2e, 0x0e31bab4, 0x4e31b841, 0x0e71baf6, + 0x4cdfa350, 0x0cd16f56, 0x4cdf27bb, 0x0d40c0d6, + 0x4ddfcbae, 0x0dd0cd96, 0x4c408c01, 0x0cdf86aa, + 0x4d60c327, 0x0dffc929, 0x4deecd89, 0x4cd14887, + 0x0c404a37, 0x4d40e6c4, 0x4ddfe84d, 0x0dcced50, + 0x4cdf0444, 0x0ccb0286, 0x0d60e18c, 0x0dffe630, + 0x0df0eb2e, 0x0e31bab4, 0x4e31b841, 0x0e71bb17, 0x4e71bbfe, 0x4eb1b9ee, 0x0e30a862, 0x4e30a8e6, - 0x0e70a883, 0x4e70a907, 0x4eb0ab38, 0x6e30f820, - 0x0e31ab9b, 0x2e31abdd, 0x4e31a8c5, 0x6e31a8c5, - 0x0e71abdd, 0x2e71a98b, 0x4e71ab59, 0x6e71a820, - 0x4eb1abfe, 0x6eb1a820, 0x6eb0fa51, 0x7e30fbbc, - 0x7e70fb59, 0x7eb0f949, 0x7ef0fb59, 0x0ea0c9ac, - 0x4ea0ca0f, 0x4ee0c98b, 0x2ea0c96a, 0x6ea0ca51, - 0x6ee0cb38, 0x0ea0dad5, 0x4ea0db17, 0x4ee0d820, - 0x0ea0ea30, 0x4ea0e96a, 0x4ee0e8e6, 0x2ea0dbbc, - 0x6ea0d8e6, 0x6ee0d8c5, 0x0e20b8c5, 0x4e20bab4, - 0x0e60ba51, 0x4e60ba0f, 0x0ea0ba51, 0x4ea0bbdd, - 0x4ee0bb7a, 0x0ea0fbbc, 0x4ea0f841, 0x4ee0fb9b, - 0x2ea0f820, 0x6ea0fab4, 0x6ee0fbbc, 0x2ea1fa0f, - 0x6ea1f9ac, 0x6ee1f96a, 0x2e205bbc, 0x6e205bbc, + 0x0e70a883, 0x4e70a928, 0x4eb0ab59, 0x6e30f820, + 0x0e31ab9b, 0x2e31abfe, 0x4e31a8c5, 0x6e31a8c5, + 0x0e71abfe, 0x2e71a98b, 0x4e71ab59, 0x6e71a820, + 0x4eb1a81f, 0x6eb1a820, 0x6eb0fa93, 0x7e30fbdd, + 0x7e70fb7a, 0x7eb0f949, 0x7ef0fb7a, 0x0ea0c9ac, + 0x4ea0ca0f, 0x4ee0c98b, 0x2ea0c98b, 0x6ea0ca72, + 0x6ee0cb59, 0x0ea0daf6, 0x4ea0db38, 0x4ee0d820, + 0x0ea0ea51, 0x4ea0e98b, 0x4ee0e8e6, 0x2ea0dbdd, + 0x6ea0d8e6, 0x6ee0d8c5, 0x0e20b8c5, 0x4e20bad5, + 0x0e60ba93, 0x4e60ba30, 0x0ea0ba72, 0x4ea0bbfe, + 0x4ee0bb9b, 0x0ea0fbbc, 0x4ea0f841, 0x4ee0fbbc, + 0x2ea0f841, 0x6ea0fab4, 0x6ee0fbdd, 0x2ea1fa30, + 0x6ea1f9cd, 0x6ee1f96a, 0x2e205bdd, 0x6e205bdd, 0x0e351e93, 0x4e381ef6, 0x0eac1d6a, 0x4ea61ca4, - 0x2e201ffe, 0x6e361eb4, 0x0e2a8528, 0x4e2087fe, - 0x0e738651, 0x4e6c856a, 0x0ebd879b, 0x4ea48462, - 0x4efa8738, 0x0e26d4a4, 0x4e25d483, 0x4e6ad528, - 0x2e3886f6, 0x6e338651, 0x2e6f85cd, 0x6e6684a4, - 0x2ebe87bc, 0x6eb98717, 0x6ef786d5, 0x0ebbd759, - 0x4ebad738, 0x4ee5d483, 0x0e399f17, 0x4e3c9f7a, - 0x0e799f17, 0x4e709dee, 0x0eb79ed5, 0x4ea59c83, - 0x2eb9d717, 0x6eaad528, 0x6efad738, 0x2e35d693, - 0x6e31d60f, 0x6e72d630, 0x2e24dc62, 0x6e23dc41, + 0x2e211c1f, 0x6e371ed5, 0x0e2a8528, 0x4e21841f, + 0x0e758693, 0x4e6c856a, 0x0ebe87bc, 0x4ea48462, + 0x4efb8759, 0x0e27d4c5, 0x4e25d483, 0x4e6ad528, + 0x2e3886f6, 0x6e358693, 0x2e6f85cd, 0x6e6784c5, + 0x2ebf87dd, 0x6eba8738, 0x6ef786d5, 0x0ebcd77a, + 0x4ebad738, 0x4ee5d483, 0x0e3a9f38, 0x4e3c9f7a, + 0x0e799f17, 0x4e719e0f, 0x0eb79ed5, 0x4ea59c83, + 0x2ebad738, 0x6eaad528, 0x6efbd759, 0x2e36d6b4, + 0x6e32d630, 0x6e73d651, 0x2e24dc62, 0x6e23dc41, 0x6e62dc20, 0x0e7a9738, 0x4e6694a4, 0x0ea59483, - 0x4ead958b, 0x0e20cffe, 0x4e3dcf9b, 0x4e6bcd49, - 0x2e7b9759, 0x6e649462, 0x2eae95ac, 0x6eb39651, - 0x0ea0cffe, 0x4ea3cc41, 0x4eeecdac, 0x2e3effbc, - 0x6e22fc20, 0x6e73fe51, 0x0e2e65ac, 0x4e336651, - 0x0e7766d5, 0x4e6e65ac, 0x0ebd679b, 0x4ebf67dd, - 0x0e20a7fe, 0x4e23a441, 0x0e7ba759, 0x4e7da79b, - 0x0ea6a4a4, 0x4ebfa7dd, 0x0e25f483, 0x4e28f4e6, - 0x4e7ff7dd, 0x0e3b6f59, 0x4e336e51, 0x0e6a6d28, - 0x4e696d07, 0x0eae6dac, 0x4ea26c20, 0x0e35ae93, - 0x4e23ac41, 0x0e79af17, 0x4e64ac62, 0x0ea2ac20, - 0x4eaaad28, 0x0eb9f717, 0x4ebbf759, 0x4ef1f60f, - 0x2ebfefdd, 0x6ea5ec83, 0x6eeced6a, 0x0e3836f6, - 0x4e2c356a, 0x0e6634a4, 0x4e733651, 0x0ea33441, - 0x4ead358b, 0x4ee93507, 0x0e2c3d6a, 0x4e313e0f, - 0x0e723e30, 0x4e643c62, 0x0eab3d49, 0x4ead3d8b, - 0x4eee3dac, 0x2e308dee, 0x6e2f8dcd, 0x2e648c62, - 0x6e688ce6, 0x2eb58e93, 0x6ebb8f59, 0x6ef18e0f, - 0x2e2634a4, 0x6e243462, 0x2e6634a4, 0x6e6d358b, - 0x2eb33651, 0x6eb636b4, 0x6ef23630, 0x2e333e51, - 0x6e2c3d6a, 0x2e763eb4, 0x6e783ef6, 0x2eae3dac, - 0x6ebb3f59, 0x6ef93f17, 0x0e3ee7bc, 0x4e30e5ee, - 0x4e6ce56a, 0x2ebae738, 0x6ea3e441, 0x6eede58b, - 0x2e20e7fe, 0x6e2ce56a, 0x6e71e60f, 0x65922c43, - 0x65d02219, 0x65d02560, 0x65d13dc4, 0x65913690, - 0x65d33b6b, 0x2500948c, 0x254c08bf, 0x25831f87, - 0x254f30af, 0x259c3359, 0x25019d35, 0x24eac76d, - 0x2431993a, 0x242f7ed8, 0x24a2f62b, 0xba5fd3e3, - 0x3a5f03e5, 0xfa411be4, 0x7a42cbe2, 0x93df03ff, - 0xc820ffff, 0x8822fc7f, 0xc8247cbf, 0x88267fff, - 0x4e010fe0, 0x5e040420, 0x4e081fe1, 0x4e0c1fe1, - 0x4e0a1fe1, 0x4e071fe1, 0x4e042c20, 0x4e062c20, - 0x4e052c20, 0x4e083c20, 0x0e0c3c20, 0x0e0a3c20, - 0x0e073c20, 0x9eae0020, 0x0f03f409, 0x6f03f40e, - 0x4cc0ac3f, 0x0ea1b820, 0x4e21c862, 0x4e61b8a4, - 0x05a08020, 0x05104fe0, 0x05505001, 0x05906fe2, - 0x05d03005, 0x05101fea, 0x05901feb, 0x04b0e3e0, - 0x0470e7e1, 0x042f9c20, 0x043f9c35, 0x047f9c20, - 0x04ff9c20, 0x04299420, 0x04319160, 0x0461943e, - 0x04a19020, 0x04038100, 0x040381a0, 0x040387e1, - 0x04438be2, 0x04c38fe3, 0x040181e0, 0x04018100, - 0x04018621, 0x04418b22, 0x04418822, 0x04818c23, - 0x040081e0, 0x04008120, 0x04008761, 0x04008621, - 0x04408822, 0x04808c23, 0x042053ff, 0x047f5401, - 0x25208028, 0x2538cfe0, 0x2578d001, 0x25b8efe2, - 0x25f8f007, 0x2538dfea, 0x25b8dfeb, 0xa400a3e0, - 0xa420a7e0, 0xa4484be0, 0xa467afe0, 0xa4a8a7ea, - 0xa547a814, 0xa4084ffe, 0xa55c53e0, 0xa5e1540b, - 0xe400fbf6, 0xe408ffff, 0xe420e7e0, 0xe4484be0, - 0xe460efe0, 0xe547e400, 0xe4014be0, 0xe4a84fe0, - 0xe5f15000, 0x858043e0, 0x85a043ff, 0xe59f5d08, - 0x0420e3e9, 0x0460e3ea, 0x04a0e3eb, 0x04e0e3ec, - 0x25104042, 0x25104871, 0x25904861, 0x25904c92, - 0x05344020, 0x05744041, 0x05b44062, 0x05f44083, - 0x252c8840, 0x253c1420, 0x25681572, 0x25a21ce3, - 0x25ea1e34, 0x253c0421, 0x25680572, 0x25a20ce3, - 0x25ea0e34, 0x0522c020, 0x05e6c0a4, 0x2401a001, - 0x2443a051, 0x24858881, 0x24c78cd1, 0x24850891, - 0x24c70cc1, 0x250f9001, 0x25508051, 0x25802491, - 0x25df28c1, 0x25850c81, 0x251e10d1, 0x65816001, - 0x65c36051, 0x65854891, 0x65c74cc1, 0x05733820, - 0x05b238a4, 0x05f138e6, 0x0570396a, 0x65d0a001, - 0x65d6a443, 0x65d4a826, 0x6594ac26, 0x6554ac26, - 0x6556ac26, 0x6552ac26, 0x65cbac85, 0x65caac01, - 0x6589ac85, 0x6588ac01, 0x65c9ac85, 0x65c8ac01, - 0x65dea833, 0x659ca509, 0x65d8a801, 0x65dcac01, - 0x655cb241, 0x0520a1e0, 0x0521a601, 0x052281e0, - 0x05238601, 0x04a14026, 0x042244a6, 0x046344a6, - 0x04a444a6, 0x04e544a7, 0x0568aca7, 0x05b23230, - 0x853040af, 0xc5b040af, 0xe57080af, 0xe5b080af, - 0x25034440, 0x254054c4, 0x25034640, 0x25415a05, - 0x25834440, 0x25c54489, 0x250b5d3a, 0x2550dc20, - 0x2518e3e1, 0x2518e021, 0x2518e0a1, 0x2518e121, - 0x2518e1a1, 0x2558e3e2, 0x2558e042, 0x2558e0c2, - 0x2558e142, 0x2598e3e3, 0x2598e063, 0x2598e0e3, - 0x2598e163, 0x25d8e3e4, 0x25d8e084, 0x25d8e104, - 0x25d8e184, 0x2518e407, 0x05214800, 0x05614800, - 0x05a14800, 0x05e14800, 0x05214c00, 0x05614c00, - 0x05a14c00, 0x05e14c00, 0x05304001, 0x05314001, - 0x05a18610, 0x05e18610, 0x05271e11, 0x6545e891, - 0x6585e891, 0x65c5e891, 0x6545c891, 0x6585c891, - 0x65c5c891, 0x45b0c210, 0x45f1c231, 0x1e601000, - 0x1e603000, 0x1e621000, 0x1e623000, 0x1e641000, - 0x1e643000, 0x1e661000, 0x1e663000, 0x1e681000, - 0x1e683000, 0x1e6a1000, 0x1e6a3000, 0x1e6c1000, - 0x1e6c3000, 0x1e6e1000, 0x1e6e3000, 0x1e701000, - 0x1e703000, 0x1e721000, 0x1e723000, 0x1e741000, - 0x1e743000, 0x1e761000, 0x1e763000, 0x1e781000, - 0x1e783000, 0x1e7a1000, 0x1e7a3000, 0x1e7c1000, - 0x1e7c3000, 0x1e7e1000, 0x1e7e3000, 0xf82f8186, - 0xf83001ab, 0xf83713c1, 0xf8332225, 0xf82232d0, - 0xf82d52aa, 0xf83d419b, 0xf83b7023, 0xf83f6278, - 0xf8b18389, 0xf8bb00ef, 0xf8b513f7, 0xf8b923e2, - 0xf8bb3150, 0xf8b75073, 0xf8b04320, 0xf8ba7057, - 0xf8b0608c, 0xf8fc83be, 0xf8f000db, 0xf8e911fd, - 0xf8e720e4, 0xf8ef32e9, 0xf8e85382, 0xf8f540bf, - 0xf8fb7220, 0xf8ef6344, 0xf86882dc, 0xf87b033b, - 0xf8771080, 0xf8662010, 0xf864302f, 0xf86a50a7, - 0xf86a40fc, 0xf87472b7, 0xf866610b, 0xb83180df, - 0xb8310182, 0xb83e107d, 0xb83b23b6, 0xb82e338d, - 0xb83150b8, 0xb822414e, 0xb830736b, 0xb837608c, - 0xb8b68091, 0xb8a10213, 0xb8b011cd, 0xb8ac2222, - 0xb8a332f5, 0xb8a550e6, 0xb8b3438d, 0xb8b170d0, - 0xb8a2607d, 0xb8e481e6, 0xb8f4018d, 0xb8f41328, - 0xb8f42013, 0xb8eb30d8, 0xb8f451df, 0xb8f04006, - 0xb8e7726f, 0xb8fa6149, 0xb87782d5, 0xb87c0062, - 0xb86f1293, 0xb86723a4, 0xb8673120, 0xb87052f4, - 0xb8644150, 0xb877732b, 0xb866621f, 0xce2b06cd, - 0xce14410d, 0xce648df9, 0xce883624, 0xce7c809d, - 0xce7a87b0, 0xcec081c9, 0xce7c8962, 0x2520c143, - 0x25a1d2da, 0x058015ce, 0x05400ed8, 0x0500bb31, - 0x25a0c074, 0x25a1d884, 0x05804944, 0x0540b1d9, - 0x05001548, 0x25a0c49e, 0x2521cabe, 0x058054b3, - 0x0543ab47, 0x050026bb, 0x2560d097, 0x25a1d6fe, - 0x058394b4, 0x0540266d, 0x05003cbc, 0x25a0c1ab, - 0x2561d3f8, 0x05800acd, 0x05403684, 0x05000c07, - 0x2560de64, 0x2521cac5, 0x0583c8b5, 0x05405089, - 0x05003e98, 0x04ad0397, 0x04ac074a, 0x658e023e, - 0x65d50a1d, 0x65820667, 0x0496b13a, 0x04001411, - 0x041a19c2, 0x049095cb, 0x041b0c7d, 0x04d9a876, - 0x049aa27b, 0x04591aa7, 0x04138b25, 0x04119235, - 0x04500a63, 0x0497adc7, 0x04dea9b1, 0x04581e31, - 0x05a78f4f, 0x056494fb, 0x04481f65, 0x048a0f00, - 0x04810074, 0x04dca739, 0x65809031, 0x658d9dae, - 0x65c683d1, 0x658797b6, 0x65828008, 0x04ddb417, - 0x6582baf9, 0x6580b435, 0x65c1b56a, 0x65cdb917, - 0x65c19671, 0x65fe95a4, 0x65f11f3e, 0x65fc298e, - 0x65ada1a5, 0x65b3c967, 0x65e3ec59, 0x65f454a0, - 0x65a86dbc, 0x041b41dd, 0x04587903, 0x042a3321, - 0x04b93281, 0x0470327c, 0x04e131bb, 0x0521692b, - 0x057a6f61, 0x65c887a2, 0x45c2b058, 0x455cb723, - 0x043639a3, 0x045a309b, 0x0498305a, 0x04993ce1, - 0x04483e1e, 0x040a3395, 0x65c72595, 0x6586294b, - 0x65d826c0, 0x04412474, + 0x4eae95ac, 0x0e21cc1f, 0x4e3ecfbc, 0x4e6ccd6a, + 0x2e7c977a, 0x6e649462, 0x2eae95ac, 0x6eb49672, + 0x0ea1cc1f, 0x4ea3cc41, 0x4eefcdcd, 0x2e3fffdd, + 0x6e22fc20, 0x6e75fe93, 0x0e2e65ac, 0x4e336651, + 0x0e7866f6, 0x4e6f65cd, 0x0ebe67bc, 0x4ea067fe, + 0x0e21a41f, 0x4e23a441, 0x0e7ca77a, 0x4e7ea7bc, + 0x0ea6a4a4, 0x4ea0a7fe, 0x0e26f4a4, 0x4e28f4e6, + 0x4e60f7fe, 0x0e3c6f7a, 0x4e346e72, 0x0e6b6d49, + 0x4e6a6d28, 0x0eae6dac, 0x4ea26c20, 0x0e36aeb4, + 0x4e23ac41, 0x0e7aaf38, 0x4e64ac62, 0x0ea2ac20, + 0x4eabad49, 0x0ebaf738, 0x4ebcf77a, 0x4ef2f630, + 0x2ea0effe, 0x6ea5ec83, 0x6eeced6a, 0x0fa710c5, + 0x4f8b8149, 0x4fc710c5, 0x0f8750c5, 0x4faa8128, + 0x4fc750c5, 0x2f8890e6, 0x4fa880e6, 0x6fc59083, + 0x0f6f81cd, 0x4f448862, 0x0f848062, 0x4fab8149, + 0x0e3736d5, 0x4e323630, 0x0e743672, 0x4e6d358b, + 0x0eb736d5, 0x4eb93717, 0x4eee35ac, 0x0e3c3f7a, + 0x4e393f17, 0x0e7e3fbc, 0x4e703dee, 0x0ead3d8b, + 0x4eba3f38, 0x4ee33c41, 0x2e2e8dac, 0x6e218c1f, + 0x2e6c8d6a, 0x6e728e30, 0x2ea98d07, 0x6ea48c62, + 0x6ee58c83, 0x2e2f35cd, 0x6e353693, 0x2e733651, + 0x6e723630, 0x2ea53483, 0x6ea33441, 0x6eed358b, + 0x2e203ffe, 0x6e273cc5, 0x2e6a3d28, 0x6e713e0f, + 0x2ebf3fdd, 0x6ea03ffe, 0x6ee23c20, 0x0e36e6b4, + 0x4e29e507, 0x4e76e6b4, 0x2eb9e717, 0x6ebee7bc, + 0x6ef7e6d5, 0x2e3de79b, 0x6e3be759, 0x6e67e4c5, + 0x65d23ee0, 0x65903d92, 0x65d03fa7, 0x65912fe9, + 0x65d13bf9, 0x65932a0a, 0x25cb90c4, 0x25040bde, + 0x25c11085, 0x25c62c6b, 0x259f2279, 0x259d8993, + 0x24e5102b, 0x24ad5458, 0x24ec7ab5, 0x24387c6d, + 0xba5fd3e3, 0x3a5f03e5, 0xfa411be4, 0x7a42cbe2, + 0x93df03ff, 0xc820ffff, 0x8822fc7f, 0xc8247cbf, + 0x88267fff, 0x4e010fe0, 0x5e040420, 0x4e081fe1, + 0x4e0c1fe1, 0x4e0a1fe1, 0x4e071fe1, 0x4e042c20, + 0x4e062c20, 0x4e052c20, 0x4e083c20, 0x0e0c3c20, + 0x0e0a3c20, 0x0e073c20, 0x9eae0020, 0x0f03f409, + 0x6f03f40e, 0x4cc0ac3f, 0x0ea1b820, 0x4e21c862, + 0x4e61b8a4, 0x05a08020, 0x05104fe0, 0x05505001, + 0x05906fe2, 0x05d03005, 0x05101fea, 0x05901feb, + 0x04b0e3e0, 0x0470e7e1, 0x042f9c20, 0x043f9c35, + 0x047f9c20, 0x04ff9c20, 0x04299420, 0x04319160, + 0x0461943e, 0x04a19020, 0x04038100, 0x040381a0, + 0x040387e1, 0x04438be2, 0x04c38fe3, 0x040181e0, + 0x04018100, 0x04018621, 0x04418b22, 0x04418822, + 0x04818c23, 0x040081e0, 0x04008120, 0x04008761, + 0x04008621, 0x04408822, 0x04808c23, 0x042053ff, + 0x047f5401, 0x25208028, 0x2538cfe0, 0x2578d001, + 0x25b8efe2, 0x25f8f007, 0x2538dfea, 0x25b8dfeb, + 0xa400a3e0, 0xa420a7e0, 0xa4484be0, 0xa467afe0, + 0xa4a8a7ea, 0xa547a814, 0xa4084ffe, 0xa55c53e0, + 0xa5e1540b, 0xe400fbf6, 0xe408ffff, 0xe420e7e0, + 0xe4484be0, 0xe460efe0, 0xe547e400, 0xe4014be0, + 0xe4a84fe0, 0xe5f15000, 0x858043e0, 0x85a043ff, + 0xe59f5d08, 0x0420e3e9, 0x0460e3ea, 0x04a0e3eb, + 0x04e0e3ec, 0x25104042, 0x25104871, 0x25904861, + 0x25904c92, 0x05344020, 0x05744041, 0x05b44062, + 0x05f44083, 0x252c8840, 0x253c1420, 0x25681572, + 0x25a21ce3, 0x25ea1e34, 0x253c0421, 0x25680572, + 0x25a20ce3, 0x25ea0e34, 0x0522c020, 0x05e6c0a4, + 0x2401a001, 0x2443a051, 0x24858881, 0x24c78cd1, + 0x24850891, 0x24c70cc1, 0x250f9001, 0x25508051, + 0x25802491, 0x25df28c1, 0x25850c81, 0x251e10d1, + 0x65816001, 0x65c36051, 0x65854891, 0x65c74cc1, + 0x05733820, 0x05b238a4, 0x05f138e6, 0x0570396a, + 0x65d0a001, 0x65d6a443, 0x65d4a826, 0x6594ac26, + 0x6554ac26, 0x6556ac26, 0x6552ac26, 0x65cbac85, + 0x65caac01, 0x6589ac85, 0x6588ac01, 0x65c9ac85, + 0x65c8ac01, 0x65dea833, 0x659ca509, 0x65d8a801, + 0x65dcac01, 0x655cb241, 0x0520a1e0, 0x0521a601, + 0x052281e0, 0x05238601, 0x04a14026, 0x042244a6, + 0x046344a6, 0x04a444a6, 0x04e544a7, 0x0568aca7, + 0x05b23230, 0x853040af, 0xc5b040af, 0xe57080af, + 0xe5b080af, 0x25034440, 0x254054c4, 0x25034640, + 0x25415a05, 0x25834440, 0x25c54489, 0x250b5d3a, + 0x2550dc20, 0x2518e3e1, 0x2518e021, 0x2518e0a1, + 0x2518e121, 0x2518e1a1, 0x2558e3e2, 0x2558e042, + 0x2558e0c2, 0x2558e142, 0x2598e3e3, 0x2598e063, + 0x2598e0e3, 0x2598e163, 0x25d8e3e4, 0x25d8e084, + 0x25d8e104, 0x25d8e184, 0x2518e407, 0x05214800, + 0x05614800, 0x05a14800, 0x05e14800, 0x05214c00, + 0x05614c00, 0x05a14c00, 0x05e14c00, 0x05304001, + 0x05314001, 0x05a18610, 0x05e18610, 0x05271e11, + 0x6545e891, 0x6585e891, 0x65c5e891, 0x6545c891, + 0x6585c891, 0x65c5c891, 0x45b0c210, 0x45f1c231, + 0x1e601000, 0x1e603000, 0x1e621000, 0x1e623000, + 0x1e641000, 0x1e643000, 0x1e661000, 0x1e663000, + 0x1e681000, 0x1e683000, 0x1e6a1000, 0x1e6a3000, + 0x1e6c1000, 0x1e6c3000, 0x1e6e1000, 0x1e6e3000, + 0x1e701000, 0x1e703000, 0x1e721000, 0x1e723000, + 0x1e741000, 0x1e743000, 0x1e761000, 0x1e763000, + 0x1e781000, 0x1e783000, 0x1e7a1000, 0x1e7a3000, + 0x1e7c1000, 0x1e7c3000, 0x1e7e1000, 0x1e7e3000, + 0xf8338131, 0xf83c01fb, 0xf82712f5, 0xf83f2059, + 0xf83f31fb, 0xf82a5277, 0xf8234010, 0xf83972fa, + 0xf8226190, 0xf8a483dc, 0xf8bd0370, 0xf8a613a9, + 0xf8b02087, 0xf8a7312f, 0xf8b75048, 0xf8bc43f5, + 0xf8a5701b, 0xf8b1608f, 0xf8fa8388, 0xf8f6037b, + 0xf8f91017, 0xf8e421e6, 0xf8e031e4, 0xf8e150ea, + 0xf8e5438a, 0xf8e772f4, 0xf8f56166, 0xf86883f1, + 0xf8660051, 0xf86c13be, 0xf86322db, 0xf87d31ae, + 0xf87c5311, 0xf86541c2, 0xf86a7170, 0xf87b6197, + 0xb8248236, 0xb8240261, 0xb83011b0, 0xb82e204c, + 0xb83132a3, 0xb83750c5, 0xb82741b3, 0xb83c7211, + 0xb82663a2, 0xb8a380c4, 0xb8b001b4, 0xb8ac1114, + 0xb8b92274, 0xb8a0330b, 0xb8a653f4, 0xb8ae40d0, + 0xb8a071e7, 0xb8b3613a, 0xb8ea82b7, 0xb8f6005c, + 0xb8e3126f, 0xb8f42087, 0xb8fd3007, 0xb8e95290, + 0xb8f74204, 0xb8ea7177, 0xb8f963e6, 0xb87082ed, + 0xb86c01c1, 0xb8691215, 0xb87a208f, 0xb8643110, + 0xb866509e, 0xb87d43b1, 0xb87a71e9, 0xb86263ab, + 0xce216ce3, 0xce0e2255, 0xce798ed2, 0xce959685, + 0xce7e8217, 0xce608694, 0xcec08264, 0xce748898, + 0x25e0da44, 0x2521c8f3, 0x05801548, 0x0540cbdf, + 0x05006521, 0x2560c7a0, 0x25a1c498, 0x058026bb, + 0x05407dd8, 0x0500f3d6, 0x2560ce3d, 0x2521d4b4, + 0x05803cbc, 0x05404d6c, 0x05001b89, 0x25a0c532, + 0x2521cc40, 0x05800c08, 0x054074c4, 0x050034a0, + 0x2520c9e3, 0x25e1ca93, 0x05803e98, 0x05425238, + 0x050024cb, 0x25a0ce7f, 0x25e1d0c3, 0x05802676, + 0x05401e63, 0x05002d49, 0x04e20080, 0x04ab04ce, + 0x659e022e, 0x65970863, 0x659c0703, 0x04d6b4f3, + 0x04400cb5, 0x049a06da, 0x04508071, 0x045b0d14, + 0x0459b22e, 0x04daba4d, 0x04590a13, 0x0493979b, + 0x04d188a8, 0x0450081c, 0x0417b6b9, 0x041eb743, + 0x04981e7a, 0x05e78dc1, 0x0564824e, 0x048816ff, + 0x040a0d1e, 0x04810ee0, 0x04dcb340, 0x65c08ed8, + 0x65cd8162, 0x65c6970c, 0x65c79e29, 0x65c29494, + 0x04ddbecd, 0x65c2ba5f, 0x65c0a9af, 0x6581a434, + 0x658da0ee, 0x65c1908c, 0x65be806f, 0x65ff0694, + 0x65ee2d2d, 0x65a3af81, 0x65a9cb3a, 0x65e1e9da, + 0x65f447ba, 0x65e17da6, 0x0401482b, 0x040279fb, + 0x0439323e, 0x04a33302, 0x046331bd, 0x04fc320e, + 0x05bb6964, 0x05e16e02, 0x65c897e7, 0x4596b150, + 0x4516b4fd, 0x0438396c, 0x041a280b, 0x04183697, + 0x04192de3, 0x04083b7e, 0x04ca3955, 0x65873883, + 0x658622a6, 0x65d83bd9, 0x0441303f, 0x0e2e11ac, + 0x4e2013fe, 0x0e6f11cd, 0x4e6a1128, 0x0ebb1359, + 0x4ebf13dd, 0x2e231041, 0x6e21101f, 0x2e791317, + 0x6e61101f, 0x2eb612b4, 0x6ea21020, }; // END Generated code -- do not edit From 1cf26a5179e619f17909426fdb26a3fb3b748483 Mon Sep 17 00:00:00 2001 From: Oli Gillespie Date: Mon, 30 Sep 2024 10:53:20 +0000 Subject: [PATCH 238/307] 8341013: Optimize x86/aarch64 MD5 intrinsics by reducing data dependency Reviewed-by: mli, ascarpino --- src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp | 10 +++++----- src/hotspot/cpu/x86/macroAssembler_x86_md5.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index ac88b427459c0..3dbde1ae8242b 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -3419,15 +3419,15 @@ class StubGenerator: public StubCodeGenerator { Register rscratch3 = r10; Register rscratch4 = r11; - __ andw(rscratch3, r2, r4); - __ bicw(rscratch4, r3, r4); reg_cache.extract_u32(rscratch1, k); __ movw(rscratch2, t); - __ orrw(rscratch3, rscratch3, rscratch4); __ addw(rscratch4, r1, rscratch2); __ addw(rscratch4, rscratch4, rscratch1); - __ addw(rscratch3, rscratch3, rscratch4); - __ rorw(rscratch2, rscratch3, 32 - s); + __ bicw(rscratch2, r3, r4); + __ andw(rscratch3, r2, r4); + __ addw(rscratch2, rscratch2, rscratch4); + __ addw(rscratch2, rscratch2, rscratch3); + __ rorw(rscratch2, rscratch2, 32 - s); __ addw(r1, rscratch2, r2); } diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_md5.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_md5.cpp index 439c17b10d37a..09d379a4296d4 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86_md5.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86_md5.cpp @@ -81,8 +81,8 @@ void MacroAssembler::fast_md5(Register buf, Address state, Address ofs, Address notl(rsi); \ andl(rdi, r2); \ andl(rsi, r3); \ - orl(rsi, rdi); \ addl(r1, rsi); \ + addl(r1, rdi); \ roll(r1, s); \ addl(r1, r2); From 58b6fc5baa0931fa6f2aa37bf0bb125497cf6cc9 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Mon, 30 Sep 2024 10:56:52 +0000 Subject: [PATCH 239/307] 8341197: [BACKOUT] 8322770: Implement C2 VectorizedHashCode on AArch64 Reviewed-by: shade, jpai --- src/hotspot/cpu/aarch64/aarch64.ad | 78 -- src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 68 +- .../cpu/aarch64/c2_MacroAssembler_aarch64.cpp | 91 -- .../cpu/aarch64/c2_MacroAssembler_aarch64.hpp | 3 - .../cpu/aarch64/stubGenerator_aarch64.cpp | 312 ----- .../cpu/aarch64/stubRoutines_aarch64.cpp | 7 +- .../cpu/aarch64/stubRoutines_aarch64.hpp | 26 +- .../cpu/aarch64/vm_version_aarch64.cpp | 4 - src/hotspot/share/utilities/intpow.hpp | 46 - test/hotspot/gtest/aarch64/aarch64-asmtest.py | 111 -- test/hotspot/gtest/aarch64/asmtest.out.h | 1189 ++++++++--------- 11 files changed, 580 insertions(+), 1355 deletions(-) delete mode 100644 src/hotspot/share/utilities/intpow.hpp diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 0a93c27c2686b..39eae43a287e7 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -4931,60 +4931,6 @@ operand vRegD_V7() interface(REG_INTER); %} -operand vRegD_V12() -%{ - constraint(ALLOC_IN_RC(v12_reg)); - match(RegD); - op_cost(0); - format %{ %} - interface(REG_INTER); -%} - -operand vRegD_V13() -%{ - constraint(ALLOC_IN_RC(v13_reg)); - match(RegD); - op_cost(0); - format %{ %} - interface(REG_INTER); -%} - -operand vRegD_V14() -%{ - constraint(ALLOC_IN_RC(v14_reg)); - match(RegD); - op_cost(0); - format %{ %} - interface(REG_INTER); -%} - -operand vRegD_V15() -%{ - constraint(ALLOC_IN_RC(v15_reg)); - match(RegD); - op_cost(0); - format %{ %} - interface(REG_INTER); -%} - -operand vRegD_V16() -%{ - constraint(ALLOC_IN_RC(v16_reg)); - match(RegD); - op_cost(0); - format %{ %} - interface(REG_INTER); -%} - -operand vRegD_V17() -%{ - constraint(ALLOC_IN_RC(v17_reg)); - match(RegD); - op_cost(0); - format %{ %} - interface(REG_INTER); -%} - operand pReg() %{ constraint(ALLOC_IN_RC(pr_reg)); @@ -16605,30 +16551,6 @@ instruct array_equalsC(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, ins_pipe(pipe_class_memory); %} -instruct arrays_hashcode(iRegP_R1 ary, iRegI_R2 cnt, iRegI_R0 result, immI basic_type, - vRegD_V0 vtmp0, vRegD_V1 vtmp1, vRegD_V2 vtmp2, vRegD_V3 vtmp3, - vRegD_V4 vtmp4, vRegD_V5 vtmp5, vRegD_V6 vtmp6, vRegD_V7 vtmp7, - vRegD_V12 vtmp8, vRegD_V13 vtmp9, vRegD_V14 vtmp10, - vRegD_V15 vtmp11, vRegD_V16 vtmp12, vRegD_V17 vtmp13, - rFlagsReg cr) -%{ - match(Set result (VectorizedHashCode (Binary ary cnt) (Binary result basic_type))); - effect(TEMP vtmp0, TEMP vtmp1, TEMP vtmp2, TEMP vtmp3, TEMP vtmp4, TEMP vtmp5, TEMP vtmp6, - TEMP vtmp7, TEMP vtmp8, TEMP vtmp9, TEMP vtmp10, TEMP vtmp11, TEMP vtmp12, TEMP vtmp13, - USE_KILL ary, USE_KILL cnt, USE basic_type, KILL cr); - - format %{ "Array HashCode array[] $ary,$cnt,$result,$basic_type -> $result // KILL all" %} - ins_encode %{ - address tpc = __ arrays_hashcode($ary$$Register, $cnt$$Register, $result$$Register, - (BasicType)$basic_type$$constant); - if (tpc == nullptr) { - ciEnv::current()->record_failure("CodeCache is full"); - return; - } - %} - ins_pipe(pipe_class_memory); -%} - instruct count_positives(iRegP_R1 ary1, iRegI_R2 len, iRegI_R0 result, rFlagsReg cr) %{ match(Set result (CountPositives ary1 len)); diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index a5e0e2665af92..28a0cc2c7d940 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2024, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -287,11 +287,6 @@ class Instruction_aarch64 { f(r->raw_encoding(), lsb + 4, lsb); } - //<0-15>reg: As `rf(FloatRegister)`, but only the lower 16 FloatRegisters are allowed. - void lrf(FloatRegister r, int lsb) { - f(r->raw_encoding(), lsb + 3, lsb); - } - void prf(PRegister r, int lsb) { f(r->raw_encoding(), lsb + 3, lsb); } @@ -770,7 +765,6 @@ class Assembler : public AbstractAssembler { #define f current_insn.f #define sf current_insn.sf #define rf current_insn.rf -#define lrf current_insn.lrf #define srf current_insn.srf #define zrf current_insn.zrf #define prf current_insn.prf @@ -1596,16 +1590,6 @@ class Assembler : public AbstractAssembler { #undef INSN - // Load/store a register, but with a BasicType parameter. Loaded signed integer values are - // extended to 64 bits. - void load(Register Rt, const Address &adr, BasicType bt) { - int op = (is_signed_subword_type(bt) || bt == T_INT) ? 0b10 : 0b01; - ld_st2(Rt, adr, exact_log2(type2aelembytes(bt)), op); - } - void store(Register Rt, const Address &adr, BasicType bt) { - ld_st2(Rt, adr, exact_log2(type2aelembytes(bt)), 0b00); - } - /* SIMD extensions * * We just use FloatRegister in the following. They are exactly the same @@ -2603,7 +2587,6 @@ template INSN(addpv, 0, 0b101111, true); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D INSN(smullv, 0, 0b110000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S INSN(umullv, 1, 0b110000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S - INSN(smlalv, 0, 0b100000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S INSN(umlalv, 1, 0b100000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S INSN(maxv, 0, 0b011001, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S INSN(minv, 0, 0b011011, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S @@ -2877,28 +2860,6 @@ template // FMULX - Vector - Scalar INSN(fmulxvs, 1, 0b1001); -#undef INSN - -#define INSN(NAME, op1, op2) \ - void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm, int index) { \ - starti; \ - assert(T == T4H || T == T8H || T == T2S || T == T4S, "invalid arrangement"); \ - assert(index >= 0 && \ - ((T == T2S && index <= 1) || (T != T2S && index <= 3) || (T == T8H && index <= 7)), \ - "invalid index"); \ - assert((T != T4H && T != T8H) || Vm->encoding() < 16, "invalid source SIMD&FP register"); \ - f(0, 31), f((int)T & 1, 30), f(op1, 29), f(0b01111, 28, 24); \ - if (T == T4H || T == T8H) { \ - f(0b01, 23, 22), f(index & 0b11, 21, 20), lrf(Vm, 16), f(index >> 2 & 1, 11); \ - } else { \ - f(0b10, 23, 22), f(index & 1, 21), rf(Vm, 16), f(index >> 1, 11); \ - } \ - f(op2, 15, 12), f(0, 10), rf(Vn, 5), rf(Vd, 0); \ - } - - // MUL - Vector - Scalar - INSN(mulvs, 0, 0b1000); - #undef INSN // Floating-point Reciprocal Estimate @@ -3062,33 +3023,6 @@ template umov(Xd, Vn, T, index); } - protected: - void _xaddwv(bool is_unsigned, FloatRegister Vd, FloatRegister Vn, SIMD_Arrangement Ta, - FloatRegister Vm, SIMD_Arrangement Tb) { - starti; - assert((Tb >> 1) + 1 == (Ta >> 1), "Incompatible arrangement"); - f(0, 31), f((int)Tb & 1, 30), f(is_unsigned ? 1 : 0, 29), f(0b01110, 28, 24); - f((int)(Ta >> 1) - 1, 23, 22), f(1, 21), rf(Vm, 16), f(0b000100, 15, 10), rf(Vn, 5), rf(Vd, 0); - } - - public: -#define INSN(NAME, assertion, is_unsigned) \ - void NAME(FloatRegister Vd, FloatRegister Vn, SIMD_Arrangement Ta, FloatRegister Vm, \ - SIMD_Arrangement Tb) { \ - assert((assertion), "invalid arrangement"); \ - _xaddwv(is_unsigned, Vd, Vn, Ta, Vm, Tb); \ - } - -public: - - INSN(uaddwv, Tb == T8B || Tb == T4H || Tb == T2S, /*is_unsigned*/true) - INSN(uaddwv2, Tb == T16B || Tb == T8H || Tb == T4S, /*is_unsigned*/true) - INSN(saddwv, Tb == T8B || Tb == T4H || Tb == T2S, /*is_unsigned*/false) - INSN(saddwv2, Tb == T16B || Tb == T8H || Tb == T4S, /*is_unsigned*/false) - -#undef INSN - - private: void _pmull(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) { starti; diff --git a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp index ab2bd7d782c04..b4c12ecd4a849 100644 --- a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp @@ -33,7 +33,6 @@ #include "opto/subnode.hpp" #include "runtime/stubRoutines.hpp" #include "utilities/globalDefinitions.hpp" -#include "utilities/powerOfTwo.hpp" #ifdef PRODUCT #define BLOCK_COMMENT(str) /* nothing */ @@ -47,96 +46,6 @@ typedef void (MacroAssembler::* chr_insn)(Register Rt, const Address &adr); -// jdk.internal.util.ArraysSupport.vectorizedHashCode -address C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register result, - BasicType eltype) { - assert_different_registers(ary, cnt, result, rscratch1, rscratch2); - - Register tmp1 = rscratch1, tmp2 = rscratch2; - - Label TAIL, STUB_SWITCH, STUB_SWITCH_OUT, LOOP, BR_BASE, LARGE, DONE; - - // Vectorization factor. Number of array elements loaded to one SIMD&FP registers by the stubs. We - // use 8H load arrangements for chars and shorts and 8B for booleans and bytes. It's possible to - // use 4H for chars and shorts instead, but using 8H gives better performance. - const size_t vf = eltype == T_BOOLEAN || eltype == T_BYTE ? 8 - : eltype == T_CHAR || eltype == T_SHORT ? 8 - : eltype == T_INT ? 4 - : 0; - guarantee(vf, "unsupported eltype"); - - // Unroll factor for the scalar loop below. The value is chosen based on performance analysis. - const size_t unroll_factor = 4; - - switch (eltype) { - case T_BOOLEAN: - BLOCK_COMMENT("arrays_hashcode(unsigned byte) {"); - break; - case T_CHAR: - BLOCK_COMMENT("arrays_hashcode(char) {"); - break; - case T_BYTE: - BLOCK_COMMENT("arrays_hashcode(byte) {"); - break; - case T_SHORT: - BLOCK_COMMENT("arrays_hashcode(short) {"); - break; - case T_INT: - BLOCK_COMMENT("arrays_hashcode(int) {"); - break; - default: - ShouldNotReachHere(); - } - - // large_arrays_hashcode(T_INT) performs worse than the scalar loop below when the Neon loop - // implemented by the stub executes just once. Call the stub only if at least two iterations will - // be executed. - const size_t large_threshold = eltype == T_INT ? vf * 2 : vf; - cmpw(cnt, large_threshold); - br(Assembler::HS, LARGE); - - bind(TAIL); - - // The andr performs cnt % uf where uf = unroll_factor. The subtract shifted by 3 offsets past - // uf - (cnt % uf) pairs of load + madd insns i.e. it only executes cnt % uf load + madd pairs. - // Iteration eats up the remainder, uf elements at a time. - assert(is_power_of_2(unroll_factor), "can't use this value to calculate the jump target PC"); - andr(tmp2, cnt, unroll_factor - 1); - adr(tmp1, BR_BASE); - sub(tmp1, tmp1, tmp2, ext::sxtw, 3); - movw(tmp2, 0x1f); - br(tmp1); - - bind(LOOP); - for (size_t i = 0; i < unroll_factor; ++i) { - load(tmp1, Address(post(ary, type2aelembytes(eltype))), eltype); - maddw(result, result, tmp2, tmp1); - } - bind(BR_BASE); - subsw(cnt, cnt, unroll_factor); - br(Assembler::HS, LOOP); - - b(DONE); - - bind(LARGE); - - RuntimeAddress stub = RuntimeAddress(StubRoutines::aarch64::large_arrays_hashcode(eltype)); - assert(stub.target() != nullptr, "array_hashcode stub has not been generated"); - address tpc = trampoline_call(stub); - if (tpc == nullptr) { - DEBUG_ONLY(reset_labels(TAIL, BR_BASE)); - postcond(pc() == badAddress); - return nullptr; - } - - bind(DONE); - - BLOCK_COMMENT("} // arrays_hashcode"); - - postcond(pc() != badAddress); - return pc(); -} - void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg, Register tmpReg, Register tmp2Reg, Register tmp3Reg) { Register oop = objectReg; diff --git a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp index 28cc401a1b2c8..43e60ae5a48f8 100644 --- a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp @@ -35,9 +35,6 @@ enum shift_kind kind = Assembler::LSL, unsigned shift = 0); public: - // jdk.internal.util.ArraysSupport.vectorizedHashCode - address arrays_hashcode(Register ary, Register cnt, Register result, BasicType eltype); - // Code used by cmpFastLock and cmpFastUnlock mach instructions in .ad file. void fast_lock(Register object, Register box, Register tmp, Register tmp2, Register tmp3); void fast_unlock(Register object, Register box, Register tmp, Register tmp2); diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index 3dbde1ae8242b..eb235f8472c1d 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -53,9 +53,7 @@ #include "runtime/stubRoutines.hpp" #include "utilities/align.hpp" #include "utilities/checkedCast.hpp" -#include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" -#include "utilities/intpow.hpp" #include "utilities/powerOfTwo.hpp" #ifdef COMPILER2 #include "opto/runtime.hpp" @@ -5313,309 +5311,6 @@ class StubGenerator: public StubCodeGenerator { return entry; } - // result = r0 - return value. Contains initial hashcode value on entry. - // ary = r1 - array address - // cnt = r2 - elements count - // Clobbers: v0-v13, rscratch1, rscratch2 - address generate_large_arrays_hashcode(BasicType eltype) { - const Register result = r0, ary = r1, cnt = r2; - const FloatRegister vdata0 = v3, vdata1 = v2, vdata2 = v1, vdata3 = v0; - const FloatRegister vmul0 = v4, vmul1 = v5, vmul2 = v6, vmul3 = v7; - const FloatRegister vpow = v8; // powers of 31: <31^3, ..., 31^0> - const FloatRegister vpowm = v9; - - assert_different_registers(ary, cnt, result); - assert_different_registers(vdata0, vdata1, vdata2, vdata3, vmul0, vmul1, vmul2, vmul3, vpow, - vpowm); - - Label SMALL_LOOP, LARGE_LOOP_PREHEADER, LARGE_LOOP, TAIL, TAIL_SHORTCUT, BR_BASE; - - unsigned int vf; // vectorization factor - bool multiply_by_halves; - Assembler::SIMD_Arrangement load_arrangement; - switch (eltype) { - case T_BOOLEAN: - case T_BYTE: - load_arrangement = Assembler::T8B; - multiply_by_halves = true; - vf = 8; - break; - case T_CHAR: - case T_SHORT: - load_arrangement = Assembler::T8H; - multiply_by_halves = true; - vf = 8; - break; - case T_INT: - load_arrangement = Assembler::T4S; - multiply_by_halves = false; - vf = 4; - break; - default: - ShouldNotReachHere(); - } - - // Unroll factor - const unsigned uf = 4; - - // Effective vectorization factor - const unsigned evf = vf * uf; - - __ align(CodeEntryAlignment); - - const char *mark_name = ""; - switch (eltype) { - case T_BOOLEAN: - mark_name = "_large_arrays_hashcode_boolean"; - break; - case T_BYTE: - mark_name = "_large_arrays_hashcode_byte"; - break; - case T_CHAR: - mark_name = "_large_arrays_hashcode_char"; - break; - case T_SHORT: - mark_name = "_large_arrays_hashcode_short"; - break; - case T_INT: - mark_name = "_large_arrays_hashcode_int"; - break; - default: - mark_name = "_large_arrays_hashcode_incorrect_type"; - __ should_not_reach_here(); - }; - - StubCodeMark mark(this, "StubRoutines", mark_name); - - address entry = __ pc(); - __ enter(); - - // Put 0-3'th powers of 31 into a single SIMD register together. The register will be used in - // the SMALL and LARGE LOOPS' epilogues. The initialization is hoisted here and the register's - // value shouldn't change throughout both loops. - __ movw(rscratch1, intpow(31U, 3)); - __ mov(vpow, Assembler::S, 0, rscratch1); - __ movw(rscratch1, intpow(31U, 2)); - __ mov(vpow, Assembler::S, 1, rscratch1); - __ movw(rscratch1, intpow(31U, 1)); - __ mov(vpow, Assembler::S, 2, rscratch1); - __ movw(rscratch1, intpow(31U, 0)); - __ mov(vpow, Assembler::S, 3, rscratch1); - - __ mov(vmul0, Assembler::T16B, 0); - __ mov(vmul0, Assembler::S, 3, result); - - __ andr(rscratch2, cnt, (uf - 1) * vf); - __ cbz(rscratch2, LARGE_LOOP_PREHEADER); - - __ movw(rscratch1, intpow(31U, multiply_by_halves ? vf / 2 : vf)); - __ mov(vpowm, Assembler::S, 0, rscratch1); - - // SMALL LOOP - __ bind(SMALL_LOOP); - - __ ld1(vdata0, load_arrangement, Address(__ post(ary, vf * type2aelembytes(eltype)))); - __ mulvs(vmul0, Assembler::T4S, vmul0, vpowm, 0); - __ subsw(rscratch2, rscratch2, vf); - - if (load_arrangement == Assembler::T8B) { - // Extend 8B to 8H to be able to use vector multiply - // instructions - assert(load_arrangement == Assembler::T8B, "expected to extend 8B to 8H"); - if (is_signed_subword_type(eltype)) { - __ sxtl(vdata0, Assembler::T8H, vdata0, load_arrangement); - } else { - __ uxtl(vdata0, Assembler::T8H, vdata0, load_arrangement); - } - } - - switch (load_arrangement) { - case Assembler::T4S: - __ addv(vmul0, load_arrangement, vmul0, vdata0); - break; - case Assembler::T8B: - case Assembler::T8H: - assert(is_subword_type(eltype), "subword type expected"); - if (is_signed_subword_type(eltype)) { - __ saddwv(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T4H); - } else { - __ uaddwv(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T4H); - } - break; - default: - __ should_not_reach_here(); - } - - // Process the upper half of a vector - if (load_arrangement == Assembler::T8B || load_arrangement == Assembler::T8H) { - __ mulvs(vmul0, Assembler::T4S, vmul0, vpowm, 0); - if (is_signed_subword_type(eltype)) { - __ saddwv2(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T8H); - } else { - __ uaddwv2(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T8H); - } - } - - __ br(Assembler::HI, SMALL_LOOP); - - // SMALL LOOP'S EPILOQUE - __ lsr(rscratch2, cnt, exact_log2(evf)); - __ cbnz(rscratch2, LARGE_LOOP_PREHEADER); - - __ mulv(vmul0, Assembler::T4S, vmul0, vpow); - __ addv(vmul0, Assembler::T4S, vmul0); - __ umov(result, vmul0, Assembler::S, 0); - - // TAIL - __ bind(TAIL); - - // The andr performs cnt % vf. The subtract shifted by 3 offsets past vf - 1 - (cnt % vf) pairs - // of load + madd insns i.e. it only executes cnt % vf load + madd pairs. - assert(is_power_of_2(vf), "can't use this value to calculate the jump target PC"); - __ andr(rscratch2, cnt, vf - 1); - __ bind(TAIL_SHORTCUT); - __ adr(rscratch1, BR_BASE); - __ sub(rscratch1, rscratch1, rscratch2, ext::uxtw, 3); - __ movw(rscratch2, 0x1f); - __ br(rscratch1); - - for (size_t i = 0; i < vf - 1; ++i) { - __ load(rscratch1, Address(__ post(ary, type2aelembytes(eltype))), - eltype); - __ maddw(result, result, rscratch2, rscratch1); - } - __ bind(BR_BASE); - - __ leave(); - __ ret(lr); - - // LARGE LOOP - __ bind(LARGE_LOOP_PREHEADER); - - __ lsr(rscratch2, cnt, exact_log2(evf)); - - if (multiply_by_halves) { - // 31^4 - multiplier between lower and upper parts of a register - __ movw(rscratch1, intpow(31U, vf / 2)); - __ mov(vpowm, Assembler::S, 1, rscratch1); - // 31^28 - remainder of the iteraion multiplier, 28 = 32 - 4 - __ movw(rscratch1, intpow(31U, evf - vf / 2)); - __ mov(vpowm, Assembler::S, 0, rscratch1); - } else { - // 31^16 - __ movw(rscratch1, intpow(31U, evf)); - __ mov(vpowm, Assembler::S, 0, rscratch1); - } - - __ mov(vmul3, Assembler::T16B, 0); - __ mov(vmul2, Assembler::T16B, 0); - __ mov(vmul1, Assembler::T16B, 0); - - __ bind(LARGE_LOOP); - - __ mulvs(vmul3, Assembler::T4S, vmul3, vpowm, 0); - __ mulvs(vmul2, Assembler::T4S, vmul2, vpowm, 0); - __ mulvs(vmul1, Assembler::T4S, vmul1, vpowm, 0); - __ mulvs(vmul0, Assembler::T4S, vmul0, vpowm, 0); - - __ ld1(vdata3, vdata2, vdata1, vdata0, load_arrangement, - Address(__ post(ary, evf * type2aelembytes(eltype)))); - - if (load_arrangement == Assembler::T8B) { - // Extend 8B to 8H to be able to use vector multiply - // instructions - assert(load_arrangement == Assembler::T8B, "expected to extend 8B to 8H"); - if (is_signed_subword_type(eltype)) { - __ sxtl(vdata3, Assembler::T8H, vdata3, load_arrangement); - __ sxtl(vdata2, Assembler::T8H, vdata2, load_arrangement); - __ sxtl(vdata1, Assembler::T8H, vdata1, load_arrangement); - __ sxtl(vdata0, Assembler::T8H, vdata0, load_arrangement); - } else { - __ uxtl(vdata3, Assembler::T8H, vdata3, load_arrangement); - __ uxtl(vdata2, Assembler::T8H, vdata2, load_arrangement); - __ uxtl(vdata1, Assembler::T8H, vdata1, load_arrangement); - __ uxtl(vdata0, Assembler::T8H, vdata0, load_arrangement); - } - } - - switch (load_arrangement) { - case Assembler::T4S: - __ addv(vmul3, load_arrangement, vmul3, vdata3); - __ addv(vmul2, load_arrangement, vmul2, vdata2); - __ addv(vmul1, load_arrangement, vmul1, vdata1); - __ addv(vmul0, load_arrangement, vmul0, vdata0); - break; - case Assembler::T8B: - case Assembler::T8H: - assert(is_subword_type(eltype), "subword type expected"); - if (is_signed_subword_type(eltype)) { - __ saddwv(vmul3, vmul3, Assembler::T4S, vdata3, Assembler::T4H); - __ saddwv(vmul2, vmul2, Assembler::T4S, vdata2, Assembler::T4H); - __ saddwv(vmul1, vmul1, Assembler::T4S, vdata1, Assembler::T4H); - __ saddwv(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T4H); - } else { - __ uaddwv(vmul3, vmul3, Assembler::T4S, vdata3, Assembler::T4H); - __ uaddwv(vmul2, vmul2, Assembler::T4S, vdata2, Assembler::T4H); - __ uaddwv(vmul1, vmul1, Assembler::T4S, vdata1, Assembler::T4H); - __ uaddwv(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T4H); - } - break; - default: - __ should_not_reach_here(); - } - - // Process the upper half of a vector - if (load_arrangement == Assembler::T8B || load_arrangement == Assembler::T8H) { - __ mulvs(vmul3, Assembler::T4S, vmul3, vpowm, 1); - __ mulvs(vmul2, Assembler::T4S, vmul2, vpowm, 1); - __ mulvs(vmul1, Assembler::T4S, vmul1, vpowm, 1); - __ mulvs(vmul0, Assembler::T4S, vmul0, vpowm, 1); - if (is_signed_subword_type(eltype)) { - __ saddwv2(vmul3, vmul3, Assembler::T4S, vdata3, Assembler::T8H); - __ saddwv2(vmul2, vmul2, Assembler::T4S, vdata2, Assembler::T8H); - __ saddwv2(vmul1, vmul1, Assembler::T4S, vdata1, Assembler::T8H); - __ saddwv2(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T8H); - } else { - __ uaddwv2(vmul3, vmul3, Assembler::T4S, vdata3, Assembler::T8H); - __ uaddwv2(vmul2, vmul2, Assembler::T4S, vdata2, Assembler::T8H); - __ uaddwv2(vmul1, vmul1, Assembler::T4S, vdata1, Assembler::T8H); - __ uaddwv2(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T8H); - } - } - - __ subsw(rscratch2, rscratch2, 1); - __ br(Assembler::HI, LARGE_LOOP); - - __ mulv(vmul3, Assembler::T4S, vmul3, vpow); - __ addv(vmul3, Assembler::T4S, vmul3); - __ umov(result, vmul3, Assembler::S, 0); - - __ mov(rscratch2, intpow(31U, vf)); - - __ mulv(vmul2, Assembler::T4S, vmul2, vpow); - __ addv(vmul2, Assembler::T4S, vmul2); - __ umov(rscratch1, vmul2, Assembler::S, 0); - __ maddw(result, result, rscratch2, rscratch1); - - __ mulv(vmul1, Assembler::T4S, vmul1, vpow); - __ addv(vmul1, Assembler::T4S, vmul1); - __ umov(rscratch1, vmul1, Assembler::S, 0); - __ maddw(result, result, rscratch2, rscratch1); - - __ mulv(vmul0, Assembler::T4S, vmul0, vpow); - __ addv(vmul0, Assembler::T4S, vmul0); - __ umov(rscratch1, vmul0, Assembler::S, 0); - __ maddw(result, result, rscratch2, rscratch1); - - __ andr(rscratch2, cnt, vf - 1); - __ cbnz(rscratch2, TAIL_SHORTCUT); - - __ leave(); - __ ret(lr); - - return entry; - } - address generate_dsin_dcos(bool isCos) { __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", isCos ? "libmDcos" : "libmDsin"); @@ -8562,13 +8257,6 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::aarch64::_large_array_equals = generate_large_array_equals(); } - // arrays_hascode stub for large arrays. - StubRoutines::aarch64::_large_arrays_hashcode_boolean = generate_large_arrays_hashcode(T_BOOLEAN); - StubRoutines::aarch64::_large_arrays_hashcode_byte = generate_large_arrays_hashcode(T_BYTE); - StubRoutines::aarch64::_large_arrays_hashcode_char = generate_large_arrays_hashcode(T_CHAR); - StubRoutines::aarch64::_large_arrays_hashcode_int = generate_large_arrays_hashcode(T_INT); - StubRoutines::aarch64::_large_arrays_hashcode_short = generate_large_arrays_hashcode(T_SHORT); - // byte_array_inflate stub for large arrays. StubRoutines::aarch64::_large_byte_array_inflate = generate_large_byte_array_inflate(); diff --git a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp index dee615df5a51f..80875a3b3cdcf 100644 --- a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, 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. * @@ -48,11 +48,6 @@ address StubRoutines::aarch64::_zero_blocks = nullptr; address StubRoutines::aarch64::_count_positives = nullptr; address StubRoutines::aarch64::_count_positives_long = nullptr; address StubRoutines::aarch64::_large_array_equals = nullptr; -address StubRoutines::aarch64::_large_arrays_hashcode_boolean = nullptr; -address StubRoutines::aarch64::_large_arrays_hashcode_byte = nullptr; -address StubRoutines::aarch64::_large_arrays_hashcode_char = nullptr; -address StubRoutines::aarch64::_large_arrays_hashcode_int = nullptr; -address StubRoutines::aarch64::_large_arrays_hashcode_short = nullptr; address StubRoutines::aarch64::_compare_long_string_LL = nullptr; address StubRoutines::aarch64::_compare_long_string_UU = nullptr; address StubRoutines::aarch64::_compare_long_string_LU = nullptr; diff --git a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp index 7d3b72a88363d..e6438908ce4c6 100644 --- a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, 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. * @@ -62,11 +62,6 @@ class aarch64 { static address _zero_blocks; static address _large_array_equals; - static address _large_arrays_hashcode_boolean; - static address _large_arrays_hashcode_byte; - static address _large_arrays_hashcode_char; - static address _large_arrays_hashcode_int; - static address _large_arrays_hashcode_short; static address _compare_long_string_LL; static address _compare_long_string_LU; static address _compare_long_string_UL; @@ -150,25 +145,6 @@ class aarch64 { return _large_array_equals; } - static address large_arrays_hashcode(BasicType eltype) { - switch (eltype) { - case T_BOOLEAN: - return _large_arrays_hashcode_boolean; - case T_BYTE: - return _large_arrays_hashcode_byte; - case T_CHAR: - return _large_arrays_hashcode_char; - case T_SHORT: - return _large_arrays_hashcode_short; - case T_INT: - return _large_arrays_hashcode_int; - default: - ShouldNotReachHere(); - } - - return nullptr; - } - static address compare_long_string_LL() { return _compare_long_string_LL; } diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp index 81e39113afaab..d71162ac568ea 100644 --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp @@ -574,10 +574,6 @@ void VM_Version::initialize() { if (FLAG_IS_DEFAULT(UsePoly1305Intrinsics)) { FLAG_SET_DEFAULT(UsePoly1305Intrinsics, true); } - - if (FLAG_IS_DEFAULT(UseVectorizedHashCodeIntrinsic)) { - FLAG_SET_DEFAULT(UseVectorizedHashCodeIntrinsic, true); - } #endif _spin_wait = get_spin_wait_desc(); diff --git a/src/hotspot/share/utilities/intpow.hpp b/src/hotspot/share/utilities/intpow.hpp deleted file mode 100644 index 0b441a55c4c96..0000000000000 --- a/src/hotspot/share/utilities/intpow.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2024, Arm 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. - * - */ - -#ifndef SHARE_UTILITIES_INTPOW_HPP -#define SHARE_UTILITIES_INTPOW_HPP - -#include "metaprogramming/enableIf.hpp" -#include -#include - -// Raise v to the power p mod 2**N, where N is the width of the type T. -template ::value && std::is_unsigned::value)> -static constexpr T intpow(T v, unsigned p) { - if (p == 0) { - return 1; - } - - // We use exponentiation by squaring to calculate the required power. - T a = intpow(v, p / 2); - T b = (p % 2) ? v : 1; - - return a * a * b; -} - -#endif // SHARE_UTILITIES_INTPOW_HPP diff --git a/test/hotspot/gtest/aarch64/aarch64-asmtest.py b/test/hotspot/gtest/aarch64/aarch64-asmtest.py index 64f3e787356e0..7e9d557d11cb7 100644 --- a/test/hotspot/gtest/aarch64/aarch64-asmtest.py +++ b/test/hotspot/gtest/aarch64/aarch64-asmtest.py @@ -77,29 +77,11 @@ class FloatRegister(Register): def __str__(self): return self.astr("v") - def generate(self): - self.number = random.randint(0, 31) - return self - def nextReg(self): next = FloatRegister() next.number = (self.number + 1) % 32 return next -class LowFloatRegister(Register): - - def __str__(self): - return self.astr("v") - - def generate(self): - self.number = random.randint(0, 15) - return self - - def nextReg(self): - next = FloatRegister() - next.number = (self.number + 1) % 16 - return next - class GeneralRegister(Register): def __str__(self): @@ -1289,75 +1271,6 @@ def astr(self): def aname(self): return self._name -class VectorScalarNEONInstruction(Instruction): - def __init__(self, args): - self._name, self.insname, self.arrangement = args - - def generate(self): - vectorLength = {"8B" : 8, "16B" : 16, "4H" : 4, "8H" : 8, "2S" : 2, "4S" : 4, "1D" : 1, "2D" : 2} [self.arrangement] - self.elemIndex = random.randrange(0, vectorLength) - self.elemSizeSpecifier = self.arrangement[len(self.arrangement) - 1:] - self._firstSIMDreg = LowFloatRegister().generate() - self.numRegs = 3 - return self - - def cstr(self): - buf = Instruction.cstr(self) + str(self._firstSIMDreg) - buf = '%s, __ T%s' % (buf, self.arrangement) - current = self._firstSIMDreg - for cnt in range(1, self.numRegs - 1): - buf = '%s, %s' % (buf, current.nextReg()) - current = current.nextReg() - buf = '%s, %s, %d' % (buf, current.nextReg(), self.elemIndex) - return '%s);' % (buf) - - def astr(self): - buf = '%s\t%s.%s' % (self.insname, self._firstSIMDreg, self.arrangement) - current = self._firstSIMDreg - for cnt in range(1, self.numRegs - 1): - buf = '%s, %s.%s' % (buf, current.nextReg(), self.arrangement) - current = current.nextReg() - buf = '%s, %s.%s[%d]' % (buf, current.nextReg(), self.elemSizeSpecifier, self.elemIndex) - return buf - - def aname(self): - return self._name - -class WideningNEONInstruction(Instruction): - def __init__(self, args): - self._name, self.insname, self.widerArrangement, self.narrowerArrangement = args - - def generate(self): - self._firstSIMDreg = FloatRegister().generate() - return self - - def cstr(self): - buf = Instruction.cstr(self) + str(self._firstSIMDreg) - current = self._firstSIMDreg - for cnt in range(1, self.numWiderRegs): - buf = '%s, %s' % (buf, current.nextReg()) - current = current.nextReg() - buf = '%s, __ T%s' % (buf, self.widerArrangement) - for cnt in range(0, self.numNarrowerRegs): - buf = '%s, %s' % (buf, current.nextReg()) - current = current.nextReg() - buf = '%s, __ T%s' % (buf, self.narrowerArrangement) - return '%s);' % (buf) - - def astr(self): - buf = '%s\t%s.%s' % (self.insname, self._firstSIMDreg, self.widerArrangement) - current = self._firstSIMDreg - for cnt in range(1, self.numWiderRegs): - buf = '%s, %s.%s' % (buf, current.nextReg(), self.widerArrangement) - current = current.nextReg() - for cnt in range(0, self.numNarrowerRegs): - buf = '%s, %s.%s' % (buf, current.nextReg(), self.narrowerArrangement) - current = current.nextReg() - return buf - - def aname(self): - return self._name - class SHA512SIMDOp(Instruction): def generate(self): @@ -1477,10 +1390,6 @@ class TwoRegNEONOp(CommonNEONInstruction): class ThreeRegNEONOp(TwoRegNEONOp): numRegs = 3 -class AddWideNEONOp(WideningNEONInstruction): - numWiderRegs = 2 - numNarrowerRegs = 1 - class NEONFloatCompareWithZero(TwoRegNEONOp): def __init__(self, args): self._name = 'fcm' @@ -1839,17 +1748,6 @@ def generate(kind, names): ["facgt", "facgt", "2D"], ]) -generate(VectorScalarNEONInstruction, - [["fmlavs", "fmla", "2S"], ["mulvs", "mul", "4S"], - ["fmlavs", "fmla", "2D"], - ["fmlsvs", "fmls", "2S"], ["mulvs", "mul", "4S"], - ["fmlsvs", "fmls", "2D"], - ["fmulxvs", "fmulx", "2S"], ["mulvs", "mul", "4S"], - ["fmulxvs", "fmulx", "2D"], - ["mulvs", "mul", "4H"], ["mulvs", "mul", "8H"], - ["mulvs", "mul", "2S"], ["mulvs", "mul", "4S"], - ]) - neonVectorCompareInstructionPrefix = ['cm', 'fcm'] neonIntegerVectorCompareConditions = ['GT', 'GE', 'EQ', 'HI', 'HS'] neonFloatVectorCompareConditions = ['EQ', 'GT', 'GE'] @@ -2183,15 +2081,6 @@ def generate(kind, names): generate(SVEReductionOp, [["andv", 0], ["orv", 0], ["eorv", 0], ["smaxv", 0], ["sminv", 0], ["fminv", 2], ["fmaxv", 2], ["fadda", 2], ["uaddv", 0]]) -generate(AddWideNEONOp, - [["saddwv", "saddw", "8H", "8B"], ["saddwv2", "saddw2", "8H", "16B"], - ["saddwv", "saddw", "4S", "4H"], ["saddwv2", "saddw2", "4S", "8H"], - ["saddwv", "saddw", "2D", "2S"], ["saddwv2", "saddw2", "2D", "4S"], - ["uaddwv", "uaddw", "8H", "8B"], ["uaddwv2", "uaddw2", "8H", "16B"], - ["uaddwv", "uaddw", "4S", "4H"], ["uaddwv2", "uaddw2", "4S", "8H"], - ["uaddwv", "uaddw", "2D", "2S"], ["uaddwv2", "uaddw2", "2D", "4S"], - ]) - print "\n __ bind(forth);" outfile.write("forth:\n") diff --git a/test/hotspot/gtest/aarch64/asmtest.out.h b/test/hotspot/gtest/aarch64/asmtest.out.h index 9805a05c5c150..b8260aaf932d1 100644 --- a/test/hotspot/gtest/aarch64/asmtest.out.h +++ b/test/hotspot/gtest/aarch64/asmtest.out.h @@ -293,9 +293,9 @@ __ ldrshw(r5, Address(r3, 12)); // ldrsh w5, [x3, 12] __ ldrsw(r27, Address(r24, 17)); // ldrsw x27, [x24, 17] __ ldrd(v13, Address(r29, -35)); // ldr d13, [x29, -35] - __ ldrs(v23, Address(r9, -47)); // ldr s23, [x9, -47] + __ ldrs(v22, Address(r9, -47)); // ldr s22, [x9, -47] __ strd(v11, Address(r0, 9)); // str d11, [x0, 9] - __ strs(v21, Address(r0, -127)); // str s21, [x0, -127] + __ strs(v20, Address(r0, -127)); // str s20, [x0, -127] // pre // LoadStoreOp @@ -314,7 +314,7 @@ __ ldrd(v0, Address(__ pre(r14, -54))); // ldr d0, [x14, -54]! __ ldrs(v3, Address(__ pre(r1, 40))); // ldr s3, [x1, 40]! __ strd(v4, Address(__ pre(r14, -94))); // str d4, [x14, -94]! - __ strs(v18, Address(__ pre(r28, -54))); // str s18, [x28, -54]! + __ strs(v17, Address(__ pre(r28, -54))); // str s17, [x28, -54]! // post // LoadStoreOp @@ -331,8 +331,8 @@ __ ldrshw(r3, Address(__ post(r11, -48))); // ldrsh w3, [x11], -48 __ ldrsw(r25, Address(__ post(r23, 22))); // ldrsw x25, [x23], 22 __ ldrd(v0, Address(__ post(r10, -215))); // ldr d0, [x10], -215 - __ ldrs(v19, Address(__ post(r6, 55))); // ldr s19, [x6], 55 - __ strd(v14, Address(__ post(r21, -234))); // str d14, [x21], -234 + __ ldrs(v17, Address(__ post(r6, 55))); // ldr s17, [x6], 55 + __ strd(v13, Address(__ post(r21, -234))); // str d13, [x21], -234 __ strs(v0, Address(__ post(r22, -70))); // str s0, [x22], -70 // base_plus_reg @@ -349,9 +349,9 @@ __ ldrsh(r21, Address(r30, r30, Address::sxtw(1))); // ldrsh x21, [x30, w30, sxtw #1] __ ldrshw(r11, Address(r10, r28, Address::sxtw(1))); // ldrsh w11, [x10, w28, sxtw #1] __ ldrsw(r28, Address(r19, r10, Address::uxtw(0))); // ldrsw x28, [x19, w10, uxtw #0] - __ ldrd(v30, Address(r29, r14, Address::sxtw(0))); // ldr d30, [x29, w14, sxtw #0] + __ ldrd(v29, Address(r29, r14, Address::sxtw(0))); // ldr d29, [x29, w14, sxtw #0] __ ldrs(v8, Address(r5, r5, Address::sxtw(2))); // ldr s8, [x5, w5, sxtw #2] - __ strd(v25, Address(r8, r13, Address::sxtx(0))); // str d25, [x8, x13, sxtx #0] + __ strd(v24, Address(r8, r13, Address::sxtx(0))); // str d24, [x8, x13, sxtx #0] __ strs(v17, Address(r24, r26, Address::lsl(2))); // str s17, [x24, x26, lsl #2] // base_plus_scaled_offset @@ -370,7 +370,7 @@ __ ldrsw(r10, Address(r7, 6372)); // ldrsw x10, [x7, 6372] __ ldrd(v3, Address(r25, 12392)); // ldr d3, [x25, 12392] __ ldrs(v12, Address(r9, 7840)); // ldr s12, [x9, 7840] - __ strd(v24, Address(r1, 12728)); // str d24, [x1, 12728] + __ strd(v23, Address(r1, 12728)); // str d23, [x1, 12728] __ strs(v3, Address(r20, 6924)); // str s3, [x20, 6924] // pcrel @@ -484,63 +484,63 @@ __ umsubl(r13, r10, r7, r5); // umsubl x13, w10, w7, x5 // ThreeRegFloatOp - __ fabds(v30, v15, v3); // fabd s30, s15, s3 - __ fmuls(v12, v12, v16); // fmul s12, s12, s16 - __ fdivs(v31, v31, v18); // fdiv s31, s31, s18 - __ fadds(v19, v21, v16); // fadd s19, s21, s16 - __ fsubs(v15, v10, v21); // fsub s15, s10, s21 - __ fabdd(v2, v10, v28); // fabd d2, d10, d28 - __ fmuld(v7, v30, v31); // fmul d7, d30, d31 - __ fdivd(v18, v1, v2); // fdiv d18, d1, d2 + __ fabds(v29, v15, v3); // fabd s29, s15, s3 + __ fmuls(v11, v12, v15); // fmul s11, s12, s15 + __ fdivs(v30, v30, v17); // fdiv s30, s30, s17 + __ fadds(v19, v20, v15); // fadd s19, s20, s15 + __ fsubs(v15, v9, v21); // fsub s15, s9, s21 + __ fabdd(v2, v9, v27); // fabd d2, d9, d27 + __ fmuld(v7, v29, v30); // fmul d7, d29, d30 + __ fdivd(v17, v1, v2); // fdiv d17, d1, d2 __ faddd(v6, v10, v3); // fadd d6, d10, d3 - __ fsubd(v25, v11, v7); // fsub d25, d11, d7 + __ fsubd(v24, v11, v7); // fsub d24, d11, d7 // FourRegFloatOp - __ fmadds(v1, v12, v0, v3); // fmadd s1, s12, s0, s3 - __ fmsubs(v19, v29, v6, v23); // fmsub s19, s29, s6, s23 - __ fnmadds(v6, v0, v28, v27); // fnmadd s6, s0, s28, s27 - __ fnmadds(v2, v5, v7, v29); // fnmadd s2, s5, s7, s29 - __ fmaddd(v12, v25, v13, v12); // fmadd d12, d25, d13, d12 - __ fmsubd(v24, v19, v8, v18); // fmsub d24, d19, d8, d18 - __ fnmaddd(v22, v26, v21, v20); // fnmadd d22, d26, d21, d20 - __ fnmaddd(v19, v2, v30, v22); // fnmadd d19, d2, d30, d22 + __ fmadds(v1, v11, v0, v3); // fmadd s1, s11, s0, s3 + __ fmsubs(v17, v28, v6, v22); // fmsub s17, s28, s6, s22 + __ fnmadds(v6, v0, v27, v26); // fnmadd s6, s0, s27, s26 + __ fnmadds(v2, v5, v7, v28); // fnmadd s2, s5, s7, s28 + __ fmaddd(v11, v25, v13, v11); // fmadd d11, d25, d13, d11 + __ fmsubd(v23, v19, v8, v17); // fmsub d23, d19, d8, d17 + __ fnmaddd(v21, v25, v20, v19); // fnmadd d21, d25, d20, d19 + __ fnmaddd(v17, v2, v29, v22); // fnmadd d17, d2, d29, d22 // TwoRegFloatOp - __ fmovs(v8, v22); // fmov s8, s22 - __ fabss(v19, v21); // fabs s19, s21 - __ fnegs(v12, v18); // fneg s12, s18 - __ fsqrts(v21, v6); // fsqrt s21, s6 - __ fcvts(v16, v3); // fcvt d16, s3 - __ fcvtsh(v3, v29); // fcvt h3, s29 - __ fcvths(v3, v28); // fcvt s3, h28 - __ fmovd(v15, v14); // fmov d15, d14 - __ fabsd(v10, v13); // fabs d10, d13 - __ fnegd(v12, v18); // fneg d12, d18 - __ fsqrtd(v10, v26); // fsqrt d10, d26 + __ fmovs(v8, v21); // fmov s8, s21 + __ fabss(v19, v20); // fabs s19, s20 + __ fnegs(v11, v17); // fneg s11, s17 + __ fsqrts(v20, v6); // fsqrt s20, s6 + __ fcvts(v15, v3); // fcvt d15, s3 + __ fcvtsh(v3, v28); // fcvt h3, s28 + __ fcvths(v3, v27); // fcvt s3, h27 + __ fmovd(v14, v14); // fmov d14, d14 + __ fabsd(v10, v12); // fabs d10, d12 + __ fnegd(v11, v17); // fneg d11, d17 + __ fsqrtd(v10, v25); // fsqrt d10, d25 __ fcvtd(v7, v7); // fcvt s7, d7 // FloatConvertOp - __ fcvtzsw(r14, v29); // fcvtzs w14, s29 - __ fcvtzs(r0, v23); // fcvtzs x0, s23 + __ fcvtzsw(r14, v28); // fcvtzs w14, s28 + __ fcvtzs(r0, v22); // fcvtzs x0, s22 __ fcvtzdw(r0, v12); // fcvtzs w0, d12 - __ fcvtzd(r23, v14); // fcvtzs x23, d14 + __ fcvtzd(r23, v13); // fcvtzs x23, d13 __ scvtfws(v13, r7); // scvtf s13, w7 - __ scvtfs(v15, r7); // scvtf s15, x7 - __ scvtfwd(v9, r20); // scvtf d9, w20 - __ scvtfd(v19, r28); // scvtf d19, x28 + __ scvtfs(v14, r7); // scvtf s14, x7 + __ scvtfwd(v8, r20); // scvtf d8, w20 + __ scvtfd(v17, r28); // scvtf d17, x28 __ fcvtassw(r30, v16); // fcvtas w30, s16 __ fcvtasd(r2, v9); // fcvtas x2, d9 - __ fcvtmssw(r16, v21); // fcvtms w16, s21 + __ fcvtmssw(r16, v20); // fcvtms w16, s20 __ fcvtmsd(r29, v4); // fcvtms x29, d4 - __ fmovs(r1, v27); // fmov w1, s27 - __ fmovd(r24, v24); // fmov x24, d24 + __ fmovs(r1, v26); // fmov w1, s26 + __ fmovd(r24, v23); // fmov x24, d23 __ fmovs(v14, r21); // fmov s14, w21 - __ fmovd(v13, r5); // fmov d13, x5 + __ fmovd(v12, r5); // fmov d12, x5 // TwoRegFloatOp - __ fcmps(v12, v25); // fcmp s12, s25 - __ fcmpd(v25, v30); // fcmp d25, d30 - __ fcmps(v28, 0.0); // fcmp s28, #0.0 + __ fcmps(v12, v24); // fcmp s12, s24 + __ fcmpd(v24, v29); // fcmp d24, d29 + __ fcmps(v27, 0.0); // fcmp s27, #0.0 __ fcmpd(v21, 0.0); // fcmp d21, #0.0 // LoadStorePairOp @@ -573,265 +573,250 @@ // LdStNEONOp __ ld1(v0, __ T8B, Address(r11)); // ld1 {v0.8B}, [x11] __ ld1(v16, v17, __ T16B, Address(__ post(r26, 32))); // ld1 {v16.16B, v17.16B}, [x26], 32 - __ ld1(v22, v23, v24, __ T1D, Address(__ post(r26, r17))); // ld1 {v22.1D, v23.1D, v24.1D}, [x26], x17 - __ ld1(v27, v28, v29, v30, __ T8H, Address(__ post(r29, 64))); // ld1 {v27.8H, v28.8H, v29.8H, v30.8H}, [x29], 64 - __ ld1r(v22, __ T8B, Address(r6)); // ld1r {v22.8B}, [x6] - __ ld1r(v14, __ T4S, Address(__ post(r29, 4))); // ld1r {v14.4S}, [x29], 4 - __ ld1r(v22, __ T1D, Address(__ post(r12, r16))); // ld1r {v22.1D}, [x12], x16 + __ ld1(v21, v22, v23, __ T1D, Address(__ post(r26, r17))); // ld1 {v21.1D, v22.1D, v23.1D}, [x26], x17 + __ ld1(v26, v27, v28, v29, __ T8H, Address(__ post(r29, 64))); // ld1 {v26.8H, v27.8H, v28.8H, v29.8H}, [x29], 64 + __ ld1r(v21, __ T8B, Address(r6)); // ld1r {v21.8B}, [x6] + __ ld1r(v13, __ T4S, Address(__ post(r29, 4))); // ld1r {v13.4S}, [x29], 4 + __ ld1r(v21, __ T1D, Address(__ post(r12, r16))); // ld1r {v21.1D}, [x12], x16 __ ld2(v1, v2, __ T2D, Address(r0)); // ld2 {v1.2D, v2.2D}, [x0] - __ ld2(v10, v11, __ T4H, Address(__ post(r21, 16))); // ld2 {v10.4H, v11.4H}, [x21], 16 + __ ld2(v9, v10, __ T4H, Address(__ post(r21, 16))); // ld2 {v9.4H, v10.4H}, [x21], 16 __ ld2r(v7, v8, __ T16B, Address(r25)); // ld2r {v7.16B, v8.16B}, [x25] - __ ld2r(v9, v10, __ T2S, Address(__ post(r9, 8))); // ld2r {v9.2S, v10.2S}, [x9], 8 + __ ld2r(v8, v9, __ T2S, Address(__ post(r9, 8))); // ld2r {v8.2S, v9.2S}, [x9], 8 __ ld2r(v9, v10, __ T2D, Address(__ post(r12, r14))); // ld2r {v9.2D, v10.2D}, [x12], x14 __ ld3(v7, v8, v9, __ T4S, Address(__ post(r4, r17))); // ld3 {v7.4S, v8.4S, v9.4S}, [x4], x17 __ ld3(v23, v24, v25, __ T2S, Address(r17)); // ld3 {v23.2S, v24.2S, v25.2S}, [x17] - __ ld3r(v4, v5, v6, __ T8H, Address(r22)); // ld3r {v4.8H, v5.8H, v6.8H}, [x22] - __ ld3r(v13, v14, v15, __ T4S, Address(__ post(r2, 12))); // ld3r {v13.4S, v14.4S, v15.4S}, [x2], 12 - __ ld3r(v16, v17, v18, __ T1D, Address(__ post(r10, r12))); // ld3r {v16.1D, v17.1D, v18.1D}, [x10], x12 + __ ld3r(v3, v4, v5, __ T8H, Address(r22)); // ld3r {v3.8H, v4.8H, v5.8H}, [x22] + __ ld3r(v12, v13, v14, __ T4S, Address(__ post(r2, 12))); // ld3r {v12.4S, v13.4S, v14.4S}, [x2], 12 + __ ld3r(v15, v16, v17, __ T1D, Address(__ post(r10, r12))); // ld3r {v15.1D, v16.1D, v17.1D}, [x10], x12 __ ld4(v4, v5, v6, v7, __ T8H, Address(__ post(r2, 64))); // ld4 {v4.8H, v5.8H, v6.8H, v7.8H}, [x2], 64 __ ld4(v6, v7, v8, v9, __ T8B, Address(__ post(r20, r11))); // ld4 {v6.8B, v7.8B, v8.8B, v9.8B}, [x20], x11 - __ ld4r(v12, v13, v14, v15, __ T8B, Address(r12)); // ld4r {v12.8B, v13.8B, v14.8B, v15.8B}, [x12] - __ ld4r(v16, v17, v18, v19, __ T4H, Address(__ post(r17, 8))); // ld4r {v16.4H, v17.4H, v18.4H, v19.4H}, [x17], 8 + __ ld4r(v11, v12, v13, v14, __ T8B, Address(r12)); // ld4r {v11.8B, v12.8B, v13.8B, v14.8B}, [x12] + __ ld4r(v15, v16, v17, v18, __ T4H, Address(__ post(r17, 8))); // ld4r {v15.4H, v16.4H, v17.4H, v18.4H}, [x17], 8 __ ld4r(v14, v15, v16, v17, __ T2S, Address(__ post(r25, r16))); // ld4r {v14.2S, v15.2S, v16.2S, v17.2S}, [x25], x16 // NEONReduceInstruction __ addv(v20, __ T8B, v21); // addv b20, v21.8B __ addv(v1, __ T16B, v2); // addv b1, v2.16B - __ addv(v23, __ T4H, v24); // addv h23, v24.4H + __ addv(v22, __ T4H, v23); // addv h22, v23.4H __ addv(v30, __ T8H, v31); // addv h30, v31.8H __ addv(v14, __ T4S, v15); // addv s14, v15.4S __ smaxv(v2, __ T8B, v3); // smaxv b2, v3.8B __ smaxv(v6, __ T16B, v7); // smaxv b6, v7.16B __ smaxv(v3, __ T4H, v4); // smaxv h3, v4.4H - __ smaxv(v8, __ T8H, v9); // smaxv h8, v9.8H - __ smaxv(v25, __ T4S, v26); // smaxv s25, v26.4S + __ smaxv(v7, __ T8H, v8); // smaxv h7, v8.8H + __ smaxv(v24, __ T4S, v25); // smaxv s24, v25.4S __ fmaxv(v0, __ T4S, v1); // fmaxv s0, v1.4S __ sminv(v27, __ T8B, v28); // sminv b27, v28.8B - __ uminv(v30, __ T8B, v31); // uminv b30, v31.8B + __ uminv(v29, __ T8B, v30); // uminv b29, v30.8B __ sminv(v5, __ T16B, v6); // sminv b5, v6.16B __ uminv(v5, __ T16B, v6); // uminv b5, v6.16B - __ sminv(v30, __ T4H, v31); // sminv h30, v31.4H + __ sminv(v29, __ T4H, v30); // sminv h29, v30.4H __ uminv(v11, __ T4H, v12); // uminv h11, v12.4H __ sminv(v25, __ T8H, v26); // sminv h25, v26.8H __ uminv(v0, __ T8H, v1); // uminv h0, v1.8H - __ sminv(v31, __ T4S, v0); // sminv s31, v0.4S + __ sminv(v30, __ T4S, v31); // sminv s30, v31.4S __ uminv(v0, __ T4S, v1); // uminv s0, v1.4S - __ fminv(v19, __ T4S, v20); // fminv s19, v20.4S - __ fmaxp(v29, v30, __ S); // fmaxp s29, v30.2S - __ fmaxp(v26, v27, __ D); // fmaxp d26, v27.2D + __ fminv(v17, __ T4S, v18); // fminv s17, v18.4S + __ fmaxp(v28, v29, __ S); // fmaxp s28, v29.2S + __ fmaxp(v25, v26, __ D); // fmaxp d25, v26.2D __ fminp(v9, v10, __ S); // fminp s9, v10.2S - __ fminp(v26, v27, __ D); // fminp d26, v27.2D + __ fminp(v25, v26, __ D); // fminp d25, v26.2D // NEONFloatCompareWithZero __ fcm(Assembler::GT, v12, __ T2S, v13); // fcmgt v12.2S, v13.2S, #0.0 __ fcm(Assembler::GT, v15, __ T4S, v16); // fcmgt v15.4S, v16.4S, #0.0 __ fcm(Assembler::GT, v11, __ T2D, v12); // fcmgt v11.2D, v12.2D, #0.0 - __ fcm(Assembler::GE, v11, __ T2S, v12); // fcmge v11.2S, v12.2S, #0.0 - __ fcm(Assembler::GE, v18, __ T4S, v19); // fcmge v18.4S, v19.4S, #0.0 - __ fcm(Assembler::GE, v25, __ T2D, v26); // fcmge v25.2D, v26.2D, #0.0 - __ fcm(Assembler::EQ, v22, __ T2S, v23); // fcmeq v22.2S, v23.2S, #0.0 - __ fcm(Assembler::EQ, v24, __ T4S, v25); // fcmeq v24.4S, v25.4S, #0.0 + __ fcm(Assembler::GE, v10, __ T2S, v11); // fcmge v10.2S, v11.2S, #0.0 + __ fcm(Assembler::GE, v17, __ T4S, v18); // fcmge v17.4S, v18.4S, #0.0 + __ fcm(Assembler::GE, v24, __ T2D, v25); // fcmge v24.2D, v25.2D, #0.0 + __ fcm(Assembler::EQ, v21, __ T2S, v22); // fcmeq v21.2S, v22.2S, #0.0 + __ fcm(Assembler::EQ, v23, __ T4S, v24); // fcmeq v23.4S, v24.4S, #0.0 __ fcm(Assembler::EQ, v0, __ T2D, v1); // fcmeq v0.2D, v1.2D, #0.0 - __ fcm(Assembler::LT, v17, __ T2S, v18); // fcmlt v17.2S, v18.2S, #0.0 - __ fcm(Assembler::LT, v11, __ T4S, v12); // fcmlt v11.4S, v12.4S, #0.0 + __ fcm(Assembler::LT, v16, __ T2S, v17); // fcmlt v16.2S, v17.2S, #0.0 + __ fcm(Assembler::LT, v10, __ T4S, v11); // fcmlt v10.4S, v11.4S, #0.0 __ fcm(Assembler::LT, v6, __ T2D, v7); // fcmlt v6.2D, v7.2D, #0.0 - __ fcm(Assembler::LE, v29, __ T2S, v30); // fcmle v29.2S, v30.2S, #0.0 + __ fcm(Assembler::LE, v28, __ T2S, v29); // fcmle v28.2S, v29.2S, #0.0 __ fcm(Assembler::LE, v6, __ T4S, v7); // fcmle v6.4S, v7.4S, #0.0 __ fcm(Assembler::LE, v5, __ T2D, v6); // fcmle v5.2D, v6.2D, #0.0 // TwoRegNEONOp __ absr(v5, __ T8B, v6); // abs v5.8B, v6.8B - __ absr(v21, __ T16B, v22); // abs v21.16B, v22.16B - __ absr(v19, __ T4H, v20); // abs v19.4H, v20.4H - __ absr(v16, __ T8H, v17); // abs v16.8H, v17.8H - __ absr(v18, __ T2S, v19); // abs v18.2S, v19.2S - __ absr(v30, __ T4S, v31); // abs v30.4S, v31.4S - __ absr(v27, __ T2D, v28); // abs v27.2D, v28.2D + __ absr(v20, __ T16B, v21); // abs v20.16B, v21.16B + __ absr(v17, __ T4H, v18); // abs v17.4H, v18.4H + __ absr(v15, __ T8H, v16); // abs v15.8H, v16.8H + __ absr(v17, __ T2S, v18); // abs v17.2S, v18.2S + __ absr(v29, __ T4S, v30); // abs v29.4S, v30.4S + __ absr(v26, __ T2D, v27); // abs v26.2D, v27.2D __ fabs(v28, __ T2S, v29); // fabs v28.2S, v29.2S __ fabs(v1, __ T4S, v2); // fabs v1.4S, v2.4S - __ fabs(v28, __ T2D, v29); // fabs v28.2D, v29.2D - __ fneg(v1, __ T2S, v2); // fneg v1.2S, v2.2S + __ fabs(v27, __ T2D, v28); // fabs v27.2D, v28.2D + __ fneg(v0, __ T2S, v1); // fneg v0.2S, v1.2S __ fneg(v20, __ T4S, v21); // fneg v20.4S, v21.4S - __ fneg(v29, __ T2D, v30); // fneg v29.2D, v30.2D - __ fsqrt(v16, __ T2S, v17); // fsqrt v16.2S, v17.2S - __ fsqrt(v13, __ T4S, v14); // fsqrt v13.4S, v14.4S + __ fneg(v28, __ T2D, v29); // fneg v28.2D, v29.2D + __ fsqrt(v15, __ T2S, v16); // fsqrt v15.2S, v16.2S + __ fsqrt(v12, __ T4S, v13); // fsqrt v12.4S, v13.4S __ fsqrt(v10, __ T2D, v11); // fsqrt v10.2D, v11.2D - __ notr(v29, __ T8B, v30); // not v29.8B, v30.8B - __ notr(v29, __ T16B, v30); // not v29.16B, v30.16B + __ notr(v28, __ T8B, v29); // not v28.8B, v29.8B + __ notr(v28, __ T16B, v29); // not v28.16B, v29.16B // ThreeRegNEONOp __ andr(v19, __ T8B, v20, v21); // and v19.8B, v20.8B, v21.8B __ andr(v22, __ T16B, v23, v24); // and v22.16B, v23.16B, v24.16B __ orr(v10, __ T8B, v11, v12); // orr v10.8B, v11.8B, v12.8B __ orr(v4, __ T16B, v5, v6); // orr v4.16B, v5.16B, v6.16B - __ eor(v31, __ T8B, v0, v1); // eor v31.8B, v0.8B, v1.8B - __ eor(v21, __ T16B, v22, v23); // eor v21.16B, v22.16B, v23.16B + __ eor(v30, __ T8B, v31, v0); // eor v30.8B, v31.8B, v0.8B + __ eor(v20, __ T16B, v21, v22); // eor v20.16B, v21.16B, v22.16B __ addv(v8, __ T8B, v9, v10); // add v8.8B, v9.8B, v10.8B - __ addv(v31, __ T16B, v0, v1); // add v31.16B, v0.16B, v1.16B - __ addv(v19, __ T4H, v20, v21); // add v19.4H, v20.4H, v21.4H + __ addv(v30, __ T16B, v31, v0); // add v30.16B, v31.16B, v0.16B + __ addv(v17, __ T4H, v18, v19); // add v17.4H, v18.4H, v19.4H __ addv(v10, __ T8H, v11, v12); // add v10.8H, v11.8H, v12.8H - __ addv(v28, __ T2S, v29, v30); // add v28.2S, v29.2S, v30.2S + __ addv(v27, __ T2S, v28, v29); // add v27.2S, v28.2S, v29.2S __ addv(v2, __ T4S, v3, v4); // add v2.4S, v3.4S, v4.4S - __ addv(v25, __ T2D, v26, v27); // add v25.2D, v26.2D, v27.2D - __ fadd(v5, __ T2S, v6, v7); // fadd v5.2S, v6.2S, v7.2S + __ addv(v24, __ T2D, v25, v26); // add v24.2D, v25.2D, v26.2D + __ fadd(v4, __ T2S, v5, v6); // fadd v4.2S, v5.2S, v6.2S __ fadd(v3, __ T4S, v4, v5); // fadd v3.4S, v4.4S, v5.4S __ fadd(v8, __ T2D, v9, v10); // fadd v8.2D, v9.2D, v10.2D __ subv(v22, __ T8B, v23, v24); // sub v22.8B, v23.8B, v24.8B - __ subv(v19, __ T16B, v20, v21); // sub v19.16B, v20.16B, v21.16B + __ subv(v17, __ T16B, v18, v19); // sub v17.16B, v18.16B, v19.16B __ subv(v13, __ T4H, v14, v15); // sub v13.4H, v14.4H, v15.4H - __ subv(v5, __ T8H, v6, v7); // sub v5.8H, v6.8H, v7.8H - __ subv(v29, __ T2S, v30, v31); // sub v29.2S, v30.2S, v31.2S - __ subv(v24, __ T4S, v25, v26); // sub v24.4S, v25.4S, v26.4S + __ subv(v4, __ T8H, v5, v6); // sub v4.8H, v5.8H, v6.8H + __ subv(v28, __ T2S, v29, v30); // sub v28.2S, v29.2S, v30.2S + __ subv(v23, __ T4S, v24, v25); // sub v23.4S, v24.4S, v25.4S __ subv(v21, __ T2D, v22, v23); // sub v21.2D, v22.2D, v23.2D - __ fsub(v26, __ T2S, v27, v28); // fsub v26.2S, v27.2S, v28.2S + __ fsub(v25, __ T2S, v26, v27); // fsub v25.2S, v26.2S, v27.2S __ fsub(v24, __ T4S, v25, v26); // fsub v24.4S, v25.4S, v26.4S __ fsub(v3, __ T2D, v4, v5); // fsub v3.2D, v4.2D, v5.2D - __ mulv(v24, __ T8B, v25, v26); // mul v24.8B, v25.8B, v26.8B + __ mulv(v23, __ T8B, v24, v25); // mul v23.8B, v24.8B, v25.8B __ mulv(v26, __ T16B, v27, v28); // mul v26.16B, v27.16B, v28.16B __ mulv(v23, __ T4H, v24, v25); // mul v23.4H, v24.4H, v25.4H - __ mulv(v15, __ T8H, v16, v17); // mul v15.8H, v16.8H, v17.8H + __ mulv(v14, __ T8H, v15, v16); // mul v14.8H, v15.8H, v16.8H __ mulv(v21, __ T2S, v22, v23); // mul v21.2S, v22.2S, v23.2S __ mulv(v3, __ T4S, v4, v5); // mul v3.4S, v4.4S, v5.4S - __ fabd(v24, __ T2S, v25, v26); // fabd v24.2S, v25.2S, v26.2S + __ fabd(v23, __ T2S, v24, v25); // fabd v23.2S, v24.2S, v25.2S __ fabd(v8, __ T4S, v9, v10); // fabd v8.4S, v9.4S, v10.4S - __ fabd(v25, __ T2D, v26, v27); // fabd v25.2D, v26.2D, v27.2D - __ faddp(v20, __ T2S, v21, v22); // faddp v20.2S, v21.2S, v22.2S - __ faddp(v16, __ T4S, v17, v18); // faddp v16.4S, v17.4S, v18.4S - __ faddp(v17, __ T2D, v18, v19); // faddp v17.2D, v18.2D, v19.2D + __ fabd(v24, __ T2D, v25, v26); // fabd v24.2D, v25.2D, v26.2D + __ faddp(v19, __ T2S, v20, v21); // faddp v19.2S, v20.2S, v21.2S + __ faddp(v15, __ T4S, v16, v17); // faddp v15.4S, v16.4S, v17.4S + __ faddp(v16, __ T2D, v17, v18); // faddp v16.2D, v17.2D, v18.2D __ fmul(v2, __ T2S, v3, v4); // fmul v2.2S, v3.2S, v4.2S __ fmul(v1, __ T4S, v2, v3); // fmul v1.4S, v2.4S, v3.4S __ fmul(v0, __ T2D, v1, v2); // fmul v0.2D, v1.2D, v2.2D __ mlav(v24, __ T4H, v25, v26); // mla v24.4H, v25.4H, v26.4H __ mlav(v4, __ T8H, v5, v6); // mla v4.8H, v5.8H, v6.8H __ mlav(v3, __ T2S, v4, v5); // mla v3.2S, v4.2S, v5.2S - __ mlav(v12, __ T4S, v13, v14); // mla v12.4S, v13.4S, v14.4S - __ fmla(v31, __ T2S, v0, v1); // fmla v31.2S, v0.2S, v1.2S - __ fmla(v28, __ T4S, v29, v30); // fmla v28.4S, v29.4S, v30.4S - __ fmla(v10, __ T2D, v11, v12); // fmla v10.2D, v11.2D, v12.2D - __ mlsv(v26, __ T4H, v27, v28); // mls v26.4H, v27.4H, v28.4H + __ mlav(v11, __ T4S, v12, v13); // mla v11.4S, v12.4S, v13.4S + __ fmla(v30, __ T2S, v31, v0); // fmla v30.2S, v31.2S, v0.2S + __ fmla(v27, __ T4S, v28, v29); // fmla v27.4S, v28.4S, v29.4S + __ fmla(v9, __ T2D, v10, v11); // fmla v9.2D, v10.2D, v11.2D + __ mlsv(v25, __ T4H, v26, v27); // mls v25.4H, v26.4H, v27.4H __ mlsv(v2, __ T8H, v3, v4); // mls v2.8H, v3.8H, v4.8H __ mlsv(v12, __ T2S, v13, v14); // mls v12.2S, v13.2S, v14.2S - __ mlsv(v18, __ T4S, v19, v20); // mls v18.4S, v19.4S, v20.4S - __ fmls(v31, __ T2S, v0, v1); // fmls v31.2S, v0.2S, v1.2S + __ mlsv(v17, __ T4S, v18, v19); // mls v17.4S, v18.4S, v19.4S + __ fmls(v30, __ T2S, v31, v0); // fmls v30.2S, v31.2S, v0.2S __ fmls(v1, __ T4S, v2, v3); // fmls v1.4S, v2.4S, v3.4S - __ fmls(v13, __ T2D, v14, v15); // fmls v13.2D, v14.2D, v15.2D - __ fdiv(v29, __ T2S, v30, v31); // fdiv v29.2S, v30.2S, v31.2S + __ fmls(v12, __ T2D, v13, v14); // fmls v12.2D, v13.2D, v14.2D + __ fdiv(v28, __ T2S, v29, v30); // fdiv v28.2S, v29.2S, v30.2S __ fdiv(v0, __ T4S, v1, v2); // fdiv v0.4S, v1.4S, v2.4S - __ fdiv(v19, __ T2D, v20, v21); // fdiv v19.2D, v20.2D, v21.2D + __ fdiv(v17, __ T2D, v18, v19); // fdiv v17.2D, v18.2D, v19.2D __ maxv(v12, __ T8B, v13, v14); // smax v12.8B, v13.8B, v14.8B __ maxv(v17, __ T16B, v18, v19); // smax v17.16B, v18.16B, v19.16B - __ maxv(v22, __ T4H, v23, v24); // smax v22.4H, v23.4H, v24.4H - __ maxv(v13, __ T8H, v14, v15); // smax v13.8H, v14.8H, v15.8H - __ maxv(v28, __ T2S, v29, v30); // smax v28.2S, v29.2S, v30.2S - __ maxv(v30, __ T4S, v31, v0); // smax v30.4S, v31.4S, v0.4S - __ smaxp(v31, __ T8B, v0, v1); // smaxp v31.8B, v0.8B, v1.8B + __ maxv(v21, __ T4H, v22, v23); // smax v21.4H, v22.4H, v23.4H + __ maxv(v12, __ T8H, v13, v14); // smax v12.8H, v13.8H, v14.8H + __ maxv(v27, __ T2S, v28, v29); // smax v27.2S, v28.2S, v29.2S + __ maxv(v29, __ T4S, v30, v31); // smax v29.4S, v30.4S, v31.4S + __ smaxp(v30, __ T8B, v31, v0); // smaxp v30.8B, v31.8B, v0.8B __ smaxp(v1, __ T16B, v2, v3); // smaxp v1.16B, v2.16B, v3.16B - __ smaxp(v26, __ T4H, v27, v28); // smaxp v26.4H, v27.4H, v28.4H - __ smaxp(v28, __ T8H, v29, v30); // smaxp v28.8H, v29.8H, v30.8H + __ smaxp(v25, __ T4H, v26, v27); // smaxp v25.4H, v26.4H, v27.4H + __ smaxp(v27, __ T8H, v28, v29); // smaxp v27.8H, v28.8H, v29.8H __ smaxp(v4, __ T2S, v5, v6); // smaxp v4.2S, v5.2S, v6.2S - __ smaxp(v30, __ T4S, v31, v0); // smaxp v30.4S, v31.4S, v0.4S - __ fmax(v4, __ T2S, v5, v6); // fmax v4.2S, v5.2S, v6.2S + __ smaxp(v29, __ T4S, v30, v31); // smaxp v29.4S, v30.4S, v31.4S + __ fmax(v3, __ T2S, v4, v5); // fmax v3.2S, v4.2S, v5.2S __ fmax(v6, __ T4S, v7, v8); // fmax v6.4S, v7.4S, v8.4S - __ fmax(v30, __ T2D, v31, v0); // fmax v30.2D, v31.2D, v0.2D - __ minv(v26, __ T8B, v27, v28); // smin v26.8B, v27.8B, v28.8B - __ minv(v18, __ T16B, v19, v20); // smin v18.16B, v19.16B, v20.16B - __ minv(v9, __ T4H, v10, v11); // smin v9.4H, v10.4H, v11.4H - __ minv(v8, __ T8H, v9, v10); // smin v8.8H, v9.8H, v10.8H + __ fmax(v29, __ T2D, v30, v31); // fmax v29.2D, v30.2D, v31.2D + __ minv(v25, __ T8B, v26, v27); // smin v25.8B, v26.8B, v27.8B + __ minv(v17, __ T16B, v18, v19); // smin v17.16B, v18.16B, v19.16B + __ minv(v8, __ T4H, v9, v10); // smin v8.4H, v9.4H, v10.4H + __ minv(v7, __ T8H, v8, v9); // smin v7.8H, v8.8H, v9.8H __ minv(v12, __ T2S, v13, v14); // smin v12.2S, v13.2S, v14.2S __ minv(v0, __ T4S, v1, v2); // smin v0.4S, v1.4S, v2.4S - __ sminp(v20, __ T8B, v21, v22); // sminp v20.8B, v21.8B, v22.8B + __ sminp(v19, __ T8B, v20, v21); // sminp v19.8B, v20.8B, v21.8B __ sminp(v1, __ T16B, v2, v3); // sminp v1.16B, v2.16B, v3.16B - __ sminp(v24, __ T4H, v25, v26); // sminp v24.4H, v25.4H, v26.4H + __ sminp(v23, __ T4H, v24, v25); // sminp v23.4H, v24.4H, v25.4H __ sminp(v2, __ T8H, v3, v4); // sminp v2.8H, v3.8H, v4.8H __ sminp(v0, __ T2S, v1, v2); // sminp v0.2S, v1.2S, v2.2S - __ sminp(v9, __ T4S, v10, v11); // sminp v9.4S, v10.4S, v11.4S - __ fmin(v24, __ T2S, v25, v26); // fmin v24.2S, v25.2S, v26.2S - __ fmin(v26, __ T4S, v27, v28); // fmin v26.4S, v27.4S, v28.4S - __ fmin(v16, __ T2D, v17, v18); // fmin v16.2D, v17.2D, v18.2D - __ facgt(v30, __ T2S, v31, v0); // facgt v30.2S, v31.2S, v0.2S + __ sminp(v8, __ T4S, v9, v10); // sminp v8.4S, v9.4S, v10.4S + __ fmin(v23, __ T2S, v24, v25); // fmin v23.2S, v24.2S, v25.2S + __ fmin(v25, __ T4S, v26, v27); // fmin v25.4S, v26.4S, v27.4S + __ fmin(v15, __ T2D, v16, v17); // fmin v15.2D, v16.2D, v17.2D + __ facgt(v29, __ T2S, v30, v31); // facgt v29.2S, v30.2S, v31.2S __ facgt(v3, __ T4S, v4, v5); // facgt v3.4S, v4.4S, v5.4S __ facgt(v10, __ T2D, v11, v12); // facgt v10.2D, v11.2D, v12.2D -// VectorScalarNEONInstruction - __ fmlavs(v5, __ T2S, v6, v7, 1); // fmla v5.2S, v6.2S, v7.S[1] - __ mulvs(v9, __ T4S, v10, v11, 0); // mul v9.4S, v10.4S, v11.S[0] - __ fmlavs(v5, __ T2D, v6, v7, 0); // fmla v5.2D, v6.2D, v7.D[0] - __ fmlsvs(v5, __ T2S, v6, v7, 0); // fmls v5.2S, v6.2S, v7.S[0] - __ mulvs(v8, __ T4S, v9, v10, 1); // mul v8.4S, v9.4S, v10.S[1] - __ fmlsvs(v5, __ T2D, v6, v7, 0); // fmls v5.2D, v6.2D, v7.D[0] - __ fmulxvs(v6, __ T2S, v7, v8, 0); // fmulx v6.2S, v7.2S, v8.S[0] - __ mulvs(v6, __ T4S, v7, v8, 1); // mul v6.4S, v7.4S, v8.S[1] - __ fmulxvs(v3, __ T2D, v4, v5, 0); // fmulx v3.2D, v4.2D, v5.D[0] - __ mulvs(v13, __ T4H, v14, v15, 2); // mul v13.4H, v14.4H, v15.H[2] - __ mulvs(v2, __ T8H, v3, v4, 4); // mul v2.8H, v3.8H, v4.H[4] - __ mulvs(v2, __ T2S, v3, v4, 0); // mul v2.2S, v3.2S, v4.S[0] - __ mulvs(v9, __ T4S, v10, v11, 1); // mul v9.4S, v10.4S, v11.S[1] - // NEONVectorCompare - __ cm(Assembler::GT, v21, __ T8B, v22, v23); // cmgt v21.8B, v22.8B, v23.8B - __ cm(Assembler::GT, v16, __ T16B, v17, v18); // cmgt v16.16B, v17.16B, v18.16B - __ cm(Assembler::GT, v18, __ T4H, v19, v20); // cmgt v18.4H, v19.4H, v20.4H - __ cm(Assembler::GT, v11, __ T8H, v12, v13); // cmgt v11.8H, v12.8H, v13.8H - __ cm(Assembler::GT, v21, __ T2S, v22, v23); // cmgt v21.2S, v22.2S, v23.2S - __ cm(Assembler::GT, v23, __ T4S, v24, v25); // cmgt v23.4S, v24.4S, v25.4S - __ cm(Assembler::GT, v12, __ T2D, v13, v14); // cmgt v12.2D, v13.2D, v14.2D - __ cm(Assembler::GE, v26, __ T8B, v27, v28); // cmge v26.8B, v27.8B, v28.8B - __ cm(Assembler::GE, v23, __ T16B, v24, v25); // cmge v23.16B, v24.16B, v25.16B - __ cm(Assembler::GE, v28, __ T4H, v29, v30); // cmge v28.4H, v29.4H, v30.4H - __ cm(Assembler::GE, v14, __ T8H, v15, v16); // cmge v14.8H, v15.8H, v16.8H - __ cm(Assembler::GE, v11, __ T2S, v12, v13); // cmge v11.2S, v12.2S, v13.2S - __ cm(Assembler::GE, v24, __ T4S, v25, v26); // cmge v24.4S, v25.4S, v26.4S - __ cm(Assembler::GE, v1, __ T2D, v2, v3); // cmge v1.2D, v2.2D, v3.2D - __ cm(Assembler::EQ, v12, __ T8B, v13, v14); // cmeq v12.8B, v13.8B, v14.8B - __ cm(Assembler::EQ, v31, __ T16B, v0, v1); // cmeq v31.16B, v0.16B, v1.16B - __ cm(Assembler::EQ, v10, __ T4H, v11, v12); // cmeq v10.4H, v11.4H, v12.4H - __ cm(Assembler::EQ, v16, __ T8H, v17, v18); // cmeq v16.8H, v17.8H, v18.8H - __ cm(Assembler::EQ, v7, __ T2S, v8, v9); // cmeq v7.2S, v8.2S, v9.2S - __ cm(Assembler::EQ, v2, __ T4S, v3, v4); // cmeq v2.4S, v3.4S, v4.4S - __ cm(Assembler::EQ, v3, __ T2D, v4, v5); // cmeq v3.2D, v4.2D, v5.2D - __ cm(Assembler::HI, v13, __ T8B, v14, v15); // cmhi v13.8B, v14.8B, v15.8B - __ cm(Assembler::HI, v19, __ T16B, v20, v21); // cmhi v19.16B, v20.16B, v21.16B - __ cm(Assembler::HI, v17, __ T4H, v18, v19); // cmhi v17.4H, v18.4H, v19.4H - __ cm(Assembler::HI, v16, __ T8H, v17, v18); // cmhi v16.8H, v17.8H, v18.8H - __ cm(Assembler::HI, v3, __ T2S, v4, v5); // cmhi v3.2S, v4.2S, v5.2S - __ cm(Assembler::HI, v1, __ T4S, v2, v3); // cmhi v1.4S, v2.4S, v3.4S - __ cm(Assembler::HI, v11, __ T2D, v12, v13); // cmhi v11.2D, v12.2D, v13.2D - __ cm(Assembler::HS, v30, __ T8B, v31, v0); // cmhs v30.8B, v31.8B, v0.8B - __ cm(Assembler::HS, v5, __ T16B, v6, v7); // cmhs v5.16B, v6.16B, v7.16B - __ cm(Assembler::HS, v8, __ T4H, v9, v10); // cmhs v8.4H, v9.4H, v10.4H - __ cm(Assembler::HS, v15, __ T8H, v16, v17); // cmhs v15.8H, v16.8H, v17.8H - __ cm(Assembler::HS, v29, __ T2S, v30, v31); // cmhs v29.2S, v30.2S, v31.2S - __ cm(Assembler::HS, v30, __ T4S, v31, v0); // cmhs v30.4S, v31.4S, v0.4S - __ cm(Assembler::HS, v0, __ T2D, v1, v2); // cmhs v0.2D, v1.2D, v2.2D - __ fcm(Assembler::EQ, v20, __ T2S, v21, v22); // fcmeq v20.2S, v21.2S, v22.2S - __ fcm(Assembler::EQ, v7, __ T4S, v8, v9); // fcmeq v7.4S, v8.4S, v9.4S - __ fcm(Assembler::EQ, v20, __ T2D, v21, v22); // fcmeq v20.2D, v21.2D, v22.2D - __ fcm(Assembler::GT, v23, __ T2S, v24, v25); // fcmgt v23.2S, v24.2S, v25.2S - __ fcm(Assembler::GT, v28, __ T4S, v29, v30); // fcmgt v28.4S, v29.4S, v30.4S - __ fcm(Assembler::GT, v21, __ T2D, v22, v23); // fcmgt v21.2D, v22.2D, v23.2D - __ fcm(Assembler::GE, v27, __ T2S, v28, v29); // fcmge v27.2S, v28.2S, v29.2S - __ fcm(Assembler::GE, v25, __ T4S, v26, v27); // fcmge v25.4S, v26.4S, v27.4S - __ fcm(Assembler::GE, v5, __ T2D, v6, v7); // fcmge v5.2D, v6.2D, v7.2D + __ cm(Assembler::GT, v22, __ T8B, v23, v24); // cmgt v22.8B, v23.8B, v24.8B + __ cm(Assembler::GT, v10, __ T16B, v11, v12); // cmgt v10.16B, v11.16B, v12.16B + __ cm(Assembler::GT, v4, __ T4H, v5, v6); // cmgt v4.4H, v5.4H, v6.4H + __ cm(Assembler::GT, v17, __ T8H, v18, v19); // cmgt v17.8H, v18.8H, v19.8H + __ cm(Assembler::GT, v1, __ T2S, v2, v3); // cmgt v1.2S, v2.2S, v3.2S + __ cm(Assembler::GT, v11, __ T4S, v12, v13); // cmgt v11.4S, v12.4S, v13.4S + __ cm(Assembler::GT, v7, __ T2D, v8, v9); // cmgt v7.2D, v8.2D, v9.2D + __ cm(Assembler::GE, v10, __ T8B, v11, v12); // cmge v10.8B, v11.8B, v12.8B + __ cm(Assembler::GE, v15, __ T16B, v16, v17); // cmge v15.16B, v16.16B, v17.16B + __ cm(Assembler::GE, v16, __ T4H, v17, v18); // cmge v16.4H, v17.4H, v18.4H + __ cm(Assembler::GE, v2, __ T8H, v3, v4); // cmge v2.8H, v3.8H, v4.8H + __ cm(Assembler::GE, v9, __ T2S, v10, v11); // cmge v9.2S, v10.2S, v11.2S + __ cm(Assembler::GE, v11, __ T4S, v12, v13); // cmge v11.4S, v12.4S, v13.4S + __ cm(Assembler::GE, v12, __ T2D, v13, v14); // cmge v12.2D, v13.2D, v14.2D + __ cm(Assembler::EQ, v14, __ T8B, v15, v16); // cmeq v14.8B, v15.8B, v16.8B + __ cm(Assembler::EQ, v13, __ T16B, v14, v15); // cmeq v13.16B, v14.16B, v15.16B + __ cm(Assembler::EQ, v2, __ T4H, v3, v4); // cmeq v2.4H, v3.4H, v4.4H + __ cm(Assembler::EQ, v6, __ T8H, v7, v8); // cmeq v6.8H, v7.8H, v8.8H + __ cm(Assembler::EQ, v19, __ T2S, v20, v21); // cmeq v19.2S, v20.2S, v21.2S + __ cm(Assembler::EQ, v25, __ T4S, v26, v27); // cmeq v25.4S, v26.4S, v27.4S + __ cm(Assembler::EQ, v15, __ T2D, v16, v17); // cmeq v15.2D, v16.2D, v17.2D + __ cm(Assembler::HI, v4, __ T8B, v5, v6); // cmhi v4.8B, v5.8B, v6.8B + __ cm(Assembler::HI, v2, __ T16B, v3, v4); // cmhi v2.16B, v3.16B, v4.16B + __ cm(Assembler::HI, v4, __ T4H, v5, v6); // cmhi v4.4H, v5.4H, v6.4H + __ cm(Assembler::HI, v11, __ T8H, v12, v13); // cmhi v11.8H, v12.8H, v13.8H + __ cm(Assembler::HI, v17, __ T2S, v18, v19); // cmhi v17.2S, v18.2S, v19.2S + __ cm(Assembler::HI, v20, __ T4S, v21, v22); // cmhi v20.4S, v21.4S, v22.4S + __ cm(Assembler::HI, v16, __ T2D, v17, v18); // cmhi v16.2D, v17.2D, v18.2D + __ cm(Assembler::HS, v17, __ T8B, v18, v19); // cmhs v17.8B, v18.8B, v19.8B + __ cm(Assembler::HS, v10, __ T16B, v11, v12); // cmhs v10.16B, v11.16B, v12.16B + __ cm(Assembler::HS, v20, __ T4H, v21, v22); // cmhs v20.4H, v21.4H, v22.4H + __ cm(Assembler::HS, v22, __ T8H, v23, v24); // cmhs v22.8H, v23.8H, v24.8H + __ cm(Assembler::HS, v12, __ T2S, v13, v14); // cmhs v12.2S, v13.2S, v14.2S + __ cm(Assembler::HS, v25, __ T4S, v26, v27); // cmhs v25.4S, v26.4S, v27.4S + __ cm(Assembler::HS, v23, __ T2D, v24, v25); // cmhs v23.2D, v24.2D, v25.2D + __ fcm(Assembler::EQ, v28, __ T2S, v29, v30); // fcmeq v28.2S, v29.2S, v30.2S + __ fcm(Assembler::EQ, v14, __ T4S, v15, v16); // fcmeq v14.4S, v15.4S, v16.4S + __ fcm(Assembler::EQ, v10, __ T2D, v11, v12); // fcmeq v10.2D, v11.2D, v12.2D + __ fcm(Assembler::GT, v24, __ T2S, v25, v26); // fcmgt v24.2S, v25.2S, v26.2S + __ fcm(Assembler::GT, v1, __ T4S, v2, v3); // fcmgt v1.4S, v2.4S, v3.4S + __ fcm(Assembler::GT, v11, __ T2D, v12, v13); // fcmgt v11.2D, v12.2D, v13.2D + __ fcm(Assembler::GE, v30, __ T2S, v31, v0); // fcmge v30.2S, v31.2S, v0.2S + __ fcm(Assembler::GE, v10, __ T4S, v11, v12); // fcmge v10.4S, v11.4S, v12.4S + __ fcm(Assembler::GE, v15, __ T2D, v16, v17); // fcmge v15.2D, v16.2D, v17.2D // SVEComparisonWithZero - __ sve_fcm(Assembler::EQ, p0, __ D, p7, z23, 0.0); // fcmeq p0.d, p7/z, z23.d, #0.0 - __ sve_fcm(Assembler::GT, p2, __ S, p7, z12, 0.0); // fcmgt p2.s, p7/z, z12.s, #0.0 - __ sve_fcm(Assembler::GE, p7, __ D, p7, z29, 0.0); // fcmge p7.d, p7/z, z29.d, #0.0 - __ sve_fcm(Assembler::LT, p9, __ S, p3, z31, 0.0); // fcmlt p9.s, p3/z, z31.s, #0.0 - __ sve_fcm(Assembler::LE, p9, __ D, p6, z31, 0.0); // fcmle p9.d, p6/z, z31.d, #0.0 - __ sve_fcm(Assembler::NE, p10, __ S, p2, z16, 0.0); // fcmne p10.s, p2/z, z16.s, #0.0 + __ sve_fcm(Assembler::EQ, p3, __ S, p3, z2, 0.0); // fcmeq p3.s, p3/z, z2.s, #0.0 + __ sve_fcm(Assembler::GT, p9, __ D, p0, z16, 0.0); // fcmgt p9.d, p0/z, z16.d, #0.0 + __ sve_fcm(Assembler::GE, p0, __ D, p1, z11, 0.0); // fcmge p0.d, p1/z, z11.d, #0.0 + __ sve_fcm(Assembler::LT, p4, __ D, p7, z14, 0.0); // fcmlt p4.d, p7/z, z14.d, #0.0 + __ sve_fcm(Assembler::LE, p0, __ S, p5, z20, 0.0); // fcmle p0.s, p5/z, z20.s, #0.0 + __ sve_fcm(Assembler::NE, p11, __ D, p6, z27, 0.0); // fcmne p11.d, p6/z, z27.d, #0.0 // SVEComparisonWithImm - __ sve_cmp(Assembler::EQ, p4, __ D, p4, z6, 11); // cmpeq p4.d, p4/z, z6.d, #11 - __ sve_cmp(Assembler::GT, p14, __ B, p2, z30, 4); // cmpgt p14.b, p2/z, z30.b, #4 - __ sve_cmp(Assembler::GE, p5, __ D, p4, z4, 1); // cmpge p5.d, p4/z, z4.d, #1 - __ sve_cmp(Assembler::LT, p11, __ D, p3, z3, 6); // cmplt p11.d, p3/z, z3.d, #6 - __ sve_cmp(Assembler::LE, p9, __ S, p0, z19, -1); // cmple p9.s, p0/z, z19.s, #-1 - __ sve_cmp(Assembler::NE, p3, __ S, p2, z12, -3); // cmpne p3.s, p2/z, z12.s, #-3 - __ sve_cmp(Assembler::HS, p11, __ D, p4, z1, 20); // cmphs p11.d, p4/z, z1.d, #20 - __ sve_cmp(Assembler::HI, p8, __ S, p5, z2, 53); // cmphi p8.s, p5/z, z2.s, #53 - __ sve_cmp(Assembler::LS, p5, __ D, p6, z21, 49); // cmpls p5.d, p6/z, z21.d, #49 - __ sve_cmp(Assembler::LO, p13, __ B, p7, z3, 97); // cmplo p13.b, p7/z, z3.b, #97 + __ sve_cmp(Assembler::EQ, p12, __ B, p5, z4, 0); // cmpeq p12.b, p5/z, z4.b, #0 + __ sve_cmp(Assembler::GT, p15, __ H, p2, z5, 12); // cmpgt p15.h, p2/z, z5.h, #12 + __ sve_cmp(Assembler::GE, p7, __ S, p7, z28, 3); // cmpge p7.s, p7/z, z28.s, #3 + __ sve_cmp(Assembler::LT, p15, __ H, p4, z5, 15); // cmplt p15.h, p4/z, z5.h, #15 + __ sve_cmp(Assembler::LE, p9, __ S, p4, z26, -4); // cmple p9.s, p4/z, z26.s, #-4 + __ sve_cmp(Assembler::NE, p5, __ B, p7, z9, 1); // cmpne p5.b, p7/z, z9.b, #1 + __ sve_cmp(Assembler::HS, p13, __ D, p1, z27, 43); // cmphs p13.d, p1/z, z27.d, #43 + __ sve_cmp(Assembler::HI, p10, __ B, p6, z9, 70); // cmphi p10.b, p6/z, z9.b, #70 + __ sve_cmp(Assembler::LS, p8, __ B, p7, z22, 61); // cmpls p8.b, p7/z, z22.b, #61 + __ sve_cmp(Assembler::LO, p11, __ S, p5, z17, 11); // cmplo p11.s, p5/z, z17.s, #11 // SpecialCases __ ccmn(zr, zr, 3u, Assembler::LE); // ccmn xzr, xzr, #3, LE @@ -1086,229 +1071,215 @@ __ fmovd(v0, -1.0625); // fmov d0, #-1.0625 // LSEOp - __ swp(Assembler::xword, r19, r17, r9); // swp x19, x17, [x9] - __ ldadd(Assembler::xword, r28, r27, r15); // ldadd x28, x27, [x15] - __ ldbic(Assembler::xword, r7, r21, r23); // ldclr x7, x21, [x23] - __ ldeor(Assembler::xword, zr, r25, r2); // ldeor xzr, x25, [x2] - __ ldorr(Assembler::xword, zr, r27, r15); // ldset xzr, x27, [x15] - __ ldsmin(Assembler::xword, r10, r23, r19); // ldsmin x10, x23, [x19] - __ ldsmax(Assembler::xword, r3, r16, r0); // ldsmax x3, x16, [x0] - __ ldumin(Assembler::xword, r25, r26, r23); // ldumin x25, x26, [x23] - __ ldumax(Assembler::xword, r2, r16, r12); // ldumax x2, x16, [x12] + __ swp(Assembler::xword, r15, r6, r12); // swp x15, x6, [x12] + __ ldadd(Assembler::xword, r16, r11, r13); // ldadd x16, x11, [x13] + __ ldbic(Assembler::xword, r23, r1, r30); // ldclr x23, x1, [x30] + __ ldeor(Assembler::xword, r19, r5, r17); // ldeor x19, x5, [x17] + __ ldorr(Assembler::xword, r2, r16, r22); // ldset x2, x16, [x22] + __ ldsmin(Assembler::xword, r13, r10, r21); // ldsmin x13, x10, [x21] + __ ldsmax(Assembler::xword, r29, r27, r12); // ldsmax x29, x27, [x12] + __ ldumin(Assembler::xword, r27, r3, r1); // ldumin x27, x3, [x1] + __ ldumax(Assembler::xword, zr, r24, r19); // ldumax xzr, x24, [x19] // LSEOp - __ swpa(Assembler::xword, r4, r28, r30); // swpa x4, x28, [x30] - __ ldadda(Assembler::xword, r29, r16, r27); // ldadda x29, x16, [x27] - __ ldbica(Assembler::xword, r6, r9, r29); // ldclra x6, x9, [x29] - __ ldeora(Assembler::xword, r16, r7, r4); // ldeora x16, x7, [x4] - __ ldorra(Assembler::xword, r7, r15, r9); // ldseta x7, x15, [x9] - __ ldsmina(Assembler::xword, r23, r8, r2); // ldsmina x23, x8, [x2] - __ ldsmaxa(Assembler::xword, r28, r21, sp); // ldsmaxa x28, x21, [sp] - __ ldumina(Assembler::xword, r5, r27, r0); // ldumina x5, x27, [x0] - __ ldumaxa(Assembler::xword, r17, r15, r4); // ldumaxa x17, x15, [x4] + __ swpa(Assembler::xword, r17, r9, r28); // swpa x17, x9, [x28] + __ ldadda(Assembler::xword, r27, r15, r7); // ldadda x27, x15, [x7] + __ ldbica(Assembler::xword, r21, r23, sp); // ldclra x21, x23, [sp] + __ ldeora(Assembler::xword, r25, r2, sp); // ldeora x25, x2, [sp] + __ ldorra(Assembler::xword, r27, r16, r10); // ldseta x27, x16, [x10] + __ ldsmina(Assembler::xword, r23, r19, r3); // ldsmina x23, x19, [x3] + __ ldsmaxa(Assembler::xword, r16, r0, r25); // ldsmaxa x16, x0, [x25] + __ ldumina(Assembler::xword, r26, r23, r2); // ldumina x26, x23, [x2] + __ ldumaxa(Assembler::xword, r16, r12, r4); // ldumaxa x16, x12, [x4] // LSEOp - __ swpal(Assembler::xword, r26, r8, r28); // swpal x26, x8, [x28] - __ ldaddal(Assembler::xword, r22, r27, r27); // ldaddal x22, x27, [x27] - __ ldbical(Assembler::xword, r25, r23, r0); // ldclral x25, x23, [x0] - __ ldeoral(Assembler::xword, r4, r6, r15); // ldeoral x4, x6, [x15] - __ ldorral(Assembler::xword, r0, r4, r15); // ldsetal x0, x4, [x15] - __ ldsminal(Assembler::xword, r1, r10, r7); // ldsminal x1, x10, [x7] - __ ldsmaxal(Assembler::xword, r5, r10, r28); // ldsmaxal x5, x10, [x28] - __ lduminal(Assembler::xword, r7, r20, r23); // lduminal x7, x20, [x23] - __ ldumaxal(Assembler::xword, r21, r6, r11); // ldumaxal x21, x6, [x11] + __ swpal(Assembler::xword, r28, r30, r29); // swpal x28, x30, [x29] + __ ldaddal(Assembler::xword, r16, r27, r6); // ldaddal x16, x27, [x6] + __ ldbical(Assembler::xword, r9, r29, r15); // ldclral x9, x29, [x15] + __ ldeoral(Assembler::xword, r7, r4, r7); // ldeoral x7, x4, [x7] + __ ldorral(Assembler::xword, r15, r9, r23); // ldsetal x15, x9, [x23] + __ ldsminal(Assembler::xword, r8, r2, r28); // ldsminal x8, x2, [x28] + __ ldsmaxal(Assembler::xword, r21, zr, r5); // ldsmaxal x21, xzr, [x5] + __ lduminal(Assembler::xword, r27, r0, r17); // lduminal x27, x0, [x17] + __ ldumaxal(Assembler::xword, r15, r4, r26); // ldumaxal x15, x4, [x26] // LSEOp - __ swpl(Assembler::xword, r8, r17, sp); // swpl x8, x17, [sp] - __ ldaddl(Assembler::xword, r6, r17, r2); // ldaddl x6, x17, [x2] - __ ldbicl(Assembler::xword, r12, r30, r29); // ldclrl x12, x30, [x29] - __ ldeorl(Assembler::xword, r3, r27, r22); // ldeorl x3, x27, [x22] - __ ldorrl(Assembler::xword, r29, r14, r13); // ldsetl x29, x14, [x13] - __ ldsminl(Assembler::xword, r28, r17, r24); // ldsminl x28, x17, [x24] - __ ldsmaxl(Assembler::xword, r5, r2, r14); // ldsmaxl x5, x2, [x14] - __ lduminl(Assembler::xword, r10, r16, r11); // lduminl x10, x16, [x11] - __ ldumaxl(Assembler::xword, r27, r23, r12); // ldumaxl x27, x23, [x12] + __ swpl(Assembler::xword, r8, r28, r22); // swpl x8, x28, [x22] + __ ldaddl(Assembler::xword, r27, r27, r25); // ldaddl x27, x27, [x25] + __ ldbicl(Assembler::xword, r23, r0, r4); // ldclrl x23, x0, [x4] + __ ldeorl(Assembler::xword, r6, r16, r0); // ldeorl x6, x16, [x0] + __ ldorrl(Assembler::xword, r4, r15, r1); // ldsetl x4, x15, [x1] + __ ldsminl(Assembler::xword, r10, r7, r5); // ldsminl x10, x7, [x5] + __ ldsmaxl(Assembler::xword, r10, r28, r7); // ldsmaxl x10, x28, [x7] + __ lduminl(Assembler::xword, r20, r23, r21); // lduminl x20, x23, [x21] + __ ldumaxl(Assembler::xword, r6, r11, r8); // ldumaxl x6, x11, [x8] // LSEOp - __ swp(Assembler::word, r4, r22, r17); // swp w4, w22, [x17] - __ ldadd(Assembler::word, r4, r1, r19); // ldadd w4, w1, [x19] - __ ldbic(Assembler::word, r16, r16, r13); // ldclr w16, w16, [x13] - __ ldeor(Assembler::word, r14, r12, r2); // ldeor w14, w12, [x2] - __ ldorr(Assembler::word, r17, r3, r21); // ldset w17, w3, [x21] - __ ldsmin(Assembler::word, r23, r5, r6); // ldsmin w23, w5, [x6] - __ ldsmax(Assembler::word, r7, r19, r13); // ldsmax w7, w19, [x13] - __ ldumin(Assembler::word, r28, r17, r16); // ldumin w28, w17, [x16] - __ ldumax(Assembler::word, r6, r2, r29); // ldumax w6, w2, [x29] + __ swp(Assembler::word, r17, zr, r6); // swp w17, wzr, [x6] + __ ldadd(Assembler::word, r17, r2, r12); // ldadd w17, w2, [x12] + __ ldbic(Assembler::word, r30, r29, r3); // ldclr w30, w29, [x3] + __ ldeor(Assembler::word, r27, r22, r29); // ldeor w27, w22, [x29] + __ ldorr(Assembler::word, r14, r13, r28); // ldset w14, w13, [x28] + __ ldsmin(Assembler::word, r17, r24, r5); // ldsmin w17, w24, [x5] + __ ldsmax(Assembler::word, r2, r14, r10); // ldsmax w2, w14, [x10] + __ ldumin(Assembler::word, r16, r11, r27); // ldumin w16, w11, [x27] + __ ldumax(Assembler::word, r23, r12, r4); // ldumax w23, w12, [x4] // LSEOp - __ swpa(Assembler::word, r3, r4, r6); // swpa w3, w4, [x6] - __ ldadda(Assembler::word, r16, r20, r13); // ldadda w16, w20, [x13] - __ ldbica(Assembler::word, r12, r20, r8); // ldclra w12, w20, [x8] - __ ldeora(Assembler::word, r25, r20, r19); // ldeora w25, w20, [x19] - __ ldorra(Assembler::word, r0, r11, r24); // ldseta w0, w11, [x24] - __ ldsmina(Assembler::word, r6, r20, sp); // ldsmina w6, w20, [sp] - __ ldsmaxa(Assembler::word, r14, r16, r6); // ldsmaxa w14, w16, [x6] - __ ldumina(Assembler::word, r0, r7, r15); // ldumina w0, w7, [x15] - __ ldumaxa(Assembler::word, r19, r26, r9); // ldumaxa w19, w26, [x9] + __ swpa(Assembler::word, r22, r17, r4); // swpa w22, w17, [x4] + __ ldadda(Assembler::word, r1, r19, r16); // ldadda w1, w19, [x16] + __ ldbica(Assembler::word, r16, r13, r14); // ldclra w16, w13, [x14] + __ ldeora(Assembler::word, r12, r2, r17); // ldeora w12, w2, [x17] + __ ldorra(Assembler::word, r3, r21, r23); // ldseta w3, w21, [x23] + __ ldsmina(Assembler::word, r5, r6, r7); // ldsmina w5, w6, [x7] + __ ldsmaxa(Assembler::word, r19, r13, r28); // ldsmaxa w19, w13, [x28] + __ ldumina(Assembler::word, r17, r16, r6); // ldumina w17, w16, [x6] + __ ldumaxa(Assembler::word, r2, r29, r3); // ldumaxa w2, w29, [x3] // LSEOp - __ swpal(Assembler::word, r10, r23, r21); // swpal w10, w23, [x21] - __ ldaddal(Assembler::word, r22, r28, r2); // ldaddal w22, w28, [x2] - __ ldbical(Assembler::word, r3, r15, r19); // ldclral w3, w15, [x19] - __ ldeoral(Assembler::word, r20, r7, r4); // ldeoral w20, w7, [x4] - __ ldorral(Assembler::word, r29, r7, r0); // ldsetal w29, w7, [x0] - __ ldsminal(Assembler::word, r9, r16, r20); // ldsminal w9, w16, [x20] - __ ldsmaxal(Assembler::word, r23, r4, r16); // ldsmaxal w23, w4, [x16] - __ lduminal(Assembler::word, r10, r23, r11); // lduminal w10, w23, [x11] - __ ldumaxal(Assembler::word, r25, r6, sp); // ldumaxal w25, w6, [sp] + __ swpal(Assembler::word, r4, r6, r15); // swpal w4, w6, [x15] + __ ldaddal(Assembler::word, r20, r13, r12); // ldaddal w20, w13, [x12] + __ ldbical(Assembler::word, r20, r8, r25); // ldclral w20, w8, [x25] + __ ldeoral(Assembler::word, r20, r19, r0); // ldeoral w20, w19, [x0] + __ ldorral(Assembler::word, r11, r24, r6); // ldsetal w11, w24, [x6] + __ ldsminal(Assembler::word, r20, zr, r14); // ldsminal w20, wzr, [x14] + __ ldsmaxal(Assembler::word, r16, r6, r0); // ldsmaxal w16, w6, [x0] + __ lduminal(Assembler::word, r7, r15, r19); // lduminal w7, w15, [x19] + __ ldumaxal(Assembler::word, r26, r9, r10); // ldumaxal w26, w9, [x10] // LSEOp - __ swpl(Assembler::word, r16, r13, r23); // swpl w16, w13, [x23] - __ ldaddl(Assembler::word, r12, r1, r14); // ldaddl w12, w1, [x14] - __ ldbicl(Assembler::word, r9, r21, r16); // ldclrl w9, w21, [x16] - __ ldeorl(Assembler::word, r26, r15, r4); // ldeorl w26, w15, [x4] - __ ldorrl(Assembler::word, r4, r16, r8); // ldsetl w4, w16, [x8] - __ ldsminl(Assembler::word, r6, r30, r4); // ldsminl w6, w30, [x4] - __ ldsmaxl(Assembler::word, r29, r17, r29); // ldsmaxl w29, w17, [x29] - __ lduminl(Assembler::word, r26, r9, r15); // lduminl w26, w9, [x15] - __ ldumaxl(Assembler::word, r2, r11, r29); // ldumaxl w2, w11, [x29] + __ swpl(Assembler::word, r23, r21, r22); // swpl w23, w21, [x22] + __ ldaddl(Assembler::word, r28, r2, r3); // ldaddl w28, w2, [x3] + __ ldbicl(Assembler::word, r15, r19, r20); // ldclrl w15, w19, [x20] + __ ldeorl(Assembler::word, r7, r4, r29); // ldeorl w7, w4, [x29] + __ ldorrl(Assembler::word, r7, r0, r9); // ldsetl w7, w0, [x9] + __ ldsminl(Assembler::word, r16, r20, r23); // ldsminl w16, w20, [x23] + __ ldsmaxl(Assembler::word, r4, r16, r10); // ldsmaxl w4, w16, [x10] + __ lduminl(Assembler::word, r23, r11, r25); // lduminl w23, w11, [x25] + __ ldumaxl(Assembler::word, r6, zr, r16); // ldumaxl w6, wzr, [x16] // SHA3SIMDOp - __ bcax(v3, __ T16B, v7, v1, v27); // bcax v3.16B, v7.16B, v1.16B, v27.16B - __ eor3(v21, __ T16B, v18, v14, v8); // eor3 v21.16B, v18.16B, v14.16B, v8.16B - __ rax1(v18, __ T2D, v22, v25); // rax1 v18.2D, v22.2D, v25.2D - __ xar(v5, __ T2D, v20, v21, 37); // xar v5.2D, v20.2D, v21.2D, #37 + __ bcax(v13, __ T16B, v22, v11, v1); // bcax v13.16B, v22.16B, v11.16B, v1.16B + __ eor3(v13, __ T16B, v8, v20, v16); // eor3 v13.16B, v8.16B, v20.16B, v16.16B + __ rax1(v25, __ T2D, v15, v4); // rax1 v25.2D, v15.2D, v4.2D + __ xar(v4, __ T2D, v17, v8, 13); // xar v4.2D, v17.2D, v8.2D, #13 // SHA512SIMDOp - __ sha512h(v23, __ T2D, v16, v30); // sha512h q23, q16, v30.2D - __ sha512h2(v20, __ T2D, v20, v0); // sha512h2 q20, q20, v0.2D - __ sha512su0(v4, __ T2D, v19); // sha512su0 v4.2D, v19.2D - __ sha512su1(v24, __ T2D, v4, v20); // sha512su1 v24.2D, v4.2D, v20.2D + __ sha512h(v29, __ T2D, v4, v28); // sha512h q29, q4, v28.2D + __ sha512h2(v16, __ T2D, v29, v26); // sha512h2 q16, q29, v26.2D + __ sha512su0(v9, __ T2D, v14); // sha512su0 v9.2D, v14.2D + __ sha512su1(v2, __ T2D, v11, v28); // sha512su1 v2.2D, v11.2D, v28.2D // SVEBinaryImmOp - __ sve_add(z4, __ D, 210u); // add z4.d, z4.d, #0xd2 - __ sve_sub(z19, __ B, 71u); // sub z19.b, z19.b, #0x47 - __ sve_and(z8, __ H, 49663u); // and z8.h, z8.h, #0xc1ff - __ sve_eor(z31, __ S, 4294967231u); // eor z31.s, z31.s, #0xffffffbf - __ sve_orr(z1, __ H, 16368u); // orr z1.h, z1.h, #0x3ff0 + __ sve_add(z3, __ B, 10u); // add z3.b, z3.b, #0xa + __ sve_sub(z26, __ S, 150u); // sub z26.s, z26.s, #0x96 + __ sve_and(z14, __ H, 57343u); // and z14.h, z14.h, #0xdfff + __ sve_eor(z24, __ B, 191u); // eor z24.b, z24.b, #0xbf + __ sve_orr(z17, __ S, 4294966791u); // orr z17.s, z17.s, #0xfffffe07 // SVEBinaryImmOp - __ sve_add(z0, __ H, 61u); // add z0.h, z0.h, #0x3d - __ sve_sub(z24, __ S, 36u); // sub z24.s, z24.s, #0x24 - __ sve_and(z27, __ B, 243u); // and z27.b, z27.b, #0xf3 - __ sve_eor(z24, __ H, 65534u); // eor z24.h, z24.h, #0xfffe - __ sve_orr(z22, __ S, 4294967293u); // orr z22.s, z22.s, #0xfffffffd + __ sve_add(z20, __ S, 3u); // add z20.s, z20.s, #0x3 + __ sve_sub(z4, __ S, 196u); // sub z4.s, z4.s, #0xc4 + __ sve_and(z4, __ S, 4286578691u); // and z4.s, z4.s, #0xff800003 + __ sve_eor(z25, __ S, 33553408u); // eor z25.s, z25.s, #0x1fffc00 + __ sve_orr(z8, __ H, 49663u); // orr z8.h, z8.h, #0xc1ff // SVEBinaryImmOp - __ sve_add(z29, __ H, 113u); // add z29.h, z29.h, #0x71 - __ sve_sub(z20, __ B, 165u); // sub z20.b, z20.b, #0xa5 - __ sve_and(z28, __ H, 32256u); // and z28.h, z28.h, #0x7e00 - __ sve_eor(z12, __ S, 4287102855u); // eor z12.s, z12.s, #0xff87ff87 - __ sve_orr(z9, __ S, 3825205247u); // orr z9.s, z9.s, #0xe3ffffff + __ sve_add(z30, __ S, 36u); // add z30.s, z30.s, #0x24 + __ sve_sub(z30, __ B, 85u); // sub z30.b, z30.b, #0x55 + __ sve_and(z19, __ H, 4032u); // and z19.h, z19.h, #0xfc0 + __ sve_eor(z7, __ D, 274877904896u); // eor z7.d, z7.d, #0x3ffffff800 + __ sve_orr(z27, __ B, 243u); // orr z27.b, z27.b, #0xf3 // SVEBinaryImmOp - __ sve_add(z18, __ S, 41u); // add z18.s, z18.s, #0x29 - __ sve_sub(z0, __ B, 98u); // sub z0.b, z0.b, #0x62 - __ sve_and(z8, __ H, 32768u); // and z8.h, z8.h, #0x8000 - __ sve_eor(z4, __ H, 508u); // eor z4.h, z4.h, #0x1fc - __ sve_orr(z0, __ H, 64512u); // orr z0.h, z0.h, #0xfc00 + __ sve_add(z23, __ H, 132u); // add z23.h, z23.h, #0x84 + __ sve_sub(z30, __ S, 183u); // sub z30.s, z30.s, #0xb7 + __ sve_and(z20, __ D, 4503599627354112u); // and z20.d, z20.d, #0xfffffffffc000 + __ sve_eor(z13, __ S, 4042322160u); // eor z13.s, z13.s, #0xf0f0f0f0 + __ sve_orr(z28, __ H, 32256u); // orr z28.h, z28.h, #0x7e00 // SVEBinaryImmOp - __ sve_add(z3, __ B, 79u); // add z3.b, z3.b, #0x4f - __ sve_sub(z19, __ D, 84u); // sub z19.d, z19.d, #0x54 - __ sve_and(z24, __ B, 62u); // and z24.b, z24.b, #0x3e - __ sve_eor(z24, __ D, 18428729675200069887u); // eor z24.d, z24.d, #0xffc00000000000ff - __ sve_orr(z11, __ D, 17296056810822168583u); // orr z11.d, z11.d, #0xf007f007f007f007 + __ sve_add(z11, __ S, 13u); // add z11.s, z11.s, #0xd + __ sve_sub(z24, __ H, 159u); // sub z24.h, z24.h, #0x9f + __ sve_and(z13, __ S, 2151677951u); // and z13.s, z13.s, #0x803fffff + __ sve_eor(z4, __ B, 124u); // eor z4.b, z4.b, #0x7c + __ sve_orr(z7, __ H, 32768u); // orr z7.h, z7.h, #0x8000 // SVEBinaryImmOp - __ sve_add(z31, __ S, 115u); // add z31.s, z31.s, #0x73 - __ sve_sub(z3, __ D, 134u); // sub z3.d, z3.d, #0x86 - __ sve_and(z22, __ S, 4042322160u); // and z22.s, z22.s, #0xf0f0f0f0 - __ sve_eor(z3, __ B, 225u); // eor z3.b, z3.b, #0xe1 - __ sve_orr(z9, __ S, 4164941887u); // orr z9.s, z9.s, #0xf83ff83f + __ sve_add(z4, __ H, 243u); // add z4.h, z4.h, #0xf3 + __ sve_sub(z5, __ B, 86u); // sub z5.b, z5.b, #0x56 + __ sve_and(z21, __ D, 8064u); // and z21.d, z21.d, #0x1f80 + __ sve_eor(z9, __ S, 130023424u); // eor z9.s, z9.s, #0x7c00000 + __ sve_orr(z24, __ B, 62u); // orr z24.b, z24.b, #0x3e // SVEVectorOp - __ sve_add(z0, __ D, z4, z2); // add z0.d, z4.d, z2.d - __ sve_sub(z14, __ S, z6, z11); // sub z14.s, z6.s, z11.s - __ sve_fadd(z14, __ S, z17, z30); // fadd z14.s, z17.s, z30.s - __ sve_fmul(z3, __ S, z3, z23); // fmul z3.s, z3.s, z23.s - __ sve_fsub(z3, __ S, z24, z28); // fsub z3.s, z24.s, z28.s - __ sve_abs(z19, __ D, p5, z7); // abs z19.d, p5/m, z7.d - __ sve_add(z21, __ H, p3, z5); // add z21.h, p3/m, z21.h, z5.h - __ sve_and(z26, __ S, p1, z22); // and z26.s, p1/m, z26.s, z22.s - __ sve_asr(z17, __ H, p0, z3); // asr z17.h, p0/m, z17.h, z3.h - __ sve_bic(z20, __ H, p3, z8); // bic z20.h, p3/m, z20.h, z8.h - __ sve_clz(z14, __ H, p4, z17); // clz z14.h, p4/m, z17.h - __ sve_cnt(z13, __ D, p6, z18); // cnt z13.d, p6/m, z18.d - __ sve_eor(z19, __ H, p2, z16); // eor z19.h, p2/m, z19.h, z16.h - __ sve_lsl(z27, __ S, p5, z28); // lsl z27.s, p5/m, z27.s, z28.s - __ sve_lsr(z8, __ D, p2, z5); // lsr z8.d, p2/m, z8.d, z5.d - __ sve_mul(z28, __ H, p2, z0); // mul z28.h, p2/m, z28.h, z0.h - __ sve_neg(z25, __ B, p5, z21); // neg z25.b, p5/m, z21.b - __ sve_not(z3, __ B, p5, z26); // not z3.b, p5/m, z26.b - __ sve_orr(z26, __ S, p7, z19); // orr z26.s, p7/m, z26.s, z19.s - __ sve_rbit(z1, __ D, p3, z14); // rbit z1.d, p3/m, z14.d - __ sve_revb(z14, __ H, p0, z18); // revb z14.h, p0/m, z18.h - __ sve_smax(z31, __ S, p5, z23); // smax z31.s, p5/m, z31.s, z23.s - __ sve_smin(z30, __ B, p3, z8); // smin z30.b, p3/m, z30.b, z8.b - __ sve_sub(z0, __ S, p3, z23); // sub z0.s, p3/m, z0.s, z23.s - __ sve_fabs(z0, __ D, p4, z26); // fabs z0.d, p4/m, z26.d - __ sve_fadd(z24, __ D, p3, z22); // fadd z24.d, p3/m, z24.d, z22.d - __ sve_fdiv(z2, __ D, p0, z11); // fdiv z2.d, p0/m, z2.d, z11.d - __ sve_fmax(z12, __ D, p5, z24); // fmax z12.d, p5/m, z12.d, z24.d - __ sve_fmin(z9, __ D, p7, z17); // fmin z9.d, p7/m, z9.d, z17.d - __ sve_fmul(z20, __ D, p5, z4); // fmul z20.d, p5/m, z20.d, z4.d - __ sve_fneg(z13, __ D, p7, z22); // fneg z13.d, p7/m, z22.d - __ sve_frintm(z31, __ D, p6, z18); // frintm z31.d, p6/m, z18.d - __ sve_frintn(z15, __ D, p2, z13); // frintn z15.d, p2/m, z13.d - __ sve_frintp(z20, __ S, p1, z1); // frintp z20.s, p1/m, z1.s - __ sve_fsqrt(z14, __ S, p0, z7); // fsqrt z14.s, p0/m, z7.s - __ sve_fsub(z12, __ D, p4, z4); // fsub z12.d, p4/m, z12.d, z4.d - __ sve_fmad(z15, __ S, p0, z3, z30); // fmad z15.s, p0/m, z3.s, z30.s - __ sve_fmla(z20, __ D, p1, z20, z31); // fmla z20.d, p1/m, z20.d, z31.d - __ sve_fmls(z13, __ D, p3, z9, z14); // fmls z13.d, p3/m, z9.d, z14.d - __ sve_fmsb(z1, __ S, p3, z28, z3); // fmsb z1.s, p3/m, z28.s, z3.s - __ sve_fnmad(z26, __ S, p2, z25, z9); // fnmad z26.s, p2/m, z25.s, z9.s - __ sve_fnmsb(z26, __ D, p2, z14, z1); // fnmsb z26.d, p2/m, z14.d, z1.d - __ sve_fnmla(z26, __ D, p1, z29, z20); // fnmla z26.d, p1/m, z29.d, z20.d - __ sve_fnmls(z6, __ D, p7, z13, z1); // fnmls z6.d, p7/m, z13.d, z1.d - __ sve_mla(z11, __ B, p2, z1, z1); // mla z11.b, p2/m, z1.b, z1.b - __ sve_mls(z27, __ B, p6, z15, z2); // mls z27.b, p6/m, z15.b, z2.b - __ sve_and(z30, z17, z25); // and z30.d, z17.d, z25.d - __ sve_eor(z2, z24, z3); // eor z2.d, z24.d, z3.d - __ sve_orr(z29, z13, z3); // orr z29.d, z13.d, z3.d - __ sve_bic(z14, z16, z28); // bic z14.d, z16.d, z28.d - __ sve_uzp1(z4, __ S, z11, z27); // uzp1 z4.s, z11.s, z27.s - __ sve_uzp2(z2, __ D, z16, z1); // uzp2 z2.d, z16.d, z1.d - __ sve_fabd(z7, __ D, p5, z31); // fabd z7.d, p5/m, z7.d, z31.d - __ sve_bext(z16, __ S, z10, z22); // bext z16.s, z10.s, z22.s - __ sve_bdep(z29, __ B, z7, z22); // bdep z29.b, z7.b, z22.b - __ sve_eor3(z12, z24, z11); // eor3 z12.d, z12.d, z24.d, z11.d + __ sve_add(z23, __ S, z28, z13); // add z23.s, z28.s, z13.s + __ sve_sub(z10, __ S, z26, z12); // sub z10.s, z26.s, z12.s + __ sve_fadd(z30, __ S, z17, z14); // fadd z30.s, z17.s, z14.s + __ sve_fmul(z29, __ D, z16, z21); // fmul z29.d, z16.d, z21.d + __ sve_fsub(z7, __ S, z19, z2); // fsub z7.s, z19.s, z2.s + __ sve_abs(z26, __ S, p4, z9); // abs z26.s, p4/m, z9.s + __ sve_add(z17, __ B, p5, z0); // add z17.b, p5/m, z17.b, z0.b + __ sve_and(z2, __ B, p6, z14); // and z2.b, p6/m, z2.b, z14.b + __ sve_asr(z11, __ S, p5, z14); // asr z11.s, p5/m, z11.s, z14.s + __ sve_bic(z29, __ B, p3, z3); // bic z29.b, p3/m, z29.b, z3.b + __ sve_clz(z22, __ D, p2, z3); // clz z22.d, p2/m, z3.d + __ sve_cnt(z27, __ S, p0, z19); // cnt z27.s, p0/m, z19.s + __ sve_eor(z7, __ H, p6, z21); // eor z7.h, p6/m, z7.h, z21.h + __ sve_lsl(z5, __ B, p2, z25); // lsl z5.b, p2/m, z5.b, z25.b + __ sve_lsr(z21, __ B, p4, z17); // lsr z21.b, p4/m, z21.b, z17.b + __ sve_mul(z3, __ H, p2, z19); // mul z3.h, p2/m, z3.h, z19.h + __ sve_neg(z7, __ S, p3, z14); // neg z7.s, p3/m, z14.s + __ sve_not(z17, __ D, p2, z13); // not z17.d, p2/m, z13.d + __ sve_orr(z17, __ H, p7, z17); // orr z17.h, p7/m, z17.h, z17.h + __ sve_rbit(z15, __ S, p3, z26); // rbit z15.s, p3/m, z26.s + __ sve_revb(z27, __ H, p5, z7); // revb z27.h, p5/m, z7.h + __ sve_smax(z5, __ H, p7, z27); // smax z5.h, p7/m, z5.h, z27.h + __ sve_smin(z0, __ S, p3, z24); // smin z0.s, p3/m, z0.s, z24.s + __ sve_sub(z20, __ S, p0, z3); // sub z20.s, p0/m, z20.s, z3.s + __ sve_fabs(z25, __ D, p1, z25); // fabs z25.d, p1/m, z25.d + __ sve_fadd(z17, __ S, p4, z1); // fadd z17.s, p4/m, z17.s, z1.s + __ sve_fdiv(z14, __ S, p7, z13); // fdiv z14.s, p7/m, z14.s, z13.s + __ sve_fmax(z17, __ D, p0, z30); // fmax z17.d, p0/m, z17.d, z30.d + __ sve_fmin(z22, __ S, p5, z29); // fmin z22.s, p5/m, z22.s, z29.s + __ sve_fmul(z8, __ S, p0, z0); // fmul z8.s, p0/m, z8.s, z0.s + __ sve_fneg(z23, __ D, p5, z0); // fneg z23.d, p5/m, z0.d + __ sve_frintm(z25, __ S, p6, z23); // frintm z25.s, p6/m, z23.s + __ sve_frintn(z21, __ S, p5, z1); // frintn z21.s, p5/m, z1.s + __ sve_frintp(z10, __ D, p5, z11); // frintp z10.d, p5/m, z11.d + __ sve_fsqrt(z23, __ D, p6, z8); // fsqrt z23.d, p6/m, z8.d + __ sve_fsub(z17, __ D, p5, z19); // fsub z17.d, p5/m, z17.d, z19.d + __ sve_fmad(z4, __ D, p5, z13, z30); // fmad z4.d, p5/m, z13.d, z30.d + __ sve_fmla(z30, __ D, p7, z25, z17); // fmla z30.d, p7/m, z25.d, z17.d + __ sve_fmls(z14, __ D, p2, z12, z28); // fmls z14.d, p2/m, z12.d, z28.d + __ sve_fmsb(z5, __ S, p0, z13, z13); // fmsb z5.s, p0/m, z13.s, z13.s + __ sve_fnmad(z7, __ S, p2, z11, z19); // fnmad z7.s, p2/m, z11.s, z19.s + __ sve_fnmsb(z25, __ D, p3, z2, z3); // fnmsb z25.d, p3/m, z2.d, z3.d + __ sve_fnmla(z0, __ D, p5, z5, z20); // fnmla z0.d, p5/m, z5.d, z20.d + __ sve_fnmls(z28, __ S, p3, z13, z8); // fnmls z28.s, p3/m, z13.s, z8.s + __ sve_mla(z29, __ B, p0, z14, z27); // mla z29.b, p0/m, z14.b, z27.b + __ sve_mls(z3, __ H, p6, z8, z24); // mls z3.h, p6/m, z8.h, z24.h + __ sve_and(z1, z25, z10); // and z1.d, z25.d, z10.d + __ sve_eor(z1, z20, z25); // eor z1.d, z20.d, z25.d + __ sve_orr(z28, z19, z16); // orr z28.d, z19.d, z16.d + __ sve_bic(z27, z13, z1); // bic z27.d, z13.d, z1.d + __ sve_uzp1(z11, __ B, z9, z1); // uzp1 z11.b, z9.b, z1.b + __ sve_uzp2(z1, __ H, z27, z26); // uzp2 z1.h, z27.h, z26.h + __ sve_fabd(z2, __ D, p1, z29); // fabd z2.d, p1/m, z2.d, z29.d + __ sve_bext(z24, __ D, z2, z2); // bext z24.d, z2.d, z2.d + __ sve_bdep(z3, __ H, z25, z28); // bdep z3.h, z25.h, z28.h + __ sve_eor3(z3, z22, z13); // eor3 z3.d, z3.d, z22.d, z13.d // SVEReductionOp - __ sve_andv(v11, __ B, p2, z0); // andv b11, p2, z0.b - __ sve_orv(v23, __ B, p5, z20); // orv b23, p5, z20.b - __ sve_eorv(v3, __ B, p3, z15); // eorv b3, p3, z15.b - __ sve_smaxv(v30, __ B, p6, z27); // smaxv b30, p6, z27.b - __ sve_sminv(v21, __ D, p6, z10); // sminv d21, p6, z10.d - __ sve_fminv(v3, __ S, p6, z4); // fminv s3, p6, z4.s - __ sve_fmaxv(v6, __ S, p0, z21); // fmaxv s6, p0, z21.s - __ sve_fadda(v25, __ D, p6, z30); // fadda d25, p6, d25, z30.d - __ sve_uaddv(v31, __ H, p4, z1); // uaddv d31, p4, z1.h - -// AddWideNEONOp - __ saddwv(v12, v13, __ T8H, v14, __ T8B); // saddw v12.8H, v13.8H, v14.8B - __ saddwv2(v30, v31, __ T8H, v0, __ T16B); // saddw2 v30.8H, v31.8H, v0.16B - __ saddwv(v13, v14, __ T4S, v15, __ T4H); // saddw v13.4S, v14.4S, v15.4H - __ saddwv2(v8, v9, __ T4S, v10, __ T8H); // saddw2 v8.4S, v9.4S, v10.8H - __ saddwv(v25, v26, __ T2D, v27, __ T2S); // saddw v25.2D, v26.2D, v27.2S - __ saddwv2(v29, v30, __ T2D, v31, __ T4S); // saddw2 v29.2D, v30.2D, v31.4S - __ uaddwv(v1, v2, __ T8H, v3, __ T8B); // uaddw v1.8H, v2.8H, v3.8B - __ uaddwv2(v31, v0, __ T8H, v1, __ T16B); // uaddw2 v31.8H, v0.8H, v1.16B - __ uaddwv(v23, v24, __ T4S, v25, __ T4H); // uaddw v23.4S, v24.4S, v25.4H - __ uaddwv2(v31, v0, __ T4S, v1, __ T8H); // uaddw2 v31.4S, v0.4S, v1.8H - __ uaddwv(v20, v21, __ T2D, v22, __ T2S); // uaddw v20.2D, v21.2D, v22.2S - __ uaddwv2(v0, v1, __ T2D, v2, __ T4S); // uaddw2 v0.2D, v1.2D, v2.4S + __ sve_andv(v27, __ H, p4, z4); // andv h27, p4, z4.h + __ sve_orv(v26, __ S, p4, z2); // orv s26, p4, z2.s + __ sve_eorv(v1, __ S, p7, z7); // eorv s1, p7, z7.s + __ sve_smaxv(v30, __ H, p7, z16); // smaxv h30, p7, z16.h + __ sve_sminv(v21, __ B, p4, z28); // sminv b21, p4, z28.b + __ sve_fminv(v21, __ D, p1, z12); // fminv d21, p1, z12.d + __ sve_fmaxv(v11, __ S, p2, z10); // fmaxv s11, p2, z10.s + __ sve_fadda(v0, __ D, p1, z22); // fadda d0, p1, d0, z22.d + __ sve_uaddv(v20, __ H, p1, z3); // uaddv d20, p1, z3.h __ bind(forth); @@ -1327,30 +1298,30 @@ 0x9101a1a0, 0xb10a5cc8, 0xd10810aa, 0xf10fd061, 0x120cb166, 0x321764bc, 0x52174681, 0x720c0227, 0x9241018e, 0xb25a2969, 0xd278b411, 0xf26aad01, - 0x14000000, 0x17ffffd7, 0x14000441, 0x94000000, - 0x97ffffd4, 0x9400043e, 0x3400000a, 0x34fffa2a, - 0x3400876a, 0x35000008, 0x35fff9c8, 0x35008708, - 0xb400000b, 0xb4fff96b, 0xb40086ab, 0xb500001d, - 0xb5fff91d, 0xb500865d, 0x10000013, 0x10fff8b3, - 0x100085f3, 0x90000013, 0x36300016, 0x3637f836, - 0x36308576, 0x3758000c, 0x375ff7cc, 0x3758850c, + 0x14000000, 0x17ffffd7, 0x14000428, 0x94000000, + 0x97ffffd4, 0x94000425, 0x3400000a, 0x34fffa2a, + 0x3400844a, 0x35000008, 0x35fff9c8, 0x350083e8, + 0xb400000b, 0xb4fff96b, 0xb400838b, 0xb500001d, + 0xb5fff91d, 0xb500833d, 0x10000013, 0x10fff8b3, + 0x100082d3, 0x90000013, 0x36300016, 0x3637f836, + 0x36308256, 0x3758000c, 0x375ff7cc, 0x375881ec, 0x128313a0, 0x528a32c7, 0x7289173b, 0x92ab3acc, 0xd2a0bf94, 0xf2c285e8, 0x9358722f, 0x330e652f, 0x53067f3b, 0x93577c53, 0xb34a1aac, 0xd35a4016, 0x13946c63, 0x93c3dbc8, 0x54000000, 0x54fff5a0, - 0x540082e0, 0x54000001, 0x54fff541, 0x54008281, - 0x54000002, 0x54fff4e2, 0x54008222, 0x54000002, - 0x54fff482, 0x540081c2, 0x54000003, 0x54fff423, - 0x54008163, 0x54000003, 0x54fff3c3, 0x54008103, - 0x54000004, 0x54fff364, 0x540080a4, 0x54000005, - 0x54fff305, 0x54008045, 0x54000006, 0x54fff2a6, - 0x54007fe6, 0x54000007, 0x54fff247, 0x54007f87, - 0x54000008, 0x54fff1e8, 0x54007f28, 0x54000009, - 0x54fff189, 0x54007ec9, 0x5400000a, 0x54fff12a, - 0x54007e6a, 0x5400000b, 0x54fff0cb, 0x54007e0b, - 0x5400000c, 0x54fff06c, 0x54007dac, 0x5400000d, - 0x54fff00d, 0x54007d4d, 0x5400000e, 0x54ffefae, - 0x54007cee, 0x5400000f, 0x54ffef4f, 0x54007c8f, + 0x54007fc0, 0x54000001, 0x54fff541, 0x54007f61, + 0x54000002, 0x54fff4e2, 0x54007f02, 0x54000002, + 0x54fff482, 0x54007ea2, 0x54000003, 0x54fff423, + 0x54007e43, 0x54000003, 0x54fff3c3, 0x54007de3, + 0x54000004, 0x54fff364, 0x54007d84, 0x54000005, + 0x54fff305, 0x54007d25, 0x54000006, 0x54fff2a6, + 0x54007cc6, 0x54000007, 0x54fff247, 0x54007c67, + 0x54000008, 0x54fff1e8, 0x54007c08, 0x54000009, + 0x54fff189, 0x54007ba9, 0x5400000a, 0x54fff12a, + 0x54007b4a, 0x5400000b, 0x54fff0cb, 0x54007aeb, + 0x5400000c, 0x54fff06c, 0x54007a8c, 0x5400000d, + 0x54fff00d, 0x54007a2d, 0x5400000e, 0x54ffefae, + 0x540079ce, 0x5400000f, 0x54ffef4f, 0x5400796f, 0xd40658e1, 0xd4014d22, 0xd4046543, 0xd4273f60, 0xd44cad80, 0xd503201f, 0xd503203f, 0xd503205f, 0xd503209f, 0xd50320bf, 0xd503219f, 0xd50323bf, @@ -1375,23 +1346,23 @@ 0xb81b1022, 0x381ea354, 0x79002fd7, 0xf85cf39a, 0xb8580309, 0x385e218c, 0x784051e1, 0x389e11d8, 0x789fa1f8, 0x79c01865, 0xb881131b, 0xfc5dd3ad, - 0xbc5d1137, 0xfc00900b, 0xbc181015, 0xf818ec7d, + 0xbc5d1136, 0xfc00900b, 0xbc181014, 0xf818ec7d, 0xb81b8c91, 0x381efc40, 0x78007c3d, 0xf857beb0, 0xb8413dd4, 0x385fddd6, 0x78409e2f, 0x389eddea, 0x789e7d94, 0x78de3d55, 0xb8805c13, 0xfc5cadc0, - 0xbc428c23, 0xfc1a2dc4, 0xbc1caf92, 0xf81475f6, + 0xbc428c23, 0xfc1a2dc4, 0xbc1caf91, 0xf81475f6, 0xb81f95d1, 0x381e757e, 0x78014561, 0xf8402436, 0xb85896e2, 0x385f4763, 0x785db4f0, 0x3880374f, 0x789e25e7, 0x78dd0563, 0xb88166f9, 0xfc529540, - 0xbc4374d3, 0xfc1166ae, 0xbc1ba6c0, 0xf820ea7b, + 0xbc4374d1, 0xfc1166ad, 0xbc1ba6c0, 0xf820ea7b, 0xb82d68c8, 0x38367a04, 0x782f4b59, 0xf878c8a4, 0xb8674a24, 0x386b78f1, 0x78776bc0, 0x38a15aca, - 0x78bedbd5, 0x78fcd94b, 0xb8aa4a7c, 0xfc6ecbbe, - 0xbc65d8a8, 0xfc2de919, 0xbc3a7b11, 0xf91f1193, + 0x78bedbd5, 0x78fcd94b, 0xb8aa4a7c, 0xfc6ecbbd, + 0xbc65d8a8, 0xfc2de918, 0xbc3a7b11, 0xf91f1193, 0xb91ed5f7, 0x391ec9bd, 0x79182ceb, 0xf95d4b0a, 0xb9581010, 0x395fc034, 0x795fb221, 0x399d8731, 0x799efb3b, 0x79dd1a2e, 0xb998e4ea, 0xfd583723, - 0xbd5ea12c, 0xfd18dc38, 0xbd1b0e83, 0x58ffdaa2, + 0xbd5ea12c, 0xfd18dc37, 0xbd1b0e83, 0x58ffdaa2, 0x1800001d, 0xf885d1c0, 0xd8ffda40, 0xf8a77820, 0xf9980220, 0x1a030301, 0x3a140311, 0x5a0d000b, 0x7a07015c, 0x9a1001e4, 0xba140182, 0xda0d01bd, @@ -1412,193 +1383,187 @@ 0x9ad521f7, 0x9adb263c, 0x9ac0286a, 0x9ac92f27, 0x9bdd7de6, 0x9b427d4f, 0x1b0b2cf1, 0x1b1ddcf7, 0x9b0b2f6e, 0x9b0cbf04, 0x9b2b728e, 0x9b2cdd6d, - 0x9bae275e, 0x9ba7954d, 0x7ea3d5fe, 0x1e30098c, - 0x1e321bff, 0x1e302ab3, 0x1e35394f, 0x7efcd542, - 0x1e7f0bc7, 0x1e621832, 0x1e632946, 0x1e673979, - 0x1f000d81, 0x1f06dfb3, 0x1f3c6c06, 0x1f2774a2, - 0x1f4d332c, 0x1f48ca78, 0x1f755356, 0x1f7e5853, - 0x1e2042c8, 0x1e20c2b3, 0x1e21424c, 0x1e21c0d5, - 0x1e22c070, 0x1e23c3a3, 0x1ee24383, 0x1e6041cf, - 0x1e60c1aa, 0x1e61424c, 0x1e61c34a, 0x1e6240e7, - 0x1e3803ae, 0x9e3802e0, 0x1e780180, 0x9e7801d7, - 0x1e2200ed, 0x9e2200ef, 0x1e620289, 0x9e620393, - 0x1e24021e, 0x9e640122, 0x1e3002b0, 0x9e70009d, - 0x1e260361, 0x9e660318, 0x1e2702ae, 0x9e6700ad, - 0x1e392180, 0x1e7e2320, 0x1e202388, 0x1e6022a8, + 0x9bae275e, 0x9ba7954d, 0x7ea3d5fd, 0x1e2f098b, + 0x1e311bde, 0x1e2f2a93, 0x1e35392f, 0x7efbd522, + 0x1e7e0ba7, 0x1e621831, 0x1e632946, 0x1e673978, + 0x1f000d61, 0x1f06db91, 0x1f3b6806, 0x1f2770a2, + 0x1f4d2f2b, 0x1f48c677, 0x1f744f35, 0x1f7d5851, + 0x1e2042a8, 0x1e20c293, 0x1e21422b, 0x1e21c0d4, + 0x1e22c06f, 0x1e23c383, 0x1ee24363, 0x1e6041ce, + 0x1e60c18a, 0x1e61422b, 0x1e61c32a, 0x1e6240e7, + 0x1e38038e, 0x9e3802c0, 0x1e780180, 0x9e7801b7, + 0x1e2200ed, 0x9e2200ee, 0x1e620288, 0x9e620391, + 0x1e24021e, 0x9e640122, 0x1e300290, 0x9e70009d, + 0x1e260341, 0x9e6602f8, 0x1e2702ae, 0x9e6700ac, + 0x1e382180, 0x1e7d2300, 0x1e202368, 0x1e6022a8, 0x293a1796, 0x29426e73, 0x697c68fc, 0xa93d0486, 0xa97b5eba, 0x29b47934, 0x29c2534d, 0x69f62dbd, 0xa9bd54bb, 0xa9c503c6, 0x28a63e13, 0x28e25d2c, 0x68c469e0, 0xa8b34748, 0xa8f51c59, 0x28264433, 0x285036c0, 0xa8005f7d, 0xa872290b, 0x0c407160, - 0x4cdfa350, 0x0cd16f56, 0x4cdf27bb, 0x0d40c0d6, - 0x4ddfcbae, 0x0dd0cd96, 0x4c408c01, 0x0cdf86aa, - 0x4d60c327, 0x0dffc929, 0x4deecd89, 0x4cd14887, - 0x0c404a37, 0x4d40e6c4, 0x4ddfe84d, 0x0dcced50, - 0x4cdf0444, 0x0ccb0286, 0x0d60e18c, 0x0dffe630, - 0x0df0eb2e, 0x0e31bab4, 0x4e31b841, 0x0e71bb17, + 0x4cdfa350, 0x0cd16f55, 0x4cdf27ba, 0x0d40c0d5, + 0x4ddfcbad, 0x0dd0cd95, 0x4c408c01, 0x0cdf86a9, + 0x4d60c327, 0x0dffc928, 0x4deecd89, 0x4cd14887, + 0x0c404a37, 0x4d40e6c3, 0x4ddfe84c, 0x0dcced4f, + 0x4cdf0444, 0x0ccb0286, 0x0d60e18b, 0x0dffe62f, + 0x0df0eb2e, 0x0e31bab4, 0x4e31b841, 0x0e71baf6, 0x4e71bbfe, 0x4eb1b9ee, 0x0e30a862, 0x4e30a8e6, - 0x0e70a883, 0x4e70a928, 0x4eb0ab59, 0x6e30f820, - 0x0e31ab9b, 0x2e31abfe, 0x4e31a8c5, 0x6e31a8c5, - 0x0e71abfe, 0x2e71a98b, 0x4e71ab59, 0x6e71a820, - 0x4eb1a81f, 0x6eb1a820, 0x6eb0fa93, 0x7e30fbdd, - 0x7e70fb7a, 0x7eb0f949, 0x7ef0fb7a, 0x0ea0c9ac, - 0x4ea0ca0f, 0x4ee0c98b, 0x2ea0c98b, 0x6ea0ca72, - 0x6ee0cb59, 0x0ea0daf6, 0x4ea0db38, 0x4ee0d820, - 0x0ea0ea51, 0x4ea0e98b, 0x4ee0e8e6, 0x2ea0dbdd, - 0x6ea0d8e6, 0x6ee0d8c5, 0x0e20b8c5, 0x4e20bad5, - 0x0e60ba93, 0x4e60ba30, 0x0ea0ba72, 0x4ea0bbfe, - 0x4ee0bb9b, 0x0ea0fbbc, 0x4ea0f841, 0x4ee0fbbc, - 0x2ea0f841, 0x6ea0fab4, 0x6ee0fbdd, 0x2ea1fa30, - 0x6ea1f9cd, 0x6ee1f96a, 0x2e205bdd, 0x6e205bdd, + 0x0e70a883, 0x4e70a907, 0x4eb0ab38, 0x6e30f820, + 0x0e31ab9b, 0x2e31abdd, 0x4e31a8c5, 0x6e31a8c5, + 0x0e71abdd, 0x2e71a98b, 0x4e71ab59, 0x6e71a820, + 0x4eb1abfe, 0x6eb1a820, 0x6eb0fa51, 0x7e30fbbc, + 0x7e70fb59, 0x7eb0f949, 0x7ef0fb59, 0x0ea0c9ac, + 0x4ea0ca0f, 0x4ee0c98b, 0x2ea0c96a, 0x6ea0ca51, + 0x6ee0cb38, 0x0ea0dad5, 0x4ea0db17, 0x4ee0d820, + 0x0ea0ea30, 0x4ea0e96a, 0x4ee0e8e6, 0x2ea0dbbc, + 0x6ea0d8e6, 0x6ee0d8c5, 0x0e20b8c5, 0x4e20bab4, + 0x0e60ba51, 0x4e60ba0f, 0x0ea0ba51, 0x4ea0bbdd, + 0x4ee0bb7a, 0x0ea0fbbc, 0x4ea0f841, 0x4ee0fb9b, + 0x2ea0f820, 0x6ea0fab4, 0x6ee0fbbc, 0x2ea1fa0f, + 0x6ea1f9ac, 0x6ee1f96a, 0x2e205bbc, 0x6e205bbc, 0x0e351e93, 0x4e381ef6, 0x0eac1d6a, 0x4ea61ca4, - 0x2e211c1f, 0x6e371ed5, 0x0e2a8528, 0x4e21841f, - 0x0e758693, 0x4e6c856a, 0x0ebe87bc, 0x4ea48462, - 0x4efb8759, 0x0e27d4c5, 0x4e25d483, 0x4e6ad528, - 0x2e3886f6, 0x6e358693, 0x2e6f85cd, 0x6e6784c5, - 0x2ebf87dd, 0x6eba8738, 0x6ef786d5, 0x0ebcd77a, - 0x4ebad738, 0x4ee5d483, 0x0e3a9f38, 0x4e3c9f7a, - 0x0e799f17, 0x4e719e0f, 0x0eb79ed5, 0x4ea59c83, - 0x2ebad738, 0x6eaad528, 0x6efbd759, 0x2e36d6b4, - 0x6e32d630, 0x6e73d651, 0x2e24dc62, 0x6e23dc41, + 0x2e201ffe, 0x6e361eb4, 0x0e2a8528, 0x4e2087fe, + 0x0e738651, 0x4e6c856a, 0x0ebd879b, 0x4ea48462, + 0x4efa8738, 0x0e26d4a4, 0x4e25d483, 0x4e6ad528, + 0x2e3886f6, 0x6e338651, 0x2e6f85cd, 0x6e6684a4, + 0x2ebe87bc, 0x6eb98717, 0x6ef786d5, 0x0ebbd759, + 0x4ebad738, 0x4ee5d483, 0x0e399f17, 0x4e3c9f7a, + 0x0e799f17, 0x4e709dee, 0x0eb79ed5, 0x4ea59c83, + 0x2eb9d717, 0x6eaad528, 0x6efad738, 0x2e35d693, + 0x6e31d60f, 0x6e72d630, 0x2e24dc62, 0x6e23dc41, 0x6e62dc20, 0x0e7a9738, 0x4e6694a4, 0x0ea59483, - 0x4eae95ac, 0x0e21cc1f, 0x4e3ecfbc, 0x4e6ccd6a, - 0x2e7c977a, 0x6e649462, 0x2eae95ac, 0x6eb49672, - 0x0ea1cc1f, 0x4ea3cc41, 0x4eefcdcd, 0x2e3fffdd, - 0x6e22fc20, 0x6e75fe93, 0x0e2e65ac, 0x4e336651, - 0x0e7866f6, 0x4e6f65cd, 0x0ebe67bc, 0x4ea067fe, - 0x0e21a41f, 0x4e23a441, 0x0e7ca77a, 0x4e7ea7bc, - 0x0ea6a4a4, 0x4ea0a7fe, 0x0e26f4a4, 0x4e28f4e6, - 0x4e60f7fe, 0x0e3c6f7a, 0x4e346e72, 0x0e6b6d49, - 0x4e6a6d28, 0x0eae6dac, 0x4ea26c20, 0x0e36aeb4, - 0x4e23ac41, 0x0e7aaf38, 0x4e64ac62, 0x0ea2ac20, - 0x4eabad49, 0x0ebaf738, 0x4ebcf77a, 0x4ef2f630, - 0x2ea0effe, 0x6ea5ec83, 0x6eeced6a, 0x0fa710c5, - 0x4f8b8149, 0x4fc710c5, 0x0f8750c5, 0x4faa8128, - 0x4fc750c5, 0x2f8890e6, 0x4fa880e6, 0x6fc59083, - 0x0f6f81cd, 0x4f448862, 0x0f848062, 0x4fab8149, - 0x0e3736d5, 0x4e323630, 0x0e743672, 0x4e6d358b, - 0x0eb736d5, 0x4eb93717, 0x4eee35ac, 0x0e3c3f7a, - 0x4e393f17, 0x0e7e3fbc, 0x4e703dee, 0x0ead3d8b, - 0x4eba3f38, 0x4ee33c41, 0x2e2e8dac, 0x6e218c1f, - 0x2e6c8d6a, 0x6e728e30, 0x2ea98d07, 0x6ea48c62, - 0x6ee58c83, 0x2e2f35cd, 0x6e353693, 0x2e733651, - 0x6e723630, 0x2ea53483, 0x6ea33441, 0x6eed358b, - 0x2e203ffe, 0x6e273cc5, 0x2e6a3d28, 0x6e713e0f, - 0x2ebf3fdd, 0x6ea03ffe, 0x6ee23c20, 0x0e36e6b4, - 0x4e29e507, 0x4e76e6b4, 0x2eb9e717, 0x6ebee7bc, - 0x6ef7e6d5, 0x2e3de79b, 0x6e3be759, 0x6e67e4c5, - 0x65d23ee0, 0x65903d92, 0x65d03fa7, 0x65912fe9, - 0x65d13bf9, 0x65932a0a, 0x25cb90c4, 0x25040bde, - 0x25c11085, 0x25c62c6b, 0x259f2279, 0x259d8993, - 0x24e5102b, 0x24ad5458, 0x24ec7ab5, 0x24387c6d, - 0xba5fd3e3, 0x3a5f03e5, 0xfa411be4, 0x7a42cbe2, - 0x93df03ff, 0xc820ffff, 0x8822fc7f, 0xc8247cbf, - 0x88267fff, 0x4e010fe0, 0x5e040420, 0x4e081fe1, - 0x4e0c1fe1, 0x4e0a1fe1, 0x4e071fe1, 0x4e042c20, - 0x4e062c20, 0x4e052c20, 0x4e083c20, 0x0e0c3c20, - 0x0e0a3c20, 0x0e073c20, 0x9eae0020, 0x0f03f409, - 0x6f03f40e, 0x4cc0ac3f, 0x0ea1b820, 0x4e21c862, - 0x4e61b8a4, 0x05a08020, 0x05104fe0, 0x05505001, - 0x05906fe2, 0x05d03005, 0x05101fea, 0x05901feb, - 0x04b0e3e0, 0x0470e7e1, 0x042f9c20, 0x043f9c35, - 0x047f9c20, 0x04ff9c20, 0x04299420, 0x04319160, - 0x0461943e, 0x04a19020, 0x04038100, 0x040381a0, - 0x040387e1, 0x04438be2, 0x04c38fe3, 0x040181e0, - 0x04018100, 0x04018621, 0x04418b22, 0x04418822, - 0x04818c23, 0x040081e0, 0x04008120, 0x04008761, - 0x04008621, 0x04408822, 0x04808c23, 0x042053ff, - 0x047f5401, 0x25208028, 0x2538cfe0, 0x2578d001, - 0x25b8efe2, 0x25f8f007, 0x2538dfea, 0x25b8dfeb, - 0xa400a3e0, 0xa420a7e0, 0xa4484be0, 0xa467afe0, - 0xa4a8a7ea, 0xa547a814, 0xa4084ffe, 0xa55c53e0, - 0xa5e1540b, 0xe400fbf6, 0xe408ffff, 0xe420e7e0, - 0xe4484be0, 0xe460efe0, 0xe547e400, 0xe4014be0, - 0xe4a84fe0, 0xe5f15000, 0x858043e0, 0x85a043ff, - 0xe59f5d08, 0x0420e3e9, 0x0460e3ea, 0x04a0e3eb, - 0x04e0e3ec, 0x25104042, 0x25104871, 0x25904861, - 0x25904c92, 0x05344020, 0x05744041, 0x05b44062, - 0x05f44083, 0x252c8840, 0x253c1420, 0x25681572, - 0x25a21ce3, 0x25ea1e34, 0x253c0421, 0x25680572, - 0x25a20ce3, 0x25ea0e34, 0x0522c020, 0x05e6c0a4, - 0x2401a001, 0x2443a051, 0x24858881, 0x24c78cd1, - 0x24850891, 0x24c70cc1, 0x250f9001, 0x25508051, - 0x25802491, 0x25df28c1, 0x25850c81, 0x251e10d1, - 0x65816001, 0x65c36051, 0x65854891, 0x65c74cc1, - 0x05733820, 0x05b238a4, 0x05f138e6, 0x0570396a, - 0x65d0a001, 0x65d6a443, 0x65d4a826, 0x6594ac26, - 0x6554ac26, 0x6556ac26, 0x6552ac26, 0x65cbac85, - 0x65caac01, 0x6589ac85, 0x6588ac01, 0x65c9ac85, - 0x65c8ac01, 0x65dea833, 0x659ca509, 0x65d8a801, - 0x65dcac01, 0x655cb241, 0x0520a1e0, 0x0521a601, - 0x052281e0, 0x05238601, 0x04a14026, 0x042244a6, - 0x046344a6, 0x04a444a6, 0x04e544a7, 0x0568aca7, - 0x05b23230, 0x853040af, 0xc5b040af, 0xe57080af, - 0xe5b080af, 0x25034440, 0x254054c4, 0x25034640, - 0x25415a05, 0x25834440, 0x25c54489, 0x250b5d3a, - 0x2550dc20, 0x2518e3e1, 0x2518e021, 0x2518e0a1, - 0x2518e121, 0x2518e1a1, 0x2558e3e2, 0x2558e042, - 0x2558e0c2, 0x2558e142, 0x2598e3e3, 0x2598e063, - 0x2598e0e3, 0x2598e163, 0x25d8e3e4, 0x25d8e084, - 0x25d8e104, 0x25d8e184, 0x2518e407, 0x05214800, - 0x05614800, 0x05a14800, 0x05e14800, 0x05214c00, - 0x05614c00, 0x05a14c00, 0x05e14c00, 0x05304001, - 0x05314001, 0x05a18610, 0x05e18610, 0x05271e11, - 0x6545e891, 0x6585e891, 0x65c5e891, 0x6545c891, - 0x6585c891, 0x65c5c891, 0x45b0c210, 0x45f1c231, - 0x1e601000, 0x1e603000, 0x1e621000, 0x1e623000, - 0x1e641000, 0x1e643000, 0x1e661000, 0x1e663000, - 0x1e681000, 0x1e683000, 0x1e6a1000, 0x1e6a3000, - 0x1e6c1000, 0x1e6c3000, 0x1e6e1000, 0x1e6e3000, - 0x1e701000, 0x1e703000, 0x1e721000, 0x1e723000, - 0x1e741000, 0x1e743000, 0x1e761000, 0x1e763000, - 0x1e781000, 0x1e783000, 0x1e7a1000, 0x1e7a3000, - 0x1e7c1000, 0x1e7c3000, 0x1e7e1000, 0x1e7e3000, - 0xf8338131, 0xf83c01fb, 0xf82712f5, 0xf83f2059, - 0xf83f31fb, 0xf82a5277, 0xf8234010, 0xf83972fa, - 0xf8226190, 0xf8a483dc, 0xf8bd0370, 0xf8a613a9, - 0xf8b02087, 0xf8a7312f, 0xf8b75048, 0xf8bc43f5, - 0xf8a5701b, 0xf8b1608f, 0xf8fa8388, 0xf8f6037b, - 0xf8f91017, 0xf8e421e6, 0xf8e031e4, 0xf8e150ea, - 0xf8e5438a, 0xf8e772f4, 0xf8f56166, 0xf86883f1, - 0xf8660051, 0xf86c13be, 0xf86322db, 0xf87d31ae, - 0xf87c5311, 0xf86541c2, 0xf86a7170, 0xf87b6197, - 0xb8248236, 0xb8240261, 0xb83011b0, 0xb82e204c, - 0xb83132a3, 0xb83750c5, 0xb82741b3, 0xb83c7211, - 0xb82663a2, 0xb8a380c4, 0xb8b001b4, 0xb8ac1114, - 0xb8b92274, 0xb8a0330b, 0xb8a653f4, 0xb8ae40d0, - 0xb8a071e7, 0xb8b3613a, 0xb8ea82b7, 0xb8f6005c, - 0xb8e3126f, 0xb8f42087, 0xb8fd3007, 0xb8e95290, - 0xb8f74204, 0xb8ea7177, 0xb8f963e6, 0xb87082ed, - 0xb86c01c1, 0xb8691215, 0xb87a208f, 0xb8643110, - 0xb866509e, 0xb87d43b1, 0xb87a71e9, 0xb86263ab, - 0xce216ce3, 0xce0e2255, 0xce798ed2, 0xce959685, - 0xce7e8217, 0xce608694, 0xcec08264, 0xce748898, - 0x25e0da44, 0x2521c8f3, 0x05801548, 0x0540cbdf, - 0x05006521, 0x2560c7a0, 0x25a1c498, 0x058026bb, - 0x05407dd8, 0x0500f3d6, 0x2560ce3d, 0x2521d4b4, - 0x05803cbc, 0x05404d6c, 0x05001b89, 0x25a0c532, - 0x2521cc40, 0x05800c08, 0x054074c4, 0x050034a0, - 0x2520c9e3, 0x25e1ca93, 0x05803e98, 0x05425238, - 0x050024cb, 0x25a0ce7f, 0x25e1d0c3, 0x05802676, - 0x05401e63, 0x05002d49, 0x04e20080, 0x04ab04ce, - 0x659e022e, 0x65970863, 0x659c0703, 0x04d6b4f3, - 0x04400cb5, 0x049a06da, 0x04508071, 0x045b0d14, - 0x0459b22e, 0x04daba4d, 0x04590a13, 0x0493979b, - 0x04d188a8, 0x0450081c, 0x0417b6b9, 0x041eb743, - 0x04981e7a, 0x05e78dc1, 0x0564824e, 0x048816ff, - 0x040a0d1e, 0x04810ee0, 0x04dcb340, 0x65c08ed8, - 0x65cd8162, 0x65c6970c, 0x65c79e29, 0x65c29494, - 0x04ddbecd, 0x65c2ba5f, 0x65c0a9af, 0x6581a434, - 0x658da0ee, 0x65c1908c, 0x65be806f, 0x65ff0694, - 0x65ee2d2d, 0x65a3af81, 0x65a9cb3a, 0x65e1e9da, - 0x65f447ba, 0x65e17da6, 0x0401482b, 0x040279fb, - 0x0439323e, 0x04a33302, 0x046331bd, 0x04fc320e, - 0x05bb6964, 0x05e16e02, 0x65c897e7, 0x4596b150, - 0x4516b4fd, 0x0438396c, 0x041a280b, 0x04183697, - 0x04192de3, 0x04083b7e, 0x04ca3955, 0x65873883, - 0x658622a6, 0x65d83bd9, 0x0441303f, 0x0e2e11ac, - 0x4e2013fe, 0x0e6f11cd, 0x4e6a1128, 0x0ebb1359, - 0x4ebf13dd, 0x2e231041, 0x6e21101f, 0x2e791317, - 0x6e61101f, 0x2eb612b4, 0x6ea21020, + 0x4ead958b, 0x0e20cffe, 0x4e3dcf9b, 0x4e6bcd49, + 0x2e7b9759, 0x6e649462, 0x2eae95ac, 0x6eb39651, + 0x0ea0cffe, 0x4ea3cc41, 0x4eeecdac, 0x2e3effbc, + 0x6e22fc20, 0x6e73fe51, 0x0e2e65ac, 0x4e336651, + 0x0e7766d5, 0x4e6e65ac, 0x0ebd679b, 0x4ebf67dd, + 0x0e20a7fe, 0x4e23a441, 0x0e7ba759, 0x4e7da79b, + 0x0ea6a4a4, 0x4ebfa7dd, 0x0e25f483, 0x4e28f4e6, + 0x4e7ff7dd, 0x0e3b6f59, 0x4e336e51, 0x0e6a6d28, + 0x4e696d07, 0x0eae6dac, 0x4ea26c20, 0x0e35ae93, + 0x4e23ac41, 0x0e79af17, 0x4e64ac62, 0x0ea2ac20, + 0x4eaaad28, 0x0eb9f717, 0x4ebbf759, 0x4ef1f60f, + 0x2ebfefdd, 0x6ea5ec83, 0x6eeced6a, 0x0e3836f6, + 0x4e2c356a, 0x0e6634a4, 0x4e733651, 0x0ea33441, + 0x4ead358b, 0x4ee93507, 0x0e2c3d6a, 0x4e313e0f, + 0x0e723e30, 0x4e643c62, 0x0eab3d49, 0x4ead3d8b, + 0x4eee3dac, 0x2e308dee, 0x6e2f8dcd, 0x2e648c62, + 0x6e688ce6, 0x2eb58e93, 0x6ebb8f59, 0x6ef18e0f, + 0x2e2634a4, 0x6e243462, 0x2e6634a4, 0x6e6d358b, + 0x2eb33651, 0x6eb636b4, 0x6ef23630, 0x2e333e51, + 0x6e2c3d6a, 0x2e763eb4, 0x6e783ef6, 0x2eae3dac, + 0x6ebb3f59, 0x6ef93f17, 0x0e3ee7bc, 0x4e30e5ee, + 0x4e6ce56a, 0x2ebae738, 0x6ea3e441, 0x6eede58b, + 0x2e20e7fe, 0x6e2ce56a, 0x6e71e60f, 0x65922c43, + 0x65d02219, 0x65d02560, 0x65d13dc4, 0x65913690, + 0x65d33b6b, 0x2500948c, 0x254c08bf, 0x25831f87, + 0x254f30af, 0x259c3359, 0x25019d35, 0x24eac76d, + 0x2431993a, 0x242f7ed8, 0x24a2f62b, 0xba5fd3e3, + 0x3a5f03e5, 0xfa411be4, 0x7a42cbe2, 0x93df03ff, + 0xc820ffff, 0x8822fc7f, 0xc8247cbf, 0x88267fff, + 0x4e010fe0, 0x5e040420, 0x4e081fe1, 0x4e0c1fe1, + 0x4e0a1fe1, 0x4e071fe1, 0x4e042c20, 0x4e062c20, + 0x4e052c20, 0x4e083c20, 0x0e0c3c20, 0x0e0a3c20, + 0x0e073c20, 0x9eae0020, 0x0f03f409, 0x6f03f40e, + 0x4cc0ac3f, 0x0ea1b820, 0x4e21c862, 0x4e61b8a4, + 0x05a08020, 0x05104fe0, 0x05505001, 0x05906fe2, + 0x05d03005, 0x05101fea, 0x05901feb, 0x04b0e3e0, + 0x0470e7e1, 0x042f9c20, 0x043f9c35, 0x047f9c20, + 0x04ff9c20, 0x04299420, 0x04319160, 0x0461943e, + 0x04a19020, 0x04038100, 0x040381a0, 0x040387e1, + 0x04438be2, 0x04c38fe3, 0x040181e0, 0x04018100, + 0x04018621, 0x04418b22, 0x04418822, 0x04818c23, + 0x040081e0, 0x04008120, 0x04008761, 0x04008621, + 0x04408822, 0x04808c23, 0x042053ff, 0x047f5401, + 0x25208028, 0x2538cfe0, 0x2578d001, 0x25b8efe2, + 0x25f8f007, 0x2538dfea, 0x25b8dfeb, 0xa400a3e0, + 0xa420a7e0, 0xa4484be0, 0xa467afe0, 0xa4a8a7ea, + 0xa547a814, 0xa4084ffe, 0xa55c53e0, 0xa5e1540b, + 0xe400fbf6, 0xe408ffff, 0xe420e7e0, 0xe4484be0, + 0xe460efe0, 0xe547e400, 0xe4014be0, 0xe4a84fe0, + 0xe5f15000, 0x858043e0, 0x85a043ff, 0xe59f5d08, + 0x0420e3e9, 0x0460e3ea, 0x04a0e3eb, 0x04e0e3ec, + 0x25104042, 0x25104871, 0x25904861, 0x25904c92, + 0x05344020, 0x05744041, 0x05b44062, 0x05f44083, + 0x252c8840, 0x253c1420, 0x25681572, 0x25a21ce3, + 0x25ea1e34, 0x253c0421, 0x25680572, 0x25a20ce3, + 0x25ea0e34, 0x0522c020, 0x05e6c0a4, 0x2401a001, + 0x2443a051, 0x24858881, 0x24c78cd1, 0x24850891, + 0x24c70cc1, 0x250f9001, 0x25508051, 0x25802491, + 0x25df28c1, 0x25850c81, 0x251e10d1, 0x65816001, + 0x65c36051, 0x65854891, 0x65c74cc1, 0x05733820, + 0x05b238a4, 0x05f138e6, 0x0570396a, 0x65d0a001, + 0x65d6a443, 0x65d4a826, 0x6594ac26, 0x6554ac26, + 0x6556ac26, 0x6552ac26, 0x65cbac85, 0x65caac01, + 0x6589ac85, 0x6588ac01, 0x65c9ac85, 0x65c8ac01, + 0x65dea833, 0x659ca509, 0x65d8a801, 0x65dcac01, + 0x655cb241, 0x0520a1e0, 0x0521a601, 0x052281e0, + 0x05238601, 0x04a14026, 0x042244a6, 0x046344a6, + 0x04a444a6, 0x04e544a7, 0x0568aca7, 0x05b23230, + 0x853040af, 0xc5b040af, 0xe57080af, 0xe5b080af, + 0x25034440, 0x254054c4, 0x25034640, 0x25415a05, + 0x25834440, 0x25c54489, 0x250b5d3a, 0x2550dc20, + 0x2518e3e1, 0x2518e021, 0x2518e0a1, 0x2518e121, + 0x2518e1a1, 0x2558e3e2, 0x2558e042, 0x2558e0c2, + 0x2558e142, 0x2598e3e3, 0x2598e063, 0x2598e0e3, + 0x2598e163, 0x25d8e3e4, 0x25d8e084, 0x25d8e104, + 0x25d8e184, 0x2518e407, 0x05214800, 0x05614800, + 0x05a14800, 0x05e14800, 0x05214c00, 0x05614c00, + 0x05a14c00, 0x05e14c00, 0x05304001, 0x05314001, + 0x05a18610, 0x05e18610, 0x05271e11, 0x6545e891, + 0x6585e891, 0x65c5e891, 0x6545c891, 0x6585c891, + 0x65c5c891, 0x45b0c210, 0x45f1c231, 0x1e601000, + 0x1e603000, 0x1e621000, 0x1e623000, 0x1e641000, + 0x1e643000, 0x1e661000, 0x1e663000, 0x1e681000, + 0x1e683000, 0x1e6a1000, 0x1e6a3000, 0x1e6c1000, + 0x1e6c3000, 0x1e6e1000, 0x1e6e3000, 0x1e701000, + 0x1e703000, 0x1e721000, 0x1e723000, 0x1e741000, + 0x1e743000, 0x1e761000, 0x1e763000, 0x1e781000, + 0x1e783000, 0x1e7a1000, 0x1e7a3000, 0x1e7c1000, + 0x1e7c3000, 0x1e7e1000, 0x1e7e3000, 0xf82f8186, + 0xf83001ab, 0xf83713c1, 0xf8332225, 0xf82232d0, + 0xf82d52aa, 0xf83d419b, 0xf83b7023, 0xf83f6278, + 0xf8b18389, 0xf8bb00ef, 0xf8b513f7, 0xf8b923e2, + 0xf8bb3150, 0xf8b75073, 0xf8b04320, 0xf8ba7057, + 0xf8b0608c, 0xf8fc83be, 0xf8f000db, 0xf8e911fd, + 0xf8e720e4, 0xf8ef32e9, 0xf8e85382, 0xf8f540bf, + 0xf8fb7220, 0xf8ef6344, 0xf86882dc, 0xf87b033b, + 0xf8771080, 0xf8662010, 0xf864302f, 0xf86a50a7, + 0xf86a40fc, 0xf87472b7, 0xf866610b, 0xb83180df, + 0xb8310182, 0xb83e107d, 0xb83b23b6, 0xb82e338d, + 0xb83150b8, 0xb822414e, 0xb830736b, 0xb837608c, + 0xb8b68091, 0xb8a10213, 0xb8b011cd, 0xb8ac2222, + 0xb8a332f5, 0xb8a550e6, 0xb8b3438d, 0xb8b170d0, + 0xb8a2607d, 0xb8e481e6, 0xb8f4018d, 0xb8f41328, + 0xb8f42013, 0xb8eb30d8, 0xb8f451df, 0xb8f04006, + 0xb8e7726f, 0xb8fa6149, 0xb87782d5, 0xb87c0062, + 0xb86f1293, 0xb86723a4, 0xb8673120, 0xb87052f4, + 0xb8644150, 0xb877732b, 0xb866621f, 0xce2b06cd, + 0xce14410d, 0xce648df9, 0xce883624, 0xce7c809d, + 0xce7a87b0, 0xcec081c9, 0xce7c8962, 0x2520c143, + 0x25a1d2da, 0x058015ce, 0x05400ed8, 0x0500bb31, + 0x25a0c074, 0x25a1d884, 0x05804944, 0x0540b1d9, + 0x05001548, 0x25a0c49e, 0x2521cabe, 0x058054b3, + 0x0543ab47, 0x050026bb, 0x2560d097, 0x25a1d6fe, + 0x058394b4, 0x0540266d, 0x05003cbc, 0x25a0c1ab, + 0x2561d3f8, 0x05800acd, 0x05403684, 0x05000c07, + 0x2560de64, 0x2521cac5, 0x0583c8b5, 0x05405089, + 0x05003e98, 0x04ad0397, 0x04ac074a, 0x658e023e, + 0x65d50a1d, 0x65820667, 0x0496b13a, 0x04001411, + 0x041a19c2, 0x049095cb, 0x041b0c7d, 0x04d9a876, + 0x049aa27b, 0x04591aa7, 0x04138b25, 0x04119235, + 0x04500a63, 0x0497adc7, 0x04dea9b1, 0x04581e31, + 0x05a78f4f, 0x056494fb, 0x04481f65, 0x048a0f00, + 0x04810074, 0x04dca739, 0x65809031, 0x658d9dae, + 0x65c683d1, 0x658797b6, 0x65828008, 0x04ddb417, + 0x6582baf9, 0x6580b435, 0x65c1b56a, 0x65cdb917, + 0x65c19671, 0x65fe95a4, 0x65f11f3e, 0x65fc298e, + 0x65ada1a5, 0x65b3c967, 0x65e3ec59, 0x65f454a0, + 0x65a86dbc, 0x041b41dd, 0x04587903, 0x042a3321, + 0x04b93281, 0x0470327c, 0x04e131bb, 0x0521692b, + 0x057a6f61, 0x65c887a2, 0x45c2b058, 0x455cb723, + 0x043639a3, 0x045a309b, 0x0498305a, 0x04993ce1, + 0x04483e1e, 0x040a3395, 0x65c72595, 0x6586294b, + 0x65d826c0, 0x04412474, }; // END Generated code -- do not edit From e19c7d80f722395583fbdb4cc10dc9051c8602f2 Mon Sep 17 00:00:00 2001 From: Jayathirth D V Date: Mon, 30 Sep 2024 11:24:48 +0000 Subject: [PATCH 240/307] 8340874: Open source some of the AWT Geometry/Button tests Reviewed-by: prr --- .../BadActionEventTest.java | 93 +++++++++++++ .../jdk/java/awt/geom/Arc2D/Arc2DHitTest.java | 100 ++++++++++++++ test/jdk/java/awt/geom/Arc2D/BoundsBug.java | 123 ++++++++++++++++++ test/jdk/java/awt/geom/Area/Translate.java | 122 +++++++++++++++++ 4 files changed, 438 insertions(+) create mode 100644 test/jdk/java/awt/Button/BadActionEventTest/BadActionEventTest.java create mode 100644 test/jdk/java/awt/geom/Arc2D/Arc2DHitTest.java create mode 100644 test/jdk/java/awt/geom/Arc2D/BoundsBug.java create mode 100644 test/jdk/java/awt/geom/Area/Translate.java diff --git a/test/jdk/java/awt/Button/BadActionEventTest/BadActionEventTest.java b/test/jdk/java/awt/Button/BadActionEventTest/BadActionEventTest.java new file mode 100644 index 0000000000000..53aac7ab78751 --- /dev/null +++ b/test/jdk/java/awt/Button/BadActionEventTest/BadActionEventTest.java @@ -0,0 +1,93 @@ +/* + * 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 4530087 + * @summary Test if double-clicking causes ActionEvent on underlying button + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual BadActionEventTest + */ + +import java.awt.Button; +import java.awt.Color; +import java.awt.FileDialog; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +public class BadActionEventTest implements ActionListener { + private static Button showBtn; + private static Button listBtn; + + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + 1) Click on 'Show File Dialog' to bring up the FileDialog window. + (If necessary, change to a directory with files (not just directories) in it.) + 2) Move the FileDialog so that one of the file names (again, a file, NOT a directory) in the list is + directly over the 'ActionListener' button. + 3) Double-click on the file name over the button. The FileDialog will disappear. + 4) If the 'ActionListener' button receives an ActionEvent, the test fails and a + message to that effect will be printed. + Otherwise, the test passes. + """; + + PassFailJFrame.builder() + .title("Test Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .testUI(BadActionEventTest::createUI) + .logArea(2) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame frame = new Frame("BadActionEventTest"); + frame.setLayout(new GridLayout(1, 2)); + frame.setSize(400, 200); + showBtn = new Button("Show File Dialog"); + listBtn = new Button("ActionListener"); + showBtn.setSize(200, 200); + listBtn.setSize(200, 200); + showBtn.addActionListener(new BadActionEventTest()); + listBtn.addActionListener(new BadActionEventTest()); + frame.add(showBtn); + frame.add(listBtn); + return frame; + } + + @Override + public void actionPerformed(ActionEvent e) { + if (e.getSource() == showBtn) { + FileDialog fd = new FileDialog(new Frame()); + fd.setVisible(true); + } else if (e.getSource() == listBtn) { + listBtn.setBackground(Color.red); + listBtn.setLabel("TEST FAILS!"); + PassFailJFrame.log("*TEST FAILS!* ActionListener got ActionEvent! *TEST FAILS!*"); + } + } +} diff --git a/test/jdk/java/awt/geom/Arc2D/Arc2DHitTest.java b/test/jdk/java/awt/geom/Arc2D/Arc2DHitTest.java new file mode 100644 index 0000000000000..de6b39d5c6f7f --- /dev/null +++ b/test/jdk/java/awt/geom/Arc2D/Arc2DHitTest.java @@ -0,0 +1,100 @@ +/* + * 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 4178123 + * @summary Verifies that the Arc2D.contains(point) methods work correctly. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual Arc2DHitTest + */ + +import java.awt.Color; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Panel; +import java.awt.Point; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.geom.Arc2D; + +public class Arc2DHitTest { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + This test displays an arc figure and lets the user click on it. + The arc will initially be drawn in red and only when the user clicks + within the arc in the window it will be redrawn into green otherwise + it should stay red. + + For convenience, the point being tested is drawn in black. Note + that rounding in the arc rendering routines may cause points near + the boundary of the arc to render incorrectly. Allow for a pixel + or two of leeway near the boundary. + """; + + PassFailJFrame.builder() + .title("Test Instructions") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(initialize()) + .build() + .awaitAndCheck(); + } + private static Frame initialize() { + Frame f = new Frame("Arc2DHitTest"); + ArcHitPanel panel = new ArcHitPanel(); + f.add(panel); + f.setSize(300, 250); + return f; + } +} + +class ArcHitPanel extends Panel { + private Arc2D arc; + private Point hit; + public ArcHitPanel() { + arc = new Arc2D.Float(10, 10, 100, 100, 0, 120, Arc2D.PIE); + this.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + hit = e.getPoint(); + repaint(); + } + }); + } + + @Override + public void paint(Graphics g) { + Graphics2D g2 = (Graphics2D) g; + g2.setColor(Color.white); + g2.fill(g2.getClipBounds()); + g2.setColor((hit != null && arc.contains(hit)) + ? Color.green : Color.red); + g2.fill(arc); + if (hit != null) { + g2.setColor(Color.black); + g2.fillRect(hit.x, hit.y, 1, 1); + } + } +} diff --git a/test/jdk/java/awt/geom/Arc2D/BoundsBug.java b/test/jdk/java/awt/geom/Arc2D/BoundsBug.java new file mode 100644 index 0000000000000..a17f45f9dad37 --- /dev/null +++ b/test/jdk/java/awt/geom/Arc2D/BoundsBug.java @@ -0,0 +1,123 @@ +/* + * 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 4197746 + * @summary Verifies that the getBounds2D method of Arc2D returns the + * correct result. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual BoundsBug + */ + +import java.awt.Color; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Panel; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.geom.Arc2D; +import java.awt.geom.Ellipse2D; +import java.awt.geom.GeneralPath; +import java.awt.geom.Point2D; +import java.awt.geom.Rectangle2D; + +public class BoundsBug { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + This test displays three figures and draws the outline of their + bounding boxes. The bounding boxes should correctly encompass + the 3 figures. + + This test also paints two highlight rectangles at the ends of the + angular extents of the arc. The two highlights should correctly + appear at the outer circumference of the arc where the radii lines + from its center intersect that circumference. + """; + + PassFailJFrame.builder() + .title("Test Instructions") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(initialize()) + .build() + .awaitAndCheck(); + } + private static Frame initialize() { + Frame f = new Frame("BoundsBug"); + ArcPanel panel = new ArcPanel(); + f.add(panel); + f.setSize(300, 250); + return f; + } +} + +class ArcPanel extends Panel { + protected void drawPoint(Graphics2D g2, Point2D p) { + g2.setColor(Color.green); + g2.fill(new Rectangle2D.Double(p.getX() - 5, p.getY() - 5, 10, 10)); + } + + protected void drawShapeAndBounds(Graphics2D g2, Shape s) { + g2.setColor(Color.orange); + g2.fill(s); + g2.setColor(Color.black); + g2.draw(s); + + Rectangle2D r = s.getBounds2D(); + g2.setColor(Color.gray); + g2.draw(r); + } + + @Override + public void paint(Graphics g) { + Graphics2D g2 = (Graphics2D)g; + g2.setColor(Color.white); + g2.fill(g.getClipBounds()); + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + + // Create some interesting shapes. + Ellipse2D ellipse = new Ellipse2D.Float(20, 40, 60, 80); + Arc2D arc = new Arc2D.Float(60, 40, 100, 120, + -30, -40, Arc2D.PIE); + GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD); + path.moveTo(0, 0); + path.lineTo(75, -25); + path.lineTo(25, 75); + path.lineTo(0, 25); + path.lineTo(100, 50); + path.lineTo(50, 0); + path.lineTo(25, 50); + path.closePath(); + // Now draw them and their bounds rectangles. + drawShapeAndBounds(g2, ellipse); + drawShapeAndBounds(g2, arc); + drawPoint(g2, arc.getStartPoint()); + drawPoint(g2, arc.getEndPoint()); + g2.translate(180, 65); + drawShapeAndBounds(g2, path); + } +} diff --git a/test/jdk/java/awt/geom/Area/Translate.java b/test/jdk/java/awt/geom/Area/Translate.java new file mode 100644 index 0000000000000..7519f1753bcf3 --- /dev/null +++ b/test/jdk/java/awt/geom/Area/Translate.java @@ -0,0 +1,122 @@ +/* + * 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 4183373 + * @summary Verifies that the translated Area objects display correctly + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual Translate + */ + +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Panel; +import java.awt.Rectangle; +import java.awt.geom.AffineTransform; +import java.awt.geom.Area; +import java.awt.geom.Rectangle2D; + +public class Translate { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + This test displays two sets of rectangular figures. The two sets + should be displayed one on top of the other and should be lined + up vertically with each other. If the two sets of figures are + not directly above and below each other then the test fails + """; + + PassFailJFrame.builder() + .title("Test Instructions") + .instructions(INSTRUCTIONS) + .columns(35) + .testUI(initialize()) + .build() + .awaitAndCheck(); + } + private static Frame initialize() { + Frame f = new Frame("Translate"); + TranslatePanel panel = new TranslatePanel(); + f.add(panel); + f.setSize(300, 250); + return f; + } +} + +class TranslatePanel extends Panel { + private static Image bufferedImage; + private static Area a1, a2, a3; + + public TranslatePanel() { + a1 = new Area(new Rectangle2D.Double(20.0, 20.0, 60.0, 60.0)); + + a2 = new Area((Area) a1.clone()); + a2.subtract(new Area(new Rectangle2D.Double(30.0, 30.0, 40.0, 40.0))); + + a3 = new Area((Area) a2.clone()); + a3.add(new Area(new Rectangle2D.Double(40.0, 40.0, 20.0, 20.0))); + + AffineTransform at2 = new AffineTransform(); + at2.translate(100.0, 0.0); + a2.transform(at2); + + AffineTransform at3 = new AffineTransform(); + at3.translate(200.0, 0.0); + a3.transform(at3); + } + private void paintRects(Graphics2D g2) { + Rectangle clip = g2.getClipBounds(); + g2.setColor(Color.white); + g2.fillRect(clip.x, clip.y, clip.width, clip.height); + g2.setPaint(Color.red); + g2.fill(a1); + g2.setPaint(Color.yellow); + g2.fill(a2); + g2.setPaint(Color.blue); + g2.fill(a3); + } + + @Override + public void paint(Graphics g) { + if (bufferedImage == null) { + bufferedImage = createImage(300, 100); + Graphics big = bufferedImage.getGraphics(); + // Notice that if you remove the translate() call, it works fine. + big.translate(-1, -1); + big.setClip(1, 1, 300, 100); + paintRects((Graphics2D)big); + big.translate(1, 1); + } + paintRects((Graphics2D)g); + g.drawImage(bufferedImage, 1, 100, this); + g.setColor(Color.black); + g.drawString("From offscreen image (with translate):", 10, 95); + g.drawString(" (should line up with rectangles above)", 10, 110); + } +} From 180affc5718c9bf2f009d6a7aa129cc36335384a Mon Sep 17 00:00:00 2001 From: Fredrik Bredberg Date: Mon, 30 Sep 2024 12:28:35 +0000 Subject: [PATCH 241/307] 8320318: ObjectMonitor Responsible thread Reviewed-by: aboldtch, coleenp, pchilanomate, eosterlund --- .../cpu/aarch64/c2_MacroAssembler_aarch64.cpp | 72 +++- src/hotspot/cpu/ppc/macroAssembler_ppc.cpp | 61 +++- .../cpu/riscv/c2_MacroAssembler_riscv.cpp | 62 +++- src/hotspot/cpu/s390/macroAssembler_s390.cpp | 74 +++- src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp | 56 +-- src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp | 133 +++---- src/hotspot/share/opto/c2_CodeStubs.hpp | 2 - src/hotspot/share/runtime/javaThread.cpp | 1 + src/hotspot/share/runtime/javaThread.hpp | 8 + src/hotspot/share/runtime/objectMonitor.cpp | 335 +++++++----------- src/hotspot/share/runtime/objectMonitor.hpp | 9 +- .../share/runtime/objectMonitor.inline.hpp | 19 +- src/hotspot/share/runtime/sharedRuntime.cpp | 20 ++ .../org/openjdk/bench/vm/lang/LockUnlock.java | 7 +- 14 files changed, 438 insertions(+), 421 deletions(-) diff --git a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp index b4c12ecd4a849..62831ee72ba05 100644 --- a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp @@ -150,10 +150,12 @@ void C2_MacroAssembler::fast_unlock(Register objectReg, Register boxReg, Registe Register oop = objectReg; Register box = boxReg; Register disp_hdr = tmpReg; + Register owner_addr = tmpReg; Register tmp = tmp2Reg; Label cont; Label object_has_monitor; Label count, no_count; + Label unlocked; assert(LockingMode != LM_LIGHTWEIGHT, "lightweight locking should use fast_unlock_lightweight"); assert_different_registers(oop, box, tmp, disp_hdr); @@ -204,14 +206,40 @@ void C2_MacroAssembler::fast_unlock(Register objectReg, Register boxReg, Registe b(cont); bind(notRecursive); + + // Compute owner address. + lea(owner_addr, Address(tmp, ObjectMonitor::owner_offset())); + + // Set owner to null. + // Release to satisfy the JMM + stlr(zr, owner_addr); + // We need a full fence after clearing owner to avoid stranding. + // StoreLoad achieves this. + membar(StoreLoad); + + // Check if the entry lists are empty. ldr(rscratch1, Address(tmp, ObjectMonitor::EntryList_offset())); - ldr(disp_hdr, Address(tmp, ObjectMonitor::cxq_offset())); - orr(rscratch1, rscratch1, disp_hdr); // Will be 0 if both are 0. - cmp(rscratch1, zr); // Sets flags for result - cbnz(rscratch1, cont); - // need a release store here - lea(tmp, Address(tmp, ObjectMonitor::owner_offset())); - stlr(zr, tmp); // set unowned + ldr(tmpReg, Address(tmp, ObjectMonitor::cxq_offset())); + orr(rscratch1, rscratch1, tmpReg); + cmp(rscratch1, zr); + br(Assembler::EQ, cont); // If so we are done. + + // Check if there is a successor. + ldr(rscratch1, Address(tmp, ObjectMonitor::succ_offset())); + cmp(rscratch1, zr); + br(Assembler::NE, unlocked); // If so we are done. + + // Save the monitor pointer in the current thread, so we can try to + // reacquire the lock in SharedRuntime::monitor_exit_helper(). + str(tmp, Address(rthread, JavaThread::unlocked_inflated_monitor_offset())); + + cmp(zr, rthread); // Set Flag to NE => slow path + b(cont); + + bind(unlocked); + cmp(zr, zr); // Set Flag to EQ => fast path + + // Intentional fall-through bind(cont); // flag == EQ indicates success @@ -498,33 +526,41 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register box, Regi bind(not_recursive); - Label release; const Register t2_owner_addr = t2; // Compute owner address. lea(t2_owner_addr, Address(t1_monitor, ObjectMonitor::owner_offset())); + // Set owner to null. + // Release to satisfy the JMM + stlr(zr, t2_owner_addr); + // We need a full fence after clearing owner to avoid stranding. + // StoreLoad achieves this. + membar(StoreLoad); + // Check if the entry lists are empty. ldr(rscratch1, Address(t1_monitor, ObjectMonitor::EntryList_offset())); ldr(t3_t, Address(t1_monitor, ObjectMonitor::cxq_offset())); orr(rscratch1, rscratch1, t3_t); cmp(rscratch1, zr); - br(Assembler::EQ, release); + br(Assembler::EQ, unlocked); // If so we are done. - // 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. - str(rthread, Address(t2_owner_addr)); - b(slow_path); + // Check if there is a successor. + ldr(rscratch1, Address(t1_monitor, ObjectMonitor::succ_offset())); + cmp(rscratch1, zr); + br(Assembler::NE, unlocked); // If so we are done. - bind(release); - // Set owner to null. - // Release to satisfy the JMM - stlr(zr, t2_owner_addr); + // Save the monitor pointer in the current thread, so we can try to + // reacquire the lock in SharedRuntime::monitor_exit_helper(). + str(t1_monitor, Address(rthread, JavaThread::unlocked_inflated_monitor_offset())); + + cmp(zr, rthread); // Set Flag to NE => slow path + b(slow_path); } bind(unlocked); decrement(Address(rthread, JavaThread::held_monitor_count_offset())); + cmp(zr, zr); // Set Flags to EQ => fast path #ifdef ASSERT // Check that unlocked label is reached with Flags == EQ. diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp index a8635af9582d1..8d8e39b8bbc00 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp @@ -2715,13 +2715,34 @@ void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Registe b(success); bind(notRecursive); + + // Set owner to null. + // Release to satisfy the JMM + release(); + li(temp, 0); + std(temp, in_bytes(ObjectMonitor::owner_offset()), current_header); + // We need a full fence after clearing owner to avoid stranding. + // StoreLoad achieves this. + membar(StoreLoad); + + // Check if the entry lists are empty. ld(temp, in_bytes(ObjectMonitor::EntryList_offset()), current_header); ld(displaced_header, in_bytes(ObjectMonitor::cxq_offset()), current_header); orr(temp, temp, displaced_header); // Will be 0 if both are 0. cmpdi(flag, temp, 0); - bne(flag, failure); - release(); - std(temp, in_bytes(ObjectMonitor::owner_offset()), current_header); + beq(flag, success); // If so we are done. + + // Check if there is a successor. + ld(temp, in_bytes(ObjectMonitor::succ_offset()), current_header); + cmpdi(flag, temp, 0); + bne(flag, success); // If so we are done. + + // Save the monitor pointer in the current thread, so we can try + // to reacquire the lock in SharedRuntime::monitor_exit_helper(). + std(current_header, in_bytes(JavaThread::unlocked_inflated_monitor_offset()), R16_thread); + + crxor(flag, Assembler::equal, flag, Assembler::equal); // Set flag = NE => slow path + b(failure); // flag == EQ indicates success, decrement held monitor count // flag == NE indicates failure @@ -3028,27 +3049,39 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister f bind(not_recursive); - Label release_; + Label set_eq_unlocked; const Register t2 = tmp2; + // Set owner to null. + // Release to satisfy the JMM + release(); + li(t, 0); + std(t, in_bytes(ObjectMonitor::owner_offset()), monitor); + // We need a full fence after clearing owner to avoid stranding. + // StoreLoad achieves this. + membar(StoreLoad); + // 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_); + beq(CCR0, unlocked); // If so we are done. - // 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); + // Check if there is a successor. + ld(t, in_bytes(ObjectMonitor::succ_offset()), monitor); + cmpdi(CCR0, t, 0); + bne(CCR0, set_eq_unlocked); // If so we are done. + + // Save the monitor pointer in the current thread, so we can try + // to reacquire the lock in SharedRuntime::monitor_exit_helper(). + std(monitor, in_bytes(JavaThread::unlocked_inflated_monitor_offset()), R16_thread); + + crxor(CCR0, Assembler::equal, CCR0, Assembler::equal); // Set flag = NE => slow path b(slow_path); - bind(release_); - // Set owner to null. - release(); - // t contains 0 - std(t, in_bytes(ObjectMonitor::owner_offset()), monitor); + bind(set_eq_unlocked); + crorc(CCR0, Assembler::equal, CCR0, Assembler::equal); // Set flag = EQ => fast path } bind(unlocked); diff --git a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp index e2c9b9dd609e0..75f87e35adf41 100644 --- a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp @@ -165,6 +165,7 @@ void C2_MacroAssembler::fast_unlock(Register objectReg, Register boxReg, Register oop = objectReg; Register box = boxReg; Register disp_hdr = tmp1Reg; + Register owner_addr = tmp1Reg; Register tmp = tmp2Reg; Label object_has_monitor; // Finish fast lock successfully. MUST branch to with flag == 0 @@ -222,15 +223,33 @@ void C2_MacroAssembler::fast_unlock(Register objectReg, Register boxReg, j(unlocked); bind(notRecursive); - ld(t0, Address(tmp, ObjectMonitor::EntryList_offset())); - ld(disp_hdr, Address(tmp, ObjectMonitor::cxq_offset())); - orr(t0, t0, disp_hdr); // Will be 0 if both are 0. - bnez(t0, slow_path); + // Compute owner address. + la(owner_addr, Address(tmp, ObjectMonitor::owner_offset())); - // need a release store here - la(tmp, Address(tmp, ObjectMonitor::owner_offset())); + // Set owner to null. + // Release to satisfy the JMM membar(MacroAssembler::LoadStore | MacroAssembler::StoreStore); - sd(zr, Address(tmp)); // set unowned + sd(zr, Address(owner_addr)); + // We need a full fence after clearing owner to avoid stranding. + // StoreLoad achieves this. + membar(StoreLoad); + + // Check if the entry lists are empty. + ld(t0, Address(tmp, ObjectMonitor::EntryList_offset())); + ld(tmp1Reg, Address(tmp, ObjectMonitor::cxq_offset())); + orr(t0, t0, tmp1Reg); + beqz(t0, unlocked); // If so we are done. + + // Check if there is a successor. + ld(t0, Address(tmp, ObjectMonitor::succ_offset())); + bnez(t0, unlocked); // If so we are done. + + // Save the monitor pointer in the current thread, so we can try to + // reacquire the lock in SharedRuntime::monitor_exit_helper(). + sd(tmp, Address(xthread, JavaThread::unlocked_inflated_monitor_offset())); + + mv(flag, 1); + j(slow_path); bind(unlocked); mv(flag, zr); @@ -534,28 +553,35 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register box, bind(not_recursive); - Label release; const Register tmp2_owner_addr = tmp2; // Compute owner address. la(tmp2_owner_addr, Address(tmp1_monitor, ObjectMonitor::owner_offset())); + // Set owner to null. + // Release to satisfy the JMM + membar(MacroAssembler::LoadStore | MacroAssembler::StoreStore); + sd(zr, Address(tmp2_owner_addr)); + // We need a full fence after clearing owner to avoid stranding. + // StoreLoad achieves this. + membar(StoreLoad); + // Check if the entry lists are empty. ld(t0, Address(tmp1_monitor, ObjectMonitor::EntryList_offset())); ld(tmp3_t, Address(tmp1_monitor, ObjectMonitor::cxq_offset())); orr(t0, t0, tmp3_t); - beqz(t0, release); + beqz(t0, unlocked); // If so we are done. - // 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. - sd(xthread, Address(tmp2_owner_addr)); - j(slow_path); + // Check if there is a successor. + ld(tmp3_t, Address(tmp1_monitor, ObjectMonitor::succ_offset())); + bnez(tmp3_t, unlocked); // If so we are done. - bind(release); - // Set owner to null. - membar(MacroAssembler::LoadStore | MacroAssembler::StoreStore); - sd(zr, Address(tmp2_owner_addr)); + // Save the monitor pointer in the current thread, so we can try + // to reacquire the lock in SharedRuntime::monitor_exit_helper(). + sd(tmp1_monitor, Address(xthread, JavaThread::unlocked_inflated_monitor_offset())); + + mv(flag, 1); + j(slow_path); } bind(unlocked); diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.cpp b/src/hotspot/cpu/s390/macroAssembler_s390.cpp index 6c26e17d5ce3b..af281345b1477 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp @@ -3655,12 +3655,38 @@ void MacroAssembler::compiler_fast_unlock_object(Register oop, Register box, Reg bind(not_recursive); + NearLabel check_succ, set_eq_unlocked; + + // Set owner to null. + // Release to satisfy the JMM + z_release(); + z_lghi(temp, 0); + z_stg(temp, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), currentHeader); + // We need a full fence after clearing owner to avoid stranding. + z_fence(); + + // Check if the entry lists are empty. load_and_test_long(temp, Address(currentHeader, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList))); - z_brne(done); + z_brne(check_succ); load_and_test_long(temp, Address(currentHeader, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq))); - z_brne(done); - z_release(); - z_stg(temp/*=0*/, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), currentHeader); + z_bre(done); // If so we are done. + + bind(check_succ); + + // Check if there is a successor. + load_and_test_long(temp, Address(currentHeader, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ))); + z_brne(set_eq_unlocked); // If so we are done. + + // Save the monitor pointer in the current thread, so we can try to + // reacquire the lock in SharedRuntime::monitor_exit_helper(). + z_xilf(currentHeader, markWord::monitor_value); + z_stg(currentHeader, Address(Z_thread, JavaThread::unlocked_inflated_monitor_offset())); + + z_ltgr(oop, oop); // Set flag = NE + z_bru(done); + + bind(set_eq_unlocked); + z_cr(temp, temp); // Set flag = EQ bind(done); @@ -6454,6 +6480,7 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(Register obj, Regis 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 succ_address{monitor, ObjectMonitor::succ_offset() - monitor_tag}; const Address EntryList_address{monitor, ObjectMonitor::EntryList_offset() - monitor_tag}; const Address owner_address{monitor, ObjectMonitor::owner_offset() - monitor_tag}; @@ -6471,25 +6498,40 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(Register obj, Regis bind(not_recursive); - NearLabel not_ok; + NearLabel check_succ, set_eq_unlocked; + + // Set owner to null. + // Release to satisfy the JMM + z_release(); + z_lghi(tmp2, 0); + z_stg(tmp2 /*=0*/, owner_address); + // We need a full fence after clearing owner to avoid stranding. + z_fence(); + // Check if the entry lists are empty. load_and_test_long(tmp2, EntryList_address); - z_brne(not_ok); + z_brne(check_succ); load_and_test_long(tmp2, cxq_address); - z_brne(not_ok); + z_bre(unlocked); // If so we are done. - z_release(); - z_stg(tmp2 /*=0*/, owner_address); + bind(check_succ); - z_bru(unlocked); // CC = EQ here + // Check if there is a successor. + load_and_test_long(tmp2, succ_address); + z_brne(set_eq_unlocked); // If so we are done. - bind(not_ok); + // Save the monitor pointer in the current thread, so we can try to + // reacquire the lock in SharedRuntime::monitor_exit_helper(). + if (!UseObjectMonitorTable) { + z_xilf(monitor, markWord::monitor_value); + } + z_stg(monitor, Address(Z_thread, JavaThread::unlocked_inflated_monitor_offset())); + + z_ltgr(obj, obj); // Set flag = NE + z_bru(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. - z_stg(Z_thread, owner_address); - z_bru(slow_path); // CC = NE here + bind(set_eq_unlocked); + z_cr(tmp2, tmp2); // Set flag = EQ } bind(unlocked); diff --git a/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp b/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp index 1990488d8a0df..44f897529e7ce 100644 --- a/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp +++ b/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp @@ -80,8 +80,6 @@ int C2FastUnlockLightweightStub::max_size() const { void C2FastUnlockLightweightStub::emit(C2_MacroAssembler& masm) { assert(_t == rax, "must be"); - Label restore_held_monitor_count_and_slow_path; - { // Restore lock-stack and handle the unlock in runtime. __ bind(_push_and_slow_path); @@ -91,61 +89,9 @@ void C2FastUnlockLightweightStub::emit(C2_MacroAssembler& masm) { __ movptr(Address(_thread, _t), _obj); #endif __ addl(Address(_thread, JavaThread::lock_stack_top_offset()), oopSize); - } - - { // Restore held monitor count and slow path. - - __ bind(restore_held_monitor_count_and_slow_path); - __ bind(_slow_path); - // Restore held monitor count. - __ increment(Address(_thread, JavaThread::held_monitor_count_offset())); - // increment will always result in ZF = 0 (no overflows). + // addl will always result in ZF = 0 (no overflows). __ jmp(slow_path_continuation()); } - - { // Handle monitor medium path. - - __ bind(_check_successor); - - Label fix_zf_and_unlocked; - const Register monitor = _mark; - -#ifndef _LP64 - __ jmpb(restore_held_monitor_count_and_slow_path); -#else // _LP64 - const ByteSize monitor_tag = in_ByteSize(UseObjectMonitorTable ? 0 : checked_cast(markWord::monitor_value)); - const Address succ_address(monitor, ObjectMonitor::succ_offset() - monitor_tag); - const Address owner_address(monitor, ObjectMonitor::owner_offset() - monitor_tag); - - // successor null check. - __ cmpptr(succ_address, NULL_WORD); - __ jccb(Assembler::equal, restore_held_monitor_count_and_slow_path); - - // Release lock. - __ movptr(owner_address, NULL_WORD); - - // Fence. - // Instead of MFENCE we use a dummy locked add of 0 to the top-of-stack. - __ lock(); __ addl(Address(rsp, 0), 0); - - // Recheck successor. - __ cmpptr(succ_address, NULL_WORD); - // Observed a successor after the release -> fence we have handed off the monitor - __ jccb(Assembler::notEqual, fix_zf_and_unlocked); - - // Try to relock, if it fails the monitor has been handed over - // TODO: Caveat, this may fail due to deflation, which does - // not handle the monitor handoff. Currently only works - // due to the responsible thread. - __ xorptr(rax, rax); - __ lock(); __ cmpxchgptr(_thread, owner_address); - __ jccb (Assembler::equal, restore_held_monitor_count_and_slow_path); -#endif - - __ bind(fix_zf_and_unlocked); - __ xorl(rax, rax); - __ jmp(unlocked_continuation()); - } } #undef __ diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp index c2801a791cb5a..839745f76ec6a 100644 --- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp @@ -459,87 +459,43 @@ void C2_MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register t // IA32's memory-model is SPO, so STs are ordered with respect to // each other and there's no need for an explicit barrier (fence). // See also http://gee.cs.oswego.edu/dl/jmm/cookbook.html. -#ifndef _LP64 - // Note that we could employ various encoding schemes to reduce - // the number of loads below (currently 4) to just 2 or 3. - // Refer to the comments in synchronizer.cpp. - // In practice the chain of fetches doesn't seem to impact performance, however. - xorptr(boxReg, boxReg); - orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions))); - jccb (Assembler::notZero, DONE_LABEL); - movptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList))); - orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq))); - jccb (Assembler::notZero, DONE_LABEL); - movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), NULL_WORD); - jmpb (DONE_LABEL); -#else // _LP64 - // It's inflated - Label CheckSucc, LNotRecursive, LSuccess, LGoSlowPath; + Label LSuccess, LNotRecursive; cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions)), 0); jccb(Assembler::equal, LNotRecursive); // Recursive inflated unlock - decq(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions))); + decrement(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions))); jmpb(LSuccess); bind(LNotRecursive); - movptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq))); - orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList))); - jccb (Assembler::notZero, CheckSucc); - // Without cast to int32_t this style of movptr will destroy r10 which is typically obj. + + // Set owner to null. + // Release to satisfy the JMM movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), NULL_WORD); - jmpb (DONE_LABEL); + // We need a full fence after clearing owner to avoid stranding. + // StoreLoad achieves this. + membar(StoreLoad); - // Try to avoid passing control into the slow_path ... - bind (CheckSucc); + // Check if the entry lists are empty. + movptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq))); + orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList))); + jccb(Assembler::zero, LSuccess); // If so we are done. - // The following optional optimization can be elided if necessary - // Effectively: if (succ == null) goto slow path - // The code reduces the window for a race, however, - // and thus benefits performance. + // Check if there is a successor. cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), NULL_WORD); - jccb (Assembler::zero, LGoSlowPath); - - xorptr(boxReg, boxReg); - // Without cast to int32_t this style of movptr will destroy r10 which is typically obj. - movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), NULL_WORD); + jccb(Assembler::notZero, LSuccess); // If so we are done. - // Memory barrier/fence - // Dekker pivot point -- fulcrum : ST Owner; MEMBAR; LD Succ - // Instead of MFENCE we use a dummy locked add of 0 to the top-of-stack. - // This is faster on Nehalem and AMD Shanghai/Barcelona. - // See https://blogs.oracle.com/dave/entry/instruction_selection_for_volatile_fences - // We might also restructure (ST Owner=0;barrier;LD _Succ) to - // (mov box,0; xchgq box, &m->Owner; LD _succ) . - lock(); addl(Address(rsp, 0), 0); + // Save the monitor pointer in the current thread, so we can try to + // reacquire the lock in SharedRuntime::monitor_exit_helper(). + andptr(tmpReg, ~(int32_t)markWord::monitor_value); +#ifndef _LP64 + get_thread(boxReg); + movptr(Address(boxReg, JavaThread::unlocked_inflated_monitor_offset()), tmpReg); +#else // _LP64 + movptr(Address(r15_thread, JavaThread::unlocked_inflated_monitor_offset()), tmpReg); +#endif - cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), NULL_WORD); - jccb (Assembler::notZero, LSuccess); - - // Rare inopportune interleaving - race. - // The successor vanished in the small window above. - // The lock is contended -- (cxq|EntryList) != null -- and there's no apparent successor. - // We need to ensure progress and succession. - // Try to reacquire the lock. - // If that fails then the new owner is responsible for succession and this - // thread needs to take no further action and can exit via the fast path (success). - // If the re-acquire succeeds then pass control into the slow path. - // As implemented, this latter mode is horrible because we generated more - // coherence traffic on the lock *and* artificially extended the critical section - // length while by virtue of passing control into the slow path. - - // box is really RAX -- the following CMPXCHG depends on that binding - // cmpxchg R,[M] is equivalent to rax = CAS(M,rax,R) - lock(); - cmpxchgptr(r15_thread, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); - // There's no successor so we tried to regrab the lock. - // If that didn't work, then another thread grabbed the - // lock so we're done (and exit was a success). - jccb (Assembler::notEqual, LSuccess); - // Intentional fall-through into slow path - - bind (LGoSlowPath); orl (boxReg, 1); // set ICC.ZF=0 to indicate failure jmpb (DONE_LABEL); @@ -547,7 +503,6 @@ void C2_MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register t testl (boxReg, 0); // set ICC.ZF=1 to indicate success jmpb (DONE_LABEL); -#endif if (LockingMode == LM_LEGACY) { bind (Stacked); movptr(tmpReg, Address (boxReg, 0)); // re-fetch @@ -744,10 +699,7 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register reg_rax, // Handle inflated monitor. Label inflated, inflated_check_lock_stack; // Finish fast unlock successfully. MUST jump with ZF == 1 - Label unlocked; - - // Assume success. - decrement(Address(thread, JavaThread::held_monitor_count_offset())); + Label unlocked, slow_path; const Register mark = t; const Register monitor = t; @@ -763,8 +715,6 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register reg_rax, } Label& push_and_slow_path = stub == nullptr ? dummy : stub->push_and_slow_path(); - Label& check_successor = stub == nullptr ? dummy : stub->check_successor(); - Label& slow_path = stub == nullptr ? dummy : stub->slow_path(); { // Lightweight Unlock @@ -839,6 +789,7 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register reg_rax, 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 succ_address{monitor, ObjectMonitor::succ_offset() - monitor_tag}; const Address EntryList_address{monitor, ObjectMonitor::EntryList_offset() - monitor_tag}; const Address owner_address{monitor, ObjectMonitor::owner_offset() - monitor_tag}; @@ -846,27 +797,42 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register reg_rax, // Check if recursive. cmpptr(recursions_address, 0); - jccb(Assembler::notEqual, recursive); + jccb(Assembler::notZero, recursive); + + // Set owner to null. + // Release to satisfy the JMM + movptr(owner_address, NULL_WORD); + // We need a full fence after clearing owner to avoid stranding. + // StoreLoad achieves this. + membar(StoreLoad); // Check if the entry lists are empty. movptr(reg_rax, cxq_address); orptr(reg_rax, EntryList_address); - jcc(Assembler::notZero, check_successor); + jccb(Assembler::zero, unlocked); // If so we are done. - // Release lock. - movptr(owner_address, NULL_WORD); - jmpb(unlocked); + // Check if there is a successor. + cmpptr(succ_address, NULL_WORD); + jccb(Assembler::notZero, unlocked); // If so we are done. + + // Save the monitor pointer in the current thread, so we can try to + // reacquire the lock in SharedRuntime::monitor_exit_helper(). + if (!UseObjectMonitorTable) { + andptr(monitor, ~(int32_t)markWord::monitor_value); + } + movptr(Address(thread, JavaThread::unlocked_inflated_monitor_offset()), monitor); + + testl(monitor, monitor); // Fast Unlock ZF = 0 + jmpb(slow_path); // Recursive unlock. bind(recursive); decrement(recursions_address); - xorl(t, t); } bind(unlocked); - if (stub != nullptr) { - bind(stub->unlocked_continuation()); - } + decrement(Address(thread, JavaThread::held_monitor_count_offset())); + xorl(t, t); // Fast Unlock ZF = 1 #ifdef ASSERT // Check that unlocked label is reached with ZF set. @@ -875,6 +841,7 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register reg_rax, stop("Fast Unlock ZF != 1"); #endif + bind(slow_path); if (stub != nullptr) { bind(stub->slow_path_continuation()); } diff --git a/src/hotspot/share/opto/c2_CodeStubs.hpp b/src/hotspot/share/opto/c2_CodeStubs.hpp index 5db7596e072dc..318bc2f45fc76 100644 --- a/src/hotspot/share/opto/c2_CodeStubs.hpp +++ b/src/hotspot/share/opto/c2_CodeStubs.hpp @@ -105,7 +105,6 @@ class C2FastUnlockLightweightStub : public C2CodeStub { Register _thread; Label _slow_path; Label _push_and_slow_path; - Label _check_successor; Label _unlocked_continuation; public: C2FastUnlockLightweightStub(Register obj, Register mark, Register t, Register thread) : C2CodeStub(), @@ -114,7 +113,6 @@ class C2FastUnlockLightweightStub : public C2CodeStub { void emit(C2_MacroAssembler& masm); Label& slow_path() { return _slow_path; } Label& push_and_slow_path() { return _push_and_slow_path; } - Label& check_successor() { return _check_successor; } Label& unlocked_continuation() { return _unlocked_continuation; } Label& slow_path_continuation() { return continuation(); } }; diff --git a/src/hotspot/share/runtime/javaThread.cpp b/src/hotspot/share/runtime/javaThread.cpp index 3528fc5b1bced..14528f6d908fc 100644 --- a/src/hotspot/share/runtime/javaThread.cpp +++ b/src/hotspot/share/runtime/javaThread.cpp @@ -487,6 +487,7 @@ JavaThread::JavaThread(MemTag mem_tag) : _cont_fastpath_thread_state(1), _held_monitor_count(0), _jni_monitor_count(0), + _unlocked_inflated_monitor(nullptr), _handshake(this), diff --git a/src/hotspot/share/runtime/javaThread.hpp b/src/hotspot/share/runtime/javaThread.hpp index e36b7dfe888a8..20bb08a4acbca 100644 --- a/src/hotspot/share/runtime/javaThread.hpp +++ b/src/hotspot/share/runtime/javaThread.hpp @@ -464,6 +464,7 @@ class JavaThread: public Thread { // It's signed for error detection. intx _held_monitor_count; // used by continuations for fast lock detection intx _jni_monitor_count; + ObjectMonitor* _unlocked_inflated_monitor; private: @@ -615,6 +616,12 @@ class JavaThread: public Thread { intx jni_monitor_count() { return _jni_monitor_count; } void clear_jni_monitor_count() { _jni_monitor_count = 0; } + // Support for SharedRuntime::monitor_exit_helper() + ObjectMonitor* unlocked_inflated_monitor() const { return _unlocked_inflated_monitor; } + void clear_unlocked_inflated_monitor() { + _unlocked_inflated_monitor = nullptr; + } + inline bool is_vthread_mounted() const; inline const ContinuationEntry* vthread_continuation() const; @@ -828,6 +835,7 @@ class JavaThread: public Thread { static ByteSize cont_fastpath_offset() { return byte_offset_of(JavaThread, _cont_fastpath); } static ByteSize held_monitor_count_offset() { return byte_offset_of(JavaThread, _held_monitor_count); } static ByteSize jni_monitor_count_offset() { return byte_offset_of(JavaThread, _jni_monitor_count); } + static ByteSize unlocked_inflated_monitor_offset() { return byte_offset_of(JavaThread, _unlocked_inflated_monitor); } #if INCLUDE_JVMTI static ByteSize is_in_VTMS_transition_offset() { return byte_offset_of(JavaThread, _is_in_VTMS_transition); } diff --git a/src/hotspot/share/runtime/objectMonitor.cpp b/src/hotspot/share/runtime/objectMonitor.cpp index 367d79a5283db..755d49d2c6c58 100644 --- a/src/hotspot/share/runtime/objectMonitor.cpp +++ b/src/hotspot/share/runtime/objectMonitor.cpp @@ -178,7 +178,7 @@ OopStorage* ObjectMonitor::_oop_storage = nullptr; // // Cxq points to the set of Recently Arrived Threads attempting entry. // Because we push threads onto _cxq with CAS, the RATs must take the form of -// a singly-linked LIFO. We drain _cxq into EntryList at unlock-time when +// a singly-linked LIFO. We drain _cxq into EntryList at unlock-time when // the unlocking thread notices that EntryList is null but _cxq is != null. // // The EntryList is ordered by the prevailing queue discipline and @@ -210,19 +210,6 @@ OopStorage* ObjectMonitor::_oop_storage = nullptr; // unpark the notifyee. Unparking a notifee in notify() is inefficient - // it's likely the notifyee would simply impale itself on the lock held // by the notifier. -// -// * An interesting alternative is to encode cxq as (List,LockByte) where -// the LockByte is 0 iff the monitor is owned. _owner is simply an auxiliary -// variable, like _recursions, in the scheme. The threads or Events that form -// the list would have to be aligned in 256-byte addresses. A thread would -// try to acquire the lock or enqueue itself with CAS, but exiting threads -// could use a 1-0 protocol and simply STB to set the LockByte to 0. -// Note that is is *not* word-tearing, but it does presume that full-word -// CAS operations are coherent with intermix with STB operations. That's true -// on most common processors. -// -// * See also http://blogs.sun.com/dave - // Check that object() and set_object() are called from the right context: static void check_object_context() { @@ -257,7 +244,6 @@ ObjectMonitor::ObjectMonitor(oop object) : _EntryList(nullptr), _cxq(nullptr), _succ(nullptr), - _Responsible(nullptr), _SpinDuration(ObjectMonitor::Knob_SpinLimit), _contentions(0), _WaitSet(nullptr), @@ -320,17 +306,11 @@ bool ObjectMonitor::enter_is_async_deflating() { return false; } -void ObjectMonitor::enter_for_with_contention_mark(JavaThread* locking_thread, ObjectMonitorContentionMark& contention_mark) { - // Used by ObjectSynchronizer::enter_for to enter for another thread. - // The monitor is private to or already owned by locking_thread which must be suspended. - // So this code may only contend with deflation. - assert(locking_thread == Thread::current() || locking_thread->is_obj_deopt_suspend(), "must be"); +bool ObjectMonitor::TryLockWithContentionMark(JavaThread* locking_thread, ObjectMonitorContentionMark& contention_mark) { assert(contention_mark._monitor == this, "must be"); assert(!is_being_async_deflated(), "must be"); - void* prev_owner = try_set_owner_from(nullptr, locking_thread); - bool success = false; if (prev_owner == nullptr) { @@ -343,8 +323,16 @@ void ObjectMonitor::enter_for_with_contention_mark(JavaThread* locking_thread, O // Racing with deflation. prev_owner = try_set_owner_from(DEFLATER_MARKER, locking_thread); if (prev_owner == DEFLATER_MARKER) { - // Cancelled deflation. Increment contentions as part of the deflation protocol. - add_to_contentions(1); + // We successfully cancelled the in-progress async deflation by + // changing owner from DEFLATER_MARKER to current. We now extend + // the lifetime of the contention_mark (e.g. contentions++) here + // to prevent the deflater thread from winning the last part of + // the 2-part async deflation protocol after the regular + // decrement occurs when the contention_mark goes out of + // scope. ObjectMonitor::deflate_monitor() which is called by + // the deflater thread will decrement contentions after it + // recognizes that the async deflation was cancelled. + contention_mark.extend(); success = true; } else if (prev_owner == nullptr) { // At this point we cannot race with deflation as we have both incremented @@ -360,12 +348,28 @@ void ObjectMonitor::enter_for_with_contention_mark(JavaThread* locking_thread, O set_owner_from_BasicLock(prev_owner, locking_thread); success = true; } + assert(!success || owner_raw() == locking_thread, "must be"); + + return success; +} + +void ObjectMonitor::enter_for_with_contention_mark(JavaThread* locking_thread, ObjectMonitorContentionMark& contention_mark) { + // Used by LightweightSynchronizer::inflate_and_enter in deoptimization path to enter for another thread. + // The monitor is private to or already owned by locking_thread which must be suspended. + // So this code may only contend with deflation. + assert(locking_thread == Thread::current() || locking_thread->is_obj_deopt_suspend(), "must be"); + bool success = TryLockWithContentionMark(locking_thread, contention_mark); + assert(success, "Failed to enter_for: locking_thread=" INTPTR_FORMAT - ", this=" INTPTR_FORMAT "{owner=" INTPTR_FORMAT "}, observed owner: " INTPTR_FORMAT, - p2i(locking_thread), p2i(this), p2i(owner_raw()), p2i(prev_owner)); + ", this=" INTPTR_FORMAT "{owner=" INTPTR_FORMAT "}", + p2i(locking_thread), p2i(this), p2i(owner_raw())); } bool ObjectMonitor::enter_for(JavaThread* locking_thread) { + // Used by ObjectSynchronizer::enter_for() to enter for another thread. + // The monitor is private to or already owned by locking_thread which must be suspended. + // So this code may only contend with deflation. + assert(locking_thread == Thread::current() || locking_thread->is_obj_deopt_suspend(), "must be"); // Block out deflation as soon as possible. ObjectMonitorContentionMark contention_mark(this); @@ -375,19 +379,29 @@ bool ObjectMonitor::enter_for(JavaThread* locking_thread) { return false; } - enter_for_with_contention_mark(locking_thread, contention_mark); + bool success = TryLockWithContentionMark(locking_thread, contention_mark); + + assert(success, "Failed to enter_for: locking_thread=" INTPTR_FORMAT + ", this=" INTPTR_FORMAT "{owner=" INTPTR_FORMAT "}", + p2i(locking_thread), p2i(this), p2i(owner_raw())); assert(owner_raw() == locking_thread, "must be"); return true; } -bool ObjectMonitor::try_enter(JavaThread* current) { - // TryLock avoids the CAS +bool ObjectMonitor::try_enter(JavaThread* current, bool check_for_recursion) { + // TryLock avoids the CAS and handles deflation. TryLockResult r = TryLock(current); if (r == TryLockResult::Success) { assert(_recursions == 0, "invariant"); return true; } + // If called from SharedRuntime::monitor_exit_helper(), we know that + // this thread doesn't already own the lock. + if (!check_for_recursion) { + return false; + } + if (r == TryLockResult::HasOwner && owner() == current) { _recursions++; return true; @@ -400,7 +414,6 @@ bool ObjectMonitor::try_enter(JavaThread* current) { set_owner_from_BasicLock(cur, current); // Convert from BasicLock* to Thread*. return true; } - return false; } @@ -561,16 +574,40 @@ void ObjectMonitor::enter_with_contention_mark(JavaThread *current, ObjectMonito ObjectMonitor::TryLockResult ObjectMonitor::TryLock(JavaThread* current) { void* own = owner_raw(); - if (own != nullptr) return TryLockResult::HasOwner; - if (try_set_owner_from(nullptr, current) == nullptr) { - assert(_recursions == 0, "invariant"); - return TryLockResult::Success; + void* first_own = own; + + for (;;) { + if (own == DEFLATER_MARKER) { + // Block out deflation as soon as possible. + ObjectMonitorContentionMark contention_mark(this); + + // Check for deflation. + if (enter_is_async_deflating()) { + // Treat deflation as interference. + return TryLockResult::Interference; + } + if (TryLockWithContentionMark(current, contention_mark)) { + assert(_recursions == 0, "invariant"); + return TryLockResult::Success; + } else { + // Deflation won or change of owner; dont spin + break; + } + } else if (own == nullptr) { + void* prev_own = try_set_owner_from(nullptr, current); + if (prev_own == nullptr) { + assert(_recursions == 0, "invariant"); + return TryLockResult::Success; + } else { + // The lock had been free momentarily, but we lost the race to the lock. + own = prev_own; + } + } else { + // Retry doesn't make as much sense because the lock was just acquired. + break; + } } - // The lock had been free momentarily, but we lost the race to the lock. - // Interference -- the CAS failed. - // We can either return -1 or retry. - // Retry doesn't make as much sense because the lock was just acquired. - return TryLockResult::Interference; + return first_own == own ? TryLockResult::HasOwner : TryLockResult::Interference; } // Deflate the specified ObjectMonitor if not in-use. Returns true if it @@ -746,8 +783,6 @@ const char* ObjectMonitor::is_busy_to_string(stringStream* ss) { return ss->base(); } -#define MAX_RECHECK_INTERVAL 1000 - void ObjectMonitor::EnterI(JavaThread* current) { assert(current->thread_state() == _thread_blocked, "invariant"); @@ -755,25 +790,6 @@ void ObjectMonitor::EnterI(JavaThread* current) { if (TryLock(current) == TryLockResult::Success) { assert(_succ != current, "invariant"); assert(owner_raw() == current, "invariant"); - assert(_Responsible != current, "invariant"); - return; - } - - if (try_set_owner_from(DEFLATER_MARKER, current) == DEFLATER_MARKER) { - // Cancelled the in-progress async deflation by changing owner from - // DEFLATER_MARKER to current. As part of the contended enter protocol, - // contentions was incremented to a positive value before EnterI() - // was called and that prevents the deflater thread from winning the - // last part of the 2-part async deflation protocol. After EnterI() - // returns to enter(), contentions is decremented because the caller - // now owns the monitor. We bump contentions an extra time here to - // prevent the deflater thread from winning the last part of the - // 2-part async deflation protocol after the regular decrement - // occurs in enter(). The deflater thread will decrement contentions - // after it recognizes that the async deflation was cancelled. - add_to_contentions(1); - assert(_succ != current, "invariant"); - assert(_Responsible != current, "invariant"); return; } @@ -789,14 +805,12 @@ void ObjectMonitor::EnterI(JavaThread* current) { if (TrySpin(current)) { assert(owner_raw() == current, "invariant"); assert(_succ != current, "invariant"); - assert(_Responsible != current, "invariant"); return; } // The Spin failed -- Enqueue and park the thread ... assert(_succ != current, "invariant"); assert(owner_raw() != current, "invariant"); - assert(_Responsible != current, "invariant"); // Enqueue "current" on ObjectMonitor's _cxq. // @@ -826,40 +840,10 @@ void ObjectMonitor::EnterI(JavaThread* current) { if (TryLock(current) == TryLockResult::Success) { assert(_succ != current, "invariant"); assert(owner_raw() == current, "invariant"); - assert(_Responsible != current, "invariant"); return; } } - // Check for cxq|EntryList edge transition to non-null. This indicates - // the onset of contention. While contention persists exiting threads - // will use a ST:MEMBAR:LD 1-1 exit protocol. When contention abates exit - // operations revert to the faster 1-0 mode. This enter operation may interleave - // (race) a concurrent 1-0 exit operation, resulting in stranding, so we - // arrange for one of the contending thread to use a timed park() operations - // to detect and recover from the race. (Stranding is form of progress failure - // where the monitor is unlocked but all the contending threads remain parked). - // That is, at least one of the contended threads will periodically poll _owner. - // One of the contending threads will become the designated "Responsible" thread. - // The Responsible thread uses a timed park instead of a normal indefinite park - // operation -- it periodically wakes and checks for and recovers from potential - // strandings admitted by 1-0 exit operations. We need at most one Responsible - // thread per-monitor at any given moment. Only threads on cxq|EntryList may - // be responsible for a monitor. - // - // Currently, one of the contended threads takes on the added role of "Responsible". - // A viable alternative would be to use a dedicated "stranding checker" thread - // that periodically iterated over all the threads (or active monitors) and unparked - // successors where there was risk of stranding. This would help eliminate the - // timer scalability issues we see on some platforms as we'd only have one thread - // -- the checker -- parked on a timer. - - if (nxt == nullptr && _EntryList == nullptr) { - // Try to assume the role of responsible thread for the monitor. - // CONSIDER: ST vs CAS vs { if (Responsible==null) Responsible=current } - Atomic::replace_if_null(&_Responsible, current); - } - // The lock might have been released while this thread was occupied queueing // itself onto _cxq. To close the race and avoid "stranding" and // progress-liveness failure we must resample-retry _owner before parking. @@ -871,8 +855,6 @@ void ObjectMonitor::EnterI(JavaThread* current) { // to defer the state transitions until absolutely necessary, // and in doing so avoid some transitions ... - int recheckInterval = 1; - for (;;) { if (TryLock(current) == TryLockResult::Success) { @@ -881,37 +863,12 @@ void ObjectMonitor::EnterI(JavaThread* current) { assert(owner_raw() != current, "invariant"); // park self - if (_Responsible == current) { - current->_ParkEvent->park((jlong) recheckInterval); - // Increase the recheckInterval, but clamp the value. - recheckInterval *= 8; - if (recheckInterval > MAX_RECHECK_INTERVAL) { - recheckInterval = MAX_RECHECK_INTERVAL; - } - } else { - current->_ParkEvent->park(); - } + current->_ParkEvent->park(); if (TryLock(current) == TryLockResult::Success) { break; } - if (try_set_owner_from(DEFLATER_MARKER, current) == DEFLATER_MARKER) { - // Cancelled the in-progress async deflation by changing owner from - // DEFLATER_MARKER to current. As part of the contended enter protocol, - // contentions was incremented to a positive value before EnterI() - // was called and that prevents the deflater thread from winning the - // last part of the 2-part async deflation protocol. After EnterI() - // returns to enter(), contentions is decremented because the caller - // now owns the monitor. We bump contentions an extra time here to - // prevent the deflater thread from winning the last part of the - // 2-part async deflation protocol after the regular decrement - // occurs in enter(). The deflater thread will decrement contentions - // after it recognizes that the async deflation was cancelled. - add_to_contentions(1); - break; - } - // The lock is still contested. // Keep a tally of the # of futile wakeups. @@ -953,44 +910,23 @@ void ObjectMonitor::EnterI(JavaThread* current) { assert(owner_raw() == current, "invariant"); UnlinkAfterAcquire(current, &node); - if (_succ == current) _succ = nullptr; - - assert(_succ != current, "invariant"); - if (_Responsible == current) { - _Responsible = nullptr; - OrderAccess::fence(); // Dekker pivot-point - - // We may leave threads on cxq|EntryList without a designated - // "Responsible" thread. This is benign. When this thread subsequently - // exits the monitor it can "see" such preexisting "old" threads -- - // threads that arrived on the cxq|EntryList before the fence, above -- - // by LDing cxq|EntryList. Newly arrived threads -- that is, threads - // that arrive on cxq after the ST:MEMBAR, above -- will set Responsible - // non-null and elect a new "Responsible" timer thread. - // - // This thread executes: - // ST Responsible=null; MEMBAR (in enter epilogue - here) - // LD cxq|EntryList (in subsequent exit) - // - // Entering threads in the slow/contended path execute: - // ST cxq=nonnull; MEMBAR; LD Responsible (in enter prolog) - // The (ST cxq; MEMBAR) is accomplished with CAS(). - // - // The MEMBAR, above, prevents the LD of cxq|EntryList in the subsequent - // exit operation from floating above the ST Responsible=null. + if (_succ == current) { + _succ = nullptr; + // Note that we don't need to do OrderAccess::fence() after clearing + // _succ here, since we own the lock. } // We've acquired ownership with CAS(). // CAS is serializing -- it has MEMBAR/FENCE-equivalent semantics. // But since the CAS() this thread may have also stored into _succ, - // EntryList, cxq or Responsible. These meta-data updates must be + // EntryList or cxq. These meta-data updates must be // visible __before this thread subsequently drops the lock. // Consider what could occur if we didn't enforce this constraint -- // STs to monitor meta-data and user-data could reorder with (become // visible after) the ST in exit that drops ownership of the lock. // Some other thread could then acquire the lock, but observe inconsistent // or old monitor meta-data and heap data. That violates the JMM. - // To that end, the 1-0 exit() operation must have at least STST|LDST + // To that end, the exit() operation must have at least STST|LDST // "release" barrier semantics. Specifically, there must be at least a // STST|LDST barrier in exit() before the ST of null into _owner that drops // the lock. The barrier ensures that changes to monitor meta-data and data @@ -1000,8 +936,7 @@ void ObjectMonitor::EnterI(JavaThread* current) { // // Critically, any prior STs to _succ or EntryList must be visible before // the ST of null into _owner in the *subsequent* (following) corresponding - // monitorexit. Recall too, that in 1-0 mode monitorexit does not necessarily - // execute a serializing instruction. + // monitorexit. return; } @@ -1174,39 +1109,32 @@ void ObjectMonitor::UnlinkAfterAcquire(JavaThread* current, ObjectWaiter* curren // In that case exit() is called with _thread_state == _thread_blocked, // but the monitor's _contentions field is > 0, which inhibits reclamation. // -// 1-0 exit -// ~~~~~~~~ -// ::exit() uses a canonical 1-1 idiom with a MEMBAR although some of -// the fast-path operators have been optimized so the common ::exit() -// operation is 1-0, e.g., see macroAssembler_x86.cpp: fast_unlock(). -// The code emitted by fast_unlock() elides the usual MEMBAR. This -// greatly improves latency -- MEMBAR and CAS having considerable local -// latency on modern processors -- but at the cost of "stranding". Absent the -// MEMBAR, a thread in fast_unlock() can race a thread in the slow -// ::enter() path, resulting in the entering thread being stranding -// and a progress-liveness failure. Stranding is extremely rare. -// We use timers (timed park operations) & periodic polling to detect -// and recover from stranding. Potentially stranded threads periodically -// wake up and poll the lock. See the usage of the _Responsible variable. +// This is the exit part of the locking protocol, often implemented in +// C2_MacroAssembler::fast_unlock() +// +// 1. A release barrier ensures that changes to monitor meta-data +// (_succ, _EntryList, _cxq) and data protected by the lock will be +// visible before we release the lock. +// 2. Release the lock by clearing the owner. +// 3. A storeload MEMBAR is needed between releasing the owner and +// subsequently reading meta-data to safely determine if the lock is +// contended (step 4) without an elected successor (step 5). +// 4. If both _EntryList and _cxq are null, we are done, since there is no +// other thread waiting on the lock to wake up. I.e. there is no +// contention. +// 5. If there is a successor (_succ is non-null), we are done. The +// responsibility for guaranteeing progress-liveness has now implicitly +// been moved from the exiting thread to the successor. +// 6. There are waiters in the entry list (_EntryList and/or cxq are +// non-null), but there is no successor (_succ is null), so we need to +// wake up (unpark) a waiting thread to avoid stranding. // -// The CAS() in enter provides for safety and exclusion, while the CAS or -// MEMBAR in exit provides for progress and avoids stranding. 1-0 locking -// eliminates the CAS/MEMBAR from the exit path, but it admits stranding. -// We detect and recover from stranding with timers. +// Note that since only the current lock owner can manipulate the _EntryList +// or drain _cxq, we need to reacquire the lock before we can wake up +// (unpark) a waiting thread. // -// If a thread transiently strands it'll park until (a) another -// thread acquires the lock and then drops the lock, at which time the -// exiting thread will notice and unpark the stranded thread, or, (b) -// the timer expires. If the lock is high traffic then the stranding latency -// will be low due to (a). If the lock is low traffic then the odds of -// stranding are lower, although the worst-case stranding latency -// is longer. Critically, we don't want to put excessive load in the -// platform's timer subsystem. We want to minimize both the timer injection -// rate (timers created/sec) as well as the number of timers active at -// any one time. (more precisely, we want to minimize timer-seconds, which is -// the integral of the # of active timers at any instant over time). -// Both impinge on OS scalability. Given that, at most one thread parked on -// a monitor will use a timer. +// The CAS() in enter provides for safety and exclusion, while the +// MEMBAR in exit provides for progress and avoids stranding. // // There is also the risk of a futile wake-up. If we drop the lock // another thread can reacquire the lock immediately, and we can @@ -1248,10 +1176,6 @@ void ObjectMonitor::exit(JavaThread* current, bool not_suspended) { return; } - // Invariant: after setting Responsible=null an thread must execute - // a MEMBAR or other serializing instruction before fetching EntryList|cxq. - _Responsible = nullptr; - #if INCLUDE_JFR // get the owner's thread id for the MonitorEnter event // if it is enabled and the thread isn't suspended @@ -1278,14 +1202,15 @@ void ObjectMonitor::exit(JavaThread* current, bool not_suspended) { // Other threads are blocked trying to acquire the lock. // Normally the exiting thread is responsible for ensuring succession, - // but if other successors are ready or other entering threads are spinning - // then this thread can simply store null into _owner and exit without - // waking a successor. The existence of spinners or ready successors - // guarantees proper succession (liveness). Responsibility passes to the - // ready or running successors. The exiting thread delegates the duty. - // More precisely, if a successor already exists this thread is absolved - // of the responsibility of waking (unparking) one. - // + // but if this thread observes other successors are ready or other + // entering threads are spinning after it has stored null into _owner + // then it can exit without waking a successor. The existence of + // spinners or ready successors guarantees proper succession (liveness). + // Responsibility passes to the ready or running successors. The exiting + // thread delegates the duty. More precisely, if a successor already + // exists this thread is absolved of the responsibility of waking + // (unparking) one. + // The _succ variable is critical to reducing futile wakeup frequency. // _succ identifies the "heir presumptive" thread that has been made // ready (unparked) but that has not yet run. We need only one such @@ -1296,24 +1221,20 @@ void ObjectMonitor::exit(JavaThread* current, bool not_suspended) { // Note that spinners in Enter() also set _succ non-null. // In the current implementation spinners opportunistically set // _succ so that exiting threads might avoid waking a successor. - // Another less appealing alternative would be for the exiting thread - // to drop the lock and then spin briefly to see if a spinner managed - // to acquire the lock. If so, the exiting thread could exit - // immediately without waking a successor, otherwise the exiting - // thread would need to dequeue and wake a successor. - // (Note that we'd need to make the post-drop spin short, but no - // shorter than the worst-case round-trip cache-line migration time. - // The dropped lock needs to become visible to the spinner, and then - // the acquisition of the lock by the spinner must become visible to - // the exiting thread). + // Which means that the exiting thread could exit immediately without + // waking a successor, if it observes a successor after it has dropped + // the lock. Note that the dropped lock needs to become visible to the + // spinner. // It appears that an heir-presumptive (successor) must be made ready. // Only the current lock owner can manipulate the EntryList or // drain _cxq, so we need to reacquire the lock. If we fail // to reacquire the lock the responsibility for ensuring succession // falls to the new owner. - // - if (try_set_owner_from(nullptr, current) != nullptr) { + + if (TryLock(current) != TryLockResult::Success) { + // Some other thread acquired the lock (or the monitor was + // deflated). Either way we are done. return; } @@ -1376,7 +1297,7 @@ void ObjectMonitor::exit(JavaThread* current, bool not_suspended) { q = p; } - // In 1-0 mode we need: ST EntryList; MEMBAR #storestore; ST _owner = nullptr + // We need to: ST EntryList; MEMBAR #storestore; ST _owner = nullptr // The MEMBAR is satisfied by the release_store() operation in ExitEpilog(). // See if we can abdicate to a spinner instead of waking a thread. @@ -1566,8 +1487,6 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) { AddWaiter(&node); Thread::SpinRelease(&_WaitSetLock); - _Responsible = nullptr; - intx save = _recursions; // record the old recursion count _waiters++; // increment the number of waiters _recursions = 0; // set the recursion level to be 1 @@ -2245,7 +2164,6 @@ void ObjectMonitor::print() const { print_on(tty); } // _EntryList = 0x0000000000000000 // _cxq = 0x0000000000000000 // _succ = 0x0000000000000000 -// _Responsible = 0x0000000000000000 // _SpinDuration = 5000 // _contentions = 0 // _WaitSet = 0x0000700009756248 @@ -2274,7 +2192,6 @@ void ObjectMonitor::print_debug_style_on(outputStream* st) const { st->print_cr(" _EntryList = " INTPTR_FORMAT, p2i(_EntryList)); st->print_cr(" _cxq = " INTPTR_FORMAT, p2i(_cxq)); st->print_cr(" _succ = " INTPTR_FORMAT, p2i(_succ)); - st->print_cr(" _Responsible = " INTPTR_FORMAT, p2i(_Responsible)); st->print_cr(" _SpinDuration = %d", _SpinDuration); st->print_cr(" _contentions = %d", contentions()); st->print_cr(" _WaitSet = " INTPTR_FORMAT, p2i(_WaitSet)); diff --git a/src/hotspot/share/runtime/objectMonitor.hpp b/src/hotspot/share/runtime/objectMonitor.hpp index ef85559c2b6c3..30d2e5094162d 100644 --- a/src/hotspot/share/runtime/objectMonitor.hpp +++ b/src/hotspot/share/runtime/objectMonitor.hpp @@ -179,7 +179,6 @@ class ObjectMonitor : public CHeapObj { ObjectWaiter* volatile _cxq; // LL of recently-arrived threads blocked on entry. JavaThread* volatile _succ; // Heir presumptive thread - used for futile wakeup throttling - JavaThread* volatile _Responsible; volatile int _SpinDuration; @@ -348,7 +347,7 @@ class ObjectMonitor : public CHeapObj { void enter_for_with_contention_mark(JavaThread* locking_thread, ObjectMonitorContentionMark& contention_mark); bool enter_for(JavaThread* locking_thread); bool enter(JavaThread* current); - bool try_enter(JavaThread* current); + bool try_enter(JavaThread* current, bool check_for_recursion = true); bool spin_enter(JavaThread* current); void enter_with_contention_mark(JavaThread* current, ObjectMonitorContentionMark& contention_mark); void exit(JavaThread* current, bool not_suspended = true); @@ -377,6 +376,7 @@ class ObjectMonitor : public CHeapObj { enum class TryLockResult { Interference = -1, HasOwner = 0, Success = 1 }; + bool TryLockWithContentionMark(JavaThread* locking_thread, ObjectMonitorContentionMark& contention_mark); TryLockResult TryLock(JavaThread* current); bool TrySpin(JavaThread* current); @@ -395,12 +395,17 @@ class ObjectMonitorContentionMark : StackObj { DEBUG_ONLY(friend class ObjectMonitor;) ObjectMonitor* _monitor; + bool _extended; NONCOPYABLE(ObjectMonitorContentionMark); public: explicit ObjectMonitorContentionMark(ObjectMonitor* monitor); ~ObjectMonitorContentionMark(); + + // Extends the contention scope beyond this objects lifetime. + // Requires manual decrement of the contentions counter. + void extend(); }; #endif // SHARE_RUNTIME_OBJECTMONITOR_HPP diff --git a/src/hotspot/share/runtime/objectMonitor.inline.hpp b/src/hotspot/share/runtime/objectMonitor.inline.hpp index d26c459b1b415..6d3c6ff24c38b 100644 --- a/src/hotspot/share/runtime/objectMonitor.inline.hpp +++ b/src/hotspot/share/runtime/objectMonitor.inline.hpp @@ -206,15 +206,32 @@ inline void ObjectMonitor::set_next_om(ObjectMonitor* new_value) { Atomic::store(&_next_om, new_value); } +// Block out deflation. inline ObjectMonitorContentionMark::ObjectMonitorContentionMark(ObjectMonitor* monitor) - : _monitor(monitor) { + : _monitor(monitor), _extended(false) { + // Contentions is incremented to a positive value as part of the + // contended enter protocol, which prevents the deflater thread from + // winning the last part of the 2-part async deflation + // protocol. See: ObjectMonitor::deflate_monitor() and + // ObjectMonitor::TryLockWithContentionMark(). _monitor->add_to_contentions(1); } inline ObjectMonitorContentionMark::~ObjectMonitorContentionMark() { + // Decrement contentions when the contention mark goes out of + // scope. This opens up for deflation, if the contention mark + // hasn't been extended. _monitor->add_to_contentions(-1); } +inline void ObjectMonitorContentionMark::extend() { + // Used by ObjectMonitor::TryLockWithContentionMark() to "extend the + // lifetime" of the contention mark. + assert(!_extended, "extending twice is probably a bad design"); + _monitor->add_to_contentions(1); + _extended = true; +} + inline oop ObjectMonitor::object_peek() const { if (_object.is_null()) { return nullptr; diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index 6ca7f42e038f5..e4d4e6aea0f8c 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -1963,6 +1963,26 @@ void SharedRuntime::monitor_exit_helper(oopDesc* obj, BasicLock* lock, JavaThrea assert(JavaThread::current() == current, "invariant"); // Exit must be non-blocking, and therefore no exceptions can be thrown. ExceptionMark em(current); + + // Check if C2_MacroAssembler::fast_unlock() or + // C2_MacroAssembler::fast_unlock_lightweight() unlocked an inflated + // monitor before going slow path. Since there is no safepoint + // polling when calling into the VM, we can be sure that the monitor + // hasn't been deallocated. + ObjectMonitor* m = current->unlocked_inflated_monitor(); + if (m != nullptr) { + assert(m->owner_raw() != current, "must be"); + current->clear_unlocked_inflated_monitor(); + + // We need to reacquire the lock before we can call ObjectSynchronizer::exit(). + if (!m->try_enter(current, /*check_for_recursion*/ false)) { + // Some other thread acquired the lock (or the monitor was + // deflated). Either way we are done. + current->dec_held_monitor_count(); + return; + } + } + // The object could become unlocked through a JNI call, which we have no other checks for. // Give a fatal message if CheckJNICalls. Otherwise we ignore it. if (obj->is_unlocked()) { diff --git a/test/micro/org/openjdk/bench/vm/lang/LockUnlock.java b/test/micro/org/openjdk/bench/vm/lang/LockUnlock.java index 3ed862e8218cd..39c8569532ec4 100644 --- a/test/micro/org/openjdk/bench/vm/lang/LockUnlock.java +++ b/test/micro/org/openjdk/bench/vm/lang/LockUnlock.java @@ -309,10 +309,11 @@ private synchronized int fact(int n) { } /** - * With two threads lockObject1 will be contended so should be - * inflated. + * With three threads lockObject1 will be contended so should be + * inflated. Three threads is also needed to ensure a high level + * of code coverage in the locking code. */ - @Threads(2) + @Threads(3) @Benchmark public void testContendedLock() { synchronized (lockObject1) { From cff420d8d3cfbbb729ee47b00c8fe38e410eab1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirik=20Bj=C3=B8rsn=C3=B8s?= Date: Mon, 30 Sep 2024 13:06:49 +0000 Subject: [PATCH 242/307] 8339711: ZipFile.Source.initCEN needlessly reads END header Reviewed-by: lancea, jpai, redestad --- .../share/classes/java/util/zip/ZipFile.java | 21 +++++++++++-------- .../util/zip/ZipFile/CenSizeTooLarge.java | 4 +++- .../util/zip/ZipFile/EndOfCenValidation.java | 6 ++++-- 3 files changed, 19 insertions(+), 12 deletions(-) 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 d54e6c1e4fcb9..43b2261f1c60a 100644 --- a/src/java.base/share/classes/java/util/zip/ZipFile.java +++ b/src/java.base/share/classes/java/util/zip/ZipFile.java @@ -63,6 +63,7 @@ import jdk.internal.access.JavaUtilZipFileAccess; import jdk.internal.access.JavaUtilJarAccess; import jdk.internal.access.SharedSecrets; +import jdk.internal.util.ArraysSupport; import jdk.internal.util.OperatingSystem; import jdk.internal.perf.PerfCounter; import jdk.internal.ref.CleanerFactory; @@ -1178,6 +1179,8 @@ private static class Source { // "META-INF/".length() private static final int META_INF_LEN = 9; private static final int[] EMPTY_META_VERSIONS = new int[0]; + // CEN size is limited to the maximum array size in the JDK + private static final int MAX_CEN_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; private final Key key; // the key in files private final @Stable ZipCoder zc; // ZIP coder used to decode/encode @@ -1185,7 +1188,7 @@ private static class Source { private int refs = 1; private RandomAccessFile zfile; // zfile of the underlying ZIP file - private byte[] cen; // CEN & ENDHDR + private byte[] cen; // CEN private long locpos; // position of first LOC header (usually 0) private byte[] comment; // ZIP file comment // list of meta entries in META-INF dir @@ -1241,7 +1244,7 @@ private int checkAndAddEntry(int pos, int index) // should not exceed 65,535 bytes per the PKWare APP.NOTE // 4.4.10, 4.4.11, & 4.4.12. Also check that current CEN header will // not exceed the length of the CEN array - if (headerSize > 0xFFFF || pos + headerSize > cen.length - ENDHDR) { + if (headerSize > 0xFFFF || pos + headerSize > cen.length) { zerror("invalid CEN header (bad header size)"); } @@ -1294,7 +1297,7 @@ private void checkExtraFields(int cenPos, int startingOffset, } // CEN Offset where this Extra field ends int extraEndOffset = startingOffset + extraFieldLen; - if (extraEndOffset > cen.length - ENDHDR) { + if (extraEndOffset > cen.length) { zerror("Invalid CEN header (extra data field size too long)"); } int currentOffset = startingOffset; @@ -1732,12 +1735,12 @@ private void initCEN(int knownTotal) throws IOException { if (locpos < 0) { zerror("invalid END header (bad central directory offset)"); } - // read in the CEN and END - if (end.cenlen + ENDHDR >= Integer.MAX_VALUE) { + // read in the CEN + if (end.cenlen > MAX_CEN_SIZE) { zerror("invalid END header (central directory size too large)"); } - cen = this.cen = new byte[(int)(end.cenlen + ENDHDR)]; - if (readFullyAt(cen, 0, cen.length, cenpos) != end.cenlen + ENDHDR) { + cen = this.cen = new byte[(int)end.cenlen]; + if (readFullyAt(cen, 0, cen.length, cenpos) != end.cenlen) { zerror("read CEN tables failed"); } this.total = end.centot; @@ -1766,7 +1769,7 @@ private void initCEN(int knownTotal) throws IOException { int idx = 0; // Index into the entries array int pos = 0; int entryPos = CENHDR; - int limit = cen.length - ENDHDR; + int limit = cen.length; manifestNum = 0; while (entryPos <= limit) { if (idx >= entriesLength) { @@ -1829,7 +1832,7 @@ private void initCEN(int knownTotal) throws IOException { } else { metaVersions = EMPTY_META_VERSIONS; } - if (pos + ENDHDR != cen.length) { + if (pos != cen.length) { zerror("invalid CEN header (bad header size)"); } } diff --git a/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java b/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java index 3a5430d0573e8..e3f0b20fce87c 100644 --- a/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java +++ b/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java @@ -23,10 +23,12 @@ /* @test * @bug 8272746 + * @modules java.base/jdk.internal.util * @summary Verify that ZipFile rejects a ZIP with a CEN size which does not fit in a Java byte array * @run junit CenSizeTooLarge */ +import jdk.internal.util.ArraysSupport; import org.junit.Before; import org.junit.Test; @@ -49,7 +51,7 @@ public class CenSizeTooLarge { 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; + static final int MAX_CEN_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; /** * From the APPNOTE.txt specification: diff --git a/test/jdk/java/util/zip/ZipFile/EndOfCenValidation.java b/test/jdk/java/util/zip/ZipFile/EndOfCenValidation.java index 51ed2c28c12c2..ec6542768c58f 100644 --- a/test/jdk/java/util/zip/ZipFile/EndOfCenValidation.java +++ b/test/jdk/java/util/zip/ZipFile/EndOfCenValidation.java @@ -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 @@ -23,10 +23,12 @@ /* @test * @bug 8272746 + * @modules java.base/jdk.internal.util * @summary Verify that ZipFile rejects files with CEN sizes exceeding the implementation limit * @run testng/othervm EndOfCenValidation */ +import jdk.internal.util.ArraysSupport; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; @@ -68,7 +70,7 @@ public class EndOfCenValidation { private static final int ENDSIZ = ZipFile.ENDSIZ; // Offset of CEN size field within ENDHDR private static final int ENDOFF = ZipFile.ENDOFF; // Offset of CEN offset field within ENDHDR // Maximum allowed CEN size allowed by ZipFile - private static int MAX_CEN_SIZE = Integer.MAX_VALUE - ENDHDR - 1; + private static int MAX_CEN_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; // Expected message when CEN size does not match file size private static final String INVALID_CEN_BAD_SIZE = "invalid END header (bad central directory size)"; From 860d49db22cf352eaf1b3b20fff43d090f0eebc8 Mon Sep 17 00:00:00 2001 From: Ramkumar Sunderbabu Date: Mon, 30 Sep 2024 13:43:40 +0000 Subject: [PATCH 243/307] 8211400: nsk.share.gc.Memory::getArrayLength returns wrong value Reviewed-by: kbarrett, tschatzl --- .../hotspot/jtreg/vmTestbase/nsk/share/gc/Memory.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/Memory.java b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/Memory.java index f5c70671e5e10..244bcf423c5bc 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/Memory.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/Memory.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 @@ -150,12 +150,9 @@ public static int getReferenceObjectSize() { * @return length of array */ public static int getArrayLength(long memory, long objectSize) { - int referenceSize = getReferenceSize(); int arrayExtraSize = getArrayExtraSize(); - return (int) Math.min( - (memory - arrayExtraSize) / (objectSize + referenceSize), - Integer.MAX_VALUE - ); + return (int) Math.min((memory - arrayExtraSize) / objectSize, + Integer.MAX_VALUE); } /** @@ -166,7 +163,7 @@ public static int getArrayLength(long memory, long objectSize) { * @return size of array */ public static long getArraySize(int length, long objectSize) { - return getObjectExtraSize() + length * (objectSize + getReferenceSize()); + return getArrayExtraSize() + length * objectSize; } /** From f1bf469b4ee07b48b629a126111e307d3cab7fd7 Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Mon, 30 Sep 2024 14:12:01 +0000 Subject: [PATCH 244/307] 8341199: Use ClassFile's new API loadConstant(int) Reviewed-by: liach, redestad --- .../java/lang/invoke/StringConcatFactory.java | 12 ++++++------ .../classes/java/lang/runtime/SwitchBootstraps.java | 2 +- .../classes/jdk/jfr/internal/EventClassBuilder.java | 2 +- .../jdk/jfr/internal/EventInstrumentation.java | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) 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 4fbbec1769364..97848e1fcb3e5 100644 --- a/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java +++ b/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java @@ -1526,7 +1526,7 @@ public void accept(CodeBuilder cb) { * length = length(this.length, arg0, arg1, ..., argN); */ if (staticConcat) { - cb.ldc(length); + cb.loadConstant(length); } else { cb.aload(thisSlot) .getfield(concatClass, "length", CD_int); @@ -1549,7 +1549,7 @@ public void accept(CodeBuilder cb) { * length -= suffix.length(); */ if (staticConcat) { - cb.ldc(constants[paramCount].length()) + cb.loadConstant(constants[paramCount].length()) .isub() .istore(lengthSlot); } else { @@ -1557,7 +1557,7 @@ public void accept(CodeBuilder cb) { .getfield(concatClass, "constants", CD_Array_String) .dup() .astore(constantsSlot) - .ldc(paramCount) + .loadConstant(paramCount) .aaload() .dup() .astore(suffixSlot) @@ -1572,7 +1572,7 @@ public void accept(CodeBuilder cb) { * buf = newArrayWithSuffix(suffix, length, coder) */ if (staticConcat) { - cb.ldc(constants[paramCount]); + cb.loadConstant(constants[paramCount]); } else { cb.aload(suffixSlot); } @@ -1759,10 +1759,10 @@ public void accept(CodeBuilder cb) { .loadLocal(kind, cb.parameterSlot(i)); if (staticConcat) { - cb.ldc(constants[i - 3]); + cb.loadConstant(constants[i - 3]); } else { cb.aload(constantsSlot) - .ldc(i - 4) + .loadConstant(i - 4) .aaload(); } diff --git a/src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java b/src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java index bfdb76e2ef1b6..f380cf1070d1d 100644 --- a/src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java +++ b/src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java @@ -659,7 +659,7 @@ private static Consumer generateTypeSwitchSkeleton(Class selecto MethodTypeDesc.of(ConstantDescs.CD_char)); cb.labelBinding(compare); - cb.ldc(integerLabel); + cb.loadConstant(integerLabel); cb.if_icmpne(next); } else if ((caseLabel instanceof Long || caseLabel instanceof Float || diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java index 523622084843c..1373c3ca4968f 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java @@ -84,7 +84,7 @@ private void buildSetMethod(ClassBuilder builder) { int index = 0; for (ValueDescriptor v : fields) { codeBuilder.iload(1); - codeBuilder.ldc(index); + codeBuilder.loadConstant(index); Label notEqual = codeBuilder.newLabel(); codeBuilder.if_icmpne(notEqual); codeBuilder.aload(0); // this diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java index 71dc97d114e2c..d962a535829ef 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java @@ -499,7 +499,7 @@ private void makeInstrumented() { // if (!settingsMethod(eventConfiguration.settingX)) goto fail; codeBuilder.aload(0); getEventConfiguration(codeBuilder); - codeBuilder.ldc(index); + codeBuilder.loadConstant(index); invokevirtual(codeBuilder, TYPE_EVENT_CONFIGURATION, METHOD_EVENT_CONFIGURATION_GET_SETTING); MethodTypeDesc mdesc = MethodTypeDesc.ofDescriptor("(" + sd.paramType().descriptorString() + ")Z"); codeBuilder.checkcast(sd.paramType()); From 4168faf54c0558a7cff4ef6ac643bbbfdea0cec3 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 30 Sep 2024 16:10:02 +0000 Subject: [PATCH 245/307] 8341100: Add index entries for terms used in java.lang.Class Reviewed-by: liach --- src/java.base/share/classes/java/lang/Class.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Class.java b/src/java.base/share/classes/java/lang/Class.java index 48ffeea5289ff..79cd57011b0ed 100644 --- a/src/java.base/share/classes/java/lang/Class.java +++ b/src/java.base/share/classes/java/lang/Class.java @@ -140,22 +140,24 @@ * }} * * It is also possible to get the {@code Class} object for a named - * class or interface (or for {@code void}) using a class literal. + * class or interface (or for {@code void}) using a class literal + * (JLS {@jls 15.8.2}). * For example: * * {@snippet lang="java" : - * System.out.println("The name of class Foo is: "+Foo.class.getName()); + * System.out.println("The name of class Foo is: " + Foo.class.getName()); // @highlight substring="Foo.class" * } * *

        Some methods of class {@code Class} expose whether the declaration of * a class or interface in Java source code was enclosed within * another declaration. Other methods describe how a class or interface - * is situated in a nest. A nest is a set of + * is situated in a {@index "nest"}. A nest is a set of * classes and interfaces, in the same run-time package, that * allow mutual access to their {@code private} members. - * The classes and interfaces are known as nestmates. + * The classes and interfaces are known as {@index "nestmates"} + * (JVMS {@jvms 4.7.29}). * One nestmate acts as the - * nest host, and enumerates the other nestmates which + * nest host (JVMS {@jvms 4.7.28}), and enumerates the other nestmates which * belong to the nest; each of them in turn records it as the nest host. * The classes and interfaces which belong to a nest, including its host, are * determined when @@ -167,7 +169,7 @@ *

        Hidden Classes

        * A class or interface created by the invocation of * {@link java.lang.invoke.MethodHandles.Lookup#defineHiddenClass(byte[], boolean, MethodHandles.Lookup.ClassOption...) - * Lookup::defineHiddenClass} is a {@linkplain Class#isHidden() hidden} + * Lookup::defineHiddenClass} is a {@linkplain Class#isHidden() hidden} * class or interface. * All kinds of class, including enum classes and record classes, may be * hidden classes; all kinds of interface, including annotation interfaces, @@ -216,7 +218,6 @@ * * @see java.lang.ClassLoader#defineClass(byte[], int, int) * @since 1.0 - * @jls 15.8.2 Class Literals */ public final class Class implements java.io.Serializable, GenericDeclaration, From 5586f83e34c2fe0bdc48daef8c456678cea55af1 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 30 Sep 2024 16:13:35 +0000 Subject: [PATCH 246/307] 8341064: Define anchor point and index term for "wrapper classes" Reviewed-by: prappo, liach --- .../share/classes/java/lang/Boolean.java | 10 ++-- .../share/classes/java/lang/Byte.java | 10 ++-- .../share/classes/java/lang/Character.java | 14 +++--- .../share/classes/java/lang/Double.java | 8 +-- .../share/classes/java/lang/Float.java | 8 +-- .../share/classes/java/lang/Integer.java | 7 +-- .../share/classes/java/lang/Long.java | 5 +- .../share/classes/java/lang/Short.java | 7 +-- .../share/classes/java/lang/package-info.java | 49 +++++++++++-------- .../classes/javax/lang/model/util/Types.java | 5 +- 10 files changed, 67 insertions(+), 56 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Boolean.java b/src/java.base/share/classes/java/lang/Boolean.java index ba88157dc923e..2c0925a979016 100644 --- a/src/java.base/share/classes/java/lang/Boolean.java +++ b/src/java.base/share/classes/java/lang/Boolean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved. * 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,10 +37,10 @@ import static java.lang.constant.ConstantDescs.CD_Boolean; /** - * The Boolean class wraps a value of the primitive type - * {@code boolean} in an object. An object of type - * {@code Boolean} contains a single field whose type is - * {@code boolean}. + * The {@code Boolean} class is the {@linkplain + * java.lang##wrapperClass wrapper class} for values of the primitive + * type {@code boolean}. An object of type {@code Boolean} contains a + * single field whose type is {@code boolean}. * *

        In addition, this class provides many methods for * converting a {@code boolean} to a {@code String} and a diff --git a/src/java.base/share/classes/java/lang/Byte.java b/src/java.base/share/classes/java/lang/Byte.java index 18502abf69c4d..ade75a7a99eeb 100644 --- a/src/java.base/share/classes/java/lang/Byte.java +++ b/src/java.base/share/classes/java/lang/Byte.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 @@ -39,10 +39,10 @@ import static java.lang.constant.ConstantDescs.DEFAULT_NAME; /** - * - * The {@code Byte} class wraps a value of primitive type {@code byte} - * in an object. An object of type {@code Byte} contains a single - * field whose type is {@code byte}. + * The {@code Byte} class is the {@linkplain + * java.lang##wrapperClass wrapper class} for values of the primitive + * type {@code byte}. An object of type {@code Byte} contains a + * single field whose type is {@code byte}. * *

        In addition, this class provides several methods for converting * a {@code byte} to a {@code String} and a {@code String} to a {@code diff --git a/src/java.base/share/classes/java/lang/Character.java b/src/java.base/share/classes/java/lang/Character.java index a829d71e11367..84db550d7cc4d 100644 --- a/src/java.base/share/classes/java/lang/Character.java +++ b/src/java.base/share/classes/java/lang/Character.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -43,12 +43,12 @@ import static java.lang.constant.ConstantDescs.DEFAULT_NAME; /** - * The {@code Character} class wraps a value of the primitive - * type {@code char} in an object. An object of class - * {@code Character} contains a single field whose type is - * {@code char}. - *

        - * In addition, this class provides a large number of static methods for + * The {@code Character} class is the {@linkplain + * java.lang##wrapperClass wrapper class} for values of the primitive + * type {@code char}. An object of type {@code Character} contains a + * single field whose type is {@code char}. + * + *

        In addition, this class provides a large number of static methods for * determining a character's category (lowercase letter, digit, etc.) * and for converting characters from uppercase to lowercase and vice * versa. diff --git a/src/java.base/share/classes/java/lang/Double.java b/src/java.base/share/classes/java/lang/Double.java index e789a6777175e..68fff6a2fbdd2 100644 --- a/src/java.base/share/classes/java/lang/Double.java +++ b/src/java.base/share/classes/java/lang/Double.java @@ -36,10 +36,10 @@ import jdk.internal.vm.annotation.IntrinsicCandidate; /** - * The {@code Double} class wraps a value of the primitive type - * {@code double} in an object. An object of type - * {@code Double} contains a single field whose type is - * {@code double}. + * The {@code Double} class is the {@linkplain + * java.lang##wrapperClass wrapper class} for values of the primitive + * type {@code double}. An object of type {@code Double} contains a + * single field whose type is {@code double}. * *

        In addition, this class provides several methods for converting a * {@code double} to a {@code String} and a diff --git a/src/java.base/share/classes/java/lang/Float.java b/src/java.base/share/classes/java/lang/Float.java index 02b6600777331..470eb71cf701f 100644 --- a/src/java.base/share/classes/java/lang/Float.java +++ b/src/java.base/share/classes/java/lang/Float.java @@ -36,10 +36,10 @@ import jdk.internal.vm.annotation.IntrinsicCandidate; /** - * The {@code Float} class wraps a value of primitive type - * {@code float} in an object. An object of type - * {@code Float} contains a single field whose type is - * {@code float}. + * The {@code Float} class is the {@linkplain + * java.lang##wrapperClass wrapper class} for values of the primitive + * type {@code float}. An object of type {@code Float} contains a + * single field whose type is {@code float}. * *

        In addition, this class provides several methods for converting a * {@code float} to a {@code String} and a diff --git a/src/java.base/share/classes/java/lang/Integer.java b/src/java.base/share/classes/java/lang/Integer.java index fccdd697c7238..eab0a942d9a9a 100644 --- a/src/java.base/share/classes/java/lang/Integer.java +++ b/src/java.base/share/classes/java/lang/Integer.java @@ -45,9 +45,10 @@ import static java.lang.String.UTF16; /** - * The {@code Integer} class wraps a value of the primitive type - * {@code int} in an object. An object of type {@code Integer} - * contains a single field whose type is {@code int}. + * The {@code Integer} class is the {@linkplain + * java.lang##wrapperClass wrapper class} for values of the primitive + * type {@code int}. An object of type {@code Integer} contains a + * single field whose type is {@code int}. * *

        In addition, this class provides several methods for converting * an {@code int} to a {@code String} and a {@code String} to an diff --git a/src/java.base/share/classes/java/lang/Long.java b/src/java.base/share/classes/java/lang/Long.java index ff34da232f9ab..f86e1622b3836 100644 --- a/src/java.base/share/classes/java/lang/Long.java +++ b/src/java.base/share/classes/java/lang/Long.java @@ -45,8 +45,9 @@ import static java.lang.String.UTF16; /** - * The {@code Long} class wraps a value of the primitive type {@code - * long} in an object. An object of type {@code Long} contains a + * The {@code Long} class is the {@linkplain + * java.lang##wrapperClass wrapper class} for values of the primitive + * type {@code long}. An object of type {@code Long} contains a * single field whose type is {@code long}. * *

        In addition, this class provides several methods for converting diff --git a/src/java.base/share/classes/java/lang/Short.java b/src/java.base/share/classes/java/lang/Short.java index 6a148d1edac00..ec792de47e2ac 100644 --- a/src/java.base/share/classes/java/lang/Short.java +++ b/src/java.base/share/classes/java/lang/Short.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 @@ -39,8 +39,9 @@ import static java.lang.constant.ConstantDescs.DEFAULT_NAME; /** - * The {@code Short} class wraps a value of primitive type {@code - * short} in an object. An object of type {@code Short} contains a + * The {@code Short} class is the {@linkplain + * java.lang##wrapperClass wrapper class} for values of the primitive + * type {@code short}. An object of type {@code Short} contains a * single field whose type is {@code short}. * *

        In addition, this class provides several methods for converting diff --git a/src/java.base/share/classes/java/lang/package-info.java b/src/java.base/share/classes/java/lang/package-info.java index 882a610c1a08e..0484ecb29527d 100644 --- a/src/java.base/share/classes/java/lang/package-info.java +++ b/src/java.base/share/classes/java/lang/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, 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 @@ -25,35 +25,42 @@ /** * Provides classes that are fundamental to the design of the Java - * programming language. The most important classes are {@code - * Object}, which is the root of the class hierarchy, and {@code + * programming language. The most important classes are {@link + * Object}, which is the root of the class hierarchy, and {@link * Class}, instances of which represent classes at run time. * *

        Frequently it is necessary to represent a value of primitive - * type as if it were an object. The wrapper classes {@code Boolean}, - * {@code Character}, {@code Integer}, {@code Long}, {@code Float}, - * and {@code Double} serve this purpose. An object of type {@code - * Double}, for example, contains a field whose type is double, - * representing that value in such a way that a reference to it can be - * stored in a variable of reference type. These classes also provide - * a number of methods for converting among primitive values, as well - * as supporting such standard methods as equals and hashCode. The - * {@code Void} class is a non-instantiable class that holds a - * reference to a {@code Class} object representing the type void. + * type as if it were an object.The {@index + * "wrapper classes"} {@link Boolean}, {@link Byte}, {@link + * Character}, {@link Short}, {@link Integer}, {@link Long}, {@link + * Float}, and {@link Double} serve this purpose. An object of type + * {@code Double}, for example, contains a field whose type is {@code + * double}, representing that value in such a way that a reference to + * it can be stored in a variable of reference type. As discussed in + * The Java Language Specification, the wrapper classes + * are involved in boxing (JLS {@jls 5.1.7}) and unboxing (JLS {@jls + * 5.1.8}) conversions. These classes provide a number of methods for + * converting among primitive values, as well as methods supporting + * such standard functionality as {@code equals} and {@code hashCode}. + * The {@link Void} class is a non-instantiable class that holds a + * reference to a {@code Class} object representing the type {@code + * void}. * - *

        The class {@code Math} provides commonly used mathematical - * functions such as sine, cosine, and square root. The classes {@code - * String}, {@code StringBuffer}, and {@code StringBuilder} similarly - * provide commonly used operations on character strings. + *

        The class {@link Math} provides commonly used mathematical + * functions such as {@linkplain Math#sin(double) sine}, {@linkplain + * Math#cos(double) cosine}, and {@linkplain Math#sqrt(double) square + * root}. The classes {@link String}, {@link StringBuffer}, and {@link + * StringBuilder} similarly provide commonly used operations on + * character strings. * - *

        Classes {@code ClassLoader}, {@code Process}, {@code - * ProcessBuilder}, {@code Runtime}, {@code SecurityManager}, and - * {@code System} provide "system operations" that manage the dynamic + *

        Classes {@link ClassLoader}, {@link Process}, {@link + * ProcessBuilder}, {@link Runtime}, {@link SecurityManager}, and + * {@link System} provide "system operations" that manage the dynamic * loading of classes, creation of external processes, host * environment inquiries such as the time of day, and enforcement of * security policies. * - *

        Class {@code Throwable} encompasses objects that may be thrown + *

        Class {@link Throwable} encompasses objects that may be thrown * by the {@code throw} statement. Subclasses of {@code Throwable} * represent errors and exceptions. * 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 232e15a84bd6a..ce83cda405862 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 @@ -205,8 +205,9 @@ public interface Types { * @return the type of an unboxed value of type {@code t} * * @throws IllegalArgumentException if the given type has no - * unboxing conversion. Only types for the wrapper classes - * have an unboxing conversion. + * unboxing conversion. Only types for the {@linkplain + * java.lang##wrapperClasses wrapper classes} have an + * unboxing conversion. * @jls 5.1.8 Unboxing Conversion */ PrimitiveType unboxedType(TypeMirror t); From a6b318863fa2775b6381977875b4f466af47beb8 Mon Sep 17 00:00:00 2001 From: Smita Kamath Date: Mon, 30 Sep 2024 17:00:13 +0000 Subject: [PATCH 247/307] 8337632: AES-GCM Algorithm optimization for x86_64 Reviewed-by: jbhateja, sviswanathan --- src/hotspot/cpu/x86/assembler_x86.cpp | 29 + src/hotspot/cpu/x86/assembler_x86.hpp | 3 + src/hotspot/cpu/x86/stubGenerator_x86_64.hpp | 21 +- .../cpu/x86/stubGenerator_x86_64_aes.cpp | 1217 ++++++++++------- .../cpu/x86/stubGenerator_x86_64_ghash.cpp | 7 +- .../crypto/provider/GaloisCounterMode.java | 2 +- .../bench/javax/crypto/full/AESGCMBench.java | 2 +- .../bench/javax/crypto/full/BenchBase.java | 2 +- 8 files changed, 778 insertions(+), 505 deletions(-) diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index 07476ab342f6d..c1679cd111f5a 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -1919,6 +1919,11 @@ void Assembler::cmpb(Address dst, int imm8) { emit_int8(imm8); } +void Assembler::cmpb(Register dst, int imm8) { + prefix(dst); + emit_arith_b(0x80, 0xF8, dst, imm8); +} + void Assembler::cmpl(Address dst, int32_t imm32) { InstructionMark im(this); prefix(dst); @@ -9667,6 +9672,15 @@ void Assembler::vinserti64x4(XMMRegister dst, XMMRegister nds, XMMRegister src, emit_int24(0x3A, (0xC0 | encode), imm8 & 0x01); } +void Assembler::evinserti64x2(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8, int vector_len) { + assert(VM_Version::supports_avx512dq(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int24(0x38, (0xC0 | encode), imm8 & 0x03); +} + // vinsertf forms @@ -11731,6 +11745,21 @@ void Assembler::vbroadcastf128(XMMRegister dst, Address src, int vector_len) { emit_operand(dst, src, 0); } +void Assembler::evbroadcastf64x2(XMMRegister dst, Address src, int vector_len) { + assert(VM_Version::supports_avx512dq(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + assert(dst != xnoreg, "sanity"); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_T2, /* input_size_in_bits */ EVEX_64bit); + attributes.set_is_evex_instruction(); + // swap src<->dst for encoding + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x1A); + emit_operand(dst, src, 0); +} + + // gpr source broadcast forms // duplicate 1-byte integer data from src into programmed locations in dest : requires AVX512BW and AVX512VL diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index 62700d1fa1bd5..eace7bb9cc169 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -1239,6 +1239,7 @@ class Assembler : public AbstractAssembler { void cmpb(Address dst, int imm8); void cmpb(Address dst, Register reg); void cmpb(Register reg, Address dst); + void cmpb(Register reg, int imm8); void cmpl(Address dst, int32_t imm32); void cmpl(Register dst, int32_t imm32); @@ -2986,6 +2987,7 @@ class Assembler : public AbstractAssembler { void vinserti32x4(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8); void vinserti32x4(XMMRegister dst, XMMRegister nds, Address src, uint8_t imm8); void vinserti64x4(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8); + void evinserti64x2(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8, int vector_len); // vinsertf forms void vinsertf128(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8); @@ -3035,6 +3037,7 @@ class Assembler : public AbstractAssembler { void vbroadcastsd(XMMRegister dst, XMMRegister src, int vector_len); void vbroadcastsd(XMMRegister dst, Address src, int vector_len); void vbroadcastf128(XMMRegister dst, Address src, int vector_len); + void evbroadcastf64x2(XMMRegister dst, Address src, int vector_len); // gpr sourced byte/word/dword/qword replicate void evpbroadcastb(XMMRegister dst, Register src, int vector_len); diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp index 0a81da4f7c957..71777fbfffea2 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp @@ -376,11 +376,22 @@ class StubGenerator: public StubCodeGenerator { void roundDec(XMMRegister key, int rnum); void lastroundDec(XMMRegister key, int rnum); void gfmul_avx512(XMMRegister ghash, XMMRegister hkey); - void generateHtbl_48_block_zmm(Register htbl, Register avx512_subkeyHtbl, Register rscratch); - void ghash16_encrypt16_parallel(Register key, Register subkeyHtbl, XMMRegister ctr_blockx, - XMMRegister aad_hashx, Register in, Register out, Register data, Register pos, bool reduction, - XMMRegister addmask, bool no_ghash_input, Register rounds, Register ghash_pos, - bool final_reduction, int index, XMMRegister counter_inc_mask); + void ghash16_encrypt_parallel16_avx512(Register in, Register out, Register ct, Register pos, Register avx512_subkeyHtbl, + Register CTR_CHECK, Register NROUNDS, Register key, XMMRegister CTR, XMMRegister GHASH, + XMMRegister ADDBE_4x4, XMMRegister ADDBE_1234, XMMRegister ADD_1234, XMMRegister SHUF_MASK, + bool hk_broadcast, bool is_hash_start, bool do_hash_reduction, bool do_hash_hxor, + bool no_ghash_in, int ghashin_offset, int aesout_offset, int hashkey_offset); + void generateHtbl_32_blocks_avx512(Register htbl, Register avx512_htbl); + void initial_blocks_16_avx512(Register in, Register out, Register ct, Register pos, Register key, Register avx512_subkeyHtbl, + Register CTR_CHECK, Register rounds, XMMRegister CTR, XMMRegister GHASH, XMMRegister ADDBE_4x4, + XMMRegister ADDBE_1234, XMMRegister ADD_1234, XMMRegister SHUF_MASK, int stack_offset); + void gcm_enc_dec_last_avx512(Register len, Register in, Register pos, XMMRegister HASH, XMMRegister SHUFM, Register subkeyHtbl, + int ghashin_offset, int hashkey_offset, bool start_ghash, bool do_reduction); + void ghash16_avx512(bool start_ghash, bool do_reduction, bool uload_shuffle, bool hk_broadcast, bool do_hxor, + Register in, Register pos, Register subkeyHtbl, XMMRegister HASH, XMMRegister SHUFM, int in_offset, + int in_disp, int displacement, int hashkey_offset); + void aesgcm_avx512(Register in, Register len, Register ct, Register out, Register key, + Register state, Register subkeyHtbl, Register avx512_subkeyHtbl, Register counter); // AVX2 AES-GCM related functions void initial_blocks_avx2(XMMRegister ctr, Register rounds, Register key, Register len, Register in, Register out, Register ct, XMMRegister aad_hashx, Register pos); diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp index 9744169498c8b..f14d368c376e1 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2019, 2023, Intel Corporation. All rights reserved. +* Copyright (c) 2019, 2024, Intel Corporation. All rights reserved. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -172,6 +172,38 @@ static address ghash_polynomial_two_one_addr() { return (address)GHASH_POLYNOMIAL_TWO_ONE; } +// This mask is used for incrementing counter value +ATTRIBUTE_ALIGNED(64) static const uint64_t COUNTER_MASK_ADDBE_4444[] = { + 0x0000000000000000ULL, 0x0400000000000000ULL, + 0x0000000000000000ULL, 0x0400000000000000ULL, + 0x0000000000000000ULL, 0x0400000000000000ULL, + 0x0000000000000000ULL, 0x0400000000000000ULL, +}; +static address counter_mask_addbe_4444_addr() { + return (address)COUNTER_MASK_ADDBE_4444; +} + +// This mask is used for incrementing counter value +ATTRIBUTE_ALIGNED(64) static const uint64_t COUNTER_MASK_ADDBE_1234[] = { + 0x0000000000000000ULL, 0x0100000000000000ULL, + 0x0000000000000000ULL, 0x0200000000000000ULL, + 0x0000000000000000ULL, 0x0300000000000000ULL, + 0x0000000000000000ULL, 0x0400000000000000ULL, +}; +static address counter_mask_addbe_1234_addr() { + return (address)COUNTER_MASK_ADDBE_1234; +} + +// This mask is used for incrementing counter value +ATTRIBUTE_ALIGNED(64) static const uint64_t COUNTER_MASK_ADD_1234[] = { + 0x0000000000000001ULL, 0x0000000000000000ULL, + 0x0000000000000002ULL, 0x0000000000000000ULL, + 0x0000000000000003ULL, 0x0000000000000000ULL, + 0x0000000000000004ULL, 0x0000000000000000ULL, +}; +static address counter_mask_add_1234_addr() { + return (address)COUNTER_MASK_ADD_1234; +} // AES intrinsic stubs @@ -209,10 +241,10 @@ void StubGenerator::generate_aes_stubs() { // len = rdx (c_rarg1) | rdi (c_rarg1) // ct = r8 (c_rarg2) | rdx (c_rarg2) // out = r9 (c_rarg3) | rcx (c_rarg3) -// key = r10 | r8 (c_rarg4) -// state = r13 | r9 (c_rarg5) -// subkeyHtbl = r14 | r11 -// counter = rsi | r12 +// key = rsi | r8 (c_rarg4) +// state = rdi | r9 (c_rarg5) +// subkeyHtbl = r10 | r10 +// counter = r11 | r11 // // Output: // rax - number of processed bytes @@ -230,31 +262,31 @@ address StubGenerator::generate_galoisCounterMode_AESCrypt() { const Register key = c_rarg4; const Register state = c_rarg5; const Address subkeyH_mem(rbp, 2 * wordSize); - const Register subkeyHtbl = r11; - const Register avx512_subkeyHtbl = r13; + const Register subkeyHtbl = r10; + const Register avx512_subkeyHtbl = r12; const Address counter_mem(rbp, 3 * wordSize); - const Register counter = r12; + const Register counter = r11; #else const Address key_mem(rbp, 6 * wordSize); - const Register key = r10; + const Register key = rsi; const Address state_mem(rbp, 7 * wordSize); - const Register state = r13; + const Register state = rdi; const Address subkeyH_mem(rbp, 8 * wordSize); - const Register subkeyHtbl = r14; + const Register subkeyHtbl = r10; const Register avx512_subkeyHtbl = r12; const Address counter_mem(rbp, 9 * wordSize); - const Register counter = rsi; + const Register counter = r11; #endif __ enter(); // Save state before entering routine - __ push(r12); - __ push(r13); - __ push(r14); - __ push(r15); - __ push(rbx); + __ push(r12);//holds pointer to avx512_subkeyHtbl + __ push(r14);//holds CTR_CHECK value to check for overflow + __ push(r15);//holds number of rounds + __ push(rbx);//scratch register #ifdef _WIN64 // on win64, fill len_reg from stack position __ push(rsi); + __ push(rdi); __ movptr(key, key_mem); __ movptr(state, state_mem); #endif @@ -262,24 +294,24 @@ address StubGenerator::generate_galoisCounterMode_AESCrypt() { __ movptr(counter, counter_mem); // Align stack __ andq(rsp, -64); - __ subptr(rsp, 96 * longSize); // Create space on the stack for htbl entries + __ subptr(rsp, 200 * longSize); // Create space on the stack for 64 htbl entries and 8 zmm AES entries __ movptr(avx512_subkeyHtbl, rsp); - aesgcm_encrypt(in, len, ct, out, key, state, subkeyHtbl, avx512_subkeyHtbl, counter); + aesgcm_avx512(in, len, ct, out, key, state, subkeyHtbl, avx512_subkeyHtbl, counter); __ vzeroupper(); // Restore state before leaving routine #ifdef _WIN64 __ lea(rsp, Address(rbp, -6 * wordSize)); + __ pop(rdi); __ pop(rsi); #else - __ lea(rsp, Address(rbp, -5 * wordSize)); + __ lea(rsp, Address(rbp, -4 * wordSize)); #endif __ pop(rbx); __ pop(r15); __ pop(r14); - __ pop(r13); __ pop(r12); __ leave(); // required for proper stackwalking of RuntimeStub frame @@ -2708,87 +2740,100 @@ void StubGenerator::gfmul_avx512(XMMRegister GH, XMMRegister HK) { __ vpternlogq(GH, 0x96, TMP1, TMP2, Assembler::AVX_512bit); } -void StubGenerator::generateHtbl_48_block_zmm(Register htbl, Register avx512_htbl, Register rscratch) { +// Holds 64 Htbl entries, 32 HKey and 32 HkKey (derived from HKey) +void StubGenerator::generateHtbl_32_blocks_avx512(Register htbl, Register avx512_htbl) { const XMMRegister HK = xmm6; - const XMMRegister ZT5 = xmm4; - const XMMRegister ZT7 = xmm7; - const XMMRegister ZT8 = xmm8; - - Label GFMUL_AVX512; + const XMMRegister ZT1 = xmm0, ZT2 = xmm1, ZT3 = xmm2, ZT4 = xmm3; + const XMMRegister ZT5 = xmm4, ZT6 = xmm5, ZT7 = xmm7, ZT8 = xmm8; + const XMMRegister ZT10 = xmm10, ZT11 = xmm11, ZT12 = xmm12; __ movdqu(HK, Address(htbl, 0)); - __ movdqu(xmm10, ExternalAddress(ghash_long_swap_mask_addr()), rscratch); - __ vpshufb(HK, HK, xmm10, Assembler::AVX_128bit); - - __ movdqu(xmm11, ExternalAddress(ghash_polynomial_addr()), rscratch); - __ movdqu(xmm12, ExternalAddress(ghash_polynomial_two_one_addr()), rscratch); + __ movdqu(ZT10, ExternalAddress(ghash_long_swap_mask_addr()), r15); + __ vpshufb(HK, HK, ZT10, Assembler::AVX_128bit); + __ movdqu(ZT11, ExternalAddress(ghash_polynomial_addr()), r15); + __ movdqu(ZT12, ExternalAddress(ghash_polynomial_two_one_addr()), r15); // Compute H ^ 2 from the input subkeyH - __ movdqu(xmm2, xmm6); - __ vpsllq(xmm6, xmm6, 1, Assembler::AVX_128bit); - __ vpsrlq(xmm2, xmm2, 63, Assembler::AVX_128bit); - __ movdqu(xmm1, xmm2); - __ vpslldq(xmm2, xmm2, 8, Assembler::AVX_128bit); - __ vpsrldq(xmm1, xmm1, 8, Assembler::AVX_128bit); - __ vpor(xmm6, xmm6, xmm2, Assembler::AVX_128bit); + __ movdqu(ZT3, HK); + __ vpsllq(HK, HK, 1, Assembler::AVX_128bit); + __ vpsrlq(ZT3, ZT3, 63, Assembler::AVX_128bit); + __ movdqu(ZT2, ZT3); + __ vpslldq(ZT3, ZT3, 8, Assembler::AVX_128bit); + __ vpsrldq(ZT2, ZT2, 8, Assembler::AVX_128bit); + __ vpor(HK, HK, ZT3, Assembler::AVX_128bit); + __ vpshufd(ZT3, ZT2, 0x24, Assembler::AVX_128bit); + __ vpcmpeqd(ZT3, ZT3, ZT12, Assembler::AVX_128bit); + __ vpand(ZT3, ZT3, ZT11, Assembler::AVX_128bit); + __ vpxor(HK, HK, ZT3, Assembler::AVX_128bit); + __ movdqu(Address(avx512_htbl, 16 * 31), HK); // H ^ 2 - __ vpshufd(xmm2, xmm1, 0x24, Assembler::AVX_128bit); - __ vpcmpeqd(xmm2, xmm2, xmm12, Assembler::AVX_128bit); - __ vpand(xmm2, xmm2, xmm11, Assembler::AVX_128bit); - __ vpxor(xmm6, xmm6, xmm2, Assembler::AVX_128bit); - __ movdqu(Address(avx512_htbl, 16 * 47), xmm6); // H ^ 2 - // Compute the remaining three powers of H using XMM registers and all following powers using ZMM __ movdqu(ZT5, HK); - __ vinserti32x4(ZT7, ZT7, HK, 3); + __ evinserti64x2(ZT7, ZT7, HK, 3, Assembler::AVX_512bit); + //calculate HashKey ^ 2 << 1 mod poly gfmul_avx512(ZT5, HK); - __ movdqu(Address(avx512_htbl, 16 * 46), ZT5); // H ^ 2 * 2 - __ vinserti32x4(ZT7, ZT7, ZT5, 2); + __ movdqu(Address(avx512_htbl, 16 * 30), ZT5); + __ evinserti64x2(ZT7, ZT7, ZT5, 2, Assembler::AVX_512bit); + //calculate HashKey ^ 3 << 1 mod poly gfmul_avx512(ZT5, HK); - __ movdqu(Address(avx512_htbl, 16 * 45), ZT5); // H ^ 2 * 3 - __ vinserti32x4(ZT7, ZT7, ZT5, 1); + __ movdqu(Address(avx512_htbl, 16 * 29), ZT5); + __ evinserti64x2(ZT7, ZT7, ZT5, 1, Assembler::AVX_512bit); + //calculate HashKey ^ 4 << 1 mod poly gfmul_avx512(ZT5, HK); - __ movdqu(Address(avx512_htbl, 16 * 44), ZT5); // H ^ 2 * 4 - __ vinserti32x4(ZT7, ZT7, ZT5, 0); - - __ evshufi64x2(ZT5, ZT5, ZT5, 0x00, Assembler::AVX_512bit); - __ evmovdquq(ZT8, ZT7, Assembler::AVX_512bit); - gfmul_avx512(ZT7, ZT5); - __ evmovdquq(Address(avx512_htbl, 16 * 40), ZT7, Assembler::AVX_512bit); - __ evshufi64x2(ZT5, ZT7, ZT7, 0x00, Assembler::AVX_512bit); - gfmul_avx512(ZT8, ZT5); - __ evmovdquq(Address(avx512_htbl, 16 * 36), ZT8, Assembler::AVX_512bit); + __ movdqu(Address(avx512_htbl, 16 * 28), ZT5); + __ evinserti64x2(ZT7, ZT7, ZT5, 0, Assembler::AVX_512bit); + // ZT5 amd ZT7 to be cleared(hash key) + //calculate HashKeyK = HashKey x POLY + __ evmovdquq(xmm11, ExternalAddress(ghash_polynomial_addr()), Assembler::AVX_512bit, r15); + __ evpclmulqdq(ZT1, ZT7, xmm11, 0x10, Assembler::AVX_512bit); + __ vpshufd(ZT2, ZT7, 78, Assembler::AVX_512bit); + __ evpxorq(ZT1, ZT1, ZT2, Assembler::AVX_512bit); + __ evmovdquq(Address(avx512_htbl, 16 * 60), ZT1, Assembler::AVX_512bit); + //**ZT1 amd ZT2 to be cleared(hash key) + + //switch to 4x128 - bit computations now + __ evshufi64x2(ZT5, ZT5, ZT5, 0x00, Assembler::AVX_512bit); //;; broadcast HashKey ^ 4 across all ZT5 + __ evmovdquq(ZT8, ZT7, Assembler::AVX_512bit);//; save HashKey ^ 4 to HashKey ^ 1 in ZT8 + //**ZT8 to be cleared(hash key) + + //calculate HashKey ^ 5 << 1 mod poly, HashKey ^ 6 << 1 mod poly, ... HashKey ^ 8 << 1 mod poly gfmul_avx512(ZT7, ZT5); - __ evmovdquq(Address(avx512_htbl, 16 * 32), ZT7, Assembler::AVX_512bit); - gfmul_avx512(ZT8, ZT5); - __ evmovdquq(Address(avx512_htbl, 16 * 28), ZT8, Assembler::AVX_512bit); - gfmul_avx512(ZT7, ZT5); - __ evmovdquq(Address(avx512_htbl, 16 * 24), ZT7, Assembler::AVX_512bit); - gfmul_avx512(ZT8, ZT5); - __ evmovdquq(Address(avx512_htbl, 16 * 20), ZT8, Assembler::AVX_512bit); - gfmul_avx512(ZT7, ZT5); - __ evmovdquq(Address(avx512_htbl, 16 * 16), ZT7, Assembler::AVX_512bit); - gfmul_avx512(ZT8, ZT5); - __ evmovdquq(Address(avx512_htbl, 16 * 12), ZT8, Assembler::AVX_512bit); - gfmul_avx512(ZT7, ZT5); - __ evmovdquq(Address(avx512_htbl, 16 * 8), ZT7, Assembler::AVX_512bit); - gfmul_avx512(ZT8, ZT5); - __ evmovdquq(Address(avx512_htbl, 16 * 4), ZT8, Assembler::AVX_512bit); - gfmul_avx512(ZT7, ZT5); - __ evmovdquq(Address(avx512_htbl, 16 * 0), ZT7, Assembler::AVX_512bit); - __ ret(0); -} - -#define vclmul_reduce(out, poly, hi128, lo128, tmp0, tmp1) \ -__ evpclmulqdq(tmp0, poly, lo128, 0x01, Assembler::AVX_512bit); \ -__ vpslldq(tmp0, tmp0, 8, Assembler::AVX_512bit); \ -__ evpxorq(tmp0, lo128, tmp0, Assembler::AVX_512bit); \ -__ evpclmulqdq(tmp1, poly, tmp0, 0x00, Assembler::AVX_512bit); \ -__ vpsrldq(tmp1, tmp1, 4, Assembler::AVX_512bit); \ -__ evpclmulqdq(out, poly, tmp0, 0x10, Assembler::AVX_512bit); \ -__ vpslldq(out, out, 4, Assembler::AVX_512bit); \ -__ vpternlogq(out, 0x96, tmp1, hi128, Assembler::AVX_512bit); \ + __ evmovdquq(Address(avx512_htbl, 16 * 24), ZT7, Assembler::AVX_512bit);//; HashKey ^ 8 to HashKey ^ 5 in ZT7 now + + //calculate HashKeyX = HashKey x POLY + __ evpclmulqdq(ZT1, ZT7, xmm11, 0x10, Assembler::AVX_512bit); + __ vpshufd(ZT2, ZT7, 78, Assembler::AVX_512bit); + __ evpxorq(ZT1, ZT1, ZT2, Assembler::AVX_512bit); + __ evmovdquq(Address(avx512_htbl, 16 * 56), ZT1, Assembler::AVX_512bit); + + __ evshufi64x2(ZT5, ZT7, ZT7, 0x00, Assembler::AVX_512bit);//;; broadcast HashKey ^ 8 across all ZT5 + + for (int i = 20, j = 52; i > 0;) { + gfmul_avx512(ZT8, ZT5); + __ evmovdquq(Address(avx512_htbl, 16 * i), ZT8, Assembler::AVX_512bit); + //calculate HashKeyK = HashKey x POLY + __ evpclmulqdq(ZT1, ZT8, xmm11, 0x10, Assembler::AVX_512bit); + __ vpshufd(ZT2, ZT8, 78, Assembler::AVX_512bit); + __ evpxorq(ZT1, ZT1, ZT2, Assembler::AVX_512bit); + __ evmovdquq(Address(avx512_htbl, 16 * j), ZT1, Assembler::AVX_512bit); + + i -= 4; + j -= 4; + //compute HashKey ^ (8 + n), HashKey ^ (7 + n), ... HashKey ^ (5 + n) + gfmul_avx512(ZT7, ZT5); + __ evmovdquq(Address(avx512_htbl, 16 * i), ZT7, Assembler::AVX_512bit); + + //calculate HashKeyK = HashKey x POLY + __ evpclmulqdq(ZT1, ZT7, xmm11, 0x10, Assembler::AVX_512bit); + __ vpshufd(ZT2, ZT7, 78, Assembler::AVX_512bit); + __ evpxorq(ZT1, ZT1, ZT2, Assembler::AVX_512bit); + __ evmovdquq(Address(avx512_htbl, 16 * j), ZT1, Assembler::AVX_512bit); + + i -= 4; + j -= 4; + } + } #define vhpxori4x128(reg, tmp) \ __ vextracti64x4(tmp, reg, 1); \ @@ -2820,21 +2865,17 @@ __ evmovdquq(dst2, Address(src, position, Address::times_1, 1 * 64), Assembler:: __ evmovdquq(dst3, Address(src, position, Address::times_1, 2 * 64), Assembler::AVX_512bit); \ __ evmovdquq(dst4, Address(src, position, Address::times_1, 3 * 64), Assembler::AVX_512bit); \ -#define carrylessMultiply(dst00, dst01, dst10, dst11, ghdata, hkey) \ -__ evpclmulqdq(dst00, ghdata, hkey, 0x00, Assembler::AVX_512bit); \ -__ evpclmulqdq(dst01, ghdata, hkey, 0x01, Assembler::AVX_512bit); \ -__ evpclmulqdq(dst10, ghdata, hkey, 0x10, Assembler::AVX_512bit); \ -__ evpclmulqdq(dst11, ghdata, hkey, 0x11, Assembler::AVX_512bit); \ - -#define shuffleExorRnd1Key(dst0, dst1, dst2, dst3, shufmask, rndkey) \ -__ vpshufb(dst0, dst0, shufmask, Assembler::AVX_512bit); \ -__ evpxorq(dst0, dst0, rndkey, Assembler::AVX_512bit); \ -__ vpshufb(dst1, dst1, shufmask, Assembler::AVX_512bit); \ -__ evpxorq(dst1, dst1, rndkey, Assembler::AVX_512bit); \ -__ vpshufb(dst2, dst2, shufmask, Assembler::AVX_512bit); \ -__ evpxorq(dst2, dst2, rndkey, Assembler::AVX_512bit); \ -__ vpshufb(dst3, dst3, shufmask, Assembler::AVX_512bit); \ -__ evpxorq(dst3, dst3, rndkey, Assembler::AVX_512bit); \ +#define carrylessMultiply(dst00, dst01, dst10, dst11, ghdata, hkey2, hkey1) \ +__ evpclmulqdq(dst00, ghdata, hkey2, 0x00, Assembler::AVX_512bit); \ +__ evpclmulqdq(dst01, ghdata, hkey2, 0x10, Assembler::AVX_512bit); \ +__ evpclmulqdq(dst10, ghdata, hkey1, 0x01, Assembler::AVX_512bit); \ +__ evpclmulqdq(dst11, ghdata, hkey1, 0x11, Assembler::AVX_512bit); \ + +#define shuffle(dst0, dst1, dst2, dst3, src0, src1, src2, src3, shufmask) \ +__ vpshufb(dst0, src0, shufmask, Assembler::AVX_512bit); \ +__ vpshufb(dst1, src1, shufmask, Assembler::AVX_512bit); \ +__ vpshufb(dst2, src2, shufmask, Assembler::AVX_512bit); \ +__ vpshufb(dst3, src3, shufmask, Assembler::AVX_512bit); \ #define xorBeforeStore(dst0, dst1, dst2, dst3, src0, src1, src2, src3) \ __ evpxorq(dst0, dst0, src0, Assembler::AVX_512bit); \ @@ -2848,211 +2889,462 @@ __ vpternlogq(dst1, 0x96, src12, src13, Assembler::AVX_512bit); \ __ vpternlogq(dst2, 0x96, src22, src23, Assembler::AVX_512bit); \ __ vpternlogq(dst3, 0x96, src32, src33, Assembler::AVX_512bit); \ -void StubGenerator::ghash16_encrypt16_parallel(Register key, Register subkeyHtbl, XMMRegister ctr_blockx, XMMRegister aad_hashx, - Register in, Register out, Register data, Register pos, bool first_time_reduction, XMMRegister addmask, bool ghash_input, Register rounds, - Register ghash_pos, bool final_reduction, int i, XMMRegister counter_inc_mask) { - Label AES_192, AES_256, LAST_AES_RND; +//schoolbook multiply of 16 blocks(8 x 16 bytes) +//it is assumed that data read is already shuffledand +void StubGenerator::ghash16_avx512(bool start_ghash, bool do_reduction, bool uload_shuffle, bool hk_broadcast, bool do_hxor, + Register in, Register pos, Register subkeyHtbl, XMMRegister HASH, XMMRegister SHUFM, int in_offset, + int in_disp, int displacement, int hashkey_offset) { const XMMRegister ZTMP0 = xmm0; const XMMRegister ZTMP1 = xmm3; const XMMRegister ZTMP2 = xmm4; const XMMRegister ZTMP3 = xmm5; + const XMMRegister ZTMP4 = xmm6; const XMMRegister ZTMP5 = xmm7; const XMMRegister ZTMP6 = xmm10; const XMMRegister ZTMP7 = xmm11; const XMMRegister ZTMP8 = xmm12; const XMMRegister ZTMP9 = xmm13; - const XMMRegister ZTMP10 = xmm15; - const XMMRegister ZTMP11 = xmm16; - const XMMRegister ZTMP12 = xmm17; + const XMMRegister ZTMPA = xmm26; + const XMMRegister ZTMPB = xmm23; + const XMMRegister GH = xmm24; + const XMMRegister GL = xmm25; + const int hkey_gap = 16 * 32; + + if (uload_shuffle) { + __ evmovdquq(ZTMP9, Address(subkeyHtbl, in_offset * 16 + in_disp), Assembler::AVX_512bit); + __ vpshufb(ZTMP9, ZTMP9, SHUFM, Assembler::AVX_512bit); + } else { + __ evmovdquq(ZTMP9, Address(subkeyHtbl, in_offset * 16 + in_disp), Assembler::AVX_512bit); + } - const XMMRegister ZTMP13 = xmm19; - const XMMRegister ZTMP14 = xmm20; - const XMMRegister ZTMP15 = xmm21; - const XMMRegister ZTMP16 = xmm30; - const XMMRegister ZTMP17 = xmm31; - const XMMRegister ZTMP18 = xmm1; - const XMMRegister ZTMP19 = xmm2; - const XMMRegister ZTMP20 = xmm8; - const XMMRegister ZTMP21 = xmm22; - const XMMRegister ZTMP22 = xmm23; + if (start_ghash) { + __ evpxorq(ZTMP9, ZTMP9, HASH, Assembler::AVX_512bit); + } + if (hk_broadcast) { + __ evbroadcastf64x2(ZTMP8, Address(subkeyHtbl, hashkey_offset + displacement + 0 * 64), Assembler::AVX_512bit); + __ evbroadcastf64x2(ZTMPA, Address(subkeyHtbl, hashkey_offset + displacement + hkey_gap + 0 * 64), Assembler::AVX_512bit); + } else { + __ evmovdquq(ZTMP8, Address(subkeyHtbl, hashkey_offset + displacement + 0 * 64), Assembler::AVX_512bit); + __ evmovdquq(ZTMPA, Address(subkeyHtbl, hashkey_offset + displacement + hkey_gap + 0 * 64), Assembler::AVX_512bit); + } + + carrylessMultiply(ZTMP0, ZTMP1, ZTMP2, ZTMP3, ZTMP9, ZTMPA, ZTMP8); + + //ghash blocks 4 - 7 + if (uload_shuffle) { + __ evmovdquq(ZTMP9, Address(subkeyHtbl, in_offset * 16 + in_disp + 64), Assembler::AVX_512bit); + __ vpshufb(ZTMP9, ZTMP9, SHUFM, Assembler::AVX_512bit); + } else { + __ evmovdquq(ZTMP9, Address(subkeyHtbl, in_offset * 16 + in_disp + 64), Assembler::AVX_512bit); + } + + if (hk_broadcast) { + __ evbroadcastf64x2(ZTMP8, Address(subkeyHtbl, hashkey_offset + displacement + 1 * 64), Assembler::AVX_512bit);; + __ evbroadcastf64x2(ZTMPA, Address(subkeyHtbl, hashkey_offset + displacement + hkey_gap + 1 * 64), Assembler::AVX_512bit); + } else { + __ evmovdquq(ZTMP8, Address(subkeyHtbl, hashkey_offset + displacement + 1 * 64), Assembler::AVX_512bit); + __ evmovdquq(ZTMPA, Address(subkeyHtbl, hashkey_offset + displacement + hkey_gap + 1 * 64), Assembler::AVX_512bit); + } + + carrylessMultiply(ZTMP4, ZTMP5, ZTMP6, ZTMP7, ZTMP9, ZTMPA, ZTMP8); + + //update sums + if (start_ghash) { + __ evpxorq(GL, ZTMP0, ZTMP2, Assembler::AVX_512bit);//T2 = THL + TLL + __ evpxorq(GH, ZTMP1, ZTMP3, Assembler::AVX_512bit);//T1 = THH + TLH + } else { //mid, end, end_reduce + __ vpternlogq(GL, 0x96, ZTMP0, ZTMP2, Assembler::AVX_512bit);//T2 = THL + TLL + __ vpternlogq(GH, 0x96, ZTMP1, ZTMP3, Assembler::AVX_512bit);//T1 = THH + TLH + } + //ghash blocks 8 - 11 + if (uload_shuffle) { + __ evmovdquq(ZTMP9, Address(subkeyHtbl, in_offset * 16 + in_disp + 128), Assembler::AVX_512bit); + __ vpshufb(ZTMP9, ZTMP9, SHUFM, Assembler::AVX_512bit); + } else { + __ evmovdquq(ZTMP9, Address(subkeyHtbl, in_offset * 16 + in_disp + 128), Assembler::AVX_512bit); + } + if (hk_broadcast) { + __ evbroadcastf64x2(ZTMP8, Address(subkeyHtbl, hashkey_offset + displacement + 2 * 64), Assembler::AVX_512bit); + __ evbroadcastf64x2(ZTMPA, Address(subkeyHtbl, hashkey_offset + displacement + hkey_gap + 2 * 64), Assembler::AVX_512bit); + } else { + __ evmovdquq(ZTMP8, Address(subkeyHtbl, hashkey_offset + displacement + 2 * 64), Assembler::AVX_512bit); + __ evmovdquq(ZTMPA, Address(subkeyHtbl, hashkey_offset + displacement + hkey_gap + 2 * 64), Assembler::AVX_512bit); + } + + carrylessMultiply(ZTMP0, ZTMP1, ZTMP2, ZTMP3, ZTMP9, ZTMPA, ZTMP8); + + //update sums + __ vpternlogq(GL, 0x96, ZTMP6, ZTMP4, Assembler::AVX_512bit);//T2 = THL + TLL + __ vpternlogq(GH, 0x96, ZTMP7, ZTMP5, Assembler::AVX_512bit);//T1 = THH + TLH + //ghash blocks 12 - 15 + if (uload_shuffle) { + __ evmovdquq(ZTMP9, Address(subkeyHtbl, in_offset * 16 + in_disp + 192), Assembler::AVX_512bit); + __ vpshufb(ZTMP9, ZTMP9, SHUFM, Assembler::AVX_512bit); + } else { + __ evmovdquq(ZTMP9, Address(subkeyHtbl, in_offset * 16 + in_disp + 192), Assembler::AVX_512bit); + } + + if (hk_broadcast) { + __ evbroadcastf64x2(ZTMP8, Address(subkeyHtbl, hashkey_offset + displacement + 3 * 64), Assembler::AVX_512bit); + __ evbroadcastf64x2(ZTMPA, Address(subkeyHtbl, hashkey_offset + displacement + hkey_gap + 3 * 64), Assembler::AVX_512bit); + } else { + __ evmovdquq(ZTMP8, Address(subkeyHtbl, hashkey_offset + displacement + 3 * 64), Assembler::AVX_512bit); + __ evmovdquq(ZTMPA, Address(subkeyHtbl, hashkey_offset + displacement + hkey_gap + 3 * 64), Assembler::AVX_512bit); + } + carrylessMultiply(ZTMP4, ZTMP5, ZTMP6, ZTMP7, ZTMP9, ZTMPA, ZTMP8); + + //update sums + xorGHASH(GL, GH, GL, GH, ZTMP0, ZTMP2, ZTMP1, ZTMP3, ZTMP6, ZTMP4, ZTMP7, ZTMP5); + + if (do_reduction) { + //new reduction + __ evmovdquq(ZTMPB, ExternalAddress(ghash_polynomial_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); + __ evpclmulqdq(HASH, GL, ZTMPB, 0x10, Assembler::AVX_512bit); + __ vpshufd(ZTMP0, GL, 78, Assembler::AVX_512bit); + __ vpternlogq(HASH, 0x96, GH, ZTMP0, Assembler::AVX_512bit); + if (do_hxor) { + vhpxori4x128(HASH, ZTMP0); + } + } +} - // Pre increment counters - __ vpaddd(ZTMP0, ctr_blockx, counter_inc_mask, Assembler::AVX_512bit); - __ vpaddd(ZTMP1, ZTMP0, counter_inc_mask, Assembler::AVX_512bit); - __ vpaddd(ZTMP2, ZTMP1, counter_inc_mask, Assembler::AVX_512bit); - __ vpaddd(ZTMP3, ZTMP2, counter_inc_mask, Assembler::AVX_512bit); - // Save counter value - __ evmovdquq(ctr_blockx, ZTMP3, Assembler::AVX_512bit); - - // Reuse ZTMP17 / ZTMP18 for loading AES Keys - // Pre-load AES round keys - ev_load_key(ZTMP17, key, 0, xmm29); - ev_load_key(ZTMP18, key, 1 * 16, xmm29); - - // ZTMP19 & ZTMP20 used for loading hash key - // Pre-load hash key - __ evmovdquq(ZTMP19, Address(subkeyHtbl, i * 64), Assembler::AVX_512bit); - __ evmovdquq(ZTMP20, Address(subkeyHtbl, ++i * 64), Assembler::AVX_512bit); - // Load data for computing ghash - __ evmovdquq(ZTMP21, Address(data, ghash_pos, Address::times_1, 0 * 64), Assembler::AVX_512bit); - __ vpshufb(ZTMP21, ZTMP21, xmm24, Assembler::AVX_512bit); - - // Xor cipher block 0 with input ghash, if available - if (ghash_input) { - __ evpxorq(ZTMP21, ZTMP21, aad_hashx, Assembler::AVX_512bit); +//Stitched GHASH of 16 blocks(with reduction) with encryption of 0 blocks +void StubGenerator::gcm_enc_dec_last_avx512(Register len, Register in, Register pos, XMMRegister HASH, XMMRegister SHUFM, Register subkeyHtbl, + int ghashin_offset, int hashkey_offset, bool start_ghash, bool do_reduction) { + //there is 0 blocks to cipher so there are only 16 blocks for ghash and reduction + ghash16_avx512(start_ghash, do_reduction, false, false, true, in, pos, subkeyHtbl, HASH, SHUFM, ghashin_offset, 0, 0, hashkey_offset); +} + +//Main GCM macro stitching cipher with GHASH +//encrypts 16 blocks at a time +//ghash the 16 previously encrypted ciphertext blocks +void StubGenerator::ghash16_encrypt_parallel16_avx512(Register in, Register out, Register ct, Register pos, Register avx512_subkeyHtbl, + Register CTR_CHECK, Register NROUNDS, Register key, XMMRegister CTR_BE, XMMRegister GHASH_IN, + XMMRegister ADDBE_4x4, XMMRegister ADDBE_1234, XMMRegister ADD_1234, XMMRegister SHFMSK, + bool hk_broadcast, bool is_hash_start, bool do_hash_reduction, bool do_hash_hxor, + bool no_ghash_in, int ghashin_offset, int aesout_offset, int hashkey_offset) { + const XMMRegister B00_03 = xmm0; + const XMMRegister B04_07 = xmm3; + const XMMRegister B08_11 = xmm4; + const XMMRegister B12_15 = xmm5; + const XMMRegister THH1 = xmm6; + const XMMRegister THL1 = xmm7; + const XMMRegister TLH1 = xmm10; + const XMMRegister TLL1 = xmm11, THH2 = xmm12, THL2 = xmm13, TLH2 = xmm15; + const XMMRegister TLL2 = xmm16, THH3 = xmm17, THL3 = xmm19, TLH3 = xmm20; + const XMMRegister TLL3 = xmm21, DATA1 = xmm17, DATA2 = xmm19, DATA3 = xmm20, DATA4 = xmm21; + const XMMRegister AESKEY1 = xmm30, AESKEY2 = xmm31; + const XMMRegister GHKEY1 = xmm1, GHKEY2 = xmm18, GHDAT1 = xmm8, GHDAT2 = xmm22; + const XMMRegister ZT = xmm23, TO_REDUCE_L = xmm25, TO_REDUCE_H = xmm24; + const int hkey_gap = 16 * 32; + + Label blocks_overflow, blocks_ok, skip_shuffle, cont, aes_256, aes_192, last_aes_rnd; + + __ cmpb(CTR_CHECK, (256 - 16)); + __ jcc(Assembler::aboveEqual, blocks_overflow); + __ vpaddd(B00_03, CTR_BE, ADDBE_1234, Assembler::AVX_512bit); + __ vpaddd(B04_07, B00_03, ADDBE_4x4, Assembler::AVX_512bit); + __ vpaddd(B08_11, B04_07, ADDBE_4x4, Assembler::AVX_512bit); + __ vpaddd(B12_15, B08_11, ADDBE_4x4, Assembler::AVX_512bit); + __ jmp(blocks_ok); + __ bind(blocks_overflow); + __ vpshufb(CTR_BE, CTR_BE, SHFMSK, Assembler::AVX_512bit); + __ evmovdquq(B12_15, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); + __ vpaddd(B00_03, CTR_BE, ADD_1234, Assembler::AVX_512bit); + __ vpaddd(B04_07, B00_03, B12_15, Assembler::AVX_512bit); + __ vpaddd(B08_11, B04_07, B12_15, Assembler::AVX_512bit); + __ vpaddd(B12_15, B08_11, B12_15, Assembler::AVX_512bit); + shuffle(B00_03, B04_07, B08_11, B12_15, B00_03, B04_07, B08_11, B12_15, SHFMSK); + + __ bind(blocks_ok); + + //pre - load constants + ev_load_key(AESKEY1, key, 0, rbx); + if (!no_ghash_in) { + __ evpxorq(GHDAT1, GHASH_IN, Address(avx512_subkeyHtbl, 16 * ghashin_offset), Assembler::AVX_512bit); + } else { + __ evmovdquq(GHDAT1, Address(avx512_subkeyHtbl, 16 * ghashin_offset), Assembler::AVX_512bit); + } + + if (hk_broadcast) { + __ evbroadcastf64x2(GHKEY1, Address(avx512_subkeyHtbl, hashkey_offset + 0 * 64), Assembler::AVX_512bit); + __ evbroadcastf64x2(GHKEY2, Address(avx512_subkeyHtbl, hashkey_offset + hkey_gap + 0 * 64), Assembler::AVX_512bit); + } else { + __ evmovdquq(GHKEY1, Address(avx512_subkeyHtbl, hashkey_offset + 0 * 64), Assembler::AVX_512bit); + __ evmovdquq(GHKEY2, Address(avx512_subkeyHtbl, hashkey_offset + hkey_gap + 0 * 64), Assembler::AVX_512bit); + } + + //save counter for the next round + //increment counter overflow check register + __ evshufi64x2(CTR_BE, B12_15, B12_15, 255, Assembler::AVX_512bit); + __ addb(CTR_CHECK, 16); + + //pre - load constants + ev_load_key(AESKEY2, key, 1 * 16, rbx); + __ evmovdquq(GHDAT2, Address(avx512_subkeyHtbl, 16 * (ghashin_offset +4)), Assembler::AVX_512bit); + + //stitch AES rounds with GHASH + //AES round 0 + __ evpxorq(B00_03, B00_03, AESKEY1, Assembler::AVX_512bit); + __ evpxorq(B04_07, B04_07, AESKEY1, Assembler::AVX_512bit); + __ evpxorq(B08_11, B08_11, AESKEY1, Assembler::AVX_512bit); + __ evpxorq(B12_15, B12_15, AESKEY1, Assembler::AVX_512bit); + ev_load_key(AESKEY1, key, 2 * 16, rbx); + + //GHASH 4 blocks(15 to 12) + carrylessMultiply(TLL1, TLH1, THL1, THH1, GHDAT1, GHKEY2, GHKEY1); + + if (hk_broadcast) { + __ evbroadcastf64x2(GHKEY1, Address(avx512_subkeyHtbl, hashkey_offset + 1 * 64), Assembler::AVX_512bit); + __ evbroadcastf64x2(GHKEY2, Address(avx512_subkeyHtbl, hashkey_offset + hkey_gap + 1 * 64), Assembler::AVX_512bit); + } else { + __ evmovdquq(GHKEY1, Address(avx512_subkeyHtbl, hashkey_offset + 1 * 64), Assembler::AVX_512bit); + __ evmovdquq(GHKEY2, Address(avx512_subkeyHtbl, hashkey_offset + hkey_gap + 1 * 64), Assembler::AVX_512bit); + } + + __ evmovdquq(GHDAT1, Address(avx512_subkeyHtbl, 16 * (ghashin_offset + 8)), Assembler::AVX_512bit); + + //AES round 1 + roundEncode(AESKEY2, B00_03, B04_07, B08_11, B12_15); + + ev_load_key(AESKEY2, key, 3 * 16, rbx); + + //GHASH 4 blocks(11 to 8) + carrylessMultiply(TLL2, TLH2, THL2, THH2, GHDAT2, GHKEY2, GHKEY1); + + if (hk_broadcast) { + __ evbroadcastf64x2(GHKEY1, Address(avx512_subkeyHtbl, hashkey_offset + 2 * 64), Assembler::AVX_512bit); + __ evbroadcastf64x2(GHKEY2, Address(avx512_subkeyHtbl, hashkey_offset + hkey_gap + 2 * 64), Assembler::AVX_512bit); + } else { + __ evmovdquq(GHKEY1, Address(avx512_subkeyHtbl, hashkey_offset + 2 * 64 ), Assembler::AVX_512bit); + __ evmovdquq(GHKEY2, Address(avx512_subkeyHtbl, hashkey_offset + hkey_gap + 2 * 64), Assembler::AVX_512bit); } - // Load data for computing ghash - __ evmovdquq(ZTMP22, Address(data, ghash_pos, Address::times_1, 1 * 64), Assembler::AVX_512bit); - __ vpshufb(ZTMP22, ZTMP22, xmm24, Assembler::AVX_512bit); - - // stitch AES rounds with GHASH - // AES round 0, xmm24 has shuffle mask - shuffleExorRnd1Key(ZTMP0, ZTMP1, ZTMP2, ZTMP3, xmm24, ZTMP17); - // Reuse ZTMP17 / ZTMP18 for loading remaining AES Keys - ev_load_key(ZTMP17, key, 2 * 16, xmm29); - // GHASH 4 blocks - carrylessMultiply(ZTMP6, ZTMP7, ZTMP8, ZTMP5, ZTMP21, ZTMP19); - // Load the next hkey and Ghash data - __ evmovdquq(ZTMP19, Address(subkeyHtbl, ++i * 64), Assembler::AVX_512bit); - __ evmovdquq(ZTMP21, Address(data, ghash_pos, Address::times_1, 2 * 64), Assembler::AVX_512bit); - __ vpshufb(ZTMP21, ZTMP21, xmm24, Assembler::AVX_512bit); - - // AES round 1 - roundEncode(ZTMP18, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP18, key, 3 * 16, xmm29); - - // GHASH 4 blocks(11 to 8) - carrylessMultiply(ZTMP10, ZTMP12, ZTMP11, ZTMP9, ZTMP22, ZTMP20); - // Load the next hkey and GDATA - __ evmovdquq(ZTMP20, Address(subkeyHtbl, ++i * 64), Assembler::AVX_512bit); - __ evmovdquq(ZTMP22, Address(data, ghash_pos, Address::times_1, 3 * 64), Assembler::AVX_512bit); - __ vpshufb(ZTMP22, ZTMP22, xmm24, Assembler::AVX_512bit); - - // AES round 2 - roundEncode(ZTMP17, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP17, key, 4 * 16, xmm29); - - // GHASH 4 blocks(7 to 4) - carrylessMultiply(ZTMP14, ZTMP16, ZTMP15, ZTMP13, ZTMP21, ZTMP19); - // AES rounds 3 - roundEncode(ZTMP18, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP18, key, 5 * 16, xmm29); - - // Gather(XOR) GHASH for 12 blocks - xorGHASH(ZTMP5, ZTMP6, ZTMP8, ZTMP7, ZTMP9, ZTMP13, ZTMP10, ZTMP14, ZTMP12, ZTMP16, ZTMP11, ZTMP15); - - // AES rounds 4 - roundEncode(ZTMP17, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP17, key, 6 * 16, xmm29); - - // load plain / cipher text(recycle registers) - loadData(in, pos, ZTMP13, ZTMP14, ZTMP15, ZTMP16); - - // AES rounds 5 - roundEncode(ZTMP18, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP18, key, 7 * 16, xmm29); - // GHASH 4 blocks(3 to 0) - carrylessMultiply(ZTMP10, ZTMP12, ZTMP11, ZTMP9, ZTMP22, ZTMP20); - - // AES round 6 - roundEncode(ZTMP17, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP17, key, 8 * 16, xmm29); - - // gather GHASH in ZTMP6(low) and ZTMP5(high) - if (first_time_reduction) { - __ vpternlogq(ZTMP7, 0x96, ZTMP8, ZTMP12, Assembler::AVX_512bit); - __ evpxorq(xmm25, ZTMP7, ZTMP11, Assembler::AVX_512bit); - __ evpxorq(xmm27, ZTMP5, ZTMP9, Assembler::AVX_512bit); - __ evpxorq(xmm26, ZTMP6, ZTMP10, Assembler::AVX_512bit); - } else if (!first_time_reduction && !final_reduction) { - xorGHASH(ZTMP7, xmm25, xmm27, xmm26, ZTMP8, ZTMP12, ZTMP7, ZTMP11, ZTMP5, ZTMP9, ZTMP6, ZTMP10); + __ evmovdquq(GHDAT2, Address(avx512_subkeyHtbl, 16 * (ghashin_offset + 12)), Assembler::AVX_512bit); + + //AES round 2 + roundEncode(AESKEY1, B00_03, B04_07, B08_11, B12_15); + ev_load_key(AESKEY1, key, 4 * 16, rbx); + + //GHASH 4 blocks(7 to 4) + carrylessMultiply(TLL3, TLH3, THL3, THH3, GHDAT1, GHKEY2, GHKEY1); + + if (hk_broadcast) { + __ evbroadcastf64x2(GHKEY1, Address(avx512_subkeyHtbl, hashkey_offset + 3 * 64), Assembler::AVX_512bit); + __ evbroadcastf64x2(GHKEY2, Address(avx512_subkeyHtbl, hashkey_offset + hkey_gap + 3 * 64), Assembler::AVX_512bit); + } else { + __ evmovdquq(GHKEY1, Address(avx512_subkeyHtbl, hashkey_offset + 3 * 64), Assembler::AVX_512bit); + __ evmovdquq(GHKEY2, Address(avx512_subkeyHtbl, hashkey_offset + hkey_gap + 3 * 64), Assembler::AVX_512bit); } - if (final_reduction) { - // Phase one: Add mid products together - // Also load polynomial constant for reduction - __ vpternlogq(ZTMP7, 0x96, ZTMP8, ZTMP12, Assembler::AVX_512bit); - __ vpternlogq(ZTMP7, 0x96, xmm25, ZTMP11, Assembler::AVX_512bit); - __ vpsrldq(ZTMP11, ZTMP7, 8, Assembler::AVX_512bit); - __ vpslldq(ZTMP7, ZTMP7, 8, Assembler::AVX_512bit); - __ evmovdquq(ZTMP12, ExternalAddress(ghash_polynomial_reduction_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); + //AES rounds 3 + roundEncode(AESKEY2, B00_03, B04_07, B08_11, B12_15); + ev_load_key(AESKEY2, key, 5 * 16, rbx); + + //Gather(XOR) GHASH for 12 blocks + xorGHASH(TLL1, TLH1, THL1, THH1, TLL2, TLL3, TLH2, TLH3, THL2, THL3, THH2, THH3); + + //AES rounds 4 + roundEncode(AESKEY1, B00_03, B04_07, B08_11, B12_15); + ev_load_key(AESKEY1, key, 6 * 16, rbx); + + //load plain / cipher text(recycle GH3xx registers) + loadData(in, pos, DATA1, DATA2, DATA3, DATA4); + + //AES rounds 5 + roundEncode(AESKEY2, B00_03, B04_07, B08_11, B12_15); + ev_load_key(AESKEY2, key, 7 * 16, rbx); + + //GHASH 4 blocks(3 to 0) + carrylessMultiply(TLL2, TLH2, THL2, THH2, GHDAT2, GHKEY2, GHKEY1); + + //AES round 6 + roundEncode(AESKEY1, B00_03, B04_07, B08_11, B12_15); + ev_load_key(AESKEY1, key, 8 * 16, rbx); + + //gather GHASH in TO_REDUCE_H / L + if (is_hash_start) { + __ evpxorq(TO_REDUCE_L, TLL2, THL2, Assembler::AVX_512bit); + __ evpxorq(TO_REDUCE_H, THH2, TLH2, Assembler::AVX_512bit); + __ vpternlogq(TO_REDUCE_L, 0x96, TLL1, THL1, Assembler::AVX_512bit); + __ vpternlogq(TO_REDUCE_H, 0x96, THH1, TLH1, Assembler::AVX_512bit); + } else { + //not the first round so sums need to be updated + xorGHASH(TO_REDUCE_L, TO_REDUCE_H, TO_REDUCE_L, TO_REDUCE_H, TLL2, THL2, THH2, TLH2, TLL1, THL1, THH1, TLH1); } - // AES round 7 - roundEncode(ZTMP18, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP18, key, 9 * 16, xmm29); - if (final_reduction) { - __ vpternlogq(ZTMP5, 0x96, ZTMP9, ZTMP11, Assembler::AVX_512bit); - __ evpxorq(ZTMP5, ZTMP5, xmm27, Assembler::AVX_512bit); - __ vpternlogq(ZTMP6, 0x96, ZTMP10, ZTMP7, Assembler::AVX_512bit); - __ evpxorq(ZTMP6, ZTMP6, xmm26, Assembler::AVX_512bit); + + //AES round 7 + roundEncode(AESKEY2, B00_03, B04_07, B08_11, B12_15); + ev_load_key(AESKEY2, key, 9 * 16, rbx); + + //new reduction + if (do_hash_reduction) { + __ evmovdquq(ZT, ExternalAddress(ghash_polynomial_reduction_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); + __ evpclmulqdq(THH1, TO_REDUCE_L, ZT, 0x10, Assembler::AVX_512bit); + __ vpshufd(TO_REDUCE_L, TO_REDUCE_L, 78, Assembler::AVX_512bit); + __ vpternlogq(THH1, 0x96, TO_REDUCE_H, TO_REDUCE_L, Assembler::AVX_512bit); } - // AES round 8 - roundEncode(ZTMP17, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP17, key, 10 * 16, xmm29); - - // Horizontal xor of low and high 4*128 - if (final_reduction) { - vhpxori4x128(ZTMP5, ZTMP9); - vhpxori4x128(ZTMP6, ZTMP10); + + //AES round 8 + roundEncode(AESKEY1, B00_03, B04_07, B08_11, B12_15); + ev_load_key(AESKEY1, key, 10 * 16, rbx); + + //horizontalxor of 4 reduced hashes + if (do_hash_hxor) { + vhpxori4x128(THH1, TLL1); } - // AES round 9 - roundEncode(ZTMP18, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - // First phase of reduction - if (final_reduction) { - __ evpclmulqdq(ZTMP10, ZTMP12, ZTMP6, 0x01, Assembler::AVX_128bit); - __ vpslldq(ZTMP10, ZTMP10, 8, Assembler::AVX_128bit); - __ evpxorq(ZTMP10, ZTMP6, ZTMP10, Assembler::AVX_128bit); + + //AES round 9 + roundEncode(AESKEY2, B00_03, B04_07, B08_11, B12_15); + ev_load_key(AESKEY2, key, 11 * 16, rbx); + //AES rounds up to 11 (AES192) or 13 (AES256) + //AES128 is done + __ cmpl(NROUNDS, 52); + __ jcc(Assembler::less, last_aes_rnd); + __ bind(aes_192); + roundEncode(AESKEY1, B00_03, B04_07, B08_11, B12_15); + ev_load_key(AESKEY1, key, 12 * 16, rbx); + roundEncode(AESKEY2, B00_03, B04_07, B08_11, B12_15); + __ cmpl(NROUNDS, 60); + __ jcc(Assembler::less, last_aes_rnd); + __ bind(aes_256); + ev_load_key(AESKEY2, key, 13 * 16, rbx); + roundEncode(AESKEY1, B00_03, B04_07, B08_11, B12_15); + ev_load_key(AESKEY1, key, 14 * 16, rbx); + roundEncode(AESKEY2, B00_03, B04_07, B08_11, B12_15); + + __ bind(last_aes_rnd); + //the last AES round + lastroundEncode(AESKEY1, B00_03, B04_07, B08_11, B12_15); + //AESKEY1and AESKEY2 contain AES round keys + + //XOR against plain / cipher text + xorBeforeStore(B00_03, B04_07, B08_11, B12_15, DATA1, DATA2, DATA3, DATA4); + + //store cipher / plain text + storeData(out, pos, B00_03, B04_07, B08_11, B12_15); + //**B00_03, B04_07, B08_011, B12_B15 may contain sensitive data + + //shuffle cipher text blocks for GHASH computation + __ cmpptr(ct, out); + __ jcc(Assembler::notEqual, skip_shuffle); + shuffle(B00_03, B04_07, B08_11, B12_15, B00_03, B04_07, B08_11, B12_15, SHFMSK); + __ jmp(cont); + __ bind(skip_shuffle); + shuffle(B00_03, B04_07, B08_11, B12_15, DATA1, DATA2, DATA3, DATA4, SHFMSK); + + //**B00_03, B04_07, B08_011, B12_B15 overwritten with shuffled cipher text + __ bind(cont); + //store shuffled cipher text for ghashing + __ evmovdquq(Address(avx512_subkeyHtbl, 16 * aesout_offset), B00_03, Assembler::AVX_512bit); + __ evmovdquq(Address(avx512_subkeyHtbl, 16 * (aesout_offset + 4)), B04_07, Assembler::AVX_512bit); + __ evmovdquq(Address(avx512_subkeyHtbl, 16 * (aesout_offset + 8)), B08_11, Assembler::AVX_512bit); + __ evmovdquq(Address(avx512_subkeyHtbl, 16 * (aesout_offset + 12)), B12_15, Assembler::AVX_512bit); +} + + +//Encrypt / decrypt the initial 16 blocks +void StubGenerator::initial_blocks_16_avx512(Register in, Register out, Register ct, Register pos, Register key, Register avx512_subkeyHtbl, + Register CTR_CHECK, Register rounds, XMMRegister CTR, XMMRegister GHASH, XMMRegister ADDBE_4x4, + XMMRegister ADDBE_1234, XMMRegister ADD_1234, XMMRegister SHUF_MASK, int stack_offset) { + const XMMRegister B00_03 = xmm7; + const XMMRegister B04_07 = xmm10; + const XMMRegister B08_11 = xmm11; + const XMMRegister B12_15 = xmm12; + const XMMRegister T0 = xmm0; + const XMMRegister T1 = xmm3; + const XMMRegister T2 = xmm4; + const XMMRegister T3 = xmm5; + const XMMRegister T4 = xmm6; + const XMMRegister T5 = xmm30; + + Label next_16_overflow, next_16_ok, cont, skip_shuffle, aes_256, aes_192, last_aes_rnd; + //prepare counter blocks + __ cmpb(CTR_CHECK, (256 - 16)); + __ jcc(Assembler::aboveEqual, next_16_overflow); + __ vpaddd(B00_03, CTR, ADDBE_1234, Assembler::AVX_512bit); + __ vpaddd(B04_07, B00_03, ADDBE_4x4, Assembler::AVX_512bit); + __ vpaddd(B08_11, B04_07, ADDBE_4x4, Assembler::AVX_512bit); + __ vpaddd(B12_15, B08_11, ADDBE_4x4, Assembler::AVX_512bit); + __ jmp(next_16_ok); + __ bind(next_16_overflow); + __ vpshufb(CTR, CTR, SHUF_MASK, Assembler::AVX_512bit); + __ evmovdquq(B12_15, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, rbx); + __ vpaddd(B00_03, CTR, ADD_1234, Assembler::AVX_512bit); + __ vpaddd(B04_07, B00_03, B12_15, Assembler::AVX_512bit); + __ vpaddd(B08_11, B04_07, B12_15, Assembler::AVX_512bit); + __ vpaddd(B12_15, B08_11, B12_15, Assembler::AVX_512bit); + shuffle(B00_03, B04_07, B08_11, B12_15, B00_03, B04_07, B08_11, B12_15, SHUF_MASK); + __ bind(next_16_ok); + __ evshufi64x2(CTR, B12_15, B12_15, 255, Assembler::AVX_512bit); + __ addb(CTR_CHECK, 16); + + //load 16 blocks of data + loadData(in, pos, T0, T1, T2, T3); + + //move to AES encryption rounds + __ movdqu(T5, ExternalAddress(key_shuffle_mask_addr()), rbx /*rscratch*/); + ev_load_key(T4, key, 0, T5); + __ evpxorq(B00_03, B00_03, T4, Assembler::AVX_512bit); + __ evpxorq(B04_07, B04_07, T4, Assembler::AVX_512bit); + __ evpxorq(B08_11, B08_11, T4, Assembler::AVX_512bit); + __ evpxorq(B12_15, B12_15, T4, Assembler::AVX_512bit); + + for (int i = 1; i < 10; i++) { + ev_load_key(T4, key, i * 16, T5); + roundEncode(T4, B00_03, B04_07, B08_11, B12_15); } + + ev_load_key(T4, key, 10 * 16, T5); __ cmpl(rounds, 52); - __ jcc(Assembler::greaterEqual, AES_192); - __ jmp(LAST_AES_RND); - // AES rounds up to 11 (AES192) or 13 (AES256) - __ bind(AES_192); - roundEncode(ZTMP17, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP18, key, 11 * 16, xmm29); - roundEncode(ZTMP18, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP17, key, 12 * 16, xmm29); + __ jcc(Assembler::less, last_aes_rnd); + __ bind(aes_192); + roundEncode(T4, B00_03, B04_07, B08_11, B12_15); + ev_load_key(T4, key, 16 * 11, T5); + roundEncode(T4, B00_03, B04_07, B08_11, B12_15); + ev_load_key(T4, key, 16 * 12, T5); __ cmpl(rounds, 60); - __ jcc(Assembler::aboveEqual, AES_256); - __ jmp(LAST_AES_RND); - - __ bind(AES_256); - roundEncode(ZTMP17, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP18, key, 13 * 16, xmm29); - roundEncode(ZTMP18, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - ev_load_key(ZTMP17, key, 14 * 16, xmm29); - - __ bind(LAST_AES_RND); - // Second phase of reduction - if (final_reduction) { - __ evpclmulqdq(ZTMP9, ZTMP12, ZTMP10, 0x00, Assembler::AVX_128bit); - __ vpsrldq(ZTMP9, ZTMP9, 4, Assembler::AVX_128bit); // Shift-R 1-DW to obtain 2-DWs shift-R - __ evpclmulqdq(ZTMP11, ZTMP12, ZTMP10, 0x10, Assembler::AVX_128bit); - __ vpslldq(ZTMP11, ZTMP11, 4, Assembler::AVX_128bit); // Shift-L 1-DW for result - // ZTMP5 = ZTMP5 X ZTMP11 X ZTMP9 - __ vpternlogq(ZTMP5, 0x96, ZTMP11, ZTMP9, Assembler::AVX_128bit); - } - // Last AES round - lastroundEncode(ZTMP17, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - // XOR against plain / cipher text - xorBeforeStore(ZTMP0, ZTMP1, ZTMP2, ZTMP3, ZTMP13, ZTMP14, ZTMP15, ZTMP16); - // store cipher / plain text - storeData(out, pos, ZTMP0, ZTMP1, ZTMP2, ZTMP3); + __ jcc(Assembler::less, last_aes_rnd); + __ bind(aes_256); + roundEncode(T4, B00_03, B04_07, B08_11, B12_15); + ev_load_key(T4, key, 16 * 13, T5); + roundEncode(T4, B00_03, B04_07, B08_11, B12_15); + ev_load_key(T4, key, 16 * 14, T5); + + __ bind(last_aes_rnd); + lastroundEncode(T4, B00_03, B04_07, B08_11, B12_15); + + //xor against text + xorBeforeStore(B00_03, B04_07, B08_11, B12_15, T0, T1, T2, T3); + + //store + storeData(out, pos, B00_03, B04_07, B08_11, B12_15); + + __ cmpptr(ct, out); + __ jcc(Assembler::equal, skip_shuffle); + //decryption - cipher text needs to go to GHASH phase + shuffle(B00_03, B04_07, B08_11, B12_15, T0, T1, T2, T3, SHUF_MASK); + __ jmp(cont); + __ bind(skip_shuffle); + shuffle(B00_03, B04_07, B08_11, B12_15, B00_03, B04_07, B08_11, B12_15, SHUF_MASK); + + //B00_03, B04_07, B08_11, B12_15 overwritten with shuffled cipher text + __ bind(cont); + __ evmovdquq(Address(avx512_subkeyHtbl, 16 * stack_offset), B00_03, Assembler::AVX_512bit); + __ evmovdquq(Address(avx512_subkeyHtbl, 16 * (stack_offset + 4)), B04_07, Assembler::AVX_512bit); + __ evmovdquq(Address(avx512_subkeyHtbl, 16 * (stack_offset + 8)), B08_11, Assembler::AVX_512bit); + __ evmovdquq(Address(avx512_subkeyHtbl, 16 * (stack_offset + 12)), B12_15, Assembler::AVX_512bit); } -void StubGenerator::aesgcm_encrypt(Register in, Register len, Register ct, Register out, Register key, - Register state, Register subkeyHtbl, Register avx512_subkeyHtbl, Register counter) { - Label ENC_DEC_DONE, GENERATE_HTBL_48_BLKS, AES_192, AES_256, STORE_CT, GHASH_LAST_32, - AES_32_BLOCKS, GHASH_AES_PARALLEL, LOOP, ACCUMULATE, GHASH_16_AES_16; - const XMMRegister CTR_BLOCKx = xmm9; +void StubGenerator::aesgcm_avx512(Register in, Register len, Register ct, Register out, Register key, Register state, + Register subkeyHtbl, Register avx512_subkeyHtbl, Register counter) { + Label ENC_DEC_DONE, MESG_BELOW_32_BLKS, NO_BIG_BLKS, ENCRYPT_BIG_BLKS_NO_HXOR, + ENCRYPT_BIG_NBLKS, ENCRYPT_16_BLKS, ENCRYPT_N_GHASH_32_N_BLKS, GHASH_DONE; + const XMMRegister CTR_BLOCKx = xmm2; const XMMRegister AAD_HASHx = xmm14; - const Register pos = rax; - const Register rounds = r15; - const Register ghash_pos = NOT_WIN64( r14) WIN64_ONLY( r11 ); const XMMRegister ZTMP0 = xmm0; - const XMMRegister ZTMP1 = xmm3; - const XMMRegister ZTMP2 = xmm4; - const XMMRegister ZTMP3 = xmm5; + const XMMRegister ZTMP1 = xmm3; //**sensitive + const XMMRegister ZTMP2 = xmm4; //**sensitive(small data) + const XMMRegister ZTMP3 = xmm5; //**sensitive(small data) const XMMRegister ZTMP4 = xmm6; const XMMRegister ZTMP5 = xmm7; const XMMRegister ZTMP6 = xmm10; @@ -3066,235 +3358,170 @@ void StubGenerator::aesgcm_encrypt(Register in, Register len, Register ct, Regis const XMMRegister ZTMP14 = xmm20; const XMMRegister ZTMP15 = xmm21; const XMMRegister ZTMP16 = xmm30; - const XMMRegister COUNTER_INC_MASK = xmm18; - - __ movl(pos, 0); // Total length processed - // Min data size processed = 768 bytes - __ cmpl(len, 768); - __ jcc(Assembler::less, ENC_DEC_DONE); + const XMMRegister ZTMP17 = xmm31; + const XMMRegister ZTMP18 = xmm1; + const XMMRegister ZTMP19 = xmm18; + const XMMRegister ZTMP20 = xmm8; + const XMMRegister ZTMP21 = xmm22; + const XMMRegister ZTMP22 = xmm23; + const XMMRegister ZTMP23 = xmm26; + const XMMRegister GH = xmm24; + const XMMRegister GL = xmm25; + const XMMRegister SHUF_MASK = xmm29; + const XMMRegister ADDBE_4x4 = xmm27; + const XMMRegister ADDBE_1234 = xmm28; + const XMMRegister ADD_1234 = xmm9; + const KRegister MASKREG = k1; + const Register pos = rax; + const Register rounds = r15; + const Register CTR_CHECK = r14; - // Generate 48 constants for htbl - __ call(GENERATE_HTBL_48_BLKS, relocInfo::none); - int index = 0; // Index for choosing subkeyHtbl entry - __ movl(ghash_pos, 0); // Pointer for ghash read and store operations + const int stack_offset = 64; + const int ghashin_offset = 64; + const int aesout_offset = 64; + const int hashkey_offset = 0; + const int hashkey_gap = 16 * 32; + const int HashKey_32 = 0; + const int HashKey_16 = 16 * 16; - // Move initial counter value and STATE value into variables + __ movl(pos, 0); + __ cmpl(len, 256); + __ jcc(Assembler::lessEqual, ENC_DEC_DONE); + + /* Structure of the Htbl is as follows: + * Where 0 - 31 we have 32 Hashkey's and 32-63 we have 32 HashKeyK (derived from HashKey) + * Rest 8 entries are for storing CTR values post AES rounds + * ---------------------------------------------------------------------------------------- + Hashkey32 -> 16 * 0 + Hashkey31 -> 16 * 1 + Hashkey30 -> 16 * 2 + ........ + Hashkey1 -> 16 * 31 + --------------------- + HaskeyK32 -> 16 * 32 + HashkeyK31 -> 16 * 33 + ......... + HashkeyK1 -> 16 * 63 + --------------------- + 1st set of AES Entries + B00_03 -> 16 * 64 + B04_07 -> 16 * 68 + B08_11 -> 16 * 72 + B12_15 -> 16 * 80 + --------------------- + 2nd set of AES Entries + B00_03 -> 16 * 84 + B04_07 -> 16 * 88 + B08_11 -> 16 * 92 + B12_15 -> 16 * 96 + ---------------------*/ + generateHtbl_32_blocks_avx512(subkeyHtbl, avx512_subkeyHtbl); + + //Move initial counter value and STATE value into variables __ movdqu(CTR_BLOCKx, Address(counter, 0)); __ movdqu(AAD_HASHx, Address(state, 0)); - // Load lswap mask for ghash + + //Load lswap mask for ghash __ movdqu(xmm24, ExternalAddress(ghash_long_swap_mask_addr()), rbx /*rscratch*/); - // Shuffle input state using lswap mask + //Shuffle input state using lswap mask __ vpshufb(AAD_HASHx, AAD_HASHx, xmm24, Assembler::AVX_128bit); // Compute #rounds for AES based on the length of the key array __ movl(rounds, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT))); - // Broadcast counter value to 512 bit register + __ evmovdquq(ADDBE_4x4, ExternalAddress(counter_mask_addbe_4444_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); + __ evmovdquq(ADDBE_1234, ExternalAddress(counter_mask_addbe_1234_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); + __ evmovdquq(SHUF_MASK, ExternalAddress(counter_shuffle_mask_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); + __ evmovdquq(ADD_1234, ExternalAddress(counter_mask_add_1234_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); + + //Shuffle counter, subtract 1 from the pre-incremented counter value and broadcast counter value to 512 bit register + __ vpshufb(CTR_BLOCKx, CTR_BLOCKx, SHUF_MASK, Assembler::AVX_128bit); + __ vpsubd(CTR_BLOCKx, CTR_BLOCKx, ADD_1234, Assembler::AVX_128bit); __ evshufi64x2(CTR_BLOCKx, CTR_BLOCKx, CTR_BLOCKx, 0, Assembler::AVX_512bit); - // Load counter shuffle mask - __ evmovdquq(xmm24, ExternalAddress(counter_shuffle_mask_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); - // Shuffle counter - __ vpshufb(CTR_BLOCKx, CTR_BLOCKx, xmm24, Assembler::AVX_512bit); - - // Load mask for incrementing counter - __ evmovdquq(COUNTER_INC_MASK, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); - // Pre-increment counter - __ vpaddd(ZTMP5, CTR_BLOCKx, ExternalAddress(counter_mask_linc0_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); - __ vpaddd(ZTMP6, ZTMP5, COUNTER_INC_MASK, Assembler::AVX_512bit); - __ vpaddd(ZTMP7, ZTMP6, COUNTER_INC_MASK, Assembler::AVX_512bit); - __ vpaddd(ZTMP8, ZTMP7, COUNTER_INC_MASK, Assembler::AVX_512bit); - - // Begin 32 blocks of AES processing - __ bind(AES_32_BLOCKS); - // Save incremented counter before overwriting it with AES data - __ evmovdquq(CTR_BLOCKx, ZTMP8, Assembler::AVX_512bit); - - // Move 256 bytes of data - loadData(in, pos, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - // Load key shuffle mask - __ movdqu(xmm29, ExternalAddress(key_shuffle_mask_addr()), rbx /*rscratch*/); - // Load 0th AES round key - ev_load_key(ZTMP4, key, 0, xmm29); - // AES-ROUND0, xmm24 has the shuffle mask - shuffleExorRnd1Key(ZTMP5, ZTMP6, ZTMP7, ZTMP8, xmm24, ZTMP4); - - for (int j = 1; j < 10; j++) { - ev_load_key(ZTMP4, key, j * 16, xmm29); - roundEncode(ZTMP4, ZTMP5, ZTMP6, ZTMP7, ZTMP8); - } - ev_load_key(ZTMP4, key, 10 * 16, xmm29); - // AES rounds up to 11 (AES192) or 13 (AES256) - __ cmpl(rounds, 52); - __ jcc(Assembler::greaterEqual, AES_192); - lastroundEncode(ZTMP4, ZTMP5, ZTMP6, ZTMP7, ZTMP8); - __ jmp(STORE_CT); - - __ bind(AES_192); - roundEncode(ZTMP4, ZTMP5, ZTMP6, ZTMP7, ZTMP8); - ev_load_key(ZTMP4, key, 11 * 16, xmm29); - roundEncode(ZTMP4, ZTMP5, ZTMP6, ZTMP7, ZTMP8); - __ cmpl(rounds, 60); - __ jcc(Assembler::aboveEqual, AES_256); - ev_load_key(ZTMP4, key, 12 * 16, xmm29); - lastroundEncode(ZTMP4, ZTMP5, ZTMP6, ZTMP7, ZTMP8); - __ jmp(STORE_CT); - - __ bind(AES_256); - ev_load_key(ZTMP4, key, 12 * 16, xmm29); - roundEncode(ZTMP4, ZTMP5, ZTMP6, ZTMP7, ZTMP8); - ev_load_key(ZTMP4, key, 13 * 16, xmm29); - roundEncode(ZTMP4, ZTMP5, ZTMP6, ZTMP7, ZTMP8); - ev_load_key(ZTMP4, key, 14 * 16, xmm29); - // Last AES round - lastroundEncode(ZTMP4, ZTMP5, ZTMP6, ZTMP7, ZTMP8); - - __ bind(STORE_CT); - // Xor the encrypted key with PT to obtain CT - xorBeforeStore(ZTMP5, ZTMP6, ZTMP7, ZTMP8, ZTMP0, ZTMP1, ZTMP2, ZTMP3); - storeData(out, pos, ZTMP5, ZTMP6, ZTMP7, ZTMP8); - // 16 blocks encryption completed - __ addl(pos, 256); - __ cmpl(pos, 512); - __ jcc(Assembler::aboveEqual, GHASH_AES_PARALLEL); - __ vpaddd(ZTMP5, CTR_BLOCKx, COUNTER_INC_MASK, Assembler::AVX_512bit); - __ vpaddd(ZTMP6, ZTMP5, COUNTER_INC_MASK, Assembler::AVX_512bit); - __ vpaddd(ZTMP7, ZTMP6, COUNTER_INC_MASK, Assembler::AVX_512bit); - __ vpaddd(ZTMP8, ZTMP7, COUNTER_INC_MASK, Assembler::AVX_512bit); - __ jmp(AES_32_BLOCKS); - - __ bind(GHASH_AES_PARALLEL); - // Ghash16_encrypt16_parallel takes place in the order with three reduction values: - // 1) First time -> cipher xor input ghash - // 2) No reduction -> accumulate multiplication values - // 3) Final reduction post 48 blocks -> new ghash value is computed for the next round - // Reduction value = first time - ghash16_encrypt16_parallel(key, avx512_subkeyHtbl, CTR_BLOCKx, AAD_HASHx, in, out, ct, pos, true, xmm24, true, rounds, ghash_pos, false, index, COUNTER_INC_MASK); - __ addl(pos, 256); - __ addl(ghash_pos, 256); - index += 4; - - // At this point we have processed 768 bytes of AES and 256 bytes of GHASH. - // If the remaining length is less than 768, process remaining 512 bytes of ghash in GHASH_LAST_32 code - __ subl(len, 768); - __ cmpl(len, 768); - __ jcc(Assembler::less, GHASH_LAST_32); - - // AES 16 blocks and GHASH 16 blocks in parallel - // For multiples of 48 blocks we will do ghash16_encrypt16 interleaved multiple times - // Reduction value = no reduction means that the carryless multiplication values are accumulated for further calculations - // Each call uses 4 subkeyHtbl values, so increment the index by 4. - __ bind(GHASH_16_AES_16); - // Reduction value = no reduction - ghash16_encrypt16_parallel(key, avx512_subkeyHtbl, CTR_BLOCKx, AAD_HASHx, in, out, ct, pos, false, xmm24, false, rounds, ghash_pos, false, index, COUNTER_INC_MASK); - __ addl(pos, 256); - __ addl(ghash_pos, 256); - index += 4; - // Reduction value = final reduction means that the accumulated values have to be reduced as we have completed 48 blocks of ghash - ghash16_encrypt16_parallel(key, avx512_subkeyHtbl, CTR_BLOCKx, AAD_HASHx, in, out, ct, pos, false, xmm24, false, rounds, ghash_pos, true, index, COUNTER_INC_MASK); - __ addl(pos, 256); - __ addl(ghash_pos, 256); - // Calculated ghash value needs to be __ moved to AAD_HASHX so that we can restart the ghash16-aes16 pipeline - __ movdqu(AAD_HASHx, ZTMP5); - index = 0; // Reset subkeyHtbl index - - // Restart the pipeline - // Reduction value = first time - ghash16_encrypt16_parallel(key, avx512_subkeyHtbl, CTR_BLOCKx, AAD_HASHx, in, out, ct, pos, true, xmm24, true, rounds, ghash_pos, false, index, COUNTER_INC_MASK); - __ addl(pos, 256); - __ addl(ghash_pos, 256); - index += 4; - - __ subl(len, 768); - __ cmpl(len, 768); - __ jcc(Assembler::greaterEqual, GHASH_16_AES_16); - - // GHASH last 32 blocks processed here - // GHASH products accumulated in ZMM27, ZMM25 and ZMM26 during GHASH16-AES16 operation is used - __ bind(GHASH_LAST_32); - // Use rbx as a pointer to the htbl; For last 32 blocks of GHASH, use key# 4-11 entry in subkeyHtbl - __ movl(rbx, 256); - // Load cipher blocks - __ evmovdquq(ZTMP13, Address(ct, ghash_pos, Address::times_1, 0 * 64), Assembler::AVX_512bit); - __ evmovdquq(ZTMP14, Address(ct, ghash_pos, Address::times_1, 1 * 64), Assembler::AVX_512bit); - __ vpshufb(ZTMP13, ZTMP13, xmm24, Assembler::AVX_512bit); - __ vpshufb(ZTMP14, ZTMP14, xmm24, Assembler::AVX_512bit); - // Load ghash keys - __ evmovdquq(ZTMP15, Address(avx512_subkeyHtbl, rbx, Address::times_1, 0 * 64), Assembler::AVX_512bit); - __ evmovdquq(ZTMP16, Address(avx512_subkeyHtbl, rbx, Address::times_1, 1 * 64), Assembler::AVX_512bit); - - // Ghash blocks 0 - 3 - carrylessMultiply(ZTMP2, ZTMP3, ZTMP4, ZTMP1, ZTMP13, ZTMP15); - // Ghash blocks 4 - 7 - carrylessMultiply(ZTMP6, ZTMP7, ZTMP8, ZTMP5, ZTMP14, ZTMP16); - - __ vpternlogq(ZTMP1, 0x96, ZTMP5, xmm27, Assembler::AVX_512bit); // ZTMP1 = ZTMP1 + ZTMP5 + zmm27 - __ vpternlogq(ZTMP2, 0x96, ZTMP6, xmm26, Assembler::AVX_512bit); // ZTMP2 = ZTMP2 + ZTMP6 + zmm26 - __ vpternlogq(ZTMP3, 0x96, ZTMP7, xmm25, Assembler::AVX_512bit); // ZTMP3 = ZTMP3 + ZTMP7 + zmm25 - __ evpxorq(ZTMP4, ZTMP4, ZTMP8, Assembler::AVX_512bit); // ZTMP4 = ZTMP4 + ZTMP8 - - __ addl(ghash_pos, 128); - __ addl(rbx, 128); - - // Ghash remaining blocks - __ bind(LOOP); - __ cmpl(ghash_pos, pos); - __ jcc(Assembler::aboveEqual, ACCUMULATE); - // Load next cipher blocks and corresponding ghash keys - __ evmovdquq(ZTMP13, Address(ct, ghash_pos, Address::times_1, 0 * 64), Assembler::AVX_512bit); - __ evmovdquq(ZTMP14, Address(ct, ghash_pos, Address::times_1, 1 * 64), Assembler::AVX_512bit); - __ vpshufb(ZTMP13, ZTMP13, xmm24, Assembler::AVX_512bit); - __ vpshufb(ZTMP14, ZTMP14, xmm24, Assembler::AVX_512bit); - __ evmovdquq(ZTMP15, Address(avx512_subkeyHtbl, rbx, Address::times_1, 0 * 64), Assembler::AVX_512bit); - __ evmovdquq(ZTMP16, Address(avx512_subkeyHtbl, rbx, Address::times_1, 1 * 64), Assembler::AVX_512bit); - - // ghash blocks 0 - 3 - carrylessMultiply(ZTMP6, ZTMP7, ZTMP8, ZTMP5, ZTMP13, ZTMP15); - - // ghash blocks 4 - 7 - carrylessMultiply(ZTMP10, ZTMP11, ZTMP12, ZTMP9, ZTMP14, ZTMP16); - - // update sums - // ZTMP1 = ZTMP1 + ZTMP5 + ZTMP9 - // ZTMP2 = ZTMP2 + ZTMP6 + ZTMP10 - // ZTMP3 = ZTMP3 + ZTMP7 xor ZTMP11 - // ZTMP4 = ZTMP4 + ZTMP8 xor ZTMP12 - xorGHASH(ZTMP1, ZTMP2, ZTMP3, ZTMP4, ZTMP5, ZTMP9, ZTMP6, ZTMP10, ZTMP7, ZTMP11, ZTMP8, ZTMP12); - __ addl(ghash_pos, 128); - __ addl(rbx, 128); - __ jmp(LOOP); - // Integrate ZTMP3/ZTMP4 into ZTMP1 and ZTMP2 - __ bind(ACCUMULATE); - __ evpxorq(ZTMP3, ZTMP3, ZTMP4, Assembler::AVX_512bit); - __ vpsrldq(ZTMP7, ZTMP3, 8, Assembler::AVX_512bit); - __ vpslldq(ZTMP8, ZTMP3, 8, Assembler::AVX_512bit); - __ evpxorq(ZTMP1, ZTMP1, ZTMP7, Assembler::AVX_512bit); - __ evpxorq(ZTMP2, ZTMP2, ZTMP8, Assembler::AVX_512bit); - - // Add ZTMP1 and ZTMP2 128 - bit words horizontally - vhpxori4x128(ZTMP1, ZTMP11); - vhpxori4x128(ZTMP2, ZTMP12); - // Load reduction polynomial and compute final reduction - __ evmovdquq(ZTMP15, ExternalAddress(ghash_polynomial_reduction_addr()), Assembler::AVX_512bit, rbx /*rscratch*/); - vclmul_reduce(AAD_HASHx, ZTMP15, ZTMP1, ZTMP2, ZTMP3, ZTMP4); - - // Pre-increment counter for next operation - __ vpaddd(CTR_BLOCKx, CTR_BLOCKx, xmm18, Assembler::AVX_128bit); - // Shuffle counter and save the updated value - __ vpshufb(CTR_BLOCKx, CTR_BLOCKx, xmm24, Assembler::AVX_512bit); + __ movdl(CTR_CHECK, CTR_BLOCKx); + __ andl(CTR_CHECK, 255); + + // Reshuffle counter + __ vpshufb(CTR_BLOCKx, CTR_BLOCKx, SHUF_MASK, Assembler::AVX_512bit); + + initial_blocks_16_avx512(in, out, ct, pos, key, avx512_subkeyHtbl, CTR_CHECK, rounds, CTR_BLOCKx, AAD_HASHx, ADDBE_4x4, ADDBE_1234, ADD_1234, SHUF_MASK, stack_offset); + __ addl(pos, 16 * 16); + __ cmpl(len, 32 * 16); + __ jcc(Assembler::below, MESG_BELOW_32_BLKS); + + initial_blocks_16_avx512(in, out, ct, pos, key, avx512_subkeyHtbl, CTR_CHECK, rounds, CTR_BLOCKx, AAD_HASHx, ADDBE_4x4, ADDBE_1234, ADD_1234, SHUF_MASK, stack_offset + 16); + __ addl(pos, 16 * 16); + __ subl(len, 32 * 16); + + __ cmpl(len, 32 * 16); + __ jcc(Assembler::below, NO_BIG_BLKS); + + __ bind(ENCRYPT_BIG_BLKS_NO_HXOR); + __ cmpl(len, 2 * 32 * 16); + __ jcc(Assembler::below, ENCRYPT_BIG_NBLKS); + ghash16_encrypt_parallel16_avx512(in, out, ct, pos, avx512_subkeyHtbl, CTR_CHECK, rounds, key, CTR_BLOCKx, AAD_HASHx, ADDBE_4x4, ADDBE_1234, ADD_1234, SHUF_MASK, + true, true, false, false, false, ghashin_offset, aesout_offset, HashKey_32); + __ addl(pos, 16 * 16); + + ghash16_encrypt_parallel16_avx512(in, out, ct, pos, avx512_subkeyHtbl, CTR_CHECK, rounds, key, CTR_BLOCKx, AAD_HASHx, ADDBE_4x4, ADDBE_1234, ADD_1234, SHUF_MASK, + true, false, true, false, true, ghashin_offset + 16, aesout_offset + 16, HashKey_16); + __ evmovdquq(AAD_HASHx, ZTMP4, Assembler::AVX_512bit); + __ addl(pos, 16 * 16); + __ subl(len, 32 * 16); + __ jmp(ENCRYPT_BIG_BLKS_NO_HXOR); + + __ bind(ENCRYPT_BIG_NBLKS); + ghash16_encrypt_parallel16_avx512(in, out, ct, pos, avx512_subkeyHtbl, CTR_CHECK, rounds, key, CTR_BLOCKx, AAD_HASHx, ADDBE_4x4, ADDBE_1234, ADD_1234, SHUF_MASK, + false, true, false, false, false, ghashin_offset, aesout_offset, HashKey_32); + __ addl(pos, 16 * 16); + ghash16_encrypt_parallel16_avx512(in, out, ct, pos, avx512_subkeyHtbl, CTR_CHECK, rounds, key, CTR_BLOCKx, AAD_HASHx, ADDBE_4x4, ADDBE_1234, ADD_1234, SHUF_MASK, + false, false, true, true, true, ghashin_offset + 16, aesout_offset + 16, HashKey_16); + + __ movdqu(AAD_HASHx, ZTMP4); + __ addl(pos, 16 * 16); + __ subl(len, 32 * 16); + + __ bind(NO_BIG_BLKS); + __ cmpl(len, 16 * 16); + __ jcc(Assembler::aboveEqual, ENCRYPT_16_BLKS); + + __ bind(ENCRYPT_N_GHASH_32_N_BLKS); + ghash16_avx512(true, false, false, false, true, in, pos, avx512_subkeyHtbl, AAD_HASHx, SHUF_MASK, stack_offset, 0, 0, HashKey_32); + gcm_enc_dec_last_avx512(len, in, pos, AAD_HASHx, SHUF_MASK, avx512_subkeyHtbl, ghashin_offset + 16, HashKey_16, false, true); + __ jmp(GHASH_DONE); + + __ bind(ENCRYPT_16_BLKS); + ghash16_encrypt_parallel16_avx512(in, out, ct, pos, avx512_subkeyHtbl, CTR_CHECK, rounds, key, CTR_BLOCKx, AAD_HASHx, ADDBE_4x4, ADDBE_1234, ADD_1234, SHUF_MASK, + false, true, false, false, false, ghashin_offset, aesout_offset, HashKey_32); + + ghash16_avx512(false, true, false, false, true, in, pos, avx512_subkeyHtbl, AAD_HASHx, SHUF_MASK, stack_offset, 16 * 16, 0, HashKey_16); + + __ bind(MESG_BELOW_32_BLKS); + __ subl(len, 16 * 16); + __ addl(pos, 16 * 16); + gcm_enc_dec_last_avx512(len, in, pos, AAD_HASHx, SHUF_MASK, avx512_subkeyHtbl, ghashin_offset, HashKey_16, true, true); + + __ bind(GHASH_DONE); + //Pre-increment counter for next operation, make sure that counter value is incremented on the LSB + __ vpshufb(CTR_BLOCKx, CTR_BLOCKx, SHUF_MASK, Assembler::AVX_128bit); + __ vpaddd(CTR_BLOCKx, CTR_BLOCKx, ADD_1234, Assembler::AVX_128bit); + __ vpshufb(CTR_BLOCKx, CTR_BLOCKx, SHUF_MASK, Assembler::AVX_128bit); __ movdqu(Address(counter, 0), CTR_BLOCKx); - // Load ghash lswap mask + //Load ghash lswap mask __ movdqu(xmm24, ExternalAddress(ghash_long_swap_mask_addr()), rbx /*rscratch*/); - // Shuffle ghash using lbswap_mask and store it + //Shuffle ghash using lbswap_mask and store it __ vpshufb(AAD_HASHx, AAD_HASHx, xmm24, Assembler::AVX_128bit); __ movdqu(Address(state, 0), AAD_HASHx); - __ jmp(ENC_DEC_DONE); - __ bind(GENERATE_HTBL_48_BLKS); - generateHtbl_48_block_zmm(subkeyHtbl, avx512_subkeyHtbl, rbx /*rscratch*/); + //Zero out sensitive data + __ evpxorq(ZTMP21, ZTMP21, ZTMP21, Assembler::AVX_512bit); + __ evpxorq(ZTMP0, ZTMP0, ZTMP0, Assembler::AVX_512bit); + __ evpxorq(ZTMP1, ZTMP1, ZTMP1, Assembler::AVX_512bit); + __ evpxorq(ZTMP2, ZTMP2, ZTMP2, Assembler::AVX_512bit); + __ evpxorq(ZTMP3, ZTMP3, ZTMP3, Assembler::AVX_512bit); __ bind(ENC_DEC_DONE); - __ movq(rax, pos); } //Implements data * hashkey mod (128, 127, 126, 121, 0) diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_ghash.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_ghash.cpp index 2056fa057654e..5a9b084841376 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64_ghash.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_ghash.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2019, 2021, Intel Corporation. All rights reserved. +* Copyright (c) 2019, 2024, Intel Corporation. All rights reserved. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -57,7 +57,10 @@ address StubGenerator::ghash_byte_swap_mask_addr() { // Polynomial x^128+x^127+x^126+x^121+1 ATTRIBUTE_ALIGNED(16) static const uint64_t GHASH_POLYNOMIAL[] = { - 0x0000000000000001UL, 0xC200000000000000UL, + 0x0000000000000001ULL, 0xC200000000000000ULL, + 0x0000000000000001ULL, 0xC200000000000000ULL, + 0x0000000000000001ULL, 0xC200000000000000ULL, + 0x0000000000000001ULL, 0xC200000000000000ULL }; address StubGenerator::ghash_polynomial_addr() { return (address)GHASH_POLYNOMIAL; diff --git a/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java b/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java index 44cfb76d1628e..478593dfac1ac 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java @@ -72,7 +72,7 @@ abstract class GaloisCounterMode extends CipherSpi { // data size when buffer is divided up to aid in intrinsics private static final int TRIGGERLEN = 65536; // 64k // x86-64 parallel intrinsic data size - private static final int PARALLEL_LEN = 7680; + private static final int PARALLEL_LEN = 512; // max data size for x86-64 intrinsic private static final int SPLIT_LEN = 1048576; // 1MB diff --git a/test/micro/org/openjdk/bench/javax/crypto/full/AESGCMBench.java b/test/micro/org/openjdk/bench/javax/crypto/full/AESGCMBench.java index e46f50678ef81..8355e4aed728e 100644 --- a/test/micro/org/openjdk/bench/javax/crypto/full/AESGCMBench.java +++ b/test/micro/org/openjdk/bench/javax/crypto/full/AESGCMBench.java @@ -35,7 +35,7 @@ public class AESGCMBench extends BenchBase { - @Param({"128"}) + @Param({"128", "192", "256"}) int keyLength; public static final int IV_MODULO = 16; diff --git a/test/micro/org/openjdk/bench/javax/crypto/full/BenchBase.java b/test/micro/org/openjdk/bench/javax/crypto/full/BenchBase.java index 0c5df20d9cb64..94c8ef30ea553 100644 --- a/test/micro/org/openjdk/bench/javax/crypto/full/BenchBase.java +++ b/test/micro/org/openjdk/bench/javax/crypto/full/BenchBase.java @@ -45,7 +45,7 @@ public abstract class BenchBase extends CryptoBase { int keyLength = 256; // Default data sizes for full tests - @Param({"1024", "1500", "4096", "16384"}) + @Param({"128", "256", "512", "1024", "1500", "4096", "16384"}) int dataSize; static final int IV_BUFFER_SIZE = 36; From bfdeb33e6f1d4f9f0cc65925ea792be98b1f4d61 Mon Sep 17 00:00:00 2001 From: Harshitha Onkar Date: Mon, 30 Sep 2024 18:45:40 +0000 Subject: [PATCH 248/307] 8340332: Open source mixed AWT tests - Set3 Reviewed-by: aivanov --- .../ContainerResizeMousePositionTest.java | 141 +++++++++++ .../awt/color/XAWTDifference/XAWTColors.jpg | Bin 0 -> 10774 bytes .../color/XAWTDifference/XAWTDifference.java | 223 ++++++++++++++++++ 3 files changed, 364 insertions(+) create mode 100644 test/jdk/java/awt/MouseInfo/ContainerResizeMousePositionTest.java create mode 100644 test/jdk/java/awt/color/XAWTDifference/XAWTColors.jpg create mode 100644 test/jdk/java/awt/color/XAWTDifference/XAWTDifference.java diff --git a/test/jdk/java/awt/MouseInfo/ContainerResizeMousePositionTest.java b/test/jdk/java/awt/MouseInfo/ContainerResizeMousePositionTest.java new file mode 100644 index 0000000000000..72aa4d93a5c71 --- /dev/null +++ b/test/jdk/java/awt/MouseInfo/ContainerResizeMousePositionTest.java @@ -0,0 +1,141 @@ +/* + * 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.BorderLayout; +import java.awt.Button; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +/* + * @test + * @key headful + * @bug 4009555 + * @summary Unit test for a new method in Container class: getMousePosition(boolean) + * while Container resized. + */ + +public class ContainerResizeMousePositionTest { + private static Frame frame; + private static Button button; + private static Robot robot; + private static volatile Point frameLocation; + private static volatile Point newLoc; + private static boolean testSucceeded = false; + + private static final CountDownLatch eventCaught = new CountDownLatch(1); + + public static void main(String[] args) throws Exception { + try { + robot = new Robot(); + EventQueue.invokeAndWait(() -> createAndShowUI()); + robot.waitForIdle(); + robot.delay(1000); + testUI(); + } finally { + EventQueue.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + } + + private static void createAndShowUI() { + frame = new Frame("Testing getMousePosition() after resize"); + button = new Button("Button"); + frame.setLayout(new BorderLayout()); + frame.add(button); + frame.setSize(200, 200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + private static void testUI() throws Exception { + EventQueue.invokeAndWait(() -> { + frameLocation = frame.getLocationOnScreen(); + newLoc = new Point(frame.getWidth() + 10, frame.getHeight() + 10); + }); + + robot.mouseMove(frameLocation.x + newLoc.x, frameLocation.y + newLoc.y); + EventQueue.invokeAndWait(() -> { + button.addComponentListener(new ResizeAdapter()); + frame.setSize(frame.getWidth() * 2, frame.getHeight() * 2); + frame.validate(); + }); + robot.waitForIdle(); + robot.delay(500); + + if (!eventCaught.await(2, TimeUnit.SECONDS)) { + throw new RuntimeException("componentResized Event isn't" + + " received within a timeout"); + } + + if (!testSucceeded) { + throw new RuntimeException("Container.getMousePosition(boolean)" + + " returned incorrect result while Container resized"); + } + } + + static class ResizeAdapter extends ComponentAdapter { + int testStageCounter = 0; + @Override + public void componentResized(ComponentEvent e) { + Point pTrue = frame.getMousePosition(true); + if (frame.getMousePosition(false) == null) { + testStageCounter++; + System.out.println(""" + TEST STAGE 1 PASSED: + Container.getMousePosition(false) + returned NULL over Child Component + during resize. + """); + } + if (pTrue != null) { + testStageCounter++; + System.out.println(""" + TEST STAGE 2 PASSED: + Container.getMousePosition(true) + returned NON-NULL over Child Component + during resize. + """); + } + if (pTrue != null && pTrue.x == newLoc.x && pTrue.y == newLoc.y) { + testStageCounter++; + System.out.println(""" + TEST STAGE 3 PASSED: + Container.getMousePosition(true) + returned correct result over Child Component + during resize. + """); + } + testSucceeded = testStageCounter == 3; + eventCaught.countDown(); + } + } +} diff --git a/test/jdk/java/awt/color/XAWTDifference/XAWTColors.jpg b/test/jdk/java/awt/color/XAWTDifference/XAWTColors.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f53b30407cc28676f9a91a9690c20b499f9ffbca GIT binary patch literal 10774 zcmch7XIN89*C+x~R1mvBC>E67dkYpoiU>#*q)3w%454>W5kbJCRH-5n=}ibl5_*Kt zkpPka8WV&-C?WK~-FV)6@B4k<{qz1fH_tQKd(Eu9X7--d*Ss_~(&aeDbBuw3fkW@k zZBqt@Bkvg)7~iom0zDV=psv7$33gM@jE#+L>c_oV0Oa=5w(`60nNXSx41x@Lw{MsQWiR3Hdh)s>t5&C;qHb6WmcUQ&TpN+im~?S` znt5gPV!Mbpn(KEWMXMD;n&KaFSnLaw2bwun5^Iym) z#TJa$x;UgUta;k(O^KO#?SzLvg~=K^wXZvZqR+#22{v=nq+Omy&nQCe$6}`oe$M!qT(v zK{uS|2F@sUEHwAP(oZ-`rV^kAC*v$YdW}xit<;mH;=wtLf$QInq1zAp$Y+A~9aDvv zJgfFr8>CA?yZ3y|QmL!&UL0J+ilX;NdCg_)ZtcTE!?UkH$-U(@Ol8%~wK3exx9Jla zOkH4*Ui|s0vGUlS>_DAwbn;w;?%yL_3|yXPJVA58dAi9j)!jrj(94$xUWXX5W#|s! z2vL|EZZ?~>(~-}{w6ppBukUP{Yn;(I{!;nYg36^?>-^?3O}G8p(?Bwj69Px>3}Ssy z^lmzVA+8hnW78!t+|l`Ot-d^EA)wj1l7*r05xFQYqBn$(i&$ET>hHB;@z+f-Dxv7BRw@DF*!P|1wq%vlR22h z-E0mjm2yPkDZV^5NeWBW?BbIP!Rb!4k9y)kSE{3Z+?>yaoh#lvidbx;f5dBkt$0QS-rKU8xQXzROX!`P{1dhzMni=Lu)~e{J;QA|hEqo_fjJ(O~5%Dhl z`)&$6b?<6IMypWM`yCq83!Z((wYZ~}o(ktaBbXJrr0=aOS6GxksO5XZO|Q5(Q4hT8 zXs(Ai?6Ra+HR%KbL1}hlfRwtidJqPAX{{#%Xj?z_few@2(KH z-}r}TTrFpwXy3XBd?xQhe)0ts;UR7<*VtC5gWyQom}R*|0!PX{!m5?Xm`9zFkx`A^ zg`iY@_-asg>7efst@eLcME}%%eX41i3w@6|XkE#EGbcOy6`D{s&L~{C6uCzbu&(T2 z0X9~@*tItEkl#=9-a#=p)|ID-remxtyLBETrYKLuNrPYT5CIUVDjMt5$kEBAHdjwO z(D`6ePrj6Uph4Z+hEXwiJf2MUg!OiHJ>SjXNU1-k#O3Qb72fG^NnWgDQ^>E)F#f3+d{^(|Yq zH!XPl!%dlHuu3P3s60=)1~s47)1wz47USTRfAa&BTMo^}bLF|MBhxv)L`=p(FO$x( z#&#A_)ks2icba{NwL_-S6^H%khg086CZC#HSbz>L-bet60B_?~%<(L2RcT=1Ze1>I zcGZJLLzli8DOQ9I{mK=v{rK0NXpYaC2Ht|dFpqXiHgCmEg14BOT~DwB67eso2|9S? zlqX7F|7KcL?<8L4IHdr)_|pd2j3cs$H=bA28A{^?COVzc&CdvBe?hjh)BG$A>TUODUT=FbRpz zb3F6v^uaATNI&tgDcZd68ksDC@sRgWaG`yS_7Nm1C%Mp4)L<(%f_~e89`Pt*I#`bh zUHhe1fN}cYkAwLwOD*tMa3m-t+FQ-SM|G)KXXX7xH1rignL}5_Xei7P6Ud{0ZlW2U z{b|sEI-oBfmwd&M^5wP?SIsFDbS&226R8KHKX=M2QL2ZhxS$&A=;{2pmX5x_*fY}h z6Kev;vf1EgdD+-Lw+4^>EwNO$Ly6_>tS{XOM*E6~=8Nz4FX7#rZwwAESB0k0udSSZ zo=+5mm)TVYgam#cs6hTDZ+PcCFWX9jGXLhRRgFcRPf>kf`_oEDs;NGAt#z$lFWBZ4 zai%+w9eOaipImk4X?I!kG(qO`<%nfPhK*VbSGNoCTDf@ zvBYkdLC_)AB}L=+8V#BhKsK$*(XnEw`h?YnF%NCj^9e2MmyLkzZ69ux=i9-;?70TEdK>GL%d<1_@E`IUo)Psf>wUWu?>-TcY+~M)0(V}~ldm>)B=kE1X zM_W|K0@KGg>5?cEN|3suRQTQ+5z}N*CXEvq2vU#O+kzIG#Uq!kVkWep&VXKFZJPrH z1O^I#Bl;S`*>@7dzxMyF;Tru>l{F#eAZr*>yRQ`yA zm#wi&L-u$S;175=kIp~&VGb}^l)0A}oL?g(1#ob_Im)CmEV(^WPjlP!;CT?#U1jb6kP3QOa!hC!x%|sK?P8!4E49NqF z%TG|&NY#t}3+&=G)2ot2)7(PUvm9r>EA#Qt?GZOz!`rVl**D4EmS(y>{XsYRXP;uG zA!*=)CtTNDzj!sMi~uhJW{TWeX)DW6!-s(~RFq;uTc6+}NDqpiwKs1|hG9y5}Ec9+3?# zVjUvYlDPW7T5`b~&o#JHy(v>4rk42m_`2-#RjNi-d6LmhQIsuA4kg%&bI8_JV{mY= z|5dkr=}-MICXT_4tP(k%F&cqR641%nfzFLZP`#`U*J533zx)MUA+E@9!gjHP``xl= z&hT#2h=LjI>6Vzpp_wBYxy)u5b$v>;9!%sx!|x`4Va$9UZ!NZQ@2&Kgg;L8vS}{mq z9Ag=7UTK+>EJh?v-q2Opr48)PnpmKM56)9hP;Q>*mAysZGKYf=*9Xn7CMYCbaS0|R zHKvg!P0W8Ze~xog266805(5FtLMYz3(K3mfv7`+Mdx2#i6)E^tcb`aQ3T#USo1INe zaHGkj9~4U5YAnpqSOX;|=;b*MHGkr5`0y@9A8xw*WwXd5C;(d-sKYlVuC$wwSHNad zrqZ!;5L;3qr?iLam%tT_qcaH&#BRS2!*?$9)1{(q-f1H81<1$Ma0U~8e_P9vh&^DA`X|vh&+j_0&?sJt<&hhZx4cSj zAh%qu72AnwzpTqFkX)18FMIyY_;cyAEMLnq23~7U&1ODk5nHTw+upH#7ReH+L`+<^ zn9<@-C2TGaZeWNX_iLuP{nrI4R?8nOlGJE)(q!8%fne#j3mYiak;1CoDpCmro7=UN z_^coou#e?K)_)Hd6m?Yd?}+pB3M1B8Jn9}?zkc1i^7xl^6gDjF_&*bV{P(bCY9|s8 zQ5qd<1p$7w%9MU_kF&3zUkdG=AYhHHcy>z|u4XNjYKE)}Ptl@goMoW`wb8y`ae$8W z-aN%CZrOyda63rhNDJg6Qg&8;Jl!TvPv@%P!@Z1F`vlr-Q{3X! zhUL1be9>$w9=46PiYQQ`4#jV?TBS=ak{M=_D?+(Fcy=)Gndw4T!UYO}N`)!O|B3Um zU}^gBmX;RN;=(z3``<`hwlaURe~HaSpS$VaLwd4BUJ# zlgE)gn)92*=-zOLmJ&?L?#qhh$vF4>N$B7L5;u#ayy$HnM%JgN>=|W&{h^(0o+pPB>&cR7|bPNHc!Js+yfwZ zNrR;6wP&DX7-IR&_RefjzZ@@@F0vcys9tnC-73cI)p$g#Z!lL>uc?fbgupAcmXg%>%6`QRYaqUs7cJEXr8Ng){5Qj zPQ?(1AOFhxU@IvG?<-nAo4%Xk)&%5V-c-LfEtcm`CaBYXb{*eb-QI4@l7=;Xv_Dtv zoc}uwgbsc)7oms2>YZ!@%pbRGzgJqO^n=*Da&tl1l<~*%Ystf}Ss^Gu^L3Xp{yL2& zFsmN&N)|y4)-)%gRU*Xe#!3DOD!KKu4|X&(G}IA|{|RggbAm_qoR-Z5R4EDV(giD# zUu@t-6RLVhfG>U`-7RuL^)RD@>=+)oS)L$5A zklvsv8B!hB5lQ-nA`}N2Xuz6kpG#cwis=0Iujux8&^)4pt}JO3vaaq3lT_t9{_-uq z#=VK`1S3}FSt_6x{!_R4KgFLK2sz5Y4tyVMX_SM_hhbr|KSR`KFNH&Q^T_+}OB_zt2m6m>1}CFF*CBm8G}Qw=tV0>h&z3S%W{BM#unD1Dg9+ zl?9K0sCrpo55SjGLgDcE79>)!$kx_YctC|g&rv=-w~^Hwa4OM+Rlp&;9v0tygk4od z1@N+%0X+?y8{Vw~lyx3Baznj~24#r%4h$R*FWbC#SDsU=y7BsDvmxVm-A9C_VO&MQ zvA)v;sEv&cg)r~8V3ciCM7d8{uiE}AHf6Xyf+H_Zmk#NUWXGtk8FJ zpKwp1*_>EE)v-F+UASCP=Ky&3nQkVMEnktzG6MJ`FssRSQx4rwZBlU^`ZQu_1n}E7q z|4K>aJ{e_p5dW2X@2PUXx+r2{wLzjIKH((g^rI($s|3yKink zww$|w;vG1Du|5pG)4yg-q(3$@2^`%mJt+peJOGCsnFF0yZ6FOS2fs@BO@N4Qv?&Be z3_6wJfw!{5cfozbY^CgJ<}G$AniVNoZmfJ`i{om`VmG9g>}h25hj`Q8@XUyU>BdU) zuWRNla!pbXx@w~?10m8zWJ%lE6>G_G%}XnL?t=F?*loYBZ$E3L7CBPIKEyIh-tYMF zWMW1N)tqMv&Y)LLdr_84L)^|v-_(|ZRw z5$A$9^oG__O=(6&YZS_t1#4nz)D`IQAIK|O`uw29aZxm|qG|S%$dJku)8347&8)(` z+Agboe0)YAf;uS3Lr`XTGyHGuC@zq>vCGXUT3aTGNpLcpur4@27f+ufLHE%(sB`~+ z0hx_m3G2EwI9@v)0wsf71b#!DUXkSqL^FRL3OC=3K#>v$`qdJi1on9~Ztg1h_(7(v zpEWx%#uK0n&WDNy(2~>I{>h`kkm&jCeg!LVOTq$w5f#TcO3m_&>i^|!+ea;=6tisp zy2T^LiprSN!{6ti^t|{se&Vapa(I-+y{!8U3a+HRV%ef6o`$W-0O9|q#!K)3UDzZ6 zjS&V-?z?=+qqShd@~Ge>eGb%TG{av8V z+6-87r7nI@TkDg`=GSj3qw0Z78#uwyNR%PvLuOfPsPjU$dv5cQP{`|fl>N2M;m&Ir zwUs=ITgP@6J^JSF=ugawE!LLG6fr&W8q5=lt&-t!LS(b?evk=x8q^~%NqTb9`lSkv z>6aeq%L2~+C;Z~5iw8w&)%4Z8U`ike(WxP&QFK-vJ-atr9WO))o>zg-s<6!Eao#!Y zpWOG{NU*B8iDfvj?UiP9D@9cC%s2zn>sQ@J{^RDg`|FppI=@>B4;zqlv1n8NhjQ!x z!?`70Naojw&+wPcEc_yy@e~N7J*KGs6T5|f;x9N-HRA=)_bePpWBfa-{`-A!WilBk zG?cOYe8hC*c<@j|k8`_!VQ@DKdef?(V{;QW`3lMG%f<|yXWCJTU@Mk^~S+C#jN%y*32c#7^TWEx)fJ?|=; zY25UA-Yk4?OXjkhqh`e3o%z=d?eYWVQ=-R*rHcIApOEW&Z?0oR_)eQebqkp)oq-!z zT=thUQN1cWo@np|a!nu6)Jb+N@Vj%{h&SB>Z|t5AO-T_aD}{L)!p7+ zc*9^xeD@)`qA_FQ2MB+#7@t2i-;dV?-feMoleo2|6~&*oFfebAk#Ny0HiORbMZYu z#j{Euz~nJjJ;Df#VZDY&Ob`km{GM;*L%&Jfg6iwyWpB?P^S~-Eq@8hue}Jgmm_O!b zBT`pedkgQ|C7xrtu(I;Hi5PFK`U|(5VydL1gohxemRwt88-VKS3^Ke_z~0Wz?&0Cj zrCDDZxU@t76|1_|u-fo3x4~QyxF0DgDXGRrpszk=`f^3ly*yE%i<6VH#!9O1cX>X7 zZEd+tg;hVjytOG)_+kAgn^Q+^)o#vXeIURlK*NL4Q^vpatITRm5S58 zjH|#CeEw#oPg!1K^Z_3I3leV+=a*loXFt7#f0{BNMFrp-0skq`OFE~!ei5+*V9g>E z#ND@6gwJ;+A415k-+uw0vp?kt0E<1mwBY*vGXURB(Y|3YKDvYYU$$h;nT`Oka2TEyls2H!(v`T^5g7l`F?8)uBVMv7g$g< z1tYP?^UmY_WSmhe8?6eL5 z@jj=4E}qMNBXQK%6yTt1*MV)dGPC0;aiB3m|QgKGW?klA6>cBm@TtUKLtS96c@0=WlQ;2Ee&vA;VLY35NwEUuoe-T+;@K z+p>)Qw|D?eqo$??)Q=d~zaztUEx^wap{E%b*mDlg0&D@rc_*awes(Y{C@6y_Dy~(z zL>{lCJzYi}Xp)W-2H86i^t^+;IkZ4zAE2yE8pig2ybu6#tp$}k1c8IC!N`5N=VN-7 zr!0402t+7@!Gj?ZudBS_-;`#;fcmXh+Scwk5AWmtpUd`F4qVZMcm1yQFN6~XTmohE_lYC!{xz*(=mr>@2SbjOv7ua zy)}bQkyDDsv79GQf`L>rxf128U-*PS+ma8+Z&__w)O< z6!4)E;>c8<$KNRe2UxtKqT*ujIfGUjbSWT|PLAH1(9#M+VM2~7=BUMu0%8%dO-w&A z&dN^_G*VMmK6LHnYz4%D5CSlqEm#2i z4%zbVvd*wM5|rsuS)&u*zsv5wY_9XPky8kD7zo~6F&YAQuFje1b5Ky`t>SH^fv9hj z-#HfFt**CLjPXQr206}d0%c~7(2Y*70-tTDh51p=GXVhs)5!2Cj-r%!P;Yhg2wn^L zx|Q}QgY*6+SVMeSQX5=v=32NnEroHa+kQv-SE+RV)pV$af zO_VTDspST`6u;CmmrehvoNb)O6f1z>CG}Ji78$B$okU#UAKz_{TPE%Yhgz(x5z0KO zva+(=WS&VyaTJ>3wScX?=M+~f?CkkI+`M!SnI(?#P)6vR3-n1}#NDk4Y5A(HJ-F>K z^WI|$n??{8^9_771pCH|UPBgoOw~zXAj-YI;&b&2k&d04vin~gG4`(JsruyHaIgGM zMdND9;VG41jt6E}$Lp z$)A`J^V?3STriwqXSGC3-CalKdgW)7s-6jGZ}a!}?+VwTN==dpWp=oSF~3!Ebo#3) z8>t^p`E-ZYdC(x4C+!rfywMAHi!{#F=*XZfC)U!f#!gg6`y!)Xe_`gG>r@}9{+hiy zSD{$O>eD?5oYpXFsg{8MDR_U|JZ8NwTlx;D5e+DDnVuR}#zerT*fh?ala3tpr3`rF zU_(wFI1J>BF3>!R0_WNn7qarTgDopPW~ME?H}^7~XyO_=RZAri)72mhe~|sfxzOhl zk4Tkz5G`semw!dMW-%&I7e%9QLxt&Zf$5CU2h^WRBVaVkTmjkPHT7 zQ0G9CH9UWbMjnUF9qjKeqjo83fuq^k*@dVi-XfrEKDCrCWnVw#P3Ii(d4ZxY`Pd`F zUIwL_mf#^5<^xaa7gX}~gh+7d+pE2yJrFz+c1_?vPbcC6ukz0CX|i68otYD4NyHeg zFT;KZGz0F^mFL{?`{A6HmX`POG=-jTqmdqp5D4T?CFOzOHzJXkx4&Kl6x7-Cp}~c$ zQ0vO0H|KBIVm+g+9^1MCG7Gw;!u{BmA{~cOVS#qtB-C^oOU_;F1xkQx&u`cc$i#_( zc+zEJeO1uL6~7d3IKC zr=vvpwKv=hG1VWUp!juoc(_2yQP)4`&=lJpz3Q%*lohJ#12~2x(zU;)9B?>X8S*t~ z1f2aFj0Y5`@0Er|-55X_N=ZqbY2@ezKElHBo=fzOm;0lD|0o-C#&sWA5OUobq%k*RfZd+0i6-_2S6v{)8Z8}PJ~A=+2H%R|)9xN_)4K^LM7bK!GsesDc#g6TD)&-FD|#r@4_Z;I!=TkSpU$ z5hL#_wa$j!41SAWE?o%Bk5DpgDlD^8N{?V&2)qI}IOcz5Fmxb#L`bOZ&^<8yG!@H+ z40twDei?q~j);Dm(s|j$G9k|Q)9M!9&~=`R)qhHh3dX=^s&`&JyBz$N>~_Yx2=s#7 z>G)sT1rXlH*oH<+pGLW7c+v^cmkG1&eJvrFoam`+?b*u>9G}Y@a;%X{e||14=Xsrn z^ESG=wDmn>Zm;Zu{^!}I|9;l#pMvXiXvY{@-#jSC;({N8qHgZ2&yP~)2Cuj_G&C3k ziL4t-6pGHE7J=dHRFFDnXfHmIn9US*vk8ez3c}(O;XvLCVCSPoN`u-%$_(1)6jS8> z+#Mwe^ae``zlSm$>jS4yZH;dNB(hXesP^X!|Ib|?4XX9%XV_;pcj13ktA~{ZC4h5T zWb+AI-~_{k3m2jVmI|O+jJ?FQKbgLS{sM5xISuV$We5LPvskJ9!7xvG9(a=|!|O`} zrHrp%g_}DF^}EUe1O#)8+=kPKlpV~8zA6CB2GITKs_*z1^g1ezcVxjv#m?Ry9K7b7 z=xKH}Pcz&%Qs0rvoGX|3wEKwrBp%O~j3(6;1KO!41n!Hb{{Vy&oh*>95C6^EArTMb z)LQ$y;QXaC>73s@X&SAr$-{c}Ws}h5wh`bpxW7q2U#27hIYZz}0zA!~j4pLP1cUbX zRFwGi^h(Db5XG4jncl4aT~5B=#9a5F9LPoL9u)j;1Xg)fKRxdD!bgBsa0uDIzC^S=P6gy5(E literal 0 HcmV?d00001 diff --git a/test/jdk/java/awt/color/XAWTDifference/XAWTDifference.java b/test/jdk/java/awt/color/XAWTDifference/XAWTDifference.java new file mode 100644 index 0000000000000..ef0f5aacf4479 --- /dev/null +++ b/test/jdk/java/awt/color/XAWTDifference/XAWTDifference.java @@ -0,0 +1,223 @@ +/* + * 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.Canvas; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Component; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.Image; +import java.awt.Label; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.Panel; +import java.awt.PopupMenu; +import java.awt.ScrollPane; +import java.awt.Scrollbar; +import java.awt.TextArea; +import java.awt.TextField; +import java.awt.Window; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.ImageIcon; +import javax.swing.JLabel; + +/* + * @test + * @bug 5092883 6513478 7154025 + * @requires (os.family == "linux") + * @summary REGRESSION: SystemColor class gives back wrong values under Linux + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual XAWTDifference + */ + +public class XAWTDifference { + + private static final String INSTRUCTIONS = """ + You would see a frame with title "XAWTDifference Test Frame". + + Test Frame (1) + + a) It has three columns in it. The 1st one with ordinary components. + The 2nd one with disabled components. + The 3rd one with uneditable components (only text components + are there). Verify that the difference between different states + is visible. + + Standard Frame (2) + + b) You would also see a frame named StandardFrame (2) + with a lot of components in it. Actually this is just a jpg-image + in a frame. Verify that every component in the frame (1) looks + similar to the same component in (2). + + They might differ in colors and be darker or brighter but + the whole picture should be the same. + + c) Also check the color of the MenuBar Items in the MenuBar and + the PopupMenu assigned to TextArea. + As you can't compare the colors of menu items with the picture + so just look if the are adequate enough. + """; + private static final int HGAP = 20; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("Test Instructions") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(XAWTDifference::createAndShowUI) + .positionTestUI(XAWTDifference::positionMultiTestUI) + .build() + .awaitAndCheck(); + } + + private static Panel addComponentsIntoPanel(boolean enabled, boolean editable) { + TextField tf = new TextField("TextField"); + TextArea ta = new TextArea("TextArea", 10, 10); + + Choice levelChooser = new Choice(); + levelChooser.add("Item #1"); + levelChooser.add("Item #2"); + + Button b = new Button("BUTTON"); + Label label = new Label("LABEL"); + java.awt.List list = new java.awt.List(4, false); + list.add("one"); + list.add("two"); + list.add("three"); + + Checkbox chb = new Checkbox(); + Scrollbar sb = new Scrollbar(Scrollbar.HORIZONTAL); + ScrollPane sp = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS); + sp.add(new TextArea("this is a textarea in scrollpane")); + sp.setSize(200, 200); + Canvas canvas = new Canvas(); + canvas.setSize(100, 100); + + //add popup menu to Button + final PopupMenu pm = new PopupMenu(); + MenuItem i1 = new MenuItem("Item1"); + MenuItem i2 = new MenuItem("Item2"); + MenuItem i3 = new MenuItem("Item3"); + i3.setEnabled(false); + pm.add(i1); + pm.add(i2); + pm.add(i3); + canvas.add(pm); + + ta.add(pm); + ta.addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent me) { + if (me.isPopupTrigger()) { + pm.show(me.getComponent(), me.getX(), me.getY()); + } + } + }); + + ArrayList componentList = new ArrayList<>(); + + componentList.add(tf); + componentList.add(ta); + if (editable){ + componentList.add(levelChooser); + componentList.add(b); + componentList.add(label); + componentList.add(list); + componentList.add(chb); + componentList.add(sb); + componentList.add(sp); + componentList.add(canvas); + } else { + tf.setEditable(false); + ta.setEditable(false); + } + + Panel panel = new Panel(); + panel.setLayout(new GridLayout(0, 1)); + for (Component c : componentList) { + if (!enabled) { + c.setEnabled(false); + } + panel.add(c); + } + return panel; + } + + private static List createAndShowUI() { + Frame testFrame = new Frame("XAWTDifference Test Frame"); + StandardFrame standardFrame = new StandardFrame("StandardFrame"); + standardFrame.pack(); + + testFrame.setLayout(new GridLayout(1, 3)); + testFrame.add(addComponentsIntoPanel(true, true)); + testFrame.add(addComponentsIntoPanel(false, true)); + testFrame.add(addComponentsIntoPanel(true, false)); + + MenuItem mi1 = new MenuItem("Item1"); + MenuItem mi2 = new MenuItem("Item2"); + MenuItem mi3 = new MenuItem("Disabled Item3"); + mi3.setEnabled(false); + + MenuBar mb = new MenuBar(); + Menu enabledMenu = new Menu("Enabled Menu"); + Menu disabledMenu = new Menu("Disabled Menu"); + disabledMenu.setEnabled(false); + mb.add(enabledMenu); + mb.add(disabledMenu); + enabledMenu.add(mi1); + enabledMenu.add(mi2); + enabledMenu.add(mi3); + + testFrame.setMenuBar(mb); + testFrame.setSize(standardFrame.getWidth(), standardFrame.getHeight()); + return List.of(testFrame, standardFrame); + } + + private static void positionMultiTestUI(List windows, + PassFailJFrame.InstructionUI instructionUI) { + int x = instructionUI.getLocation().x + instructionUI.getSize().width + HGAP; + for (Window w : windows) { + w.setLocation(x, instructionUI.getLocation().y); + x += w.getWidth() + HGAP; + } + } + + private static class StandardFrame extends Frame { + public StandardFrame(String name) { + super(name); + String testPath = System.getProperty("test.src", "."); + Panel panel = new Panel(); + panel.add(new JLabel(new ImageIcon(testPath + File.separator + "XAWTColors.jpg"))); + add(panel); + } + } +} From 31858fc4107a616aefd785cc06e932d1f03e2697 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Mon, 30 Sep 2024 22:06:23 +0000 Subject: [PATCH 249/307] 8340491: Thread stack-base assertion should report which thread has the un-set stack Reviewed-by: shade, kevinw, stefank --- src/hotspot/share/runtime/thread.cpp | 10 ++++++++++ src/hotspot/share/runtime/thread.hpp | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index 7c01c8d4e16b3..5b871248c590b 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -145,6 +145,16 @@ Thread::Thread(MemTag mem_tag) { MACOS_AARCH64_ONLY(DEBUG_ONLY(_wx_init = false)); } +#ifdef ASSERT +address Thread::stack_base() const { + // Note: can't report Thread::name() here as that can require a ResourceMark which we + // can't use because this gets called too early in the thread initialization. + assert(_stack_base != nullptr, "Stack base not yet set for thread id:%d (0 if not set)", + osthread() != nullptr ? osthread()->thread_id() : 0); + return _stack_base; +} +#endif + void Thread::initialize_tlab() { if (UseTLAB) { tlab().initialize(); diff --git a/src/hotspot/share/runtime/thread.hpp b/src/hotspot/share/runtime/thread.hpp index 567a76d0eadea..d059a14a0f96d 100644 --- a/src/hotspot/share/runtime/thread.hpp +++ b/src/hotspot/share/runtime/thread.hpp @@ -532,7 +532,7 @@ class Thread: public ThreadShadow { public: // Stack overflow support - address stack_base() const { assert(_stack_base != nullptr,"Sanity check"); return _stack_base; } + address stack_base() const DEBUG_ONLY(;) NOT_DEBUG({ return _stack_base; }) void set_stack_base(address base) { _stack_base = base; } size_t stack_size() const { return _stack_size; } void set_stack_size(size_t size) { _stack_size = size; } From a32c3b43aaefdebf5be229f90d9cd26db1859b95 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Mon, 30 Sep 2024 22:09:39 +0000 Subject: [PATCH 250/307] 8340407: Open source a few more Component related tests Reviewed-by: prr --- .../ComponentLeakTest/ComponentLeakTest.java | 769 ++++++++++++++++++ .../ComponentSerializationTest.java | 354 ++++++++ .../MinMaxSizeDefensive/GetSizesTest.java | 113 +++ .../awt/Component/ZOrderTest/ZOrderTest.java | 159 ++++ 4 files changed, 1395 insertions(+) create mode 100644 test/jdk/java/awt/Component/ComponentLeakTest/ComponentLeakTest.java create mode 100644 test/jdk/java/awt/Component/ComponentSerializationTest/ComponentSerializationTest.java create mode 100644 test/jdk/java/awt/Component/MinMaxSizeDefensive/GetSizesTest.java create mode 100644 test/jdk/java/awt/Component/ZOrderTest/ZOrderTest.java diff --git a/test/jdk/java/awt/Component/ComponentLeakTest/ComponentLeakTest.java b/test/jdk/java/awt/Component/ComponentLeakTest/ComponentLeakTest.java new file mode 100644 index 0000000000000..2936880dde6c6 --- /dev/null +++ b/test/jdk/java/awt/Component/ComponentLeakTest/ComponentLeakTest.java @@ -0,0 +1,769 @@ +/* + * 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. + */ + +/* + * @test + * @key headful + * @requires (os.family != "linux") + * @bug 4119609 4149812 4136116 4171960 4170095 4294016 4343272 + * @summary This test verifies that java.awt objects are being garbage + * collected correctly. That is, it ensures that unneeded + * references (such as JNI global refs or refs in static arrays) + * do not remain after the object is disposed. + * @run main/othervm ComponentLeakTest + */ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Canvas; +import java.awt.CardLayout; +import java.awt.Checkbox; +import java.awt.CheckboxGroup; +import java.awt.CheckboxMenuItem; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.FileDialog; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.GraphicsConfiguration; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.GridLayout; +import java.awt.Label; +import java.awt.LayoutManager; +import java.awt.List; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.MenuShortcut; +import java.awt.Panel; +import java.awt.PopupMenu; +import java.awt.ScrollPane; +import java.awt.Scrollbar; +import java.awt.TextArea; +import java.awt.TextField; +import java.awt.Window; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.dnd.DropTargetEvent; +import java.awt.dnd.DropTargetListener; +import java.lang.ref.PhantomReference; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.util.Map; +import java.util.HashMap; + +public class ComponentLeakTest { + + public static void main(String[] args) { + final int iter = 5; + + for(int count = 0; count < iter; count++) { + MainFrame f = new MainFrame(); + MainWindow w = new MainWindow(f); + MainDialog d = new MainDialog(f); + TestFileDialog fd = new TestFileDialog(f, "TestFileDialog"); + fd.addNotify(); // fd.show() hangs + + fd.dispose(); + d.dispose(); + w.dispose(); + f.dispose(); + } + + // Test layout managers + Frame border = new Frame(); + border.setLayout(new BorderLayout()); + Frame card = new Frame(); + card.setLayout(new CardLayout()); + Frame flow = new Frame(); + flow.setLayout(new FlowLayout()); + Frame gridBag = new Frame(); + gridBag.setLayout(new GridBagLayout()); + Frame grid = new Frame(); + grid.setLayout(new GridLayout(1, 2)); + + for (int count = 0; count < iter; count++) { + border.add(new BorderTestButton("BorderTest"), + BorderLayout.WEST); + border.add(new BorderTestButton("BorderTest"), + BorderLayout.EAST); + card.add(new CardTestButton("CardTest"), "card0"); + card.add(new CardTestButton("CardTest"), "card1"); + flow.add(new FlowTestButton()); + flow.add(new FlowTestButton()); + gridBag.add(new GridBagTestButton(), new GridBagConstraints()); + gridBag.add(new GridBagTestButton(), new GridBagConstraints()); + grid.add(new GridTestButton()); + grid.add(new GridTestButton()); + + border.removeAll(); + card.removeAll(); + flow.removeAll(); + gridBag.removeAll(); + grid.removeAll(); + } + + gc(5); + try { + Thread.sleep(1000); + } catch (InterruptedException ie) { + } + + freeReferences(); + reportLeaks(); + System.err.println("Test passed."); + } + + public static void initWindow(Window w) { + w.setSize(600, 400); + w.setLayout(new FlowLayout()); + + // peered components + w.add(new TestButton("Button")); + w.add(new TestCanvas()); + w.add(new TestCheckbox("Checkbox", true)); + TestChoice choice = new TestChoice(); + choice.add("Choice 1"); + choice.add("Choice Two"); + w.add(choice); + w.add(new TestLabel("Label")); + TestList list = new TestList(); + list.add("List 1"); + list.add("List Two"); + w.add(list); + w.add(new TestScrollbar(Scrollbar.VERTICAL)); + w.add(new TestScrollbar(Scrollbar.HORIZONTAL)); + TestScrollPane scrollpane = new TestScrollPane(); + scrollpane.add(new TestButton("Button in a scrollpane")); + w.add(scrollpane); + w.add(new TestTextArea("TextArea", 3, 30)); + w.add(new TestTextField("TextField")); + + // nested components + TestPanel panel1 = new TestPanel(); + panel1.setLayout(new FlowLayout()); + panel1.setBackground(Color.red); + w.add(panel1); + + panel1.add(new TestButton("level 2")); + + Panel panel2 = new Panel(); + panel2.setLayout(new FlowLayout()); + panel2.setBackground(Color.green); + panel1.add(panel2); + + panel2.add(new TestButton("level 3")); + + w.add(new TestLightweight("Lightweight")); + } + + private static ReferenceQueue queue = new ReferenceQueue(); + private static Map refs = new HashMap(); + + public static void register(Object obj) { + PhantomReference ref = new PhantomReference(obj, queue); + refs.put(ref, obj.getClass().getName()); + } + + private static void gc() { + System.gc(); + try { + Thread.sleep(100); + } catch (InterruptedException ie) { + throw new RuntimeException("Test was interrupted"); + } + } + + private static void gc(int num) { + for (; num > 0; num--) { + gc(); + } + } + + public static void freeReferences() { + System.err.println("Total references: " + refs.size()); + boolean wasFreed = false; + do { + Object[] arr = new Object[2000]; + gc(5); + Reference ref = null; + wasFreed = false; + while ((ref = queue.poll()) != null) { + refs.remove(ref); + wasFreed = true; + gc(); + } + } while (wasFreed); + } + + public static void reportLeaks() { + for (Reference ref : refs.keySet()) { + System.err.println("Leaked " + refs.get(ref)); + } + + if (refs.size() > 0) { + throw new RuntimeException("Some references remained: " + refs.size()); + } + } +} + +class TestFrame extends Frame { + public TestFrame() { + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestFrame(String title) { + super(title); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestWindow extends Window { + public TestWindow(Frame owner) { + super(owner); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestWindow(Window owner) { + super(owner); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestDialogL extends Dialog { + public TestDialogL(Frame owner) { + super(owner); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestDialogL(Frame owner, boolean modal) { + super(owner, modal); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestDialogL(Frame owner, String title) { + super(owner, title); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestDialogL(Frame owner, String title, boolean modal) { + super(owner, title, modal); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestDialogL(Dialog owner) { + super(owner); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestDialogL(Dialog owner, String title) { + super(owner, title); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestDialogL(Dialog owner, String title, boolean modal) { + super(owner, title, modal); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestFileDialog extends FileDialog { + public TestFileDialog(Frame parent) { + super(parent); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestFileDialog(Frame parent, String title) { + super(parent, title); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestFileDialog(Frame parent, String title, int mode) { + super(parent, title, mode); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestButton extends Button { + public TestButton() { + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestButton(String title) { + super(title); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestCanvas extends Canvas { + int width = 100; + int height = 100; + + public TestCanvas() { + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestCanvas(GraphicsConfiguration config) { + super(config); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public void paint(Graphics g) { + g.setColor(Color.blue); + g.fillRoundRect(10, 10, 50, 50, 15, 30); + g.setColor(Color.red); + g.fillOval(70, 70, 25, 25); + } + + public Dimension getPreferredSize() { + return new Dimension(width, height); + } +} + +class TestCheckbox extends Checkbox { + public TestCheckbox() { + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestCheckbox(String label) { + super(label); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestCheckbox(String label, boolean state) { + super(label, state); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestCheckbox(String label, boolean state, CheckboxGroup group) { + super(label, state, group); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestCheckbox(String label, CheckboxGroup group, boolean state) { + super(label, group, state); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestChoice extends Choice { + public TestChoice() { + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestLabel extends Label { + public TestLabel() { + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestLabel(String text) { + super(text); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestLabel(String text, int align) { + super(text, align); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestList extends List { + public TestList() { + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestList(int rows) { + super(rows); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestList(int rows, boolean multipleMode) { + super(rows, multipleMode); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestScrollbar extends Scrollbar { + public TestScrollbar() { + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestScrollbar(int orientation) { + super(orientation); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestScrollbar(int orient, int val, int visible, int min, int max) { + super(orient, val, visible, min, max); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestScrollPane extends ScrollPane { + public TestScrollPane() { + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestScrollPane(int policy) { + super(policy); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestTextField extends TextField { + public TestTextField() { + ComponentLeakTest.register(this); + requestFocus(); + setDropTarget(new TestDropTarget(this)); + } + + public TestTextField(String text) { + super(text); + ComponentLeakTest.register(this); + requestFocus(); + setDropTarget(new TestDropTarget(this)); + } + + public TestTextField(int columns) { + super(columns); + ComponentLeakTest.register(this); + requestFocus(); + setDropTarget(new TestDropTarget(this)); + } + + public TestTextField(String text, int columns) { + super(text, columns); + ComponentLeakTest.register(this); + requestFocus(); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestTextArea extends TextArea { + public TestTextArea() { + ComponentLeakTest.register(this); + requestFocus(); + setDropTarget(new TestDropTarget(this)); + } + + public TestTextArea(String text) { + super(text); + ComponentLeakTest.register(this); + requestFocus(); + setDropTarget(new TestDropTarget(this)); + } + + public TestTextArea(int rows, int columns) { + super(rows, columns); + ComponentLeakTest.register(this); + requestFocus(); + setDropTarget(new TestDropTarget(this)); + } + + public TestTextArea(String text, int rows, int columns) { + super(text, rows, columns); + ComponentLeakTest.register(this); + requestFocus(); + setDropTarget(new TestDropTarget(this)); + } + + public TestTextArea(String text, int rows, int columns, int bars) { + super(text, rows, columns, bars); + ComponentLeakTest.register(this); + requestFocus(); + setDropTarget(new TestDropTarget(this)); + } +} + +class TestPanel extends Panel { + public TestPanel() { + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } + + public TestPanel(LayoutManager layout) { + super(layout); + ComponentLeakTest.register(this); + setDropTarget(new TestDropTarget(this)); + } +} +class TestMenu extends Menu { + public TestMenu() { + ComponentLeakTest.register(this); + } + + public TestMenu(String label) { + super(label); + ComponentLeakTest.register(this); + } + + public TestMenu(String label, boolean tearOff) { + super(label, tearOff); + ComponentLeakTest.register(this); + } +} + +class TestMenuItem extends MenuItem { + public TestMenuItem() { + ComponentLeakTest.register(this); + } + public TestMenuItem(String label) { + super(label); + ComponentLeakTest.register(this); + } + + public TestMenuItem(String label, MenuShortcut s) { + super(label, s); + ComponentLeakTest.register(this); + } +} + +class TestMenuBar extends MenuBar { + public TestMenuBar() { + ComponentLeakTest.register(this); + } +} + +class TestPopupMenu extends PopupMenu { + public TestPopupMenu() { + ComponentLeakTest.register(this); + } + + public TestPopupMenu(String label) { + super(label); + ComponentLeakTest.register(this); + } +} + +class TestCheckboxMenuItem extends CheckboxMenuItem { + public TestCheckboxMenuItem() { + ComponentLeakTest.register(this); + } + + public TestCheckboxMenuItem(String label) { + super(label); + ComponentLeakTest.register(this); + } + + public TestCheckboxMenuItem(String label, boolean state) { + super(label, state); + ComponentLeakTest.register(this); + } +} + +class BorderTestButton extends Button { + public BorderTestButton() { + ComponentLeakTest.register(this); + } + + public BorderTestButton(String title) { + super(title); + ComponentLeakTest.register(this); + } +} + +class CardTestButton extends Button { + public CardTestButton() { + ComponentLeakTest.register(this); + } + + public CardTestButton(String title) { + super(title); + ComponentLeakTest.register(this); + } +} + +class FlowTestButton extends Button { + public FlowTestButton() { + ComponentLeakTest.register(this); + } + + public FlowTestButton(String title) { + super(title); + ComponentLeakTest.register(this); + } +} + +class GridBagTestButton extends Button { + public GridBagTestButton() { + ComponentLeakTest.register(this); + } + + public GridBagTestButton(String title) { + super(title); + ComponentLeakTest.register(this); + } +} + +class GridTestButton extends Button { + public GridTestButton() { + ComponentLeakTest.register(this); + } + + public GridTestButton(String title) { + super(title); + ComponentLeakTest.register(this); + } +} + +class TestLightweight extends Component { + String label; + int width = 100; + int height = 30; + + public TestLightweight(String label) { + this.label = label; + ComponentLeakTest.register(this); + } + + public void paint(Graphics g) { + Dimension d = getSize(); + g.setColor(Color.orange); + g.fillRect(0, 0, d.width, d.height); + g.setColor(Color.black); + int x = 5; + int y = (d.height - 5); + g.drawString(label, x, y); + } + + public Dimension getPreferredSize() { + return new Dimension(width,height); + } +} + +class TestDropTarget extends DropTarget { + public TestDropTarget(Component comp) { + super(comp, new DropTargetListener() { + public void dragEnter(DropTargetDragEvent dtde) {} + public void dragOver(DropTargetDragEvent dtde) {} + public void dropActionChanged(DropTargetDragEvent dtde) {} + public void dragExit(DropTargetEvent dte) {} + public void drop(DropTargetDropEvent dtde) {} + }); + ComponentLeakTest.register(this); + } +} + +class MainWindow extends TestWindow { + public MainWindow(Frame f) { + super(f); + ComponentLeakTest.initWindow(this); + setVisible(true); + + TestPopupMenu popup = new TestPopupMenu("hi"); + add(popup); + popup.show(this, 5, 5); + } +} + +class MainDialog extends TestDialogL { + public MainDialog(Frame f) { + super(f, "MainDialog", false); + ComponentLeakTest.initWindow(this); + setVisible(true); + + TestPopupMenu popup = new TestPopupMenu("hi"); + add(popup); + popup.show(this, 5, 5); + } +} + +class MainFrame extends TestFrame { + public MainFrame(){ + super("Component Leak Test MainFrame"); + + ComponentLeakTest.initWindow(this); + + TestMenu menu = new TestMenu("Print"); + TestMenu menu2 = new TestMenu("File"); + TestMenu menu3 = new TestMenu("Edit"); + TestMenu menu4 = new TestMenu("ReallyReallyReallyReallyReallyReallyReallyReally" + + "ReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLong"); + menu2.setFont(new Font("SansSerif", Font.BOLD, 20)); + menu2.setEnabled(false); + menu3.setFont(new Font("Monospaced", Font.ITALIC, 18)); + menu3.setEnabled(false); + menu4.setEnabled(false); + TestMenuItem itemPrinter = new TestMenuItem("foobar"); + TestMenuItem itemScreen = new TestMenuItem("baz"); + TestCheckboxMenuItem itemCheck = new TestCheckboxMenuItem("yep"); + menu.add(itemPrinter); + menu.add(itemScreen); + menu.add(itemCheck); + TestMenuBar menuBar = new TestMenuBar(); + menuBar.add( menu ); + menuBar.add( menu2 ); + menuBar.add( menu3 ); + menuBar.add( menu4 ); + setMenuBar(menuBar); + + setVisible(true); + + TestPopupMenu popup = new TestPopupMenu("hi"); + add(popup); + popup.show(this, 5, 5); + } +} diff --git a/test/jdk/java/awt/Component/ComponentSerializationTest/ComponentSerializationTest.java b/test/jdk/java/awt/Component/ComponentSerializationTest/ComponentSerializationTest.java new file mode 100644 index 0000000000000..ddf7efffdbdfc --- /dev/null +++ b/test/jdk/java/awt/Component/ComponentSerializationTest/ComponentSerializationTest.java @@ -0,0 +1,354 @@ +/* + * 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 4146452 + * @summary Tests serialization of peered and lightweight Components. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ComponentSerializationTest + */ + +import java.awt.Button; +import java.awt.Canvas; +import java.awt.Checkbox; +import java.awt.CheckboxMenuItem; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.FileDialog; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Insets; +import java.awt.Label; +import java.awt.List; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.Panel; +import java.awt.ScrollPane; +import java.awt.Scrollbar; +import java.awt.TextArea; +import java.awt.TextField; +import java.awt.Window; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import javax.swing.JPanel; + +public class ComponentSerializationTest extends JPanel { + private MainFrame mf; + private MainWindow mw; + private MainDialog md; + private MainFileDialog mfd; + private static final String INSTRUCTIONS = """ + A Frame, a Window, and a Dialog should appear. From the Frame's + "Serialize" menu, select "Serialize!". Another Frame, Window, and + Dialog should appear exactly on top of the existing ones. The state + and functionality of the two sets of Windows should be identical. If + any errors or exceptions appear in the log area, or if the second set of + Windows is different from the first, the test fails. Otherwise, the + test passes. + """; + + private static final ArrayList toDispose = new ArrayList<>(); + + public ComponentSerializationTest() { + mf = new MainFrame(); + toDispose.add(mf); + mw = new MainWindow(mf); + toDispose.add(mw); + md = new MainDialog(mf); + toDispose.add(md); + mfd = new MainFileDialog(mf); + toDispose.add(mfd); + } + + public static void main(String[] argc) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Component Serialization Test") + .splitUI(ComponentSerializationTest::new) + .instructions(INSTRUCTIONS) + .columns(40) + .logArea() + .build() + .awaitAndCheck(); + for (Window w : toDispose) { + if (w != null) { + EventQueue.invokeAndWait(w::dispose); + } + } + } + + private void initWindow(Window w) { + w.setSize(600, 400); + w.setLayout(new FlowLayout()); + + // peered components + w.add(new Button("Button")); + w.add(new TestCanvas()); + w.add(new Checkbox("Checkbox", true)); + Choice choice = new Choice(); + choice.add("Choice 1"); + choice.add("Choice Two"); + w.add(choice); + w.add(new Label("Label")); + List list = new List(); + list.add("List 1"); + list.add("List Two"); + w.add(list); + w.add(new Scrollbar(Scrollbar.VERTICAL)); + w.add(new Scrollbar(Scrollbar.HORIZONTAL)); + ScrollPane scrollpane = new ScrollPane(); + scrollpane.add(new Button("Button in a scrollpane")); + w.add(scrollpane); + w.add(new TextArea("TextArea", 3, 30)); + w.add(new TextField("TextField")); + + // nested components + Panel panel1 = new Panel(); + panel1.setLayout(new FlowLayout()); + panel1.setBackground(Color.red); + w.add(panel1); + + panel1.add(new Button("level 2")); + + Panel panel2 = new Panel(); + panel2.setLayout(new FlowLayout()); + panel2.setBackground(Color.green); + panel1.add(panel2); + + panel2.add(new Button("level 3")); + + // lightweight components + w.add(new LWButton("LWbutton") ); + + // overlapping components + w.add(new ZOrderPanel()); + } + + class MainWindow extends Window { + public MainWindow(Frame f) { + super(f); + initWindow(this); + setLocation(650, 0); + setVisible(true); + } + } + + class MainDialog extends Dialog { + public MainDialog(Frame f) { + super(f, "MainDialog", false); + initWindow(this); + setLocation(0, 450); + setVisible(true); + } + } + + class MainFileDialog extends FileDialog { + public MainFileDialog(Frame f) { + super(f, "MainFileDialog", FileDialog.SAVE); + setLocation(650, 450); + addNotify(); + } + } + + class MainFrame extends Frame { + public MainFrame() { + super("ComponentSerializationTest"); + initWindow(this); + + Menu menu = new Menu("Serialize"); + Menu menu2 = new Menu("File"); + Menu menu3 = new Menu("Edit"); + Menu menu4 = new Menu("ReallyReallyReallyReallyReallyReallyReallyReally" + + "ReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLong"); + menu2.setFont(new Font("SansSerif", Font.BOLD, 20)); + menu2.setEnabled(false); + menu3.setFont(new Font("Monospaced", Font.ITALIC, 18)); + menu3.setEnabled(false); + menu4.setEnabled(false); + MenuItem itemSerialize = new MenuItem("Serialize!"); + CheckboxMenuItem itemCheck = new CheckboxMenuItem("Check me"); + menu.add(itemSerialize); + menu.add(itemCheck); + MenuBar menuBar = new MenuBar(); + menuBar.add(menu); + menuBar.add(menu2); + menuBar.add(menu3); + menuBar.add(menu4); + setMenuBar(menuBar); + + itemSerialize.addActionListener(new ActionSerialize()); + + setLocation(0, 0); + setVisible(true); + } + } + + class ActionSerialize implements ActionListener { + public void actionPerformed(ActionEvent ev) { + Frame f2 = null; + Window w2 = null; + Dialog d2 = null; + FileDialog fd2 = null; + + try { + FileOutputStream fos = new FileOutputStream("tmp"); + ObjectOutputStream oos = new ObjectOutputStream(fos); + oos.writeObject(mf); + oos.writeObject(mw); + oos.writeObject(md); + oos.writeObject(mfd); + oos.flush(); + + FileInputStream fis = new FileInputStream("tmp"); + ObjectInputStream ois = new ObjectInputStream(fis); + f2 = (Frame)ois.readObject(); + w2 = (Window)ois.readObject(); + d2 = (Dialog)ois.readObject(); + fd2= (FileDialog)ois.readObject(); + } catch (Exception e) { + PassFailJFrame.log(e.getMessage()); + } + + if (f2 == null || w2 == null || d2 == null || fd2 == null) { + PassFailJFrame.log("ERROR: one of the components was not deserialized."); + PassFailJFrame.log("frame = " + f2); + PassFailJFrame.log("window = " + w2); + PassFailJFrame.log("dialog = " + d2); + PassFailJFrame.log("file dalog = " + fd2); + } + + if (f2 != null) { + toDispose.add(f2); + f2.setVisible(true); + } + if (w2 != null) { + toDispose.add(w2); + w2.setVisible(true); + } + if (d2 != null) { + toDispose.add(d2); + d2.setVisible(true); + } + if (fd2 != null) { + toDispose.add(fd2); + fd2.addNotify(); + } + } + } + + class LWButton extends Component { + String label; + int width = 100; + int height = 30; + + public LWButton(String label) { + super(); + this.label = label; + } + + public void paint(Graphics g) { + Dimension d = getSize(); + g.setColor(Color.orange); + g.fillRect(0, 0, d.width, d.height); + g.setColor(Color.black); + int x = 5; + int y = (d.height - 5); + g.drawString(label, x, y); + } + + public Dimension getPreferredSize() { + return new Dimension(width, height); + } + } + + class TestCanvas extends Canvas { + int width = 100; + int height = 100; + + public void paint(Graphics g) { + g.setColor(Color.blue); + g.fillRoundRect(10, 10, 50, 50, 15, 30); + g.setColor(Color.red); + g.fillOval(70, 70, 25, 25); + } + public Dimension getPreferredSize() { + return new Dimension(width, height); + } + } + + class ZOrderPanel extends Panel { + public ZOrderPanel() { + setLayout(null); + + Component first, second, third, fourth; + + show(); + first = makeBox("Second", Color.blue, -1); + second = makeBox("First", Color.yellow, 0); + fourth = makeBox("Fourth", Color.red, 2); + third = makeBox("Third", Color.green, 3); + remove(third); + add(third, 2); + validate(); + add(new LWButton("LWButton"), 0); + } + + public Dimension preferredSize() { + return new Dimension(260, 80); + } + + public void layout() { + int i, n; + Insets ins = insets(); + n = countComponents(); + for (i = n - 1; i >= 0; i--) { + Component p = getComponent(i); + p.reshape(ins.left + 40 * i, ins.top + 5 * i, 60, 60); + } + } + + public Component makeBox(String s, Color c, int index) { + Label l = new Label(s); + l.setBackground(c); + l.setAlignment(Label.RIGHT); + add(l, index); + validate(); + return l; + } + } +} diff --git a/test/jdk/java/awt/Component/MinMaxSizeDefensive/GetSizesTest.java b/test/jdk/java/awt/Component/MinMaxSizeDefensive/GetSizesTest.java new file mode 100644 index 0000000000000..2b4954879380a --- /dev/null +++ b/test/jdk/java/awt/Component/MinMaxSizeDefensive/GetSizesTest.java @@ -0,0 +1,113 @@ +/* + * 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 4783989 + @summary get(Preferred|Minimum|Maximum)Size() must not return a reference. + The object copy of Dimension class needed. + @key headful + @run main GetSizesTest +*/ + +import java.awt.Button; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.lang.reflect.InvocationTargetException; + +public class GetSizesTest extends Frame { + Button b; + + public static void main(final String[] args) throws InterruptedException, + InvocationTargetException { + GetSizesTest app = new GetSizesTest(); + EventQueue.invokeAndWait(() -> { + try { + app.init(); + app.start(); + } finally { + app.dispose(); + } + }); + } + + public void init() { + b = new Button("button"); + add(b); + } + + public void start () { + setSize(200, 200); + setLocationRelativeTo(null); + setVisible(true); + validate(); + + System.out.println("Test set for Container (Frame)."); + + Dimension dimPref = getPreferredSize(); + dimPref.setSize(101, 101); + if (getPreferredSize().equals(new Dimension(101, 101))) { + throw new RuntimeException("Test Failed for: " + dimPref); + } + System.out.println("getPreferredSize() Passed."); + + Dimension dimMin = getMinimumSize(); + dimMin.setSize(101, 101); + if (getMinimumSize().equals(new Dimension(101, 101))) { + throw new RuntimeException("Test Failed for: " + dimMin); + } + System.out.println("getMinimumSize() Passed."); + + Dimension dimMax = getMaximumSize(); + dimMax.setSize(101, 101); + if (getMaximumSize().equals(new Dimension(101, 101))) { + throw new RuntimeException("Test Failed for: " + dimMax); + } + System.out.println("getMaximumSize() Passed."); + + System.out.println("Test set for Component (Button)."); + + dimPref = b.getPreferredSize(); + dimPref.setSize(33, 33); + if (b.getPreferredSize().equals(new Dimension(33, 33))) { + throw new RuntimeException("Test Failed for: " + dimPref); + } + System.out.println("getPreferredSize() Passed."); + + dimMin = b.getMinimumSize(); + dimMin.setSize(33, 33); + if (b.getMinimumSize().equals(new Dimension(33, 33))) { + throw new RuntimeException("Test Failed for: " + dimMin); + } + System.out.println("getMinimumSize() Passed."); + + dimMax = b.getMaximumSize(); + dimMax.setSize(33, 33); + if (b.getMaximumSize().equals(new Dimension(33, 33))) { + throw new RuntimeException("Test Failed for: " + dimMax); + } + System.out.println("getMaximumSize() Passed."); + System.out.println("GetSizesTest Succeeded."); + } +} diff --git a/test/jdk/java/awt/Component/ZOrderTest/ZOrderTest.java b/test/jdk/java/awt/Component/ZOrderTest/ZOrderTest.java new file mode 100644 index 0000000000000..15003f753a6fe --- /dev/null +++ b/test/jdk/java/awt/Component/ZOrderTest/ZOrderTest.java @@ -0,0 +1,159 @@ +/* + * 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. + */ + +/* + * @test + * @bug 4059430 + * @summary Test for component z-ordering consistency + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ZOrderTest + */ + +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.Insets; +import java.awt.Label; +import java.awt.Panel; +import java.lang.reflect.InvocationTargetException; +import java.util.List; + +public class ZOrderTest { + public final static String INSTRUCTIONS = """ + The ZOrderTest creates two frames. + - Frame 1 has components added to an intermediate panel + - Frame 2 has components added directly to the frame itself + Verify that the components are in the correct z-order. Lower numbered + components should overlap higher numbered ones (e.g. component zero should + appear on top of component one). + Both frames should have the same component ordering, and this ordering should + be the same on all supported operating systems. + """; + + public static void main(String [] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Component ZOrder Test") + .testUI(ZOrderTest::makeFrames) + .instructions(INSTRUCTIONS) + .columns(40) + .logArea() + .build() + .awaitAndCheck(); + } + + private static List makeFrames() { + Frame frame, frame2; + + // test adding components to panel on a frame + frame = new Frame("ZOrderTest(1) for 4059430"); + frame.pack(); + frame.show(); + Panel panel = new ZOrderPanel(); + frame.setBounds(0, 0, 500, 350); + frame.setLayout(new GridLayout()); + frame.add(panel); + doTest(panel); + + // test adding components directly to frame + frame2 = new ZOrderTestFrame("ZOrderTest(2) for 4059430"); + frame2.pack(); + frame2.show(); + frame2.setBounds(80, 80, 500, 350); + doTest(frame2); + + return List.of(frame, frame2); + } + + /* + * This tests various boundary conditions with z-ordering + * - inserting at the top of the z-order + * - inserting at the bottom of the z-order + * - inserting in the middle of the z-order + */ + private static void doTest(Container cont) { + Component compZero, compOne, compTwo, compThree, compFour; + + compZero = makeBox(cont, "Comp One", Color.blue, -1); + // insert on top + compOne = makeBox(cont, "Comp Zero", Color.yellow, 0); + // put at the back + compThree = makeBox(cont, "Comp Three", Color.red, 2); + // insert in last position + compTwo = makeBox(cont, "Comp Two", Color.green, 3); + // swap compTwo and compThree to correct positions + cont.remove(compTwo); + cont.add(compTwo, 2); + // one more test of adding to the end + compFour = makeBox(cont, "Comp Four", Color.magenta, -1); + // re-validate so components cascade into proper place + cont.validate(); + } + + private static Component makeBox(Container cont, String s, Color c, int index) { + Label l = new Label(s); + l.setBackground(c); + l.setAlignment(Label.RIGHT); + if (index == -1) { + cont.add(l); // semantically equivalent to -1, but why not test this too + } else { + cont.add(l, index); + } + cont.validate(); + return l; + } + + /** + * Cascades components across the container so + * that they overlap, demonstrating their z-ordering + */ + static void doCascadeLayout(Container cont) { + int i, n; + Insets ins = cont.insets(); + n = cont.countComponents(); + for (i = n - 1; i >= 0; i--) { + Component comp = cont.getComponent(i); + comp.reshape(ins.left + 75 * i, ins.top + 30 * i, 100, 100); + } + } +} + +class ZOrderPanel extends Panel { + public void layout() { + ZOrderTest.doCascadeLayout(this); + } +} + +class ZOrderTestFrame extends Frame +{ + public ZOrderTestFrame(String title) { + super(title); + } + + public void layout() { + ZOrderTest.doCascadeLayout(this); + } +} From b11066b56b69b2c526539e712cef47723098597f Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Tue, 1 Oct 2024 02:47:40 +0000 Subject: [PATCH 251/307] 8340719: Open source AWT List tests Reviewed-by: prr --- test/jdk/ProblemList.txt | 1 + .../HandlingKeyEventIfMousePressedTest.java | 167 ++++++++++++++++++ .../java/awt/List/ListActionEventTest.java | 93 ++++++++++ .../MultiSelectionListHorizScrollbar.java | 80 +++++++++ .../jdk/java/awt/List/RepaintAfterResize.java | 73 ++++++++ 5 files changed, 414 insertions(+) create mode 100644 test/jdk/java/awt/List/HandlingKeyEventIfMousePressedTest.java create mode 100644 test/jdk/java/awt/List/ListActionEventTest.java create mode 100644 test/jdk/java/awt/List/MultiSelectionListHorizScrollbar.java create mode 100644 test/jdk/java/awt/List/RepaintAfterResize.java diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 8060792a51f9a..f02272977aa17 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -797,3 +797,4 @@ 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 +java/awt/List/HandlingKeyEventIfMousePressedTest.java 6848358 macosx-all,windows-all diff --git a/test/jdk/java/awt/List/HandlingKeyEventIfMousePressedTest.java b/test/jdk/java/awt/List/HandlingKeyEventIfMousePressedTest.java new file mode 100644 index 0000000000000..e5c89c1df126d --- /dev/null +++ b/test/jdk/java/awt/List/HandlingKeyEventIfMousePressedTest.java @@ -0,0 +1,167 @@ +/* + * 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. + */ + +/* + * @test + * @bug 6293432 + * @summary Key events ('SPACE', 'UP', 'DOWN') aren't blocked + * if mouse is kept in 'PRESSED' state for List + * @key headful + * @run main HandlingKeyEventIfMousePressedTest + */ + +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.List; +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.InputEvent; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; + +public class HandlingKeyEventIfMousePressedTest { + + static Frame frame; + static List list; + static volatile Point loc; + + public static void main(String[] args) throws Exception { + Robot robot = new Robot(); + robot.setAutoDelay(100); + try { + EventQueue.invokeAndWait(() -> createUI()); + robot.waitForIdle(); + robot.delay(1000); + EventQueue.invokeAndWait(() -> { + loc = list.getLocationOnScreen(); + }); + robot.mouseMove(loc.x + 10, loc.y + 10); + robot.waitForIdle(); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + + // key pressing when the mouse is kept in the 'pressed' state + robot.keyPress(KeyEvent.VK_DOWN); + robot.keyRelease(KeyEvent.VK_DOWN); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + + int selectedIndex = list.getSelectedIndex(); + if (selectedIndex != 0) { + throw new RuntimeException("Test failed: list.getCurrentItem = " + selectedIndex); + } + } finally { + EventQueue.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + } + + private static void createUI() { + frame = new Frame("HandlingKeyEventIfMousePressedTest"); + list = new List(10, false); + + list.add("111"); + list.add("222"); + list.add("333"); + list.add("444"); + frame.add(list); + + addListeners(); + + frame.setLayout(new FlowLayout()); + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + // added in order to have more information in failed case + private static void addListeners() { + + list.addMouseMotionListener( + new MouseMotionAdapter() { + @Override + public void mouseDragged(MouseEvent me) { + System.out.println(me); + } + + @Override + public void mouseMoved(MouseEvent me) { + System.out.println(me); + } + }); + + list.addMouseListener( + new MouseAdapter(){ + public void mousePressed(MouseEvent me) { + System.out.println(me); + } + public void mouseClicked(MouseEvent me) { + System.out.println(me); + } + public void mouseEntered(MouseEvent me) { + System.out.println(me); + } + public void mouseExited(MouseEvent me) { + System.out.println(me); + } + public void mouseReleased(MouseEvent me) { + System.out.println(me); + } + }); + + list.addActionListener( + new ActionListener() { + public void actionPerformed(ActionEvent ae) { + System.out.println(ae); + } + }); + + list.addItemListener( + new ItemListener() { + public void itemStateChanged(ItemEvent ie) { + System.out.println(ie); + } + }); + + list.addFocusListener( + new FocusAdapter() { + public void focusGained(FocusEvent fe) { + System.out.println(fe); + } + public void focusLost(FocusEvent fe) { + System.out.println(fe); + } + }); + } +} diff --git a/test/jdk/java/awt/List/ListActionEventTest.java b/test/jdk/java/awt/List/ListActionEventTest.java new file mode 100644 index 0000000000000..2cd8d04a39dc6 --- /dev/null +++ b/test/jdk/java/awt/List/ListActionEventTest.java @@ -0,0 +1,93 @@ +/* + * 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 4089604 + * @summary Enter key doesn't fire List actionPerformed as specified + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ListActionEventTest +*/ + +import java.awt.BorderLayout; +import java.awt.Frame; +import java.awt.List; +import java.awt.Panel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + +public class ListActionEventTest { + + private static final String INSTRUCTIONS = """ + A frame will be shown. + 1. Click any item in the list (say item 1) in the frame + 2. A message 'ItemSelected' is displayed on the message window. + 3. Press the return key on the selected item. + 4. If the text 'ActionPerformed' is displayed on the message window, + then press PASS else press FAIL."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("ListActionEventTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(ListActionEventTest::createTestUI) + .logArea() + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame frame = new Frame("ListActionEventTest frame"); + + Panel pnl1 = new Panel(); + frame.add(pnl1); + pnl1.setLayout(new BorderLayout()); + + List list = new List(); + for (int i = 0; i < 5; i++) { + list.addItem("Item " + i); + } + pnl1.add(list); + + list.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent ev) { + PassFailJFrame.log("ActionPerformed"); + } + }); + + list.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent ev) { + PassFailJFrame.log("ItemSelected"); + } + }); + frame.pack(); + return frame; + } +} diff --git a/test/jdk/java/awt/List/MultiSelectionListHorizScrollbar.java b/test/jdk/java/awt/List/MultiSelectionListHorizScrollbar.java new file mode 100644 index 0000000000000..289cd0c2daca9 --- /dev/null +++ b/test/jdk/java/awt/List/MultiSelectionListHorizScrollbar.java @@ -0,0 +1,80 @@ +/* + * 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 4102881 + * @summary Ensure multiple selection Lists have horizontal scrollbars when necessary + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MultiSelectionListHorizScrollbar +*/ + +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.List; + +public class MultiSelectionListHorizScrollbar { + + private static final String INSTRUCTIONS = """ + Resize the frame so that the lists are not wide enough + to fully display the lines of text they contain. + Once the lists are in this state, press pass + if both lists display an horizontal scrollbar. Otherwise press fail."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("MultiSelectionListHorizScrollbar Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(MultiSelectionListHorizScrollbar::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame frame = new Frame("MultiSelectionListHorizScrollbar Frame"); + List singleList = new List(3); + List multiList = new List(3, true); + + frame.setLayout(new GridLayout(1, 2)); + frame.add(singleList); + frame.add(multiList); + + singleList.addItem("This is the 1st item in the list! Does it scroll horizontally??"); + singleList.addItem("This is the 2nd item in the list! Does it scroll horizontally??"); + singleList.addItem("This is the 4th item in the list! Does it scroll horizontally??"); + singleList.addItem("This is the 5th item in the list! Does it scroll horizontally??"); + singleList.addItem("This is the 6th item in the list! Does it scroll horizontally??"); + + multiList.addItem("This is the 1st item in the list! Does it scroll horizontally??"); + multiList.addItem("This is the 2nd item in the list! Does it scroll horizontally??"); + multiList.addItem("This is the 4th item in the list! Does it scroll horizontally??"); + multiList.addItem("This is the 5th item in the list! Does it scroll horizontally??"); + multiList.addItem("This is the 6th item in the list! Does it scroll horizontally??"); + + frame.pack(); + return frame; + } +} diff --git a/test/jdk/java/awt/List/RepaintAfterResize.java b/test/jdk/java/awt/List/RepaintAfterResize.java new file mode 100644 index 0000000000000..12bb584aefa88 --- /dev/null +++ b/test/jdk/java/awt/List/RepaintAfterResize.java @@ -0,0 +1,73 @@ +/* + * 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. + */ + +/* + * @test + * @bug 6308295 + * @summary XAWTduplicate list item is displayed + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual RepaintAfterResize +*/ + +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.List; + +public class RepaintAfterResize { + + private static final String INSTRUCTIONS = """ + 1) A Frame appears with a list + 2) Resize somehow the frame using mouse + 3) Move down the vertical scrollbar of the list + 4) If you see that two selected items are displayed then the test failed. + Otherwise, the test passed."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("RepaintAfterResize Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(RepaintAfterResize::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame frame = new Frame("RepaintAfterResize Frame"); + List list = new List(4, false); + + frame.setLayout (new FlowLayout ()); + list.setBounds(100, 100, 100, 100); + for (int i = 0 ; i < 7 ; i++) { + list.add(" " + i); + } + frame.add(list); + list.select(3); + + frame.setSize(100, 100); + return frame; + + } +} From 988f13a3875a6d29d7de07c5e97fcd6e7f9a31ff Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 1 Oct 2024 04:32:55 +0000 Subject: [PATCH 252/307] 8340354: Open source AWT desktop properties and print related tests Reviewed-by: prr --- .../awt/DesktopProperties/FontSmoothing.java | 93 ++++ .../ThreeDBackgroundColor.java | 100 ++++ .../awt/PrintJob/PrintCompatibilityTest.java | 446 ++++++++++++++++ .../java/awt/PrintJob/PrintComponentTest.java | 486 ++++++++++++++++++ .../awt/PrintJob/ScaledImagePrintingTest.java | 102 ++++ 5 files changed, 1227 insertions(+) create mode 100644 test/jdk/java/awt/DesktopProperties/FontSmoothing.java create mode 100644 test/jdk/java/awt/DesktopProperties/ThreeDBackgroundColor.java create mode 100644 test/jdk/java/awt/PrintJob/PrintCompatibilityTest.java create mode 100644 test/jdk/java/awt/PrintJob/PrintComponentTest.java create mode 100644 test/jdk/java/awt/PrintJob/ScaledImagePrintingTest.java diff --git a/test/jdk/java/awt/DesktopProperties/FontSmoothing.java b/test/jdk/java/awt/DesktopProperties/FontSmoothing.java new file mode 100644 index 0000000000000..d3879d4893ff2 --- /dev/null +++ b/test/jdk/java/awt/DesktopProperties/FontSmoothing.java @@ -0,0 +1,93 @@ +/* + * 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.Frame; +import java.awt.Toolkit; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +/* + * @test + * @bug 4808569 + * @requires (os.family == "windows") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary add desktop property for the Windows XP or later font smoothing settings + * @run main/manual FontSmoothing + */ + +public class FontSmoothing { + + private static final String PROP_NAME = "win.text.fontSmoothingType"; + + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + This test should be run on Windows XP or later. + + On Windows 11: + 1. Open Run dialog by typing 'run' in search bar. + 2. Type 'cttune' and press Ok. + 3. Uncheck the "Turn On ClearType" checkbox and follow next instructions on screen. + 4. Repeat Step 1-2. + 5. Check the "Turn On ClearType" checkbox and follow next instructions on screen. + 6. Take a look at the output window to determine if the test passed or failed. + """; + + PassFailJFrame.builder() + .title("FontSmoothing Test Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testTimeOut(5) + .testUI(FontSmoothing::createUI) + .logArea(8) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame f = new Frame("FontSmoothing Test"); + f.setSize(50, 50); + + Object value = Toolkit.getDefaultToolkit().getDesktopProperty(PROP_NAME); + PassFailJFrame.log("toolkit.getDesktopProperty: " + PROP_NAME + " = " + value + "\n"); + + Toolkit.getDefaultToolkit().addPropertyChangeListener(PROP_NAME, new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent e) { + PassFailJFrame.log("PropertyChangeEvent: " + e.getPropertyName() + + "\n old value=" + e.getOldValue() + + "\n new value=" + e.getNewValue()); + + Integer value = (Integer) Toolkit.getDefaultToolkit().getDesktopProperty(PROP_NAME); + PassFailJFrame.log("toolkit.getDesktopProperty:" + PROP_NAME + "=" + value); + + if (value.equals((Integer) e.getNewValue())) { + PassFailJFrame.log("test PASSED"); + } else { + PassFailJFrame.log("test FAILED"); + } + } + }); + return f; + } +} diff --git a/test/jdk/java/awt/DesktopProperties/ThreeDBackgroundColor.java b/test/jdk/java/awt/DesktopProperties/ThreeDBackgroundColor.java new file mode 100644 index 0000000000000..26792e79a92d1 --- /dev/null +++ b/test/jdk/java/awt/DesktopProperties/ThreeDBackgroundColor.java @@ -0,0 +1,100 @@ +/* + * 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.Color; +import java.awt.Frame; +import java.awt.Toolkit; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +/* + * @test + * @bug 4368193 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @requires (os.family == "windows") + * @summary Toolkit's getDesktopProperty returns stale values on Microsoft Windows + * @run main/manual ThreeDBackgroundColor + */ + +public class ThreeDBackgroundColor { + + private static final String PROP_NAME = "win.3d.backgroundColor"; + + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + On Windows 10: + 1. Open Windows Settings, in the search bar type + 'high contrast', in the list of suggestions choose option + 'Turn high contrast on or off' + 2. In the High contrast control panel click on the on/off switch + to initialize High contrast mode + 3. Wait for the High contrast mode to finish initialization + 4. Click on the same switch again to turn off High contrast mode + + On Windows 11: + 1. Open Windows settings, in the search bar type + 'Contrast Theme'. + 2. Select any value from 'Contrast themes' dropdown menu and press 'Apply'. + 3. Wait for the High contrast mode to finish initialization + 4. Select 'None' from 'Contrast themes' dropdown menu to revert the changes. + + Take a look at the output window to determine if the test passed or failed."""; + + PassFailJFrame.builder() + .title("ThreeDBackgroundColor Test Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testTimeOut(5) + .testUI(ThreeDBackgroundColor::createUI) + .logArea(8) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame f = new Frame("ThreeDBackgroundColor Test"); + f.setSize(50, 50); + + Object value = Toolkit.getDefaultToolkit().getDesktopProperty(PROP_NAME); + PassFailJFrame.log("toolkit.getDesktopProperty:" + PROP_NAME + "=" + value); + + Toolkit.getDefaultToolkit().addPropertyChangeListener(PROP_NAME, new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent e) { + PassFailJFrame.log("PropertyChangeEvent: " + e.getPropertyName() + + "\n old value=" + e.getOldValue() + + "\n new value=" + e.getNewValue()); + + Color value = (Color) Toolkit.getDefaultToolkit().getDesktopProperty(PROP_NAME); + PassFailJFrame.log("toolkit.getDesktopProperty:" + PROP_NAME + "=" + value); + if (value.equals((Color) e.getNewValue())) { + PassFailJFrame.log("test PASSED"); + } else { + PassFailJFrame.log("test FAILED"); + } + } + }); + return f; + } +} diff --git a/test/jdk/java/awt/PrintJob/PrintCompatibilityTest.java b/test/jdk/java/awt/PrintJob/PrintCompatibilityTest.java new file mode 100644 index 0000000000000..a2433f455470e --- /dev/null +++ b/test/jdk/java/awt/PrintJob/PrintCompatibilityTest.java @@ -0,0 +1,446 @@ +/* + * 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.Canvas; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Insets; +import java.awt.JobAttributes; +import java.awt.Label; +import java.awt.List; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.PageAttributes; +import java.awt.Panel; +import java.awt.PrintJob; +import java.awt.Scrollbar; +import java.awt.ScrollPane; +import java.awt.TextArea; +import java.awt.TextField; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.JobAttributes.DialogType; +import java.awt.PageAttributes.OriginType; + +import java.util.Enumeration; +import java.util.Properties; + +/* + * @test + * @bug 4247583 + * @key printer + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Tests that the old Properties API still works + * @run main/manual PrintCompatibilityTest + */ + +public class PrintCompatibilityTest { + + public static void main(String[] args) throws Exception { + + String INSTRUCTIONS = """ + A frame window will appear. + Choose 'Print to Printer...' from the 'Print' menu. Make sure that you print + to a printer, not a file. Examine the output and verify that the frame and all + the components in it get printed properly. + + Known problems: + * The text in the second row of the menubar is not indented correctly. + + You can also use the 'Print to Screen...' command for a quick manual check that + printing works, but this is only for debugging purposes."""; + + PassFailJFrame.builder() + .title("PrintComponentTest Test Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(60) + .testTimeOut(10) + .testUI(new MainFrame()) + .logArea(8) + .build() + .awaitAndCheck(); + } +} + +class MainFrame extends Frame { + private LWContainer lwc; + + public MainFrame() { + super("PrintCompatibilityTest"); + + setSize(800, 400); + setLayout(new FlowLayout()); + + // peered components + Button button = new Button("Button"); + button.setFont(new Font("Dialog", Font.PLAIN, 12)); + add(button); + add(new TestCanvas()); + Checkbox cbox = new Checkbox("Checkbox", true); + cbox.setFont(new Font("DialogInput", Font.PLAIN, 12)); + add(cbox); + Choice choice = new Choice(); + choice.add("Choice 1"); + choice.add("Choice Two"); + choice.setFont(new Font("Monospaced", Font.PLAIN, 12)); + add(choice); + Label label = new Label("Label"); + label.setFont(new Font("Serif", Font.PLAIN, 12)); + add(label); + List list = new List(); + list.add("List 1"); + list.add("List Two"); + list.setFont(new Font("SansSerif", Font.PLAIN, 12)); + add(list); + add(new Scrollbar(Scrollbar.VERTICAL) ); + add(new Scrollbar(Scrollbar.HORIZONTAL) ); + ScrollPane scrollpane = new ScrollPane(); + Button spButton = new Button("Button in a scrollpane"); + spButton.setFont(new Font("Monospaced", Font.PLAIN, 12)); + scrollpane.add(spButton); + add(scrollpane); + TextArea textarea = new TextArea("TextArea", 3, 30); + textarea.setFont(new Font("Dialog", Font.ITALIC, 10)); + add(textarea); + TextField textfield = new TextField("TextField"); + textfield.setFont(new Font("DialogInput", Font.ITALIC, 10)); + add(textfield); + + // nested components + Panel panel1 = new Panel(); + panel1.setLayout(new FlowLayout()); + panel1.setBackground(Color.red); + this.add(panel1); + + Button p1Button = new Button("level 2"); + p1Button.setFont(new Font("Monospaced", Font.ITALIC, 10)); + panel1.add(p1Button); + + Panel panel2 = new Panel(); + panel2.setLayout(new FlowLayout()); + panel2.setBackground(Color.green); + panel1.add(panel2); + + Button p2Button = new Button("level 3"); + p2Button.setFont(new Font("Serif", Font.ITALIC, 10)); + panel2.add(p2Button); + + + // lightweight components + LWButton lwbutton = new LWButton("LWbutton"); + lwbutton.setFont(new Font("SansSerif", Font.ITALIC, 10)); + add(lwbutton); + + lwc = new LWContainer("LWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainer"); + lwc.setFont(new Font("Monospaced", Font.ITALIC, 10)); + add(lwc); + Button lwcButton1 = new Button("HW Button 1"); + Button lwcButton2 = new Button("HW Button 2"); + LWButton lwcButton3 = new LWButton("LW Button"); + lwcButton1.setFont(new Font("Dialog", Font.BOLD, 14)); + lwcButton2.setFont(new Font("DialogInput", Font.BOLD, 14)); + lwcButton3.setFont(new Font("Monospaced", Font.BOLD, 14)); + lwc.add(lwcButton1); + lwc.add(lwcButton2); + lwc.add(lwcButton3); + + // overlapping components + add(new ZOrderPanel()); + + /////////////////////// + + Menu menu = new Menu("Print"); + Menu menu2 = new Menu("File"); + Menu menu3 = new Menu("Edit"); + Menu menu4 = new Menu("ReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLong"); + menu2.setFont(new Font("SansSerif", Font.BOLD, 20)); + menu2.setEnabled(false); + menu3.setFont(new Font("Monospaced", Font.ITALIC, 18)); + menu3.setEnabled(false); + menu4.setEnabled(false); + MenuItem itemPrinter = new MenuItem("Print to Printer..."); + MenuItem itemScreen = new MenuItem("Print to Screen..."); + menu.add(itemPrinter); + menu.add(itemScreen); + MenuBar menuBar = new MenuBar(); + menuBar.add( menu ); + menuBar.add( menu2 ); + menuBar.add( menu3 ); + menuBar.add( menu4 ); + setMenuBar(menuBar); + + itemPrinter.addActionListener( new ActionPrint() ); + itemScreen.addActionListener( new ActionPrintToScreen() ); + setVisible(true); + } + + static void printProps(Properties props) + { + Enumeration propNames = props.propertyNames(); + while (propNames.hasMoreElements()) { + String propName = (String)propNames.nextElement(); + PassFailJFrame.log( propName + " = " + props.getProperty(propName)); + } + } + + class ActionPrint implements ActionListener { + private final int ITERATIONS = 1; + private Properties props = new Properties(); + + public void actionPerformed(ActionEvent ev) { + PassFailJFrame.log("About to show print dialog..."); + printProps(props); + PrintJob pj = getToolkit().getPrintJob( + MainFrame.this, "Print test!", props); + if (pj == null) { + return; + } + Dimension d = pj.getPageDimension(); + PassFailJFrame.log("About to print..."); + PassFailJFrame.log("Dimensions: " + d); + printProps(props); + + // For xor mode set, there is a printing issue with number of copies to be print. + // So, ITERATIONS are changed to 1 from 3. + // So, for now the XOR related code is commented out. + + //boolean xor = false; + + for (int i = 0; i < ITERATIONS; i++) { + Graphics g = pj.getGraphics(); + g.setColor(Color.red); + //if (xor) { + // g.setXORMode(Color.blue); + //} + g.translate(13, 13); + printAll(g); + g.dispose(); + //xor = (xor) ? false : true; + } + + // For xor mode set, LWC components don't get printed. + // So, for now the code is commented out and separate bug + // (JDK-8340495) is filed to handle it. + + // one more page so that we can test printing a lightweight + // at the top of the hierarchy (BugId 4212564) + //Graphics g = pj.getGraphics(); + //g.setColor(Color.red); + //g.translate(13, 13); + //lwc.printAll(g); + //g.dispose(); + // end 4212564 + + pj.end(); + } + } + + class ActionPrintToScreen implements ActionListener { + public void actionPerformed(ActionEvent ev) { + PrintFrame printFrame = new PrintFrame(MainFrame.this); + printFrame.show(); + Graphics g = printFrame.getGraphics(); + g.setColor(Color.red); + printAll(g); + g.dispose(); + } + } + + // Frame window that displays results of printing + // main window to a screen Graphics-- useful for + // quick testing of printing + class PrintFrame extends Frame + { + private Component printComponent; + public PrintFrame( Component c ) + { + super("Print to Screen"); + printComponent = c ; + addWindowListener( new WindowAdapter() { + public void windowClosing(WindowEvent ev) { + setVisible(false); + dispose(); + } + } + ); + setSize(printComponent.getSize()); + setResizable(false); + } + + public void paint( Graphics g ) { + printComponent.printAll(g); + } + } + + class LWButton extends Component { + String label; + int width = 100; + int height = 30; + + public LWButton(String label) { + super(); + this.label = label; + } + + public void paint(Graphics g) { + Dimension d = getSize(); + g.setColor(Color.orange); + g.setFont(getFont()); + g.fillRect(0, 0, d.width, d.height); + g.setColor(Color.black); + int x = 5; + int y = (d.height - 5); + g.drawString(label, x, y); + } + + public Dimension getPreferredSize() + { + return new Dimension(width, height); + } + } + + class LWContainer extends Container { + String label; + int width = 300; + int height = 100; + + public LWContainer(String label) { + super(); + this.label = label; + setLayout(new FlowLayout()); + } + + public void paint(Graphics g) { + super.paint(g); + Dimension d = getSize(); + g.setColor(Color.green); + g.setFont(getFont()); + g.drawLine(0, 0, d.width - 1, 0); + g.drawLine(d.width - 1, 0, d.width - 1, d.height - 1); + g.drawLine(d.width - 1, d.height - 1, 0, d.height - 1); + g.drawLine(0, d.height - 1, 0, 0); + g.setColor(Color.black); + int x = 5; + int y = (d.height - 5); + g.drawString(label, x, y); + } + + public Dimension getPreferredSize() + { + return new Dimension(width, height); + } + } + + class TestCanvas extends Canvas { + int width = 100; + int height = 100; + + public void paint(Graphics g) { + g.setColor(Color.blue); + g.fillRoundRect(10, 10, 50, 50, 15, 30); + g.setColor(Color.red); + g.fillOval(70, 70, 25, 25); + } + public Dimension getPreferredSize() { + return new Dimension(width, height); + } + } + + class ZOrderPanel extends Panel + { + ZOrderPanel() + { + setLayout(null); + + Component first, second, third, fourth; + + setVisible(true); + // add first component + first = makeBox("Second", Color.blue, + new Font("Serif", Font.BOLD, 14), + -1); + // insert on top + second = makeBox("First", Color.yellow, + new Font("SansSerif", Font.BOLD, 14), + 0); + // put at the back + fourth = makeBox("Fourth", Color.red, + new Font("Monospaced", Font.BOLD, 14), + 2); + // insert in last position + third = makeBox("Third", Color.green, + new Font("Dialog", Font.PLAIN, 12), + 3); + // swap third and fourth to correct positions + remove(third); + add(third, 2); + // re-validate so third and fourth peers change position + validate(); + // now make things really interesting with a lightweight + // component at the top of the z-order, that should print + // _below_ the native guys to match the screen... + add(new LWButton("LWButton"), 0); + } + + public Dimension preferredSize() + { + return new Dimension(260, 80); + } + + public void layout() + { + int i, n; + Insets ins = getInsets(); + n = getComponentCount(); + for (i = n-1; i >= 0; i--) { + Component p = getComponent(i); + p.setBounds(ins.left + 40 * i, ins.top + 5 * i, 60, 60); + } + } + + public Component makeBox(String s, Color c, Font f, int index) + { + Label l = new Label(s); + l.setBackground(c); + l.setAlignment(Label.RIGHT); + l.setFont(f); + add(l, index); + validate(); + return l; + } + } +} diff --git a/test/jdk/java/awt/PrintJob/PrintComponentTest.java b/test/jdk/java/awt/PrintJob/PrintComponentTest.java new file mode 100644 index 0000000000000..d568c5a427977 --- /dev/null +++ b/test/jdk/java/awt/PrintJob/PrintComponentTest.java @@ -0,0 +1,486 @@ +/* + * 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.Canvas; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Insets; +import java.awt.JobAttributes; +import java.awt.Label; +import java.awt.List; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.PageAttributes; +import java.awt.Panel; +import java.awt.PrintJob; +import java.awt.Scrollbar; +import java.awt.ScrollPane; +import java.awt.TextArea; +import java.awt.TextField; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.JobAttributes.DialogType; +import java.awt.PageAttributes.OriginType; + + +/* + * @test + * @bug 4111262 4035285 4038900 4046147 4049680 4084038 4100004 4105875 + * @bug 4117502 4037486 4068433 4128031 4151161 4151707 4155884 4212564 + * @bug 4025626 4029565 4034365 4036068 4040622 4061890 4067405 4086256 + * @bug 4113827 4116722 4121984 4145350 4146510 4172659 4179886 4218471 + * @bug 4219657 4227128 4242308 4245917 4265746 + * @key printer + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Test printing of lightweight (and heavyweight) components + * @run main/manual PrintComponentTest + */ + +public class PrintComponentTest { + public static void main(String[] args) throws Exception { + + String INSTRUCTIONS = """ + A frame window will appear. + Choose 'Print to Printer...' from the 'Print' menu. Examine the output + and verify that the frame and all the components in it get printed properly. + + Print using both 'Portrait' and 'Landscape' orientation. + Verify that the paper dimensions printed to standard error + are exactly inverted. + (That is, if the output for 'Portrait' is + "Dimensions: java.awt.Dimension[width=612,height=792]" then the output + for 'Landscape' should be "Dimensions: java.awt.Dimension[width=792, height=612].) + + Now, attempt to print a second time. When the print dialog box appears, + however, cancel the print request. + Verify that _no_ output is sent to standard error. + + You should attempt to print with both the native and common print dialogs, + as well as with no dialog. + Note that on Linux the native and common print dialogs are identical. + + On Windows, the common print dialog communicates with the printer to + determine supported paper sizes and duplex capability. + Verify that these constraints are properly enforced in the common dialog + for the target printer. + + Known problems: + * The text in the second row of the menubar is not indented + correctly. + + You can also use the 'Print to Screen...' command for a quick manual + check that printing works, but this is only for debugging purposes."""; + + PassFailJFrame.builder() + .title("PrintComponentTest Test Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(60) + .testTimeOut(10) + .testUI(new MainFrame()) + .logArea(8) + .build() + .awaitAndCheck(); + } +} + +class MainFrame extends Frame { + private LWContainer lwc; + + public MainFrame() { + super("PrintComponentTest"); + + setSize(800, 400); + setLayout(new FlowLayout()); + + // peered components + Button button = new Button("Button"); + button.setFont(new Font("Dialog", Font.PLAIN, 12)); + add(button); + add(new TestCanvas()); + Checkbox cbox = new Checkbox("Checkbox", true); + cbox.setFont(new Font("DialogInput", Font.PLAIN, 12)); + add(cbox); + Choice choice = new Choice(); + choice.add("Choice 1"); + choice.add("Choice Two"); + choice.setFont(new Font("Monospaced", Font.PLAIN, 12)); + add(choice); + Label label = new Label("Label"); + label.setFont(new Font("Serif", Font.PLAIN, 12)); + add(label); + List list = new List(); + list.add("List 1"); + list.add("List Two"); + list.setFont(new Font("SansSerif", Font.PLAIN, 12)); + add(list); + add(new Scrollbar(Scrollbar.VERTICAL) ); + add(new Scrollbar(Scrollbar.HORIZONTAL) ); + ScrollPane scrollpane = new ScrollPane(); + Button spButton = new Button("Button in a scrollpane"); + spButton.setFont(new Font("Monospaced", Font.PLAIN, 12)); + scrollpane.add(spButton); + add(scrollpane); + TextArea textarea = new TextArea("TextArea", 3, 30); + textarea.setFont(new Font("Dialog", Font.ITALIC, 10)); + add(textarea); + TextField textfield = new TextField("TextField"); + textfield.setFont(new Font("DialogInput", Font.ITALIC, 10)); + add(textfield); + + // nested components + Panel panel1 = new Panel(); + panel1.setLayout(new FlowLayout()); + panel1.setBackground(Color.red); + this.add(panel1); + + Button p1Button = new Button("level 2"); + p1Button.setFont(new Font("Monospaced", Font.ITALIC, 10)); + panel1.add(p1Button); + + Panel panel2 = new Panel(); + panel2.setLayout(new FlowLayout()); + panel2.setBackground(Color.green); + panel1.add(panel2); + + Button p2Button = new Button("level 3"); + p2Button.setFont(new Font("Serif", Font.ITALIC, 10)); + panel2.add(p2Button); + + + // lightweight components + LWButton lwbutton = new LWButton("LWbutton"); + lwbutton.setFont(new Font("SansSerif", Font.ITALIC, 10)); + add(lwbutton); + + lwc = new LWContainer("LWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainerLWContainer"); + lwc.setFont(new Font("Monospaced", Font.ITALIC, 10)); + add(lwc); + Button lwcButton1 = new Button("HW Button 1"); + Button lwcButton2 = new Button("HW Button 2"); + LWButton lwcButton3 = new LWButton("LW Button"); + lwcButton1.setFont(new Font("Dialog", Font.BOLD, 14)); + lwcButton2.setFont(new Font("DialogInput", Font.BOLD, 14)); + lwcButton3.setFont(new Font("Monospaced", Font.BOLD, 14)); + lwc.add(lwcButton1); + lwc.add(lwcButton2); + lwc.add(lwcButton3); + + // overlapping components + add(new ZOrderPanel()); + + /////////////////////// + + Menu menu = new Menu("Print"); + Menu menu2 = new Menu("File"); + Menu menu3 = new Menu("Edit"); + Menu menu4 = new Menu("ReallyReallyReallyReallyReallyReallyReallyReally" + + "ReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReally" + + "ReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLong"); + menu2.setFont(new Font("SansSerif", Font.BOLD, 20)); + menu2.setEnabled(false); + menu3.setFont(new Font("Monospaced", Font.ITALIC, 18)); + menu3.setEnabled(false); + menu4.setEnabled(false); + MenuItem itemJFC = + new MenuItem("Print to Printer with Cross-Platform Dialog..."); + itemJFC.setActionCommand("common"); + MenuItem itemNative = + new MenuItem("Print to Printer with Native Dialog..."); + itemNative.setActionCommand("native"); + MenuItem itemBackground = + new MenuItem("Print to Printer in Background"); + itemBackground.setActionCommand("none"); + MenuItem itemScreen = new MenuItem("Print to Screen..."); + menu.add(itemJFC); + menu.add(itemNative); + menu.add(itemBackground); + menu.add(itemScreen); + MenuBar menuBar = new MenuBar(); + menuBar.add( menu ); + menuBar.add( menu2 ); + menuBar.add( menu3 ); + menuBar.add( menu4 ); + setMenuBar(menuBar); + + ActionPrint actionPrint = new ActionPrint(); + + itemJFC.addActionListener( actionPrint ); + itemNative.addActionListener( actionPrint ); + itemBackground.addActionListener( actionPrint ); + itemScreen.addActionListener( new ActionPrintToScreen() ); + } + + class ActionPrint implements ActionListener { + private final int ITERATIONS = 1; + private PageAttributes pageAttributes = new PageAttributes(); + private JobAttributes jobAttributes = new JobAttributes(); + + public void actionPerformed(ActionEvent ev) { + DialogType dialog; + if (ev.getActionCommand().equals("common")) { + dialog = DialogType.COMMON; + } else if (ev.getActionCommand().equals("native")) { + dialog = DialogType.NATIVE; + } else { + dialog = DialogType.NONE; + } + jobAttributes.setDialog(dialog); + pageAttributes.setOrigin(OriginType.PRINTABLE); + System.err.println(jobAttributes); + System.err.println(pageAttributes); + + PassFailJFrame.log("About to show print dialog..."); + + PrintJob pj = getToolkit().getPrintJob( + MainFrame.this, "Print test!", jobAttributes, pageAttributes); + if (pj == null) { + return; + } + Dimension d = pj.getPageDimension(); + PassFailJFrame.log("About to print..."); + PassFailJFrame.log("Dimensions: " + d); + System.err.println(jobAttributes); + System.err.println(pageAttributes); + + // For xor mode set, there is a printing issue with number of copies to be print. + // So, ITERATIONS are changed to 1 from 3. + // So, for now the XOR related code is commented out. + + //boolean xor = false; + + for (int i = 0; i < ITERATIONS; i++) { + Graphics g = pj.getGraphics(); + g.setColor(Color.red); + //if (xor) { + // g.setXORMode(Color.blue); + //} + printAll(g); + g.dispose(); + //xor = (xor) ? false : true; + } + + // For xor mode set, LWC components don't get printed. + // So, for now the code is commented out and separate bug + // (JDK-8340495) is filed to handle it. + + // one more page so that we can test printing a lightweight + // at the top of the hierarchy (BugId 4212564) + //Graphics g = pj.getGraphics(); + //g.setColor(Color.red); + //lwc.printAll(g); + //g.dispose(); + // end 4212564 + + pj.end(); + } + } + + class ActionPrintToScreen implements ActionListener { + public void actionPerformed(ActionEvent ev) { + PrintFrame printFrame = new PrintFrame(MainFrame.this); + printFrame.show(); + Graphics g = printFrame.getGraphics(); + g.setColor(Color.red); + printAll(g); + g.dispose(); + } + } + + // Frame window that displays results of printing + // main window to a screen Graphics-- useful for + // quick testing of printing + class PrintFrame extends Frame + { + private Component printComponent; + public PrintFrame( Component c ) + { + super("Print to Screen"); + printComponent = c ; + addWindowListener( new WindowAdapter() { + public void windowClosing(WindowEvent ev) { + setVisible(false); + dispose(); + } + } + ); + setSize(printComponent.getSize()); + setResizable(false); + } + + public void paint( Graphics g ) { + printComponent.printAll(g); + } + } + + class LWButton extends Component { + String label; + int width = 100; + int height = 30; + + public LWButton(String label) { + super(); + this.label = label; + } + + public void paint(Graphics g) { + Dimension d = getSize(); + g.setColor(Color.orange); + g.setFont(getFont()); + g.fillRect(0, 0, d.width, d.height); + g.setColor(Color.black); + int x = 5; + int y = (d.height - 5); + g.drawString(label, x, y); + } + + public Dimension getPreferredSize() + { + return new Dimension(width, height); + } + } + + class LWContainer extends Container { + String label; + int width = 300; + int height = 100; + + public LWContainer(String label) { + super(); + this.label = label; + setLayout(new FlowLayout()); + } + + public void paint(Graphics g) { + super.paint(g); + Dimension d = getSize(); + g.setColor(Color.green); + g.setFont(getFont()); + g.drawLine(0, 0, d.width - 1, 0); + g.drawLine(d.width - 1, 0, d.width - 1, d.height - 1); + g.drawLine(d.width - 1, d.height - 1, 0, d.height - 1); + g.drawLine(0, d.height - 1, 0, 0); + g.setColor(Color.black); + int x = 5; + int y = (d.height - 5); + g.drawString(label, x, y); + } + + public Dimension getPreferredSize() + { + return new Dimension(width, height); + } + } + + class TestCanvas extends Canvas { + int width = 100; + int height = 100; + + public void paint(Graphics g) { + g.setColor(Color.blue); + g.fillRoundRect(10, 10, 50, 50, 15, 30); + g.setColor(Color.red); + g.fillOval(70, 70, 25, 25); + } + public Dimension getPreferredSize() { + return new Dimension(width, height); + } + } + + class ZOrderPanel extends Panel + { + ZOrderPanel() + { + setLayout(null); + + Component first, second, third, fourth; + + setVisible(true); + // add first component + first = makeBox("Second", Color.blue, + new Font("Serif", Font.BOLD, 14), + -1); + // insert on top + second = makeBox("First", Color.yellow, + new Font("SansSerif", Font.BOLD, 14), + 0); + // put at the back + fourth = makeBox("Fourth", Color.red, + new Font("Monospaced", Font.BOLD, 14), + 2); + // insert in last position + third = makeBox("Third", Color.green, + new Font("Dialog", Font.PLAIN, 12), + 3); + // swap third and fourth to correct positions + remove(third); + add(third, 2); + // re-validate so third and fourth peers change position + validate(); + // now make things really interesting with a lightweight + // component at the top of the z-order, that should print + // _below_ the native guys to match the screen... + add(new LWButton("LWButton"), 0); + } + + public Dimension preferredSize() + { + return new Dimension(260, 80); + } + + public void layout() + { + int i, n; + Insets ins = getInsets(); + n = getComponentCount(); + for (i = n-1; i >= 0; i--) { + Component p = getComponent(i); + p.setBounds(ins.left + 40 * i, ins.top + 5 * i, 60, 60); + } + } + + public Component makeBox(String s, Color c, Font f, int index) + { + Label l = new Label(s); + l.setBackground(c); + l.setAlignment(Label.RIGHT); + l.setFont(f); + add(l, index); + validate(); + return l; + } + } +} diff --git a/test/jdk/java/awt/PrintJob/ScaledImagePrintingTest.java b/test/jdk/java/awt/PrintJob/ScaledImagePrintingTest.java new file mode 100644 index 0000000000000..838c9210e308b --- /dev/null +++ b/test/jdk/java/awt/PrintJob/ScaledImagePrintingTest.java @@ -0,0 +1,102 @@ +/* + * 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.Color; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.PrintJob; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/* + * @test + * @bug 4257962 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary tests that scaled images are printed at resolution greater than 72dpi + * @run main/manual ScaledImagePrintingTest + */ + +public class ScaledImagePrintingTest { + + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + Press 'Print' button from the test UI. + + The test will bring up a print dialog. Select a printer and proceed. + Verify that the output is a series of a horizontal lines in a + rectangular box in the center of the page. + + If output is as mentioned above, press Pass else Fail."""; + + PassFailJFrame.builder() + .title("ScaledImagePrintingTest Test Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testTimeOut(5) + .testUI(ScaledImagePrintingTest::createUI) + .logArea(8) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame frame = new Frame("ResolutionTest"); + Button b = new Button("Print"); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + PrintJob pj = frame.getToolkit().getPrintJob(frame, "ResolutionTest", null); + PassFailJFrame.log("Printing code started."); + if (pj != null) { + Graphics g = pj.getGraphics(); + g.setColor(Color.black); + int w = 200; + int h = 200; + Image image = frame.createImage(w, h); + Graphics imageGraphics = image.getGraphics(); + Dimension d = pj.getPageDimension(); + imageGraphics.setColor(Color.black); + for (int i = 0; i < h; i += 20) { + imageGraphics.drawLine(0, i, w, i); + } + g.translate(d.width / 2, d.height / 2); + g.drawImage(image, -w / 8, -h / 8, w / 4, h / 4, frame); + g.setColor(Color.black); + g.drawRect(-w / 4, -h / 4, w / 2, h / 2); + imageGraphics.dispose(); + g.dispose(); + pj.end(); + } + PassFailJFrame.log("Printing code finished."); + } + }); + frame.add(b); + frame.setSize(50, 50); + return frame; + } +} From 9bd478593cc92a716151d1373f3426f1d92143bb Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 1 Oct 2024 04:40:16 +0000 Subject: [PATCH 253/307] 8340437: Open source few more AWT Frame related tests Reviewed-by: prr, kizune --- .../awt/Frame/DisabledParentOfToplevel.java | 99 ++++ test/jdk/java/awt/Frame/FrameVisualTest.java | 117 +++++ test/jdk/java/awt/Frame/IMStatusBar.java | 70 +++ test/jdk/java/awt/Frame/MultiScreenTest.java | 485 ++++++++++++++++++ 4 files changed, 771 insertions(+) create mode 100644 test/jdk/java/awt/Frame/DisabledParentOfToplevel.java create mode 100644 test/jdk/java/awt/Frame/FrameVisualTest.java create mode 100644 test/jdk/java/awt/Frame/IMStatusBar.java create mode 100644 test/jdk/java/awt/Frame/MultiScreenTest.java diff --git a/test/jdk/java/awt/Frame/DisabledParentOfToplevel.java b/test/jdk/java/awt/Frame/DisabledParentOfToplevel.java new file mode 100644 index 0000000000000..878809749d35a --- /dev/null +++ b/test/jdk/java/awt/Frame/DisabledParentOfToplevel.java @@ -0,0 +1,99 @@ +/* + * 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. + */ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Window; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/* + * @test + * @bug 5062118 + * @key headful + * @summary Disabling of a parent should not disable Window. + * @run main DisabledParentOfToplevel + */ + +public class DisabledParentOfToplevel { + private static Button okBtn; + private static Window ww; + private static Frame parentFrame; + private static volatile Point p; + private static volatile Dimension d; + + public static void main(String[] args) throws Exception { + Robot robot = new Robot(); + robot.setAutoDelay(100); + try { + EventQueue.invokeAndWait(() -> { + createAndShowUI(); + }); + robot.delay(1000); + EventQueue.invokeAndWait(() -> { + p = okBtn.getLocationOnScreen(); + d = okBtn.getSize(); + }); + robot.mouseMove(p.x + d.width / 2, p.x + d.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(500); + if (ww.isVisible()) { + throw new RuntimeException("Window is visible but should be hidden: failure."); + } + } finally { + EventQueue.invokeAndWait(() -> { + if (parentFrame != null) { + parentFrame.dispose(); + } + }); + } + } + + private static void createAndShowUI() { + parentFrame = new Frame("parentFrame"); + parentFrame.setSize(100, 100); + parentFrame.setEnabled(false); + ww = new Window(parentFrame); + ww.setLayout(new BorderLayout()); + okBtn = new Button("Click to Close Me"); + ww.add(okBtn); + ww.setSize(250, 250); + ww.setLocation(110, 110); + okBtn.addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent me) { + System.out.println("Pressed: close"); + ww.setVisible(false); + } + }); + parentFrame.setVisible(true); + ww.setVisible(true); + okBtn.requestFocus(); + } +} diff --git a/test/jdk/java/awt/Frame/FrameVisualTest.java b/test/jdk/java/awt/Frame/FrameVisualTest.java new file mode 100644 index 0000000000000..767eb0a18965c --- /dev/null +++ b/test/jdk/java/awt/Frame/FrameVisualTest.java @@ -0,0 +1,117 @@ +/* + * 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.Color; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsEnvironment; +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 4328588 + * @key headful + * @summary Non-default visual on top-level Frame should work + * @run main FrameVisualTest + */ + +public class FrameVisualTest { + private static GraphicsConfiguration[] gcs; + private static volatile Frame[] frames; + private static volatile int index; + + 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 { + gcs = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getConfigurations(); + robot = new Robot(); + robot.setAutoDelay(100); + try { + EventQueue.invokeAndWait(() -> { + createAndShowUI(); + }); + robot.delay(1000); + System.out.println("frames.length: "+frames.length); + for (index = 0; index < frames.length; index++) { + EventQueue.invokeAndWait(() -> { + p = frames[index].getLocation(); + d = frames[index].getSize(); + }); + Rectangle rect = new Rectangle(p, d); + BufferedImage img = robot.createScreenCapture(rect); + if (chkImgBackgroundColor(img)) { + try { + ImageIO.write(img, "png", new File("Frame_" + index + ".png")); + } catch (IOException ignored) {} + throw new RuntimeException("Frame visual test failed with non-white background color"); + } + } + } finally { + for (index = 0; index < frames.length; index++) { + EventQueue.invokeAndWait(() -> { + if (frames[index] != null) { + frames[index].dispose(); + } + }); + } + } + } + + private static void createAndShowUI() { + frames = new Frame[gcs.length]; + for (int i = 0; i < frames.length; i++) { + frames[i] = new Frame("Frame w/ gc " + i, gcs[i]); + frames[i].setSize(100, 100); + frames[i].setUndecorated(true); + frames[i].setBackground(Color.WHITE); + frames[i].setVisible(true); + } + } + + private static boolean chkImgBackgroundColor(BufferedImage img) { + + // scan for mid-line and if it is non-white color then return true. + for (int x = 1; x < img.getWidth() - 1; ++x) { + Color c = new Color(img.getRGB(x, img.getHeight() / 2)); + if ((c.getRed() - Color.WHITE.getRed()) > TOLERANCE && + (c.getGreen() - Color.WHITE.getGreen()) > TOLERANCE && + (c.getBlue() - Color.WHITE.getBlue()) > TOLERANCE) { + return true; + } + } + return false; + } +} + diff --git a/test/jdk/java/awt/Frame/IMStatusBar.java b/test/jdk/java/awt/Frame/IMStatusBar.java new file mode 100644 index 0000000000000..7e882d01c707c --- /dev/null +++ b/test/jdk/java/awt/Frame/IMStatusBar.java @@ -0,0 +1,70 @@ +/* + * 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.Frame; +import java.awt.Label; +import java.awt.Panel; +import java.awt.TextField; + +/* + * @test + * @bug 4113040 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Checks that IMStatusBar does not affect Frame layout + * @run main/manual/othervm -Duser.language=ja -Duser.country=JP IMStatusBar + */ + +public class IMStatusBar { + + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + If the window appears the right size, but then resizes so that the + status field overlaps the bottom label, press Fail; otherwise press Pass. + """; + + PassFailJFrame.builder() + .title("IMStatusBar Instruction") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testUI(IMStatusBar::createUI) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame f = new Frame(); + Panel centerPanel = new Panel(); + f.setSize(200, 200); + f.setLayout(new BorderLayout()); + f.add(new Label("Top"), BorderLayout.NORTH); + f.add(centerPanel, BorderLayout.CENTER); + f.add(new Label("Bottom"), BorderLayout.SOUTH); + centerPanel.setLayout(new BorderLayout()); + centerPanel.add(new TextField("Middle"), BorderLayout.CENTER); + centerPanel.validate(); + return f; + } +} diff --git a/test/jdk/java/awt/Frame/MultiScreenTest.java b/test/jdk/java/awt/Frame/MultiScreenTest.java new file mode 100644 index 0000000000000..845f601138b74 --- /dev/null +++ b/test/jdk/java/awt/Frame/MultiScreenTest.java @@ -0,0 +1,485 @@ +/* + * 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.Button; +import java.awt.Canvas; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.FontMetrics; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Image; +import java.awt.Label; +import java.awt.LayoutManager; +import java.awt.Panel; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.TextField; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import java.awt.image.ColorModel; +import java.awt.image.MemoryImageSource; + +import java.util.ArrayList; +import java.util.List; + +import javax.swing.JFrame; + +import jtreg.SkippedException; + +/* + * @test + * @bug 4312921 + * @key multimon + * @library /java/awt/regtesthelpers /test/lib + * @build PassFailJFrame + * @summary Tests that no garbage is painted on primary screen with DGA + * @run main/manual MultiScreenTest + */ + +public class MultiScreenTest { + static GraphicsEnvironment ge; + static GraphicsDevice[] gs; + + public static void main(String[] args) throws Exception { + ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + gs = ge.getScreenDevices(); + if (gs.length < 2) { + throw new SkippedException("You have only one monitor in your system - test passed"); + } + MultiScreenTest obj = new MultiScreenTest(); + String INSTRUCTIONS = + "This test is to be run only on multiscreen machine. " + + "You have " + gs.length + " monitors in your system.\n" + + "Actively drag the DitherTest frames on the secondary screen and " + + "if you see garbage appearing on your primary screen " + + "test failed otherwise it passed.";; + + PassFailJFrame.builder() + .title("MultiScreenTest Instruction") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testUI(obj::init) + .build() + .awaitAndCheck(); + } + + public List init() { + List list = new ArrayList<>(); + for (int j = 0; j < gs.length; j++) { + GraphicsConfiguration[] gc = gs[j].getConfigurations(); + if (gc.length > 0) { + for (int i = 0; i < gc.length / 2; i++) { + JFrame f = new JFrame(gc[i]); //test JFrame( gc ) + GCCanvas c = new GCCanvas(gc[i]);//test canvas( gc ) + Rectangle gcBounds = gc[i].getBounds(); //test getBounds() + int xoffs = gcBounds.x; + int yoffs = gcBounds.y; + + f.getContentPane().add(c); + f.setTitle("Screen# " + Integer.toString(j) + ", GC#" + Integer.toString(i)); + f.setSize(300, 200); + f.setLocation(400 + xoffs, (i * 150) + yoffs);//test displaying in right location + list.add(f); + + Frame ditherfs = new Frame("DitherTest GC#" + Integer.toString(i), gc[i]); + ditherfs.setLayout(new BorderLayout()); //showDitherTest + DitherTest ditherTest = new DitherTest(gc[i]); + ditherfs.add("Center", ditherTest); + ditherfs.setBounds(300, 200, 300, 200); + ditherfs.setLocation(750 + xoffs, (i * 50) + yoffs); + ditherfs.pack(); + ditherfs.show(); + ditherTest.start(); + } + } + } + return list; + } +} + +class GCCanvas extends Canvas { + + GraphicsConfiguration gc; + Rectangle bounds; + Graphics g = this.getGraphics(); + Dimension size = getSize(); + + public GCCanvas(GraphicsConfiguration gc) { + super(gc); + this.gc = gc; + bounds = gc.getBounds(); + } + + public void paint( Graphics _g ) { + + Graphics2D g = (Graphics2D) _g; + + g.drawRect(0, 0, size.width-1, size.height-1); + g.setColor(Color.lightGray); + g.draw3DRect(1, 1, size.width-3, size.height-3, true); + + g.setColor(Color.red); + g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + + g.drawString("HELLO!", 110, 10); + + g.setColor(Color.blue); + g.drawString("ScreenSize="+Integer.toString(bounds.width)+"X"+ + Integer.toString(bounds.height), 10, 20); + g.setColor(Color.green); + g.drawString(gc.toString(), 10, 30); + g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + + g.setColor(Color.orange); + g.fillRect(40, 20, 50, 50); + + g.setColor(Color.red); + g.drawRect(100, 20, 30, 30); + + g.setColor(Color.gray); + g.drawLine(220, 20, 280, 40); + + g.setColor(Color.cyan); + g.fillArc(150, 30, 30, 30, 0, 200); + } + + public Dimension getPreferredSize(){ + return new Dimension(300, 200); + } +} + +class DitherCanvas extends Canvas { + Image img; + static String calcString = "Calculating..."; + + GraphicsConfiguration mGC; + + public DitherCanvas(GraphicsConfiguration gc) { + super(gc); + mGC = gc; + } + + public GraphicsConfiguration getGraphicsConfig() { + return mGC; + } + + public void paint(Graphics g) { + int w = getSize().width; + int h = getSize().height; + if (img == null) { + super.paint(g); + g.setColor(Color.black); + FontMetrics fm = g.getFontMetrics(); + int x = (w - fm.stringWidth(calcString)) / 2; + int y = h / 2; + g.drawString(calcString, x, y); + } else { + g.drawImage(img, 0, 0, w, h, this); + } + } + + public void update(Graphics g) { + paint(g); + } + + public Dimension getMinimumSize() { + return new Dimension(20, 20); + } + + public Dimension getPreferredSize() { + return new Dimension(200, 200); + } + + public Image getImage() { + return img; + } + + public void setImage(Image img) { + this.img = img; + paint(getGraphics()); + } +} + +class DitherTest extends Panel implements Runnable { + 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; + + Thread runner; + + DitherControls XControls; + DitherControls YControls; + DitherCanvas canvas; + + public DitherTest(GraphicsConfiguration gc) { + String xspec, yspec; + int xvals[] = new int[2]; + int yvals[] = new int[2]; + + xspec = "red"; + yspec = "blue"; + int xmethod = colormethod(xspec, xvals); + int ymethod = colormethod(yspec, yvals); + + setLayout(new BorderLayout()); + XControls = new DitherControls(this, xvals[0], xvals[1], + xmethod, false); + YControls = new DitherControls(this, yvals[0], yvals[1], + ymethod, true); + YControls.addRenderButton(); + add("North", XControls); + add("South", YControls); + add("Center", canvas = new DitherCanvas(gc)); + } + + public void start() { + runner = new Thread(this); + runner.start(); + } + + int colormethod(String s, int vals[]) { + int method = NOOP; + + if (s == null) { + s = ""; + } + + String lower = s.toLowerCase(); + int len = 0; + if (lower.startsWith("red")) { + method = RED; + lower = lower.substring(3); + } else if (lower.startsWith("green")) { + method = GREEN; + lower = lower.substring(5); + } else if (lower.startsWith("blue")) { + method = BLUE; + lower = lower.substring(4); + } else if (lower.startsWith("alpha")) { + method = ALPHA; + lower = lower.substring(4); + } else if (lower.startsWith("saturation")) { + method = SATURATION; + lower = lower.substring(10); + } + + if (method == NOOP) { + vals[0] = 0; + vals[1] = 0; + return method; + } + + int begval = 0; + int endval = 255; + + try { + int dash = lower.indexOf('-'); + if (dash < 0) { + begval = endval = Integer.parseInt(lower); + } else { + begval = Integer.parseInt(lower.substring(0, dash)); + endval = Integer.parseInt(lower.substring(dash + 1)); + } + } catch (Exception e) { + } + + if (begval < 0) { + begval = 0; + } + if (endval < 0) { + endval = 0; + } + if (begval > 255) { + begval = 255; + } + if (endval > 255) { + endval = 255; + } + + vals[0] = begval; + vals[1] = endval; + + return method; + } + + 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; + } + } + + public void run() { + canvas.setImage(null); // Wipe previous image + Image img = calculateImage(); + synchronized (this) { + if (img != null && runner == Thread.currentThread()) { + canvas.setImage(img); + } + } + } + + /** + * Calculates and returns the image. Halts the calculation and returns + * null if stopped during the calculation. + */ + Image calculateImage() { + Thread me = Thread.currentThread(); + + int width = canvas.getSize().width; + int height = canvas.getSize().height; + int xvals[] = new int[2]; + int yvals[] = new int[2]; + int xmethod = XControls.getParams(xvals); + int ymethod = YControls.getParams(yvals); + 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)); + + } + // Poll once per row to see if we've been told to stop. + if (runner != me) { + return null; + } + } + + return createImage(new MemoryImageSource(width, height, + ColorModel.getRGBdefault(), pixels, 0, width)); + } + + public String getInfo() { + return "An interactive demonstration of dithering."; + } + + public String[][] getParameterInfo() { + String[][] info = { + {"xaxis", "{RED, GREEN, BLUE, PINK, ORANGE, MAGENTA, CYAN, WHITE, YELLOW, GRAY, DARKGRAY}", + "The color of the Y axis. Default is RED."}, + {"yaxis", "{RED, GREEN, BLUE, PINK, ORANGE, MAGENTA, CYAN, WHITE, YELLOW, GRAY, DARKGRAY}", + "The color of the X axis. Default is BLUE."} + }; + return info; + } +} + +class DitherControls extends Panel implements ActionListener { + TextField start; + TextField end; + Button button; + Choice choice; + DitherTest dt; + + static LayoutManager dcLayout = new FlowLayout(FlowLayout.CENTER, 10, 5); + + public DitherControls(DitherTest app, int s, int e, int type, + boolean vertical) { + dt = app; + setLayout(dcLayout); + add(new Label(vertical ? "Vertical" : "Horizontal")); + add(choice = new Choice()); + choice.addItem("Noop"); + choice.addItem("Red"); + choice.addItem("Green"); + choice.addItem("Blue"); + choice.addItem("Alpha"); + choice.addItem("Saturation"); + choice.select(type); + add(start = new TextField(Integer.toString(s), 4)); + add(end = new TextField(Integer.toString(e), 4)); + } + + public void addRenderButton() { + add(button = new Button("New Image")); + button.addActionListener(this); + } + + public int getParams(int vals[]) { + vals[0] = Integer.parseInt(start.getText()); + vals[1] = Integer.parseInt(end.getText()); + return choice.getSelectedIndex(); + } + + public void actionPerformed(ActionEvent e) { + if (e.getSource() == button) { + dt.start(); + } + } +} From 1b46fea59cf8f53b23e5c16a604b4decc8c7dbbe Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 1 Oct 2024 07:15:42 +0000 Subject: [PATCH 254/307] 8341024: [test] build/AbsPathsInImage.java fails with OOM when using ubsan-enabled binaries Reviewed-by: erikj --- test/jdk/build/AbsPathsInImage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/build/AbsPathsInImage.java b/test/jdk/build/AbsPathsInImage.java index 712f990507d19..229094a0920e3 100644 --- a/test/jdk/build/AbsPathsInImage.java +++ b/test/jdk/build/AbsPathsInImage.java @@ -40,7 +40,7 @@ * @bug 8226346 * @summary Check all output files for absolute path fragments * @requires !vm.debug - * @run main AbsPathsInImage + * @run main/othervm -Xmx900m AbsPathsInImage */ public class AbsPathsInImage { From ad5ffccffa89359dac6ad44b9e43242e5bf3e398 Mon Sep 17 00:00:00 2001 From: Axel Boldt-Christmas Date: Tue, 1 Oct 2024 08:02:56 +0000 Subject: [PATCH 255/307] 8341168: Cleanup dead code after JDK-8322630 Reviewed-by: stefank, tschatzl, mli, shade --- src/hotspot/share/code/compiledIC.cpp | 2 +- .../share/compiler/compilerDefinitions.cpp | 5 ----- src/hotspot/share/runtime/globals.hpp | 3 --- src/hotspot/share/runtime/mutexLocker.cpp | 4 +--- src/hotspot/share/runtime/mutexLocker.hpp | 1 - src/hotspot/share/runtime/thread.cpp | 1 - src/hotspot/share/runtime/thread.hpp | 15 --------------- src/hotspot/share/runtime/vmOperation.hpp | 1 - src/hotspot/share/runtime/vmOperations.hpp | 6 ------ .../classes/sun/jvm/hotspot/code/StubQueue.java | 4 ++-- 10 files changed, 4 insertions(+), 38 deletions(-) diff --git a/src/hotspot/share/code/compiledIC.cpp b/src/hotspot/share/code/compiledIC.cpp index f142e306a6b02..684aee509ee53 100644 --- a/src/hotspot/share/code/compiledIC.cpp +++ b/src/hotspot/share/code/compiledIC.cpp @@ -293,7 +293,7 @@ bool CompiledIC::is_monomorphic() const { } bool CompiledIC::is_megamorphic() const { - return VtableStubs::entry_point(destination()) != nullptr;; + return VtableStubs::entry_point(destination()) != nullptr; } bool CompiledIC::is_speculated_klass(Klass* receiver_klass) { diff --git a/src/hotspot/share/compiler/compilerDefinitions.cpp b/src/hotspot/share/compiler/compilerDefinitions.cpp index ee0c73254f180..7b091d8ade50c 100644 --- a/src/hotspot/share/compiler/compilerDefinitions.cpp +++ b/src/hotspot/share/compiler/compilerDefinitions.cpp @@ -497,11 +497,6 @@ bool CompilerConfig::check_args_consistency(bool status) { "Invalid NonNMethodCodeHeapSize=%dK. Must be at least %uK.\n", NonNMethodCodeHeapSize/K, min_code_cache_size/K); status = false; - } else if (InlineCacheBufferSize > NonNMethodCodeHeapSize / 2) { - jio_fprintf(defaultStream::error_stream(), - "Invalid InlineCacheBufferSize=" SIZE_FORMAT "K. Must be less than or equal to " SIZE_FORMAT "K.\n", - InlineCacheBufferSize/K, NonNMethodCodeHeapSize/2/K); - status = false; } #ifdef _LP64 diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 8dafc9a508d99..2bcc26043cd96 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -289,9 +289,6 @@ const int ObjectAlignmentInBytes = 8; product(bool, UseInlineCaches, true, \ "Use Inline Caches for virtual calls ") \ \ - product(size_t, InlineCacheBufferSize, 10*K, EXPERIMENTAL, \ - "InlineCacheBuffer size") \ - \ product(bool, InlineArrayCopy, true, DIAGNOSTIC, \ "Inline arraycopy native that is known to be part of " \ "base library DLL") \ diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp index f033f42624987..a0ba783c36408 100644 --- a/src/hotspot/share/runtime/mutexLocker.cpp +++ b/src/hotspot/share/runtime/mutexLocker.cpp @@ -45,7 +45,6 @@ Mutex* SharedDictionary_lock = nullptr; Monitor* ClassInitError_lock = nullptr; Mutex* Module_lock = nullptr; Mutex* CompiledIC_lock = nullptr; -Mutex* InlineCacheBuffer_lock = nullptr; Mutex* VMStatistic_lock = nullptr; Mutex* JmethodIdCreation_lock = nullptr; Mutex* JfieldIdCreation_lock = nullptr; @@ -262,7 +261,7 @@ void mutex_init() { MUTEX_DEFN(JfieldIdCreation_lock , PaddedMutex , safepoint); - MUTEX_DEFN(CompiledIC_lock , PaddedMutex , nosafepoint); // locks VtableStubs_lock, InlineCacheBuffer_lock + MUTEX_DEFN(CompiledIC_lock , PaddedMutex , nosafepoint); // locks VtableStubs_lock MUTEX_DEFN(MethodCompileQueue_lock , PaddedMonitor, safepoint); MUTEX_DEFN(CompileStatistics_lock , PaddedMutex , safepoint); MUTEX_DEFN(DirectivesStack_lock , PaddedMutex , nosafepoint); @@ -319,7 +318,6 @@ void mutex_init() { #endif // These locks have relative rankings, and inherit safepoint checking attributes from that rank. - MUTEX_DEFL(InlineCacheBuffer_lock , PaddedMutex , CompiledIC_lock); MUTEX_DEFL(VtableStubs_lock , PaddedMutex , CompiledIC_lock); // Also holds DumpTimeTable_lock MUTEX_DEFL(CodeCache_lock , PaddedMonitor, VtableStubs_lock); MUTEX_DEFL(NMethodState_lock , PaddedMutex , CodeCache_lock); diff --git a/src/hotspot/share/runtime/mutexLocker.hpp b/src/hotspot/share/runtime/mutexLocker.hpp index 160e6c97db07f..3da859585019b 100644 --- a/src/hotspot/share/runtime/mutexLocker.hpp +++ b/src/hotspot/share/runtime/mutexLocker.hpp @@ -40,7 +40,6 @@ extern Mutex* SharedDictionary_lock; // a lock on the CDS shared dic extern Monitor* ClassInitError_lock; // a lock on the class initialization error table extern Mutex* Module_lock; // a lock on module and package related data structures extern Mutex* CompiledIC_lock; // a lock used to guard compiled IC patching and access -extern Mutex* InlineCacheBuffer_lock; // a lock used to guard the InlineCacheBuffer extern Mutex* VMStatistic_lock; // a lock used to guard statistics count increment extern Mutex* JmethodIdCreation_lock; // a lock on creating JNI method identifiers extern Mutex* JfieldIdCreation_lock; // a lock on creating JNI static field identifiers diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index 5b871248c590b..df6a660a0aa21 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -83,7 +83,6 @@ Thread::Thread(MemTag mem_tag) { 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); // Initial value of zero ==> never claimed. _threads_do_token = 0; diff --git a/src/hotspot/share/runtime/thread.hpp b/src/hotspot/share/runtime/thread.hpp index d059a14a0f96d..45c39eae151d2 100644 --- a/src/hotspot/share/runtime/thread.hpp +++ b/src/hotspot/share/runtime/thread.hpp @@ -46,7 +46,6 @@ class CompilerThread; class HandleArea; class HandleMark; -class ICRefillVerifier; class JvmtiRawMonitor; class NMethodClosure; class Metadata; @@ -242,20 +241,6 @@ class Thread: public ThreadShadow { public: void set_last_handle_mark(HandleMark* mark) { _last_handle_mark = mark; } HandleMark* last_handle_mark() const { return _last_handle_mark; } - private: - -#ifdef ASSERT - ICRefillVerifier* _missed_ic_stub_refill_verifier; - - public: - ICRefillVerifier* missed_ic_stub_refill_verifier() { - return _missed_ic_stub_refill_verifier; - } - - void set_missed_ic_stub_refill_verifier(ICRefillVerifier* verifier) { - _missed_ic_stub_refill_verifier = verifier; - } -#endif // ASSERT private: // Used by SkipGCALot class. diff --git a/src/hotspot/share/runtime/vmOperation.hpp b/src/hotspot/share/runtime/vmOperation.hpp index 532a9231b70e8..eede52f00d566 100644 --- a/src/hotspot/share/runtime/vmOperation.hpp +++ b/src/hotspot/share/runtime/vmOperation.hpp @@ -109,7 +109,6 @@ template(PrintCompileQueue) \ template(PrintClassHierarchy) \ template(PrintClasses) \ - template(ICBufferFull) \ template(PrintMetadata) \ template(GTestExecuteAtSafepoint) \ template(GTestStopSafepoint) \ diff --git a/src/hotspot/share/runtime/vmOperations.hpp b/src/hotspot/share/runtime/vmOperations.hpp index 5ccf689eaf3d9..ea7f62df37db8 100644 --- a/src/hotspot/share/runtime/vmOperations.hpp +++ b/src/hotspot/share/runtime/vmOperations.hpp @@ -60,12 +60,6 @@ class VM_ForceSafepoint: public VM_EmptyOperation { VMOp_Type type() const { return VMOp_ForceSafepoint; } }; -// empty vm op, when forcing a safepoint due to inline cache buffers being full -class VM_ICBufferFull: public VM_EmptyOperation { - public: - VMOp_Type type() const { return VMOp_ICBufferFull; } -}; - class VM_ClearICs: public VM_Operation { private: bool _preserve_static_stubs; diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java index d59971b33ecf0..8d06a257e626d 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java @@ -52,8 +52,8 @@ public class StubQueue extends VMObject { private static CIntegerField queueEndField; private static CIntegerField numberOfStubsField; - // The type of the contained stubs (i.e., InterpreterCodelet, - // ICStub). Must be a subclass of type Stub. + // The type of the contained stubs (i.e., InterpreterCodelet). + // Must be a subclass of type Stub. private Class stubType; static { From 2dc3b1a71ffe71bc08ec967bb6b24ccf803037f3 Mon Sep 17 00:00:00 2001 From: Nizar Benalla Date: Tue, 1 Oct 2024 10:27:07 +0000 Subject: [PATCH 256/307] 8341201: Broken link in AbstractAnnotationValueVisitor7 due to extra quotation mark Reviewed-by: iris, darcy --- .../javax/lang/model/util/AbstractAnnotationValueVisitor7.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java index 0ca2bb1376621..dbdeb3a950644 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java @@ -37,7 +37,7 @@ * @param the return type of this visitor's methods * @param

        the type of the additional parameter to this visitor's methods. * - * @see AbstractAnnotationValueVisitor6##note_for_subclasses" + * @see AbstractAnnotationValueVisitor6##note_for_subclasses * Compatibility note for subclasses * @see AbstractAnnotationValueVisitor6 * @see AbstractAnnotationValueVisitor8 From f7c7958f001b3242eb485efd25bbcf9e1be75d85 Mon Sep 17 00:00:00 2001 From: Axel Boldt-Christmas Date: Tue, 1 Oct 2024 11:33:11 +0000 Subject: [PATCH 257/307] 8340420: ZGC: Should call `vm_shutdown_during_initialization` if initialization fails Reviewed-by: stefank, mli --- .../bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp | 4 +- .../gc/z/zPhysicalMemoryBacking_linux.cpp | 30 ++++----- src/hotspot/share/gc/z/zCollectedHeap.cpp | 6 +- src/hotspot/share/gc/z/zCollectedHeap.hpp | 2 +- src/hotspot/share/gc/z/zHeap.cpp | 3 +- src/hotspot/share/gc/z/zInitialize.cpp | 61 ++++++++++++++++++- src/hotspot/share/gc/z/zInitialize.hpp | 31 ++++++++-- .../share/gc/z/zMarkStackAllocator.cpp | 4 +- src/hotspot/share/gc/z/zVirtualMemory.cpp | 3 +- 9 files changed, 117 insertions(+), 27 deletions(-) diff --git a/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp b/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp index 29825a9eab291..2e56c092a79b5 100644 --- a/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp +++ b/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp @@ -22,10 +22,10 @@ */ #include "precompiled.hpp" -#include "gc/shared/gcLogPrecious.hpp" #include "gc/z/zAddress.inline.hpp" #include "gc/z/zErrno.hpp" #include "gc/z/zGlobals.hpp" +#include "gc/z/zInitialize.hpp" #include "gc/z/zLargePages.inline.hpp" #include "gc/z/zPhysicalMemory.inline.hpp" #include "gc/z/zPhysicalMemoryBacking_bsd.hpp" @@ -82,7 +82,7 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking(size_t max_capacity) _base = (uintptr_t)os::reserve_memory(max_capacity); if (_base == 0) { // Failed - log_error_pd(gc)("Failed to reserve address space for backing memory"); + ZInitialize::error("Failed to reserve address space for backing memory"); return; } diff --git a/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp b/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp index f967fee930579..b648876ac602c 100644 --- a/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp +++ b/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp @@ -27,6 +27,7 @@ #include "gc/z/zArray.inline.hpp" #include "gc/z/zErrno.hpp" #include "gc/z/zGlobals.hpp" +#include "gc/z/zInitialize.hpp" #include "gc/z/zLargePages.inline.hpp" #include "gc/z/zMountPoint_linux.hpp" #include "gc/z/zNUMA.inline.hpp" @@ -129,6 +130,7 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking(size_t max_capacity) // Create backing file _fd = create_fd(ZFILENAME_HEAP); if (_fd == -1) { + ZInitialize::error("Failed to create heap backing file"); return; } @@ -136,7 +138,7 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking(size_t max_capacity) while (ftruncate(_fd, max_capacity) == -1) { if (errno != EINTR) { ZErrno err; - log_error_p(gc)("Failed to truncate backing file (%s)", err.to_string()); + ZInitialize::error("Failed to truncate backing file (%s)", err.to_string()); return; } } @@ -145,7 +147,7 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking(size_t max_capacity) struct statfs buf; if (fstatfs(_fd, &buf) == -1) { ZErrno err; - log_error_p(gc)("Failed to determine filesystem type for backing file (%s)", err.to_string()); + ZInitialize::error("Failed to determine filesystem type for backing file (%s)", err.to_string()); return; } @@ -158,39 +160,39 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking(size_t max_capacity) // Make sure the filesystem type matches requested large page type if (ZLargePages::is_transparent() && !is_tmpfs()) { - log_error_p(gc)("-XX:+UseTransparentHugePages can only be enabled when using a %s filesystem", - ZFILESYSTEM_TMPFS); + ZInitialize::error("-XX:+UseTransparentHugePages can only be enabled when using a %s filesystem", + ZFILESYSTEM_TMPFS); return; } if (ZLargePages::is_transparent() && !tmpfs_supports_transparent_huge_pages()) { - log_error_p(gc)("-XX:+UseTransparentHugePages on a %s filesystem not supported by kernel", - ZFILESYSTEM_TMPFS); + ZInitialize::error("-XX:+UseTransparentHugePages on a %s filesystem not supported by kernel", + ZFILESYSTEM_TMPFS); return; } if (ZLargePages::is_explicit() && !is_hugetlbfs()) { - log_error_p(gc)("-XX:+UseLargePages (without -XX:+UseTransparentHugePages) can only be enabled " - "when using a %s filesystem", ZFILESYSTEM_HUGETLBFS); + ZInitialize::error("-XX:+UseLargePages (without -XX:+UseTransparentHugePages) can only be enabled " + "when using a %s filesystem", ZFILESYSTEM_HUGETLBFS); return; } if (!ZLargePages::is_explicit() && is_hugetlbfs()) { - log_error_p(gc)("-XX:+UseLargePages must be enabled when using a %s filesystem", - ZFILESYSTEM_HUGETLBFS); + ZInitialize::error("-XX:+UseLargePages must be enabled when using a %s filesystem", + ZFILESYSTEM_HUGETLBFS); return; } // Make sure the filesystem block size is compatible if (ZGranuleSize % _block_size != 0) { - log_error_p(gc)("Filesystem backing the heap has incompatible block size (" SIZE_FORMAT ")", - _block_size); + ZInitialize::error("Filesystem backing the heap has incompatible block size (" SIZE_FORMAT ")", + _block_size); return; } if (is_hugetlbfs() && _block_size != ZGranuleSize) { - log_error_p(gc)("%s filesystem has unexpected block size " SIZE_FORMAT " (expected " SIZE_FORMAT ")", - ZFILESYSTEM_HUGETLBFS, _block_size, ZGranuleSize); + ZInitialize::error("%s filesystem has unexpected block size " SIZE_FORMAT " (expected " SIZE_FORMAT ")", + ZFILESYSTEM_HUGETLBFS, _block_size, ZGranuleSize); return; } diff --git a/src/hotspot/share/gc/z/zCollectedHeap.cpp b/src/hotspot/share/gc/z/zCollectedHeap.cpp index ccfa7af6b7d72..8afefd5a7cc1c 100644 --- a/src/hotspot/share/gc/z/zCollectedHeap.cpp +++ b/src/hotspot/share/gc/z/zCollectedHeap.cpp @@ -49,6 +49,7 @@ #include "memory/universe.hpp" #include "oops/stackChunkOop.hpp" #include "runtime/continuationJavaClasses.hpp" +#include "runtime/java.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/stackWatermarkSet.hpp" #include "services/memoryUsage.hpp" @@ -60,7 +61,7 @@ ZCollectedHeap* ZCollectedHeap::heap() { ZCollectedHeap::ZCollectedHeap() : _barrier_set(), - _initialize(&_barrier_set), + _initializer(&_barrier_set), _heap(), _driver_minor(new ZDriverMinor()), _driver_major(new ZDriverMajor()), @@ -78,11 +79,14 @@ const char* ZCollectedHeap::name() const { jint ZCollectedHeap::initialize() { if (!_heap.is_initialized()) { + vm_shutdown_during_initialization(ZInitialize::error_message()); return JNI_ENOMEM; } Universe::set_verify_data(~(ZAddressHeapBase - 1) | 0x7, ZAddressHeapBase); + ZInitialize::finish(); + return JNI_OK; } diff --git a/src/hotspot/share/gc/z/zCollectedHeap.hpp b/src/hotspot/share/gc/z/zCollectedHeap.hpp index 528bacd8df82b..434204e16b80d 100644 --- a/src/hotspot/share/gc/z/zCollectedHeap.hpp +++ b/src/hotspot/share/gc/z/zCollectedHeap.hpp @@ -43,7 +43,7 @@ class ZCollectedHeap : public CollectedHeap { private: ZBarrierSet _barrier_set; - ZInitialize _initialize; + ZInitializer _initializer; ZHeap _heap; ZDriverMinor* _driver_minor; ZDriverMajor* _driver_major; diff --git a/src/hotspot/share/gc/z/zHeap.cpp b/src/hotspot/share/gc/z/zHeap.cpp index dc5f1e3d21d57..40aa76867f424 100644 --- a/src/hotspot/share/gc/z/zHeap.cpp +++ b/src/hotspot/share/gc/z/zHeap.cpp @@ -34,6 +34,7 @@ #include "gc/z/zHeap.inline.hpp" #include "gc/z/zHeapIterator.hpp" #include "gc/z/zHeuristics.hpp" +#include "gc/z/zInitialize.hpp" #include "gc/z/zPage.inline.hpp" #include "gc/z/zPageTable.inline.hpp" #include "gc/z/zResurrection.hpp" @@ -74,7 +75,7 @@ ZHeap::ZHeap() // Prime cache if (!_page_allocator.prime_cache(_old.workers(), InitialHeapSize)) { - log_error_p(gc)("Failed to allocate initial Java heap (" SIZE_FORMAT "M)", InitialHeapSize / M); + ZInitialize::error("Failed to allocate initial Java heap (" SIZE_FORMAT "M)", InitialHeapSize / M); return; } diff --git a/src/hotspot/share/gc/z/zInitialize.cpp b/src/hotspot/share/gc/z/zInitialize.cpp index 52229bf283097..e37fc550bfe2a 100644 --- a/src/hotspot/share/gc/z/zInitialize.cpp +++ b/src/hotspot/share/gc/z/zInitialize.cpp @@ -22,6 +22,7 @@ */ #include "precompiled.hpp" +#include "gc/shared/gcLogPrecious.hpp" #include "gc/z/zAddress.hpp" #include "gc/z/zBarrierSet.hpp" #include "gc/z/zCPU.hpp" @@ -38,9 +39,19 @@ #include "gc/z/zThreadLocalAllocBuffer.hpp" #include "gc/z/zTracer.hpp" #include "logging/log.hpp" +#include "nmt/memTag.hpp" #include "runtime/vm_version.hpp" +#include "utilities/formatBuffer.hpp" -ZInitialize::ZInitialize(ZBarrierSet* barrier_set) { +char ZInitialize::_error_message[ErrorMessageLength] = {}; +bool ZInitialize::_had_error = false; +bool ZInitialize::_finished = false; + +ZInitializer::ZInitializer(ZBarrierSet* barrier_set) { + ZInitialize::initialize(barrier_set); +} + +void ZInitialize::initialize(ZBarrierSet* barrier_set) { log_info(gc, init)("Initializing %s", ZName); log_info(gc, init)("Version: %s (%s)", VM_Version::vm_release(), @@ -62,3 +73,51 @@ ZInitialize::ZInitialize(ZBarrierSet* barrier_set) { pd_initialize(); } + +void ZInitialize::register_error(bool debug, const char *error_msg) { + guarantee(!_finished, "Only register errors during initialization"); + + if (!_had_error) { + strncpy(_error_message, error_msg, ErrorMessageLength - 1); + _had_error = true; + } + + if (debug) { + log_error_pd(gc)("%s", error_msg); + } else { + log_error_p(gc)("%s", error_msg); + } +} + +void ZInitialize::error(const char* msg_format, ...) { + va_list argp; + va_start(argp, msg_format); + const FormatBuffer error_msg(FormatBufferDummy(), msg_format, argp); + va_end(argp); + register_error(false /* debug */, error_msg); +} + +void ZInitialize::error_d(const char* msg_format, ...) { + va_list argp; + va_start(argp, msg_format); + const FormatBuffer error_msg(FormatBufferDummy(), msg_format, argp); + va_end(argp); + register_error(true /* debug */, error_msg); +} + +bool ZInitialize::had_error() { + return _had_error; +} + +const char* ZInitialize::error_message() { + assert(had_error(), "Should have registered an error"); + if (had_error()) { + return _error_message; + } + return "Unknown error, check error GC logs"; +} + +void ZInitialize::finish() { + guarantee(!_finished, "Only finish initialization once"); + _finished = true; +} diff --git a/src/hotspot/share/gc/z/zInitialize.hpp b/src/hotspot/share/gc/z/zInitialize.hpp index 599b656623448..3c551b4c62260 100644 --- a/src/hotspot/share/gc/z/zInitialize.hpp +++ b/src/hotspot/share/gc/z/zInitialize.hpp @@ -24,16 +24,39 @@ #ifndef SHARE_GC_Z_ZINITIALIZE_HPP #define SHARE_GC_Z_ZINITIALIZE_HPP -#include "memory/allocation.hpp" +#include "memory/allStatic.hpp" +#include "utilities/compilerWarnings.hpp" + +#include class ZBarrierSet; -class ZInitialize { +class ZInitializer { +public: + ZInitializer(ZBarrierSet* barrier_set); +}; + +class ZInitialize : public AllStatic { private: - void pd_initialize(); + static constexpr size_t ErrorMessageLength = 256; + + static char _error_message[ErrorMessageLength]; + static bool _had_error; + static bool _finished; + + static void register_error(bool debug, const char *error_msg); + + static void pd_initialize(); public: - ZInitialize(ZBarrierSet* barrier_set); + static void error(const char* msg_format, ...) ATTRIBUTE_PRINTF(1, 2); + static void error_d(const char* msg_format, ...) ATTRIBUTE_PRINTF(1, 2); + + static bool had_error(); + static const char* error_message(); + + static void initialize(ZBarrierSet* barrier_set); + static void finish(); }; #endif // SHARE_GC_Z_ZINITIALIZE_HPP diff --git a/src/hotspot/share/gc/z/zMarkStackAllocator.cpp b/src/hotspot/share/gc/z/zMarkStackAllocator.cpp index a9e404a0f55c1..100036dc3fe53 100644 --- a/src/hotspot/share/gc/z/zMarkStackAllocator.cpp +++ b/src/hotspot/share/gc/z/zMarkStackAllocator.cpp @@ -22,8 +22,8 @@ */ #include "precompiled.hpp" -#include "gc/shared/gcLogPrecious.hpp" #include "gc/shared/gc_globals.hpp" +#include "gc/z/zInitialize.hpp" #include "gc/z/zLock.inline.hpp" #include "gc/z/zMarkStack.inline.hpp" #include "gc/z/zMarkStackAllocator.hpp" @@ -43,7 +43,7 @@ ZMarkStackSpace::ZMarkStackSpace() const size_t size = ZMarkStackSpaceLimit; const uintptr_t addr = (uintptr_t)os::reserve_memory(size, !ExecMem, mtGC); if (addr == 0) { - log_error_pd(gc, marking)("Failed to reserve address space for mark stacks"); + ZInitialize::error_d("Failed to reserve address space for mark stacks"); return; } diff --git a/src/hotspot/share/gc/z/zVirtualMemory.cpp b/src/hotspot/share/gc/z/zVirtualMemory.cpp index 6b53b2ba7c82b..2160aa3894802 100644 --- a/src/hotspot/share/gc/z/zVirtualMemory.cpp +++ b/src/hotspot/share/gc/z/zVirtualMemory.cpp @@ -27,6 +27,7 @@ #include "gc/z/zAddress.inline.hpp" #include "gc/z/zAddressSpaceLimit.hpp" #include "gc/z/zGlobals.hpp" +#include "gc/z/zInitialize.hpp" #include "gc/z/zNMT.hpp" #include "gc/z/zVirtualMemory.inline.hpp" #include "utilities/align.hpp" @@ -44,7 +45,7 @@ ZVirtualMemoryManager::ZVirtualMemoryManager(size_t max_capacity) // Reserve address space if (!reserve(max_capacity)) { - log_error_pd(gc)("Failed to reserve enough address space for Java heap"); + ZInitialize::error_d("Failed to reserve enough address space for Java heap"); return; } From 7cc7c080b5dbab61914512bf63227944697c0cbe Mon Sep 17 00:00:00 2001 From: Raphael Mosaner Date: Tue, 1 Oct 2024 11:46:13 +0000 Subject: [PATCH 258/307] 8337493: [JVMCI] Number of libgraal threads might be too low Reviewed-by: dnsimon --- src/hotspot/share/jvmci/jvmci_globals.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmci_globals.hpp b/src/hotspot/share/jvmci/jvmci_globals.hpp index d6f9ddd6739d4..4da49b24e6ef9 100644 --- a/src/hotspot/share/jvmci/jvmci_globals.hpp +++ b/src/hotspot/share/jvmci/jvmci_globals.hpp @@ -143,9 +143,11 @@ class fileStream; "on the HotSpot heap. Defaults to true if UseJVMCICompiler or " \ "EnableJVMCI is true and a JVMCI native library is available.") \ \ - product(double, JVMCINativeLibraryThreadFraction, 0.33, EXPERIMENTAL, \ + product(double, JVMCINativeLibraryThreadFraction, 0.66, EXPERIMENTAL, \ "The fraction of compiler threads used by libjvmci. " \ - "The remaining compiler threads are used by C1.") \ + "The remaining compiler threads are used by C1. " \ + "Reducing this value could reduce the max RSS but " \ + "also increase the warmup time.") \ range(0.0, 1.0) \ \ product(ccstr, JVMCINativeLibraryErrorFile, nullptr, EXPERIMENTAL, \ From 684d246ccf497f599ffcd498f2fbe4b1b2357e27 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 1 Oct 2024 13:29:56 +0000 Subject: [PATCH 259/307] 8341242: Shenandoah: LRB node is not matched as GC barrier after JDK-8340183 Reviewed-by: rkennke, phh --- src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp index 10b80b6802942..7ac9dcc2e8134 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp @@ -682,7 +682,8 @@ bool ShenandoahBarrierSetC2::is_gc_pre_barrier_node(Node* node) const { } bool ShenandoahBarrierSetC2::is_gc_barrier_node(Node* node) const { - return is_shenandoah_lrb_call(node) || + return (node->Opcode() == Op_ShenandoahLoadReferenceBarrier) || + is_shenandoah_lrb_call(node) || is_shenandoah_wb_pre_call(node) || is_shenandoah_clone_call(node); } From 2120a8414ef9c34d5875d33ac9a16594908fe403 Mon Sep 17 00:00:00 2001 From: Yudi Zheng Date: Tue, 1 Oct 2024 13:59:36 +0000 Subject: [PATCH 260/307] 8341333: [JVMCI] Export JavaThread::_unlocked_inflated_monitor to JVMCI Reviewed-by: dnsimon --- src/hotspot/share/jvmci/vmStructs_jvmci.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp index df77e8a2882ee..13b208932199a 100644 --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp @@ -246,6 +246,7 @@ nonstatic_field(JavaThread, _lock_stack, LockStack) \ nonstatic_field(JavaThread, _om_cache, OMCache) \ nonstatic_field(JavaThread, _cont_entry, ContinuationEntry*) \ + nonstatic_field(JavaThread, _unlocked_inflated_monitor, ObjectMonitor*) \ JVMTI_ONLY(nonstatic_field(JavaThread, _is_in_VTMS_transition, bool)) \ JVMTI_ONLY(nonstatic_field(JavaThread, _is_in_tmp_VTMS_transition, bool)) \ JVMTI_ONLY(nonstatic_field(JavaThread, _is_disable_suspend, bool)) \ From 7b1e6f8ed9dbc07158717a32d341393afaa54b66 Mon Sep 17 00:00:00 2001 From: "joseph.jackson" Date: Tue, 1 Oct 2024 14:00:39 +0000 Subject: [PATCH 261/307] 8337389: Parallel: Remove unnecessary forward declarations in psScavenge.hpp Reviewed-by: kbarrett, tschatzl --- src/hotspot/share/gc/parallel/psScavenge.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/hotspot/share/gc/parallel/psScavenge.hpp b/src/hotspot/share/gc/parallel/psScavenge.hpp index 99d0487760b15..55abdfd3cf38e 100644 --- a/src/hotspot/share/gc/parallel/psScavenge.hpp +++ b/src/hotspot/share/gc/parallel/psScavenge.hpp @@ -34,9 +34,7 @@ #include "oops/oop.hpp" #include "utilities/stack.hpp" -class ReferenceProcessor; class ParallelScavengeHeap; -class ParallelScavengeTracer; class PSIsAliveClosure; class STWGCTimer; From f2a767f59b1f66966665bc8601273b532961395a Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Tue, 1 Oct 2024 14:28:22 +0000 Subject: [PATCH 262/307] 8340907: Open source closed frame tests # 2 Reviewed-by: prr, honkar --- test/jdk/ProblemList.txt | 1 + .../jdk/java/awt/Frame/DeiconifyClipTest.java | 140 ++++++++++++++++++ .../java/awt/Frame/FrameSetCursorTest.java | 100 +++++++++++++ .../java/awt/Frame/InitialIconifiedTest.java | 98 ++++++++++++ .../java/awt/Frame/InsetCorrectionTest.java | 102 +++++++++++++ 5 files changed, 441 insertions(+) create mode 100644 test/jdk/java/awt/Frame/DeiconifyClipTest.java create mode 100644 test/jdk/java/awt/Frame/FrameSetCursorTest.java create mode 100644 test/jdk/java/awt/Frame/InitialIconifiedTest.java create mode 100644 test/jdk/java/awt/Frame/InsetCorrectionTest.java diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index f02272977aa17..ef9b82d596728 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -121,6 +121,7 @@ java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java 6848406 gen java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java 6848407 generic-all java/awt/Frame/MaximizedUndecorated/MaximizedUndecorated.java 8022302 generic-all java/awt/Frame/RestoreToOppositeScreen/RestoreToOppositeScreen.java 8286840 linux-all +java/awt/Frame/InitialIconifiedTest.java 8203920 macosx-all,linux-all java/awt/FileDialog/FileDialogIconTest/FileDialogIconTest.java 8160558 windows-all java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java 8060176 windows-all,macosx-all java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java 8060176 windows-all,macosx-all diff --git a/test/jdk/java/awt/Frame/DeiconifyClipTest.java b/test/jdk/java/awt/Frame/DeiconifyClipTest.java new file mode 100644 index 0000000000000..c650355f3ec73 --- /dev/null +++ b/test/jdk/java/awt/Frame/DeiconifyClipTest.java @@ -0,0 +1,140 @@ +/* + * 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. + */ + +/* + * DeiconifyClipTest.java + * + * summary: + * + * What happens is that we call AwtWindow::UpdateInsets when + * processing WM_NCCALCSIZE delivered on programmatic deiconification. + * At this point IsIconic returns false (so UpdateInsets proceeds), + * but the rect sizes still seems to be those weird of the iconic + * state. Based on them we compute insets with top = left = 0 (and + * bottom and right that are completely bogus) and pass them to + * PaintUpdateRgn which results in incorrect clip origin. Immediately + * after that we do UpdateInsets again during WM_SIZE processing and + * get real values. + */ + +import javax.swing.BoxLayout; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Insets; + +/* + * @test + * @bug 4792958 + * @summary Incorrect clip region after programmatic restore + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual DeiconifyClipTest +*/ + +public class DeiconifyClipTest { + private static final String INSTRUCTIONS = """ + This test creates a frame that is automatically iconified/deiconified + in a cycle. + + The test FAILS if after deiconfication the frame has a greyed-out area + in the lower-right corner. + If the frame contents is drawn completely - the test PASSES. + + Press PASS or FAIL button accordingly. + """; + + static TestFrame testFrame; + static volatile boolean shouldContinue = true; + + public static void main(String[] args) throws Exception { + PassFailJFrame passFailJFrame = PassFailJFrame.builder() + .title("DeiconifyClipTest Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .testUI(DeiconifyClipTest::createAndShowUI) + .build(); + try { + runThread(); + } finally { + passFailJFrame.awaitAndCheck(); + shouldContinue = false; + } + } + + private static void runThread() { + new Thread(() -> { + for (int i = 0; i < 1000 && shouldContinue; ++i) { + try { + Thread.sleep(3000); + SwingUtilities.invokeAndWait(() -> { + if ((testFrame.getExtendedState() & Frame.ICONIFIED) + != 0) { + testFrame.setExtendedState(Frame.NORMAL); + } else { + testFrame.setState(Frame.ICONIFIED); + } + }); + } catch (Exception ignored) { + } + } + }).start(); + } + + static Frame createAndShowUI() { + testFrame = new TestFrame(); + testFrame.getContentPane().setLayout(new BoxLayout(testFrame.getContentPane(), + BoxLayout.Y_AXIS)); + testFrame.getContentPane().setBackground(Color.yellow); + testFrame.setSize(300, 300); + return testFrame; + } + + static class TestFrame extends JFrame { + public TestFrame() { + super("DeiconifyClipTest"); + } + + // make it more visible if the clip is wrong. + public void paint(Graphics g) { + Insets b = getInsets(); + Dimension d = getSize(); + + int x = b.left; + int y = b.top; + int w = d.width - x - b.right; + int h = d.height - y - b.bottom; + + g.setColor(Color.white); + g.fillRect(0, 0, d.width, d.height); + + g.setColor(Color.green); + g.drawRect(x, y, w-1, h-1); + g.drawLine(x, y, x+w, y+h); + g.drawLine(x, y+h, x+w, y); + } + } +} diff --git a/test/jdk/java/awt/Frame/FrameSetCursorTest.java b/test/jdk/java/awt/Frame/FrameSetCursorTest.java new file mode 100644 index 0000000000000..98968a8fbab82 --- /dev/null +++ b/test/jdk/java/awt/Frame/FrameSetCursorTest.java @@ -0,0 +1,100 @@ +/* + * 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.Button; +import java.awt.Cursor; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.event.ActionListener; +import java.lang.Exception; +import java.lang.InterruptedException; +import java.lang.Object; +import java.lang.String; +import java.lang.Thread; + +/* + * @test + * @bug 4097226 + * @summary Frame.setCursor() sometimes doesn't update the cursor until user moves the mouse + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual FrameSetCursorTest + */ + +public class FrameSetCursorTest { + private static final String INSTRUCTIONS = """ + 1. Keep the instruction dialog and TestFrame side by side so that + you can read the instructions while doing the test + 2. Click on the 'Start Busy' button on the frame titled 'TestFrame' + and DO NOT MOVE THE MOUSE ANYWHERE till you complete the steps below + 3. The cursor on the TestFrame changes to busy cursor + 4. If you don't see the busy cursor press 'Fail' after + the `done sleeping` message + 5. If the busy cursor is seen, after 5 seconds the message + 'done sleeping' is displayed in the message window + 6. Check for the cursor type after the display of 'done sleeping' + 7. If the cursor on the TestFrame has changed back to default cursor + (without you touching or moving the mouse), then press 'Pass' + else if the frame still shows the busy cursor press 'Fail' + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("FrameSetCursorTest Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .testUI(FrameSetCursorTest::createAndShowUI) + .logArea(5) + .build() + .awaitAndCheck(); + + } + + static Frame createAndShowUI() { + Frame frame = new Frame("TestFrame"); + Panel panel = new Panel(); + Button busyButton = new Button("Start Busy"); + + ActionListener actionListener = event -> { + Object source = event.getSource(); + if (source == busyButton) { + frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + try { + Thread.sleep(5000); + } catch (InterruptedException ignored) {} + PassFailJFrame.log("done sleeping"); + frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + }; + + busyButton.addActionListener(actionListener); + panel.setLayout(new BorderLayout()); + panel.add("North", busyButton); + + frame.add(panel); + frame.pack(); + frame.setSize(200, 200); + return frame; + } +} \ No newline at end of file diff --git a/test/jdk/java/awt/Frame/InitialIconifiedTest.java b/test/jdk/java/awt/Frame/InitialIconifiedTest.java new file mode 100644 index 0000000000000..f3f43929e7b16 --- /dev/null +++ b/test/jdk/java/awt/Frame/InitialIconifiedTest.java @@ -0,0 +1,98 @@ +/* + * 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 javax.imageio.ImageIO; +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +/* + * @test + * @key headful + * @bug 4851435 + * @summary Frame is not shown initially iconified after pack + */ + +public class InitialIconifiedTest { + + private static Frame backgroundFrame; + private static Frame testedFrame; + + private static final Rectangle backgroundFrameBounds = + new Rectangle(100, 100, 200, 200); + private static final Rectangle testedFrameBounds = + new Rectangle(150, 150, 100, 100); + + private static Robot robot; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + + try { + EventQueue.invokeAndWait(InitialIconifiedTest::initAndShowGui); + robot.waitForIdle(); + robot.delay(500); + test(); + } finally { + EventQueue.invokeAndWait(() -> { + backgroundFrame.dispose(); + testedFrame.dispose(); + }); + } + } + + private static void initAndShowGui() { + backgroundFrame = new Frame("DisposeTest background"); + backgroundFrame.setUndecorated(true); + backgroundFrame.setBackground(Color.RED); + backgroundFrame.setBounds(backgroundFrameBounds); + backgroundFrame.setVisible(true); + + testedFrame = new Frame("Should have started ICONIC"); + testedFrame.setExtendedState(Frame.ICONIFIED); + testedFrame.setBounds(testedFrameBounds); + testedFrame.setVisible(true); + } + + private static void test() { + BufferedImage bi = robot.createScreenCapture(backgroundFrameBounds); + int redPix = Color.RED.getRGB(); + + for (int x = 0; x < bi.getWidth(); x++) { + for (int y = 0; y < bi.getHeight(); y++) { + if (bi.getRGB(x, y) != redPix) { + try { + ImageIO.write(bi, "png", + new File("failure.png")); + } catch (IOException ignored) {} + throw new RuntimeException("Test failed"); + } + } + } + } +} diff --git a/test/jdk/java/awt/Frame/InsetCorrectionTest.java b/test/jdk/java/awt/Frame/InsetCorrectionTest.java new file mode 100644 index 0000000000000..1ea6f03b24b15 --- /dev/null +++ b/test/jdk/java/awt/Frame/InsetCorrectionTest.java @@ -0,0 +1,102 @@ +/* + * 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.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/* + * @test + * @bug 4091426 + * @key headful + * @summary Test inset correction when setVisible(true) BEFORE setSize(), setLocation() + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual InsetCorrectionTest + */ + +public class InsetCorrectionTest { + private static final String INSTRUCTIONS = """ + There is a frame of size 300x300 at location (100,100). + It has a menubar with one menu, 'File', but the frame + is otherwise empty. In particular, there should be no + part of the frame that is not shown in the background color. + Upon test completion, click Pass or Fail appropriately. + """; + + private static InsetCorrection testFrame; + + public static void main(String[] args) throws Exception { + EventQueue.invokeAndWait(() -> testFrame = new InsetCorrection()); + + try { + PassFailJFrame passFailJFrame = PassFailJFrame.builder() + .title("InsetCorrectionTest Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .logArea(3) + .build(); + EventQueue.invokeAndWait(() -> + PassFailJFrame.log("frame location: " + testFrame.getBounds())); + passFailJFrame.awaitAndCheck(); + } finally { + EventQueue.invokeAndWait(testFrame::dispose); + } + } + + static class InsetCorrection extends Frame + implements ActionListener { + MenuBar mb; + Menu file; + MenuItem cause_bug_b; + + public InsetCorrection() { + super("InsetCorrection"); + mb = new MenuBar(); + file = new Menu("File"); + mb.add(file); + cause_bug_b = new MenuItem("cause bug"); + file.add(cause_bug_b); + setMenuBar(mb); + cause_bug_b.addActionListener(this); + + // Making the frame visible before setSize and setLocation() + // are being called causes sometimes strange behaviour with + // JDK1.1.5G. The frame is then sometimes to large and the + // excess areas are drawn in black. This only happens + // sometimes. + setVisible(true); + setSize(300, 300); + setLocation(100, 100); + } + + public void actionPerformed(ActionEvent e) { + setVisible(false); + setVisible(true); + } + } +} From 9a7817b1376d055c5a7c1005b275cc1f198e5364 Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Tue, 1 Oct 2024 16:02:02 +0000 Subject: [PATCH 263/307] 8340988: Update jdk/jfr/event/gc/collection tests to accept "CodeCache GC Threshold" as valid GC reason Reviewed-by: tschatzl --- .../event/gc/collection/TestGCCauseWithG1ConcurrentMark.java | 4 ++-- .../event/gc/collection/TestGCCauseWithG1FullCollection.java | 4 ++-- .../jfr/event/gc/collection/TestGCCauseWithParallelOld.java | 5 +++-- .../jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java | 5 +++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1ConcurrentMark.java b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1ConcurrentMark.java index bd3a7f63a8a99..e0ea218a07f0b 100644 --- a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1ConcurrentMark.java +++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1ConcurrentMark.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,7 +41,7 @@ public static void main(String[] args) throws Exception { String[] vmFlags = {"-XX:+UseG1GC", "-XX:+ExplicitGCInvokesConcurrent"}; String[] gcNames = {GCHelper.gcG1New, GCHelper.gcG1Old, GCHelper.gcG1Full}; String[] gcCauses = {"Metadata GC Threshold", "G1 Evacuation Pause", "G1 Preventive Collection", - "G1 Compaction Pause", "System.gc()"}; + "G1 Compaction Pause", "CodeCache GC Threshold", "System.gc()"}; GCGarbageCollectionUtil.test(testID, vmFlags, gcNames, gcCauses); } } diff --git a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1FullCollection.java b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1FullCollection.java index 072c3905baf59..308a544adeb17 100644 --- a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1FullCollection.java +++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1FullCollection.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,7 +41,7 @@ public static void main(String[] args) throws Exception { String[] vmFlags = {"-XX:+UseG1GC"}; String[] gcNames = {GCHelper.gcG1New, GCHelper.gcG1Old, GCHelper.gcG1Full}; String[] gcCauses = {"Metadata GC Threshold", "G1 Evacuation Pause", "G1 Preventive Collection", - "G1 Compaction Pause", "System.gc()"}; + "G1 Compaction Pause", "CodeCache GC Threshold", "System.gc()"}; GCGarbageCollectionUtil.test(testID, vmFlags, gcNames, gcCauses); } } diff --git a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java index 4d8f697d83719..16217c0cbe1b7 100644 --- a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java +++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, 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 @@ -39,7 +39,8 @@ public static void main(String[] args) throws Exception { String testID = "ParallelOld"; String[] vmFlags = {"-XX:+UseParallelGC"}; String[] gcNames = {GCHelper.gcParallelScavenge, GCHelper.gcParallelOld}; - String[] gcCauses = {"Allocation Failure", "System.gc()", "GCLocker Initiated GC"}; + String[] gcCauses = {"Allocation Failure", "System.gc()", "GCLocker Initiated GC", + "CodeCache GC Threshold"}; GCGarbageCollectionUtil.test(testID, vmFlags, gcNames, gcCauses); } } diff --git a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java index 403bd07758524..344c61043a2e1 100644 --- a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java +++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, 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 @@ -39,7 +39,8 @@ public static void main(String[] args) throws Exception { String testID = "Serial"; String[] vmFlags = {"-XX:+UseSerialGC"}; String[] gcNames = {GCHelper.gcDefNew, GCHelper.gcSerialOld}; - String[] gcCauses = {"Allocation Failure", "System.gc()", "GCLocker Initiated GC"}; + String[] gcCauses = {"Allocation Failure", "System.gc()", "GCLocker Initiated GC", + "CodeCache GC Threshold"}; GCGarbageCollectionUtil.test(testID, vmFlags, gcNames, gcCauses); } } From 021bf630351fd5369fac732b1099bc2bfe8b5e19 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Tue, 1 Oct 2024 18:27:25 +0000 Subject: [PATCH 264/307] 8340458: Open source additional Component tests (part 2) Reviewed-by: psadhukhan --- .../InitialBackgroundSettingTest.java | 132 ++++++++++++++++ .../FlickeringOnScroll.java | 139 ++++++++++++++++ .../FocusRepaintTest/FocusRepaintTest.java | 83 ++++++++++ .../ListDoubleIndentTest.java | 148 ++++++++++++++++++ 4 files changed, 502 insertions(+) create mode 100644 test/jdk/java/awt/Component/BackgroundColorTest/InitialBackgroundSettingTest.java create mode 100644 test/jdk/java/awt/Component/FlickeringOnScroll/FlickeringOnScroll.java create mode 100644 test/jdk/java/awt/Component/FocusRepaintTest/FocusRepaintTest.java create mode 100644 test/jdk/java/awt/Component/ListDoubleIndentTest/ListDoubleIndentTest.java diff --git a/test/jdk/java/awt/Component/BackgroundColorTest/InitialBackgroundSettingTest.java b/test/jdk/java/awt/Component/BackgroundColorTest/InitialBackgroundSettingTest.java new file mode 100644 index 0000000000000..3bed6f106c59a --- /dev/null +++ b/test/jdk/java/awt/Component/BackgroundColorTest/InitialBackgroundSettingTest.java @@ -0,0 +1,132 @@ +/* + * 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 4148334 + * @summary tests that background color is initially set correctly. + * @requires os.family == "windows" + * @key headful + * @run main InitialBackgroundSettingTest + */ +import java.awt.Button; +import java.awt.Choice; +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.List; +import java.awt.TextArea; +import java.awt.TextField; +import java.awt.Scrollbar; +import java.lang.reflect.InvocationTargetException; + +public class InitialBackgroundSettingTest { + Frame frame; + TextField tf; + TextArea ta; + Choice choice; + List list; + Scrollbar bar; + Button button; + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + InitialBackgroundSettingTest test= new InitialBackgroundSettingTest(); + try { + EventQueue.invokeAndWait(test::setupGUI); + EventQueue.invokeAndWait(test::test); + } finally { + EventQueue.invokeAndWait(test::dispose); + } + } + + public void setupGUI () { + frame = new Frame("InitialBackgroundSettingTest frame"); + tf = new TextField("I am the TextField"); + ta = new TextArea("I am the TextArea"); + choice = new Choice(); + list = new List(); + bar = new Scrollbar(Scrollbar.HORIZONTAL); + button = new Button("I am the button"); + frame.setBackground(Color.red); + frame.setLayout(new GridLayout(7, 1)); + frame.add(button); + frame.add(bar); + frame.add(choice); + frame.add(list); + frame.add(tf); + frame.add(ta); + frame.setVisible(true); + frame.setBounds (400, 0, 300, 300); + } + + public void test() { + boolean passed = true; + System.out.println("Button background color is:" + + button.getBackground()); + if (Color.red.equals(button.getBackground())) { + System.err.println("Button background is red"); + passed = false; + } + System.out.println("Scrollbar background color is:" + + bar.getBackground()); + if (Color.red.equals(bar.getBackground())) { + System.err.println("ScrollBar background is red"); + passed = false; + } + System.out.println("Choice background color is:" + + choice.getBackground()); + if (Color.red.equals(choice.getBackground())) { + System.err.println("Choice background is red"); + passed = false; + } + System.out.println("List background color is:" + + list.getBackground()); + if (Color.red.equals(list.getBackground())) { + System.err.println("List background is red"); + passed = false; + } + System.out.println("TextField background color is:" + + tf.getBackground()); + if (Color.red.equals(tf.getBackground())) { + System.err.println("TextField background is red"); + passed = false; + } + System.out.println("TextArea background color is:" + + ta.getBackground()); + if (Color.red.equals(ta.getBackground())) { + System.err.println("TextArea background is red"); + passed = false; + } + + if (!passed) { + throw new RuntimeException("One or more component inherited" + + " background from a Frame"); + } + } + + public void dispose() { + frame.dispose(); + } +} diff --git a/test/jdk/java/awt/Component/FlickeringOnScroll/FlickeringOnScroll.java b/test/jdk/java/awt/Component/FlickeringOnScroll/FlickeringOnScroll.java new file mode 100644 index 0000000000000..2119ae7bcc01e --- /dev/null +++ b/test/jdk/java/awt/Component/FlickeringOnScroll/FlickeringOnScroll.java @@ -0,0 +1,139 @@ +/* + * 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. + */ + +/* + * @test + * @bug 6347994 + * @summary REG: Scrollbar, Choice, Checkbox flickers and grays out when scrolling, XToolkit + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual FlickeringOnScroll + */ + +import java.awt.BorderLayout; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.MenuItem; +import java.awt.Panel; +import java.awt.PopupMenu; +import java.awt.Scrollbar; +import java.awt.TextArea; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.lang.reflect.InvocationTargetException; + +public class FlickeringOnScroll extends Frame { + + static final String INSTRUCTIONS = """ + There are five components in the frame: + Scrollbars(vertical and horizontal), a Choice, + a Checkbox and a TextArea + 1) Drag the thumbs of each Scrollbar. + 2) Do the same with Choice's scrollbar. + 3) Focus on Checkbox and press left mouse button or SPACE repeatedly. + 4) Right click inside TextArea and navigate through all menu items + in PopupMenu using the arrow keys. + If you notice some component or its scrollbar flickers on + key/mouse press or drag, press Fail. Otherwise press Pass. + """; + + public FlickeringOnScroll() { + Choice ch = new Choice(); + ch.add("Praveen"); + ch.add("Mohan"); + ch.add("Rakesh"); + ch.add("Menon"); + ch.add("Girish"); + ch.add("Ramachandran"); + ch.add("Elancheran"); + ch.add("Subramanian"); + ch.add("Raju"); + ch.add("Pallath"); + ch.add("Mayank"); + ch.add("Joshi"); + ch.add("Sundar"); + ch.add("Srinivas"); + ch.add("Mandalika"); + Checkbox chb = new Checkbox ("Checkbox", false); + TextArea ta = new TextArea("Text Area"); + Panel panel = new Panel(); + PopupMenu popup = new PopupMenu("Popup"); + MenuItem mi1 = new MenuItem("mi1"); + MenuItem mi2 = new MenuItem("mi2"); + MenuItem mi3 = new MenuItem("mi3"); + MenuItem mi4 = new MenuItem("mi4"); + + setTitle("Flickering Scroll Area Testing Frame"); + setLayout(new FlowLayout()); + add(ch); + add(chb); + add(ta); + + panel.setLayout(new BorderLayout()); + panel.setPreferredSize(new Dimension(200, 200)); + add(panel); + panel.add("Center",new java.awt.Label("Scrollbar flickering test..." ,java.awt.Label.CENTER)); + panel.add("South",new Scrollbar(Scrollbar.HORIZONTAL, 0, 100, 0, 255)); + panel.add("East",new Scrollbar(Scrollbar.VERTICAL, 0, 100, 0, 255)); + + ta.add(popup); + popup.add (mi1); + popup.add (mi2); + popup.add (mi3); + popup.add (mi4); + + ta.addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent me) { + if (me.isPopupTrigger()) { + if (popup != null) { + popup.show(me.getComponent(), me.getX(), me.getY()); + } + } + } + public void mouseReleased(MouseEvent me) { + if (me.isPopupTrigger()) { + if (popup != null) { + popup.show(me.getComponent(), me.getX(), me.getY()); + } + } + } + }); + + pack(); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Scroll Area Flickering Repaint") + .testUI(FlickeringOnScroll::new) + .instructions(INSTRUCTIONS) + .columns(40) + .logArea() + .build() + .awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/Component/FocusRepaintTest/FocusRepaintTest.java b/test/jdk/java/awt/Component/FocusRepaintTest/FocusRepaintTest.java new file mode 100644 index 0000000000000..ecffdfda6135d --- /dev/null +++ b/test/jdk/java/awt/Component/FocusRepaintTest/FocusRepaintTest.java @@ -0,0 +1,83 @@ +/* + * 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. + */ + +/* + * @test + * @bug 4079435 + * @summary Calling repaint() in focus handlers messes up the window. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual FocusRepaintTest + */ + +import java.awt.Button; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.lang.reflect.InvocationTargetException; + +public class FocusRepaintTest extends Frame implements FocusListener { + static final String INSTRUCTIONS = """ + Hit the tab key repeatedly in the Test window. + If any of the buttons disappear press Fail, otherwise press Pass. + """; + + public FocusRepaintTest() { + setTitle("Test"); + setLayout(new FlowLayout()); + setSize(200, 100); + Button b1 = new Button("Close"); + Button b2 = new Button("Button"); + add(b1); + add(b2); + b1.setSize(50, 30); + b2.setSize(50, 30); + b1.addFocusListener(this); + b2.addFocusListener(this); + } + + public void focusGained(FocusEvent e) { + Button b = (Button) e.getSource(); + PassFailJFrame.log("Focus gained for " + b.getLabel()); + b.repaint(); + } + + public void focusLost(FocusEvent e) { + Button b = (Button) e.getSource(); + PassFailJFrame.log("Focus lost for " + b.getLabel()); + b.repaint(); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Focus Repaint") + .testUI(FocusRepaintTest::new) + .instructions(INSTRUCTIONS) + .columns(40) + .logArea() + .build() + .awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/Component/ListDoubleIndentTest/ListDoubleIndentTest.java b/test/jdk/java/awt/Component/ListDoubleIndentTest/ListDoubleIndentTest.java new file mode 100644 index 0000000000000..4c6c1248950e4 --- /dev/null +++ b/test/jdk/java/awt/Component/ListDoubleIndentTest/ListDoubleIndentTest.java @@ -0,0 +1,148 @@ +/* + * 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 4185460 + * @summary Container list the indentation is 2x the indent param value + * @key headful + * @run main ListDoubleIndentTest + */ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.EventQueue; +import java.awt.Frame; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.IOException; +import java.io.PipedInputStream; +import java.io.PrintStream; +import java.io.PipedOutputStream; + +import java.lang.reflect.InvocationTargetException; +import java.util.Vector; + +public class ListDoubleIndentTest { + public static void main(final String[] args) throws InterruptedException, + InvocationTargetException { + EventQueue.invokeAndWait(new ListDoubleIndentTest()::performTest); + } + + public void performTest() { + boolean bReturn = false; + int iCompCount = 0; + int iNotEqual = 0; + int iIndentWrong = 0; + System.out.println("Test: Check indentation"); + Vector v = new Vector(); + String sLine; + String sReturn; + String sExpTrim; + Button b1, b2, b3, b4, b5; + Frame f = null; + + try { + f = new Frame("ListDoubleIndentTest"); + + f.add(b1 = new Button("North"), BorderLayout.NORTH, 0); + f.add(b2 = new Button("South"), BorderLayout.SOUTH, 1); + f.add(b3 = new Button("East"), BorderLayout.EAST, 2); + f.add(b4 = new Button("West"), BorderLayout.WEST, 3); + f.add(b5 = new Button("Center"), BorderLayout.CENTER, -1); + + String[] sExpected = {f.toString(), b1.toString(), b2.toString(), + b3.toString(), b4.toString(), b5.toString()}; + + iCompCount = f.getComponentCount(); + System.out.println("Component count: " + iCompCount); + + for (int j = 0; j <= 10; j++) { + PipedInputStream pin = new PipedInputStream(); + PrintStream output = new PrintStream(new PipedOutputStream(pin), true); + BufferedReader input = new BufferedReader(new InputStreamReader(pin)); + + f.list(output, j); + + output.flush(); + output.close(); + + while ((sLine = input.readLine()) != null) { + v.addElement(sLine); + } + + for (int i = 0; i < v.size(); i++) { + sReturn = (String)v.elementAt(i); + sExpTrim = sExpected[i].trim(); + + if (!(sExpTrim.equals(sReturn.trim()))) { + System.out.println("iNotEqual"); + ++iNotEqual; + } + + int iSpace = sReturn.lastIndexOf(' ') + 1; + + if (i == 0) { + System.out.println("Indent set at: " + j); + System.out.println("Indent return: " + iSpace); + if (iSpace != j) { + System.out.println("iIndentWrong1"); + ++iIndentWrong; + } + } else { + if (iSpace != (j + 1)) { + System.out.println(iSpace + "; " + j); + ++iIndentWrong; + } + } + System.out.println(sReturn); + } + v.removeAllElements(); + v.trimToSize(); + } + + if (iNotEqual == 0 && iIndentWrong == 0) { + bReturn = true; + } else { + bReturn = false; + } + + } catch(IOException e) { + bReturn = false; + System.out.println ("Unexpected Exception thrown: " + e.getMessage()); + e.printStackTrace(); + } finally { + if (f != null) { + f.dispose(); + } + } + + if (bReturn) { + System.out.println("Test for Container.list Passed"); + } else { + System.out.println("Test for Container.list Failed"); + throw new RuntimeException("Test FAILED"); + } + } +} From 03149735e59b7d1d409a6e29ee05ae0537e03d53 Mon Sep 17 00:00:00 2001 From: Alex Menkov Date: Tue, 1 Oct 2024 18:50:37 +0000 Subject: [PATCH 265/307] 8341060: Cleanup statics in HeapDumper Reviewed-by: shade, sspitsyn --- src/hotspot/share/services/heapDumper.cpp | 101 ++++++++-------------- 1 file changed, 37 insertions(+), 64 deletions(-) diff --git a/src/hotspot/share/services/heapDumper.cpp b/src/hotspot/share/services/heapDumper.cpp index 5b3749381a01b..10e1a804ad213 100644 --- a/src/hotspot/share/services/heapDumper.cpp +++ b/src/hotspot/share/services/heapDumper.cpp @@ -1512,6 +1512,38 @@ class ClassDumper : public KlassClosure { } }; +// Support class used to generate HPROF_LOAD_CLASS records + +class LoadedClassDumper : public LockedClassesDo { + private: + AbstractDumpWriter* _writer; + GrowableArray* _klass_map; + u4 _class_serial_num; + AbstractDumpWriter* writer() const { return _writer; } + void add_class_serial_number(Klass* k, int serial_num) { + _klass_map->at_put_grow(serial_num, k); + } + public: + LoadedClassDumper(AbstractDumpWriter* writer, GrowableArray* klass_map) + : _writer(writer), _klass_map(klass_map), _class_serial_num(0) {} + + void do_klass(Klass* k) { + // len of HPROF_LOAD_CLASS record + u4 remaining = 2 * oopSize + 2 * sizeof(u4); + DumperSupport::write_header(writer(), HPROF_LOAD_CLASS, remaining); + // class serial number is just a number + writer()->write_u4(++_class_serial_num); + // class ID + writer()->write_classID(k); + // add the Klass* and class serial number pair + add_class_serial_number(k, _class_serial_num); + writer()->write_u4(STACK_TRACE_ID); + // class name ID + Symbol* name = k->name(); + writer()->write_symbolID(name); + } +}; + // Support class used to generate HPROF_GC_ROOT_JNI_LOCAL records class JNILocalsDumper : public OopClosure { @@ -2190,9 +2222,7 @@ void DumpMerger::do_merge() { // The VM operation that performs the heap dump class VM_HeapDumper : public VM_GC_Operation, public WorkerTask, public UnmountedVThreadDumper { private: - static VM_HeapDumper* _global_dumper; - static DumpWriter* _global_writer; - DumpWriter* _local_writer; + DumpWriter* _writer; JavaThread* _oome_thread; Method* _oome_constructor; bool _gc_before_heap_dump; @@ -2218,33 +2248,13 @@ class VM_HeapDumper : public VM_GC_Operation, public WorkerTask, public Unmounte return Atomic::fetch_then_add(&_dump_seq, 1); } - // accessors and setters - static VM_HeapDumper* dumper() { assert(_global_dumper != nullptr, "Error"); return _global_dumper; } - static DumpWriter* writer() { assert(_global_writer != nullptr, "Error"); return _global_writer; } - - void set_global_dumper() { - assert(_global_dumper == nullptr, "Error"); - _global_dumper = this; - } - void set_global_writer() { - assert(_global_writer == nullptr, "Error"); - _global_writer = _local_writer; - } - void clear_global_dumper() { _global_dumper = nullptr; } - void clear_global_writer() { _global_writer = nullptr; } + DumpWriter* writer() const { return _writer; } bool skip_operation() const; - // writes a HPROF_LOAD_CLASS record to global writer - static void do_load_class(Klass* k); - // HPROF_GC_ROOT_THREAD_OBJ records for platform and mounted virtual threads void dump_threads(AbstractDumpWriter* writer); - void add_class_serial_number(Klass* k, int serial_num) { - _klass_map->at_put_grow(serial_num, k); - } - bool is_oom_thread(JavaThread* thread) const { return thread == _oome_thread && _oome_constructor != nullptr; } @@ -2259,7 +2269,7 @@ class VM_HeapDumper : public VM_GC_Operation, public WorkerTask, public Unmounte 0 /* total full collections, dummy, ignored */, gc_before_heap_dump), WorkerTask("dump heap") { - _local_writer = writer; + _writer = writer; _gc_before_heap_dump = gc_before_heap_dump; _klass_map = new (mtServiceability) GrowableArray(INITIAL_CLASS_COUNT, mtServiceability); @@ -2313,9 +2323,6 @@ class VM_HeapDumper : public VM_GC_Operation, public WorkerTask, public Unmounte void dump_vthread(oop vt, AbstractDumpWriter* segment_writer); }; -VM_HeapDumper* VM_HeapDumper::_global_dumper = nullptr; -DumpWriter* VM_HeapDumper::_global_writer = nullptr; - bool VM_HeapDumper::skip_operation() const { return false; } @@ -2329,31 +2336,6 @@ void DumperSupport::end_of_dump(AbstractDumpWriter* writer) { writer->write_u4(0); } -// writes a HPROF_LOAD_CLASS record for the class -void VM_HeapDumper::do_load_class(Klass* k) { - static u4 class_serial_num = 0; - - // len of HPROF_LOAD_CLASS record - u4 remaining = 2*oopSize + 2*sizeof(u4); - - DumperSupport::write_header(writer(), HPROF_LOAD_CLASS, remaining); - - // class serial number is just a number - writer()->write_u4(++class_serial_num); - - // class ID - writer()->write_classID(k); - - // add the Klass* and class serial number pair - dumper()->add_class_serial_number(k, class_serial_num); - - writer()->write_u4(STACK_TRACE_ID); - - // class name ID - Symbol* name = k->name(); - writer()->write_symbolID(name); -} - // Write a HPROF_GC_ROOT_THREAD_OBJ record for platform/carrier and mounted virtual threads. // Then walk the stack so that locals and JNI locals are dumped. void VM_HeapDumper::dump_threads(AbstractDumpWriter* writer) { @@ -2430,11 +2412,6 @@ void VM_HeapDumper::doit() { } } - // At this point we should be the only dumper active, so - // the following should be safe. - set_global_dumper(); - set_global_writer(); - WorkerThreads* workers = ch->safepoint_workers(); prepare_parallel_dump(workers); @@ -2446,10 +2423,6 @@ void VM_HeapDumper::doit() { workers->run_task(this, _num_dumper_threads); _poi = nullptr; } - - // Now we clear the global variables, so that a future dumper can run. - clear_global_dumper(); - clear_global_writer(); } void VM_HeapDumper::work(uint worker_id) { @@ -2480,8 +2453,8 @@ void VM_HeapDumper::work(uint worker_id) { // write HPROF_LOAD_CLASS records { - LockedClassesDo locked_load_classes(&do_load_class); - ClassLoaderDataGraph::classes_do(&locked_load_classes); + LoadedClassDumper loaded_class_dumper(writer(), _klass_map); + ClassLoaderDataGraph::classes_do(&loaded_class_dumper); } // write HPROF_FRAME and HPROF_TRACE records From d2e77089aaeef83e6f659fd77fdd0a360def760a Mon Sep 17 00:00:00 2001 From: Harshitha Onkar Date: Tue, 1 Oct 2024 21:08:41 +0000 Subject: [PATCH 266/307] 8341367: Problemlist ShapeNotSetSometimes.java on macOS Reviewed-by: aivanov --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index ef9b82d596728..bf1c9bd31e7a6 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -122,6 +122,7 @@ java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java 6848407 java/awt/Frame/MaximizedUndecorated/MaximizedUndecorated.java 8022302 generic-all java/awt/Frame/RestoreToOppositeScreen/RestoreToOppositeScreen.java 8286840 linux-all java/awt/Frame/InitialIconifiedTest.java 8203920 macosx-all,linux-all +java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java 8341370 macosx-all java/awt/FileDialog/FileDialogIconTest/FileDialogIconTest.java 8160558 windows-all java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java 8060176 windows-all,macosx-all java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java 8060176 windows-all,macosx-all From 83dcb02d776448aa04f3f41df489bd4355443a4d Mon Sep 17 00:00:00 2001 From: Sandhya Viswanathan Date: Tue, 1 Oct 2024 22:48:31 +0000 Subject: [PATCH 267/307] 8340079: Modify rearrange/selectFrom Vector API methods to perform wrapIndexes instead of checkIndexes Reviewed-by: jbhateja, psandoz --- src/hotspot/share/adlc/formssel.cpp | 2 +- src/hotspot/share/classfile/vmIntrinsics.hpp | 21 ++ src/hotspot/share/opto/c2compiler.cpp | 2 + src/hotspot/share/opto/library_call.cpp | 4 + src/hotspot/share/opto/library_call.hpp | 2 + src/hotspot/share/opto/vectorIntrinsics.cpp | 202 ++++++++++++++++++ .../jdk/internal/vm/vector/VectorSupport.java | 31 +++ .../jdk/incubator/vector/AbstractShuffle.java | 2 +- .../jdk/incubator/vector/Byte128Vector.java | 9 +- .../jdk/incubator/vector/Byte256Vector.java | 9 +- .../jdk/incubator/vector/Byte512Vector.java | 9 +- .../jdk/incubator/vector/Byte64Vector.java | 9 +- .../jdk/incubator/vector/ByteMaxVector.java | 9 +- .../jdk/incubator/vector/ByteVector.java | 35 +-- .../jdk/incubator/vector/Double128Vector.java | 9 +- .../jdk/incubator/vector/Double256Vector.java | 9 +- .../jdk/incubator/vector/Double512Vector.java | 9 +- .../jdk/incubator/vector/Double64Vector.java | 9 +- .../jdk/incubator/vector/DoubleMaxVector.java | 9 +- .../jdk/incubator/vector/DoubleVector.java | 35 +-- .../jdk/incubator/vector/Float128Vector.java | 9 +- .../jdk/incubator/vector/Float256Vector.java | 9 +- .../jdk/incubator/vector/Float512Vector.java | 9 +- .../jdk/incubator/vector/Float64Vector.java | 9 +- .../jdk/incubator/vector/FloatMaxVector.java | 9 +- .../jdk/incubator/vector/FloatVector.java | 35 +-- .../jdk/incubator/vector/Int128Vector.java | 9 +- .../jdk/incubator/vector/Int256Vector.java | 9 +- .../jdk/incubator/vector/Int512Vector.java | 9 +- .../jdk/incubator/vector/Int64Vector.java | 9 +- .../jdk/incubator/vector/IntMaxVector.java | 9 +- .../jdk/incubator/vector/IntVector.java | 35 +-- .../jdk/incubator/vector/Long128Vector.java | 9 +- .../jdk/incubator/vector/Long256Vector.java | 9 +- .../jdk/incubator/vector/Long512Vector.java | 9 +- .../jdk/incubator/vector/Long64Vector.java | 9 +- .../jdk/incubator/vector/LongMaxVector.java | 9 +- .../jdk/incubator/vector/LongVector.java | 35 +-- .../jdk/incubator/vector/Short128Vector.java | 9 +- .../jdk/incubator/vector/Short256Vector.java | 9 +- .../jdk/incubator/vector/Short512Vector.java | 9 +- .../jdk/incubator/vector/Short64Vector.java | 9 +- .../jdk/incubator/vector/ShortMaxVector.java | 9 +- .../jdk/incubator/vector/ShortVector.java | 35 +-- .../classes/jdk/incubator/vector/Vector.java | 21 +- .../incubator/vector/X-Vector.java.template | 35 +-- .../vector/X-VectorBits.java.template | 9 +- 47 files changed, 663 insertions(+), 148 deletions(-) diff --git a/src/hotspot/share/adlc/formssel.cpp b/src/hotspot/share/adlc/formssel.cpp index e7df38ff221a9..15bc7ddc67d60 100644 --- a/src/hotspot/share/adlc/formssel.cpp +++ b/src/hotspot/share/adlc/formssel.cpp @@ -4357,7 +4357,7 @@ bool MatchRule::is_vector() const { "RoundDoubleModeV","RotateLeftV" , "RotateRightV", "LoadVector","StoreVector", "LoadVectorGather", "StoreVectorScatter", "LoadVectorGatherMasked", "StoreVectorScatterMasked", "VectorTest", "VectorLoadMask", "VectorStoreMask", "VectorBlend", "VectorInsert", - "VectorRearrange","VectorLoadShuffle", "VectorLoadConst", + "VectorRearrange", "VectorLoadShuffle", "VectorLoadConst", "VectorCastB2X", "VectorCastS2X", "VectorCastI2X", "VectorCastL2X", "VectorCastF2X", "VectorCastD2X", "VectorCastF2HF", "VectorCastHF2F", "VectorUCastB2X", "VectorUCastS2X", "VectorUCastI2X", diff --git a/src/hotspot/share/classfile/vmIntrinsics.hpp b/src/hotspot/share/classfile/vmIntrinsics.hpp index af1c2b31a9809..b6ce21797a618 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.hpp +++ b/src/hotspot/share/classfile/vmIntrinsics.hpp @@ -1008,6 +1008,15 @@ class methodHandle; "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ do_name(vector_shuffle_to_vector_name, "shuffleToVector") \ \ + do_intrinsic(_VectorWrapShuffleIndexes, jdk_internal_vm_vector_VectorSupport, vector_wrap_shuffle_indexes_name, \ + vector_wrap_shuffle_indexes_sig, F_S) \ + do_signature(vector_wrap_shuffle_indexes_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;" \ + "ILjdk/internal/vm/vector/VectorSupport$WrapShuffleIndexesOperation;)" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;") \ + do_name(vector_wrap_shuffle_indexes_name, "wrapShuffleIndexes") \ + \ do_intrinsic(_VectorLoadOp, jdk_internal_vm_vector_VectorSupport, vector_load_op_name, vector_load_op_sig, F_S) \ do_signature(vector_load_op_sig, "(Ljava/lang/Class;" \ "Ljava/lang/Class;" \ @@ -1129,6 +1138,18 @@ class methodHandle; "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ do_name(vector_rearrange_name, "rearrangeOp") \ \ + do_intrinsic(_VectorSelectFrom, jdk_internal_vm_vector_VectorSupport, vector_select_from_name, vector_select_from_sig, F_S) \ + do_signature(vector_select_from_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorSelectFromOp;)" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ + do_name(vector_select_from_name, "selectFromOp") \ + \ do_intrinsic(_VectorExtract, jdk_internal_vm_vector_VectorSupport, vector_extract_name, vector_extract_sig, F_S) \ do_signature(vector_extract_sig, "(Ljava/lang/Class;" \ "Ljava/lang/Class;" \ diff --git a/src/hotspot/share/opto/c2compiler.cpp b/src/hotspot/share/opto/c2compiler.cpp index 117e06acd6f31..151c320cadde6 100644 --- a/src/hotspot/share/opto/c2compiler.cpp +++ b/src/hotspot/share/opto/c2compiler.cpp @@ -811,6 +811,7 @@ bool C2Compiler::is_intrinsic_supported(vmIntrinsics::ID id) { case vmIntrinsics::_VectorFromBitsCoerced: case vmIntrinsics::_VectorShuffleIota: case vmIntrinsics::_VectorShuffleToVector: + case vmIntrinsics::_VectorWrapShuffleIndexes: case vmIntrinsics::_VectorLoadOp: case vmIntrinsics::_VectorLoadMaskedOp: case vmIntrinsics::_VectorStoreOp: @@ -821,6 +822,7 @@ bool C2Compiler::is_intrinsic_supported(vmIntrinsics::ID id) { case vmIntrinsics::_VectorTest: case vmIntrinsics::_VectorBlend: case vmIntrinsics::_VectorRearrange: + case vmIntrinsics::_VectorSelectFrom: case vmIntrinsics::_VectorCompare: case vmIntrinsics::_VectorBroadcastInt: case vmIntrinsics::_VectorConvert: diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index 8bbb2f8115ec4..dd4f0b94af6ee 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -717,6 +717,8 @@ bool LibraryCallKit::try_to_inline(int predicate) { return inline_vector_mask_operation(); case vmIntrinsics::_VectorShuffleToVector: return inline_vector_shuffle_to_vector(); + case vmIntrinsics::_VectorWrapShuffleIndexes: + return inline_vector_wrap_shuffle_indexes(); case vmIntrinsics::_VectorLoadOp: return inline_vector_mem_operation(/*is_store=*/false); case vmIntrinsics::_VectorLoadMaskedOp: @@ -737,6 +739,8 @@ bool LibraryCallKit::try_to_inline(int predicate) { return inline_vector_blend(); case vmIntrinsics::_VectorRearrange: return inline_vector_rearrange(); + case vmIntrinsics::_VectorSelectFrom: + return inline_vector_select_from(); case vmIntrinsics::_VectorCompare: return inline_vector_compare(); case vmIntrinsics::_VectorBroadcastInt: diff --git a/src/hotspot/share/opto/library_call.hpp b/src/hotspot/share/opto/library_call.hpp index dd74734802f65..10375fc23f650 100644 --- a/src/hotspot/share/opto/library_call.hpp +++ b/src/hotspot/share/opto/library_call.hpp @@ -353,6 +353,7 @@ class LibraryCallKit : public GraphKit { bool inline_vector_nary_operation(int n); bool inline_vector_frombits_coerced(); bool inline_vector_shuffle_to_vector(); + bool inline_vector_wrap_shuffle_indexes(); bool inline_vector_shuffle_iota(); Node* partially_wrap_indexes(Node* index_vec, int num_elem, BasicType type_bt); bool inline_vector_mask_operation(); @@ -363,6 +364,7 @@ class LibraryCallKit : public GraphKit { bool inline_vector_test(); bool inline_vector_blend(); bool inline_vector_rearrange(); + bool inline_vector_select_from(); bool inline_vector_compare(); bool inline_vector_broadcast_int(); bool inline_vector_convert(); diff --git a/src/hotspot/share/opto/vectorIntrinsics.cpp b/src/hotspot/share/opto/vectorIntrinsics.cpp index cfcd903e79d95..3753619822938 100644 --- a/src/hotspot/share/opto/vectorIntrinsics.cpp +++ b/src/hotspot/share/opto/vectorIntrinsics.cpp @@ -757,6 +757,64 @@ bool LibraryCallKit::inline_vector_shuffle_to_vector() { return true; } +// public static +// > +// SH wrapShuffleIndexes(Class eClass, Class shClass, SH sh, int length, +// ShuffleWrapIndexesOperation defaultImpl) +bool LibraryCallKit::inline_vector_wrap_shuffle_indexes() { + const TypeInstPtr* elem_klass = gvn().type(argument(0))->isa_instptr(); + const TypeInstPtr* shuffle_klass = gvn().type(argument(1))->isa_instptr(); + Node* shuffle = argument(2); + const TypeInt* vlen = gvn().type(argument(3))->isa_int(); + + if (elem_klass == nullptr || shuffle_klass == nullptr || shuffle->is_top() || vlen == nullptr || + !vlen->is_con() || shuffle_klass->const_oop() == nullptr) { + // not enough info for intrinsification + return false; + } + + if (!is_klass_initialized(shuffle_klass)) { + log_if_needed(" ** klass argument not initialized"); + return false; + } + + int num_elem = vlen->get_con(); + if ((num_elem < 4) || !is_power_of_2(num_elem)) { + log_if_needed(" ** vlen < 4 or not power of two=%d", num_elem); + return false; + } + + // Shuffles use byte array based backing storage + BasicType shuffle_bt = T_BYTE; + if (!arch_supports_vector(Op_AndV, num_elem, shuffle_bt, VecMaskNotUsed) || + !arch_supports_vector(Op_Replicate, num_elem, shuffle_bt, VecMaskNotUsed)) { + log_if_needed(" ** not supported: op=wrapShuffleIndexes vlen=%d etype=%s", + num_elem, type2name(shuffle_bt)); + return false; + } + + ciKlass* sbox_klass = shuffle_klass->const_oop()->as_instance()->java_lang_Class_klass(); + const TypeInstPtr* shuffle_box_type = TypeInstPtr::make_exact(TypePtr::NotNull, sbox_klass); + + // Unbox shuffle with true flag to indicate its load shuffle to vector + // shuffle is a byte array + Node* shuffle_vec = unbox_vector(shuffle, shuffle_box_type, shuffle_bt, num_elem, true); + + const TypeVect* vt = TypeVect::make(shuffle_bt, num_elem); + const Type* shuffle_type_bt = Type::get_const_basic_type(shuffle_bt); + Node* mod_mask = gvn().makecon(TypeInt::make(num_elem-1)); + Node* bcast_mod_mask = gvn().transform(VectorNode::scalar2vector(mod_mask, num_elem, shuffle_type_bt)); + // Wrap the indices greater than lane count. + Node* res = gvn().transform(VectorNode::make(Op_AndV, shuffle_vec, bcast_mod_mask, vt)); + + // Wrap it up in VectorBox to keep object type information. + res = box_vector(res, shuffle_box_type, shuffle_bt, num_elem); + set_result(res); + C->set_max_vector_size(MAX2(C->max_vector_size(), (uint)(num_elem * type2aelembytes(shuffle_bt)))); + return true; +} + // public static // , @@ -2044,6 +2102,150 @@ static address get_svml_address(int vop, int bits, BasicType bt, char* name_ptr, return addr; } +// public static +// , +// M extends VectorMask, +// E> +// V selectFromOp(Class vClass, Class mClass, Class eClass, +// int length, V v1, V v2, M m, +// VectorSelectFromOp defaultImpl) +bool LibraryCallKit::inline_vector_select_from() { + const TypeInstPtr* vector_klass = gvn().type(argument(0))->isa_instptr(); + const TypeInstPtr* mask_klass = gvn().type(argument(1))->isa_instptr(); + const TypeInstPtr* elem_klass = gvn().type(argument(2))->isa_instptr(); + const TypeInt* vlen = gvn().type(argument(3))->isa_int(); + + if (vector_klass == nullptr || elem_klass == nullptr || vlen == nullptr || + vector_klass->const_oop() == nullptr || + elem_klass->const_oop() == nullptr || + !vlen->is_con()) { + log_if_needed(" ** missing constant: vclass=%s etype=%s vlen=%s", + NodeClassNames[argument(0)->Opcode()], + NodeClassNames[argument(2)->Opcode()], + NodeClassNames[argument(3)->Opcode()]); + return false; // not enough info for intrinsification + } + if (!is_klass_initialized(vector_klass)) { + log_if_needed(" ** klass argument not initialized"); + return false; + } + ciType* elem_type = elem_klass->const_oop()->as_instance()->java_mirror_type(); + if (!elem_type->is_primitive_type()) { + log_if_needed(" ** not a primitive bt=%d", elem_type->basic_type()); + return false; // should be primitive type + } + BasicType elem_bt = elem_type->basic_type(); + int num_elem = vlen->get_con(); + if (!is_power_of_2(num_elem)) { + log_if_needed(" ** vlen not power of two=%d", num_elem); + return false; + } + + int cast_vopc = VectorCastNode::opcode(-1, elem_bt); // from vector of type elem_bt + if (!arch_supports_vector(Op_VectorLoadShuffle, num_elem, elem_bt, VecMaskNotUsed)|| + !arch_supports_vector(Op_AndV, num_elem, T_BYTE, VecMaskNotUsed) || + !arch_supports_vector(Op_Replicate, num_elem, T_BYTE, VecMaskNotUsed) || + !arch_supports_vector(cast_vopc, num_elem, T_BYTE, VecMaskNotUsed)) { + log_if_needed(" ** not supported: arity=0 op=selectFrom vlen=%d etype=%s ismask=no", + num_elem, type2name(elem_bt)); + return false; // not supported + } + + bool is_masked_op = argument(6)->bottom_type() != TypePtr::NULL_PTR; + bool use_predicate = is_masked_op; + if (is_masked_op && + (mask_klass == nullptr || + mask_klass->const_oop() == nullptr || + !is_klass_initialized(mask_klass))) { + log_if_needed(" ** mask_klass argument not initialized"); + return false; // not supported + } + VectorMaskUseType checkFlags = (VectorMaskUseType)(is_masked_op ? (VecMaskUseLoad | VecMaskUsePred) : VecMaskNotUsed); + if (!arch_supports_vector(Op_VectorRearrange, num_elem, elem_bt, checkFlags)) { + use_predicate = false; + if(!is_masked_op || + (!arch_supports_vector(Op_VectorRearrange, num_elem, elem_bt, VecMaskNotUsed) || + !arch_supports_vector(Op_VectorBlend, num_elem, elem_bt, VecMaskUseLoad) || + !arch_supports_vector(Op_Replicate, num_elem, elem_bt, VecMaskNotUsed))) { + log_if_needed(" ** not supported: op=selectFrom vlen=%d etype=%s is_masked_op=%d", + num_elem, type2name(elem_bt), is_masked_op); + return false; // not supported + } + } + ciKlass* vbox_klass = vector_klass->const_oop()->as_instance()->java_lang_Class_klass(); + const TypeInstPtr* vbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, vbox_klass); + + // v1 is the index vector + Node* v1 = unbox_vector(argument(4), vbox_type, elem_bt, num_elem); + // v2 is the vector being rearranged + Node* v2 = unbox_vector(argument(5), vbox_type, elem_bt, num_elem); + + if (v1 == nullptr) { + log_if_needed(" ** unbox failed v1=%s", NodeClassNames[argument(4)->Opcode()]); + return false; // operand unboxing failed + } + + if (v2 == nullptr) { + log_if_needed(" ** unbox failed v2=%s", NodeClassNames[argument(5)->Opcode()]); + return false; // operand unboxing failed + } + + Node* mask = nullptr; + if (is_masked_op) { + ciKlass* mbox_klass = mask_klass->const_oop()->as_instance()->java_lang_Class_klass(); + const TypeInstPtr* mbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, mbox_klass); + mask = unbox_vector(argument(6), mbox_type, elem_bt, num_elem); + if (mask == nullptr) { + log_if_needed(" ** unbox failed mask=%s", NodeClassNames[argument(6)->Opcode()]); + return false; + } + } + + // cast index vector from elem_bt vector to byte vector + const Type * byte_bt = Type::get_const_basic_type(T_BYTE); + const TypeVect * byte_vt = TypeVect::make(byte_bt, num_elem); + Node* byte_shuffle = gvn().transform(VectorCastNode::make(cast_vopc, v1, T_BYTE, num_elem)); + + // wrap the byte vector lanes to (num_elem - 1) to form the shuffle vector where num_elem is vector length + // this is a simple AND operation as we come here only for power of two vector length + Node* mod_val = gvn().makecon(TypeInt::make(num_elem-1)); + Node* bcast_mod = gvn().transform(VectorNode::scalar2vector(mod_val, num_elem, byte_bt)); + byte_shuffle = gvn().transform(VectorNode::make(Op_AndV, byte_shuffle, bcast_mod, byte_vt)); + + // load the shuffle to use in rearrange + const TypeVect * shuffle_vt = TypeVect::make(elem_bt, num_elem); + Node* load_shuffle = gvn().transform(new VectorLoadShuffleNode(byte_shuffle, shuffle_vt)); + + // and finally rearrange + Node* rearrange = new VectorRearrangeNode(v2, load_shuffle); + if (is_masked_op) { + if (use_predicate) { + // masked rearrange is supported so use that directly + rearrange->add_req(mask); + rearrange->add_flag(Node::Flag_is_predicated_vector); + } else { + // masked rearrange is not supported so emulate usig blend + const TypeVect* vt = v1->bottom_type()->is_vect(); + rearrange = gvn().transform(rearrange); + + // create a zero vector with each lane element set as zero + Node* zero = gvn().makecon(Type::get_zero_type(elem_bt)); + Node* zerovec = gvn().transform(VectorNode::scalar2vector(zero, num_elem, Type::get_const_basic_type(elem_bt))); + + // For each lane for which mask is set, blend in the rearranged lane into zero vector + rearrange = new VectorBlendNode(zerovec, rearrange, mask); + } + } + rearrange = gvn().transform(rearrange); + + // box the result + Node* box = box_vector(rearrange, vbox_type, elem_bt, num_elem); + set_result(box); + + C->set_max_vector_size(MAX2(C->max_vector_size(), (uint)(num_elem * type2aelembytes(elem_bt)))); + return true; +} + Node* LibraryCallKit::gen_call_to_svml(int vector_api_op_id, BasicType bt, int num_elem, Node* opd1, Node* opd2) { assert(UseVectorStubs, "sanity"); assert(vector_api_op_id >= VectorSupport::VECTOR_OP_SVML_START && vector_api_op_id <= VectorSupport::VECTOR_OP_SVML_END, "need valid op id"); diff --git a/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java b/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java index ccfa006b102c2..5c4040d912804 100644 --- a/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java +++ b/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java @@ -263,6 +263,20 @@ V shuffleToVector(Class> vClass, Class eClass, Class> { + SH apply(SH sh); + } + + @IntrinsicCandidate + public static + > + SH wrapShuffleIndexes(Class eClass, Class shClass, SH sh, int length, + WrapShuffleIndexesOperation defaultImpl) { + assert isNonCapturingLambda(defaultImpl) : defaultImpl; + return defaultImpl.apply(sh); + } + /* ============================================================================ */ public interface IndexOperation, S extends VectorSpecies> { @@ -605,6 +619,23 @@ V rearrangeOp(Class vClass, Class shClass, Class mClass, Cla return defaultImpl.apply(v, sh, m); } + public interface VectorSelectFromOp, + M extends VectorMask> { + V apply(V v1, V v2, M m); + } + + @IntrinsicCandidate + public static + , + M extends VectorMask, + E> + V selectFromOp(Class vClass, Class mClass, Class eClass, + int length, V v1, V v2, M m, + VectorSelectFromOp defaultImpl) { + assert isNonCapturingLambda(defaultImpl) : defaultImpl; + return defaultImpl.apply(v1, v2, m); + } + /* ============================================================================ */ public interface VectorBlendOp, diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractShuffle.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractShuffle.java index d648fd86484e0..fc39cb6adaccb 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractShuffle.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractShuffle.java @@ -133,7 +133,7 @@ public final VectorShuffle checkIndexes() { } @ForceInline - public final VectorShuffle wrapIndexes() { + public final VectorShuffle wrapIndexesTemplate() { Vector shufvec = this.toVector(); VectorMask vecmask = shufvec.compare(VectorOperators.LT, vspecies().zero()); if (vecmask.anyTrue()) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java index 02a389d08b2e9..0bc25958a7617 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java @@ -503,7 +503,7 @@ public Byte128Vector selectFrom(Vector v, VectorMask m) { return (Byte128Vector) super.selectFromTemplate((Byte128Vector) v, - (Byte128Mask) m); // specialize + Byte128Mask.class, (Byte128Mask) m); // specialize } @@ -860,6 +860,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Byte128Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Byte128Shuffle.class, this, VLENGTH, + (s) -> ((Byte128Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Byte128Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java index 4e035b13b5e04..639646aa77ad5 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java @@ -503,7 +503,7 @@ public Byte256Vector selectFrom(Vector v, VectorMask m) { return (Byte256Vector) super.selectFromTemplate((Byte256Vector) v, - (Byte256Mask) m); // specialize + Byte256Mask.class, (Byte256Mask) m); // specialize } @@ -892,6 +892,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Byte256Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Byte256Shuffle.class, this, VLENGTH, + (s) -> ((Byte256Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Byte256Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java index 15dd06cdccc00..2d8151f6800f3 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java @@ -503,7 +503,7 @@ public Byte512Vector selectFrom(Vector v, VectorMask m) { return (Byte512Vector) super.selectFromTemplate((Byte512Vector) v, - (Byte512Mask) m); // specialize + Byte512Mask.class, (Byte512Mask) m); // specialize } @@ -956,6 +956,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Byte512Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Byte512Shuffle.class, this, VLENGTH, + (s) -> ((Byte512Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Byte512Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java index 6ac9d7a8918b1..bc8ed7d704d96 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java @@ -503,7 +503,7 @@ public Byte64Vector selectFrom(Vector v, VectorMask m) { return (Byte64Vector) super.selectFromTemplate((Byte64Vector) v, - (Byte64Mask) m); // specialize + Byte64Mask.class, (Byte64Mask) m); // specialize } @@ -844,6 +844,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Byte64Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Byte64Shuffle.class, this, VLENGTH, + (s) -> ((Byte64Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Byte64Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java index ed6e15ca293b2..597afd8d165b3 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java @@ -503,7 +503,7 @@ public ByteMaxVector selectFrom(Vector v, VectorMask m) { return (ByteMaxVector) super.selectFromTemplate((ByteMaxVector) v, - (ByteMaxMask) m); // specialize + ByteMaxMask.class, (ByteMaxMask) m); // specialize } @@ -830,6 +830,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public ByteMaxShuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, ByteMaxShuffle.class, this, VLENGTH, + (s) -> ((ByteMaxShuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public ByteMaxShuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java index 8fae8d71b042a..a23bbc7f70957 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java @@ -2393,17 +2393,18 @@ ByteVector sliceTemplate(int origin) { */ @Override public abstract - ByteVector rearrange(VectorShuffle m); + ByteVector rearrange(VectorShuffle shuffle); /*package-private*/ @ForceInline final > ByteVector rearrangeTemplate(Class shuffletype, S shuffle) { - shuffle.checkIndexes(); + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, byte.class, length(), - this, shuffle, null, + this, ws, null, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); @@ -2428,17 +2429,14 @@ ByteVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - VectorMask valid = shuffle.laneIsValid(); - if (m.andNot(valid).anyTrue()) { - shuffle.checkIndexes(); - throw new AssertionError(); - } + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, byte.class, length(), - this, shuffle, m, + this, ws, m, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); - return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2551,7 +2549,10 @@ byte.class, length(), this, m, /*package-private*/ @ForceInline final ByteVector selectFromTemplate(ByteVector v) { - return v.rearrange(this.toShuffle()); + return (ByteVector)VectorSupport.selectFromOp(getClass(), null, byte.class, + length(), this, v, null, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle())); } /** @@ -2563,9 +2564,15 @@ final ByteVector selectFromTemplate(ByteVector v) { /*package-private*/ @ForceInline - final ByteVector selectFromTemplate(ByteVector v, - AbstractMask m) { - return v.rearrange(this.toShuffle(), m); + final + > + ByteVector selectFromTemplate(ByteVector v, + Class masktype, M m) { + m.check(masktype, this); + return (ByteVector)VectorSupport.selectFromOp(getClass(), masktype, byte.class, + length(), this, v, m, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle(), _m)); } /// Ternary operations diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java index f2a077604f7fc..00840026fff9f 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java @@ -490,7 +490,7 @@ public Double128Vector selectFrom(Vector v, VectorMask m) { return (Double128Vector) super.selectFromTemplate((Double128Vector) v, - (Double128Mask) m); // specialize + Double128Mask.class, (Double128Mask) m); // specialize } @@ -821,6 +821,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Double128Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Double128Shuffle.class, this, VLENGTH, + (s) -> ((Double128Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Double128Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java index da9dd421b17c2..4b42deba73841 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java @@ -490,7 +490,7 @@ public Double256Vector selectFrom(Vector v, VectorMask m) { return (Double256Vector) super.selectFromTemplate((Double256Vector) v, - (Double256Mask) m); // specialize + Double256Mask.class, (Double256Mask) m); // specialize } @@ -825,6 +825,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Double256Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Double256Shuffle.class, this, VLENGTH, + (s) -> ((Double256Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Double256Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java index d23f09e774b4a..c188f990c335f 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java @@ -490,7 +490,7 @@ public Double512Vector selectFrom(Vector v, VectorMask m) { return (Double512Vector) super.selectFromTemplate((Double512Vector) v, - (Double512Mask) m); // specialize + Double512Mask.class, (Double512Mask) m); // specialize } @@ -833,6 +833,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Double512Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Double512Shuffle.class, this, VLENGTH, + (s) -> ((Double512Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Double512Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java index 19bd640f97844..032fa1ac277d9 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java @@ -490,7 +490,7 @@ public Double64Vector selectFrom(Vector v, VectorMask m) { return (Double64Vector) super.selectFromTemplate((Double64Vector) v, - (Double64Mask) m); // specialize + Double64Mask.class, (Double64Mask) m); // specialize } @@ -819,6 +819,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Double64Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Double64Shuffle.class, this, VLENGTH, + (s) -> ((Double64Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Double64Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java index 73f6f2ece5d12..7251ec82aa63c 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java @@ -490,7 +490,7 @@ public DoubleMaxVector selectFrom(Vector v, VectorMask m) { return (DoubleMaxVector) super.selectFromTemplate((DoubleMaxVector) v, - (DoubleMaxMask) m); // specialize + DoubleMaxMask.class, (DoubleMaxMask) m); // specialize } @@ -818,6 +818,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public DoubleMaxShuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, DoubleMaxShuffle.class, this, VLENGTH, + (s) -> ((DoubleMaxShuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public DoubleMaxShuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java index 59e6719573209..6cc12048d4632 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java @@ -2235,17 +2235,18 @@ DoubleVector sliceTemplate(int origin) { */ @Override public abstract - DoubleVector rearrange(VectorShuffle m); + DoubleVector rearrange(VectorShuffle shuffle); /*package-private*/ @ForceInline final > DoubleVector rearrangeTemplate(Class shuffletype, S shuffle) { - shuffle.checkIndexes(); + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, double.class, length(), - this, shuffle, null, + this, ws, null, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); @@ -2270,17 +2271,14 @@ DoubleVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - VectorMask valid = shuffle.laneIsValid(); - if (m.andNot(valid).anyTrue()) { - shuffle.checkIndexes(); - throw new AssertionError(); - } + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, double.class, length(), - this, shuffle, m, + this, ws, m, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); - return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2393,7 +2391,10 @@ DoubleVector expandTemplate(Class masktype, M m) { /*package-private*/ @ForceInline final DoubleVector selectFromTemplate(DoubleVector v) { - return v.rearrange(this.toShuffle()); + return (DoubleVector)VectorSupport.selectFromOp(getClass(), null, double.class, + length(), this, v, null, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle())); } /** @@ -2405,9 +2406,15 @@ final DoubleVector selectFromTemplate(DoubleVector v) { /*package-private*/ @ForceInline - final DoubleVector selectFromTemplate(DoubleVector v, - AbstractMask m) { - return v.rearrange(this.toShuffle(), m); + final + > + DoubleVector selectFromTemplate(DoubleVector v, + Class masktype, M m) { + m.check(masktype, this); + return (DoubleVector)VectorSupport.selectFromOp(getClass(), masktype, double.class, + length(), this, v, m, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle(), _m)); } /// Ternary operations diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java index ae47beca5de53..2e016725f812b 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java @@ -490,7 +490,7 @@ public Float128Vector selectFrom(Vector v, VectorMask m) { return (Float128Vector) super.selectFromTemplate((Float128Vector) v, - (Float128Mask) m); // specialize + Float128Mask.class, (Float128Mask) m); // specialize } @@ -825,6 +825,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Float128Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Float128Shuffle.class, this, VLENGTH, + (s) -> ((Float128Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Float128Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java index d5c0506a54257..00e6083588339 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java @@ -490,7 +490,7 @@ public Float256Vector selectFrom(Vector v, VectorMask m) { return (Float256Vector) super.selectFromTemplate((Float256Vector) v, - (Float256Mask) m); // specialize + Float256Mask.class, (Float256Mask) m); // specialize } @@ -833,6 +833,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Float256Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Float256Shuffle.class, this, VLENGTH, + (s) -> ((Float256Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Float256Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java index 536f7db69465e..1f2a792c52c2e 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java @@ -490,7 +490,7 @@ public Float512Vector selectFrom(Vector v, VectorMask m) { return (Float512Vector) super.selectFromTemplate((Float512Vector) v, - (Float512Mask) m); // specialize + Float512Mask.class, (Float512Mask) m); // specialize } @@ -849,6 +849,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Float512Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Float512Shuffle.class, this, VLENGTH, + (s) -> ((Float512Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Float512Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java index 849062c6cb84b..6c913ce84a9ba 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java @@ -490,7 +490,7 @@ public Float64Vector selectFrom(Vector v, VectorMask m) { return (Float64Vector) super.selectFromTemplate((Float64Vector) v, - (Float64Mask) m); // specialize + Float64Mask.class, (Float64Mask) m); // specialize } @@ -821,6 +821,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Float64Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Float64Shuffle.class, this, VLENGTH, + (s) -> ((Float64Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Float64Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java index b14797f6788d4..b9a0a93f91253 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java @@ -490,7 +490,7 @@ public FloatMaxVector selectFrom(Vector v, VectorMask m) { return (FloatMaxVector) super.selectFromTemplate((FloatMaxVector) v, - (FloatMaxMask) m); // specialize + FloatMaxMask.class, (FloatMaxMask) m); // specialize } @@ -818,6 +818,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public FloatMaxShuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, FloatMaxShuffle.class, this, VLENGTH, + (s) -> ((FloatMaxShuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public FloatMaxShuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java index 45427817e3dac..b962dc55ce351 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java @@ -2247,17 +2247,18 @@ FloatVector sliceTemplate(int origin) { */ @Override public abstract - FloatVector rearrange(VectorShuffle m); + FloatVector rearrange(VectorShuffle shuffle); /*package-private*/ @ForceInline final > FloatVector rearrangeTemplate(Class shuffletype, S shuffle) { - shuffle.checkIndexes(); + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, float.class, length(), - this, shuffle, null, + this, ws, null, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); @@ -2282,17 +2283,14 @@ FloatVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - VectorMask valid = shuffle.laneIsValid(); - if (m.andNot(valid).anyTrue()) { - shuffle.checkIndexes(); - throw new AssertionError(); - } + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, float.class, length(), - this, shuffle, m, + this, ws, m, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); - return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2405,7 +2403,10 @@ float.class, length(), this, m, /*package-private*/ @ForceInline final FloatVector selectFromTemplate(FloatVector v) { - return v.rearrange(this.toShuffle()); + return (FloatVector)VectorSupport.selectFromOp(getClass(), null, float.class, + length(), this, v, null, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle())); } /** @@ -2417,9 +2418,15 @@ final FloatVector selectFromTemplate(FloatVector v) { /*package-private*/ @ForceInline - final FloatVector selectFromTemplate(FloatVector v, - AbstractMask m) { - return v.rearrange(this.toShuffle(), m); + final + > + FloatVector selectFromTemplate(FloatVector v, + Class masktype, M m) { + m.check(masktype, this); + return (FloatVector)VectorSupport.selectFromOp(getClass(), masktype, float.class, + length(), this, v, m, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle(), _m)); } /// Ternary operations diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java index cd652941fb366..f7135e19cb6e2 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java @@ -503,7 +503,7 @@ public Int128Vector selectFrom(Vector v, VectorMask m) { return (Int128Vector) super.selectFromTemplate((Int128Vector) v, - (Int128Mask) m); // specialize + Int128Mask.class, (Int128Mask) m); // specialize } @@ -836,6 +836,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Int128Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Int128Shuffle.class, this, VLENGTH, + (s) -> ((Int128Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Int128Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java index b76a1035561f6..474ff974b3169 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java @@ -503,7 +503,7 @@ public Int256Vector selectFrom(Vector v, VectorMask m) { return (Int256Vector) super.selectFromTemplate((Int256Vector) v, - (Int256Mask) m); // specialize + Int256Mask.class, (Int256Mask) m); // specialize } @@ -844,6 +844,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Int256Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Int256Shuffle.class, this, VLENGTH, + (s) -> ((Int256Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Int256Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java index 3a42c6611445b..9fec8c0c99f13 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java @@ -503,7 +503,7 @@ public Int512Vector selectFrom(Vector v, VectorMask m) { return (Int512Vector) super.selectFromTemplate((Int512Vector) v, - (Int512Mask) m); // specialize + Int512Mask.class, (Int512Mask) m); // specialize } @@ -860,6 +860,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Int512Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Int512Shuffle.class, this, VLENGTH, + (s) -> ((Int512Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Int512Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java index 4181e6b4ea3e7..3b3c0723ee1a3 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java @@ -503,7 +503,7 @@ public Int64Vector selectFrom(Vector v, VectorMask m) { return (Int64Vector) super.selectFromTemplate((Int64Vector) v, - (Int64Mask) m); // specialize + Int64Mask.class, (Int64Mask) m); // specialize } @@ -832,6 +832,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Int64Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Int64Shuffle.class, this, VLENGTH, + (s) -> ((Int64Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Int64Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java index 785022fcd65f0..5738cb7a4bc94 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java @@ -503,7 +503,7 @@ public IntMaxVector selectFrom(Vector v, VectorMask m) { return (IntMaxVector) super.selectFromTemplate((IntMaxVector) v, - (IntMaxMask) m); // specialize + IntMaxMask.class, (IntMaxMask) m); // specialize } @@ -841,6 +841,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public IntMaxShuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, IntMaxShuffle.class, this, VLENGTH, + (s) -> ((IntMaxShuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public IntMaxShuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java index 3317e25e73e73..16b5ceecba35e 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java @@ -2378,17 +2378,18 @@ IntVector sliceTemplate(int origin) { */ @Override public abstract - IntVector rearrange(VectorShuffle m); + IntVector rearrange(VectorShuffle shuffle); /*package-private*/ @ForceInline final > IntVector rearrangeTemplate(Class shuffletype, S shuffle) { - shuffle.checkIndexes(); + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, int.class, length(), - this, shuffle, null, + this, ws, null, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); @@ -2413,17 +2414,14 @@ IntVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - VectorMask valid = shuffle.laneIsValid(); - if (m.andNot(valid).anyTrue()) { - shuffle.checkIndexes(); - throw new AssertionError(); - } + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, int.class, length(), - this, shuffle, m, + this, ws, m, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); - return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2536,7 +2534,10 @@ int.class, length(), this, m, /*package-private*/ @ForceInline final IntVector selectFromTemplate(IntVector v) { - return v.rearrange(this.toShuffle()); + return (IntVector)VectorSupport.selectFromOp(getClass(), null, int.class, + length(), this, v, null, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle())); } /** @@ -2548,9 +2549,15 @@ final IntVector selectFromTemplate(IntVector v) { /*package-private*/ @ForceInline - final IntVector selectFromTemplate(IntVector v, - AbstractMask m) { - return v.rearrange(this.toShuffle(), m); + final + > + IntVector selectFromTemplate(IntVector v, + Class masktype, M m) { + m.check(masktype, this); + return (IntVector)VectorSupport.selectFromOp(getClass(), masktype, int.class, + length(), this, v, m, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle(), _m)); } /// Ternary operations diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java index 302c71bc13b10..567789627c6cb 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java @@ -493,7 +493,7 @@ public Long128Vector selectFrom(Vector v, VectorMask m) { return (Long128Vector) super.selectFromTemplate((Long128Vector) v, - (Long128Mask) m); // specialize + Long128Mask.class, (Long128Mask) m); // specialize } @@ -822,6 +822,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Long128Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Long128Shuffle.class, this, VLENGTH, + (s) -> ((Long128Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Long128Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java index 04c51c377e1de..5ef0f121464f6 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java @@ -493,7 +493,7 @@ public Long256Vector selectFrom(Vector v, VectorMask m) { return (Long256Vector) super.selectFromTemplate((Long256Vector) v, - (Long256Mask) m); // specialize + Long256Mask.class, (Long256Mask) m); // specialize } @@ -826,6 +826,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Long256Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Long256Shuffle.class, this, VLENGTH, + (s) -> ((Long256Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Long256Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java index fbcd57400d579..acdb471609f22 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java @@ -493,7 +493,7 @@ public Long512Vector selectFrom(Vector v, VectorMask m) { return (Long512Vector) super.selectFromTemplate((Long512Vector) v, - (Long512Mask) m); // specialize + Long512Mask.class, (Long512Mask) m); // specialize } @@ -834,6 +834,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Long512Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Long512Shuffle.class, this, VLENGTH, + (s) -> ((Long512Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Long512Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java index 3b2e77f1a54ac..627f7437367cb 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java @@ -493,7 +493,7 @@ public Long64Vector selectFrom(Vector v, VectorMask m) { return (Long64Vector) super.selectFromTemplate((Long64Vector) v, - (Long64Mask) m); // specialize + Long64Mask.class, (Long64Mask) m); // specialize } @@ -820,6 +820,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Long64Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Long64Shuffle.class, this, VLENGTH, + (s) -> ((Long64Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Long64Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java index cc3641be3d62f..aec3bb89fcd02 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java @@ -493,7 +493,7 @@ public LongMaxVector selectFrom(Vector v, VectorMask m) { return (LongMaxVector) super.selectFromTemplate((LongMaxVector) v, - (LongMaxMask) m); // specialize + LongMaxMask.class, (LongMaxMask) m); // specialize } @@ -820,6 +820,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public LongMaxShuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, LongMaxShuffle.class, this, VLENGTH, + (s) -> ((LongMaxShuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public LongMaxShuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java index 9dd3f2eb13626..15ac2bc7b7f6c 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java @@ -2244,17 +2244,18 @@ LongVector sliceTemplate(int origin) { */ @Override public abstract - LongVector rearrange(VectorShuffle m); + LongVector rearrange(VectorShuffle shuffle); /*package-private*/ @ForceInline final > LongVector rearrangeTemplate(Class shuffletype, S shuffle) { - shuffle.checkIndexes(); + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, long.class, length(), - this, shuffle, null, + this, ws, null, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); @@ -2279,17 +2280,14 @@ LongVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - VectorMask valid = shuffle.laneIsValid(); - if (m.andNot(valid).anyTrue()) { - shuffle.checkIndexes(); - throw new AssertionError(); - } + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, long.class, length(), - this, shuffle, m, + this, ws, m, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); - return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2402,7 +2400,10 @@ long.class, length(), this, m, /*package-private*/ @ForceInline final LongVector selectFromTemplate(LongVector v) { - return v.rearrange(this.toShuffle()); + return (LongVector)VectorSupport.selectFromOp(getClass(), null, long.class, + length(), this, v, null, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle())); } /** @@ -2414,9 +2415,15 @@ final LongVector selectFromTemplate(LongVector v) { /*package-private*/ @ForceInline - final LongVector selectFromTemplate(LongVector v, - AbstractMask m) { - return v.rearrange(this.toShuffle(), m); + final + > + LongVector selectFromTemplate(LongVector v, + Class masktype, M m) { + m.check(masktype, this); + return (LongVector)VectorSupport.selectFromOp(getClass(), masktype, long.class, + length(), this, v, m, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle(), _m)); } /// Ternary operations diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java index 7703df9a59a3d..fe34886512a13 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java @@ -503,7 +503,7 @@ public Short128Vector selectFrom(Vector v, VectorMask m) { return (Short128Vector) super.selectFromTemplate((Short128Vector) v, - (Short128Mask) m); // specialize + Short128Mask.class, (Short128Mask) m); // specialize } @@ -844,6 +844,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Short128Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Short128Shuffle.class, this, VLENGTH, + (s) -> ((Short128Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Short128Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java index cf84593019523..243e24ad26bef 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java @@ -503,7 +503,7 @@ public Short256Vector selectFrom(Vector v, VectorMask m) { return (Short256Vector) super.selectFromTemplate((Short256Vector) v, - (Short256Mask) m); // specialize + Short256Mask.class, (Short256Mask) m); // specialize } @@ -860,6 +860,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Short256Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Short256Shuffle.class, this, VLENGTH, + (s) -> ((Short256Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Short256Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java index 67a5073df0525..4114783608960 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java @@ -503,7 +503,7 @@ public Short512Vector selectFrom(Vector v, VectorMask m) { return (Short512Vector) super.selectFromTemplate((Short512Vector) v, - (Short512Mask) m); // specialize + Short512Mask.class, (Short512Mask) m); // specialize } @@ -892,6 +892,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Short512Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Short512Shuffle.class, this, VLENGTH, + (s) -> ((Short512Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Short512Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java index 263ee10d907ba..d80d4c4e2ec52 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java @@ -503,7 +503,7 @@ public Short64Vector selectFrom(Vector v, VectorMask m) { return (Short64Vector) super.selectFromTemplate((Short64Vector) v, - (Short64Mask) m); // specialize + Short64Mask.class, (Short64Mask) m); // specialize } @@ -836,6 +836,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public Short64Shuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, Short64Shuffle.class, this, VLENGTH, + (s) -> ((Short64Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public Short64Shuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java index 07a2caebef0ae..799483a667590 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java @@ -503,7 +503,7 @@ public ShortMaxVector selectFrom(Vector v, VectorMask m) { return (ShortMaxVector) super.selectFromTemplate((ShortMaxVector) v, - (ShortMaxMask) m); // specialize + ShortMaxMask.class, (ShortMaxMask) m); // specialize } @@ -830,6 +830,13 @@ public VectorShuffle cast(VectorSpecies s) { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public ShortMaxShuffle wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, ShortMaxShuffle.class, this, VLENGTH, + (s) -> ((ShortMaxShuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public ShortMaxShuffle rearrange(VectorShuffle shuffle) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java index ba21e8a9e9563..fb0512fd5b9ea 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java @@ -2394,17 +2394,18 @@ ShortVector sliceTemplate(int origin) { */ @Override public abstract - ShortVector rearrange(VectorShuffle m); + ShortVector rearrange(VectorShuffle shuffle); /*package-private*/ @ForceInline final > ShortVector rearrangeTemplate(Class shuffletype, S shuffle) { - shuffle.checkIndexes(); + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, short.class, length(), - this, shuffle, null, + this, ws, null, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); @@ -2429,17 +2430,14 @@ ShortVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - VectorMask valid = shuffle.laneIsValid(); - if (m.andNot(valid).anyTrue()) { - shuffle.checkIndexes(); - throw new AssertionError(); - } + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, short.class, length(), - this, shuffle, m, + this, ws, m, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); - return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2552,7 +2550,10 @@ short.class, length(), this, m, /*package-private*/ @ForceInline final ShortVector selectFromTemplate(ShortVector v) { - return v.rearrange(this.toShuffle()); + return (ShortVector)VectorSupport.selectFromOp(getClass(), null, short.class, + length(), this, v, null, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle())); } /** @@ -2564,9 +2565,15 @@ final ShortVector selectFromTemplate(ShortVector v) { /*package-private*/ @ForceInline - final ShortVector selectFromTemplate(ShortVector v, - AbstractMask m) { - return v.rearrange(this.toShuffle(), m); + final + > + ShortVector selectFromTemplate(ShortVector v, + Class masktype, M m) { + m.check(masktype, this); + return (ShortVector)VectorSupport.selectFromOp(getClass(), masktype, short.class, + length(), this, v, m, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle(), _m)); } /// Ternary operations diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java index d34ac79e7c32c..fda073f686389 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java @@ -2614,17 +2614,14 @@ public abstract VectorMask compare(VectorOperators.Comparison op, * elements of this vector. * * For each lane {@code N} of the shuffle, and for each lane - * source index {@code I=s.laneSource(N)} in the shuffle, + * source index {@code I=s.wrapIndex(s.laneSource(N))} in the shuffle, * the output lane {@code N} obtains the value from * the input vector at lane {@code I}. * * @param s the shuffle controlling lane index selection * @return the rearrangement of the lane elements of this vector - * @throws IndexOutOfBoundsException if there are any exceptional - * source indexes in the shuffle * @see #rearrange(VectorShuffle,VectorMask) * @see #rearrange(VectorShuffle,Vector) - * @see VectorShuffle#laneIsValid() */ public abstract Vector rearrange(VectorShuffle s); @@ -2636,27 +2633,22 @@ public abstract VectorMask compare(VectorOperators.Comparison op, * elements of this vector. * * For each lane {@code N} of the shuffle, and for each lane - * source index {@code I=s.laneSource(N)} in the shuffle, + * source index {@code I=s.wrapIndex(s.laneSource(N))} in the shuffle, * the output lane {@code N} obtains the value from * the input vector at lane {@code I} if the mask is set. * Otherwise the output lane {@code N} is set to zero. * *

        This method returns the value of this pseudocode: *

        {@code
        -     * Vector r = this.rearrange(s.wrapIndexes());
        -     * VectorMask valid = s.laneIsValid();
        -     * if (m.andNot(valid).anyTrue()) throw ...;
        +     * Vector r = this.rearrange(s);
              * return broadcast(0).blend(r, m);
              * }
        * * @param s the shuffle controlling lane index selection * @param m the mask controlling application of the shuffle * @return the rearrangement of the lane elements of this vector - * @throws IndexOutOfBoundsException if there are any exceptional - * source indexes in the shuffle where the mask is set * @see #rearrange(VectorShuffle) * @see #rearrange(VectorShuffle,Vector) - * @see VectorShuffle#laneIsValid() */ public abstract Vector rearrange(VectorShuffle s, VectorMask m); @@ -2747,7 +2739,7 @@ public abstract VectorMask compare(VectorOperators.Comparison op, * this vector. * * For each lane {@code N} of this vector, and for each lane - * value {@code I=this.lane(N)} in this vector, + * value {@code I=wrapIndex(this.lane(N))} in this vector, * the output lane {@code N} obtains the value from * the argument vector at lane {@code I}. * @@ -2760,8 +2752,6 @@ public abstract VectorMask compare(VectorOperators.Comparison op, * * @param v the vector supplying the result values * @return the rearrangement of the lane elements of {@code v} - * @throws IndexOutOfBoundsException if any invalid - * source indexes are found in {@code this} * @see #rearrange(VectorShuffle) */ public abstract Vector selectFrom(Vector v); @@ -2787,9 +2777,6 @@ public abstract VectorMask compare(VectorOperators.Comparison op, * @param v the vector supplying the result values * @param m the mask controlling selection from {@code v} * @return the rearrangement of the lane elements of {@code v} - * @throws IndexOutOfBoundsException if any invalid - * source indexes are found in {@code this}, - * in a lane which is set in the mask * @see #selectFrom(Vector) * @see #rearrange(VectorShuffle,VectorMask) */ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template index d7562bae4755a..fcc128ea8c7b0 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template @@ -2770,17 +2770,18 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { */ @Override public abstract - $abstractvectortype$ rearrange(VectorShuffle<$Boxtype$> m); + $abstractvectortype$ rearrange(VectorShuffle<$Boxtype$> shuffle); /*package-private*/ @ForceInline final > $abstractvectortype$ rearrangeTemplate(Class shuffletype, S shuffle) { - shuffle.checkIndexes(); + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, $type$.class, length(), - this, shuffle, null, + this, ws, null, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); @@ -2805,17 +2806,14 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { M m) { m.check(masktype, this); - VectorMask<$Boxtype$> valid = shuffle.laneIsValid(); - if (m.andNot(valid).anyTrue()) { - shuffle.checkIndexes(); - throw new AssertionError(); - } + @SuppressWarnings("unchecked") + S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, $type$.class, length(), - this, shuffle, m, + this, ws, m, (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); - return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2928,7 +2926,10 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { /*package-private*/ @ForceInline final $abstractvectortype$ selectFromTemplate($abstractvectortype$ v) { - return v.rearrange(this.toShuffle()); + return ($Type$Vector)VectorSupport.selectFromOp(getClass(), null, $type$.class, + length(), this, v, null, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle())); } /** @@ -2940,9 +2941,15 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { /*package-private*/ @ForceInline - final $abstractvectortype$ selectFromTemplate($abstractvectortype$ v, - AbstractMask<$Boxtype$> m) { - return v.rearrange(this.toShuffle(), m); + final + > + $abstractvectortype$ selectFromTemplate($abstractvectortype$ v, + Class masktype, M m) { + m.check(masktype, this); + return ($Type$Vector)VectorSupport.selectFromOp(getClass(), masktype, $type$.class, + length(), this, v, m, + (v1, v2, _m) -> + v2.rearrange(v1.toShuffle(), _m)); } /// Ternary operations diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template index 111d4bbefd44b..483962b4e0670 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template @@ -509,7 +509,7 @@ final class $vectortype$ extends $abstractvectortype$ { VectorMask<$Boxtype$> m) { return ($vectortype$) super.selectFromTemplate(($vectortype$) v, - ($masktype$) m); // specialize + $masktype$.class, ($masktype$) m); // specialize } @@ -1118,6 +1118,13 @@ final class $vectortype$ extends $abstractvectortype$ { return s.shuffleFromArray(shuffleArray, 0).check(s); } + @Override + @ForceInline + public $shuffletype$ wrapIndexes() { + return VectorSupport.wrapShuffleIndexes(ETYPE, $shuffletype$.class, this, VLENGTH, + (s) -> (($shuffletype$)(((AbstractShuffle<$Boxtype$>)(s)).wrapIndexesTemplate()))); + } + @ForceInline @Override public $shuffletype$ rearrange(VectorShuffle<$Boxtype$> shuffle) { From 8d6d37fea133380d4143f5db38ad3790efa84f68 Mon Sep 17 00:00:00 2001 From: Tobias Holenstein Date: Tue, 1 Oct 2024 23:52:46 +0000 Subject: [PATCH 268/307] 8320308: C2 compilation crashes in LibraryCallKit::inline_unsafe_access Reviewed-by: thartmann, kvn, vlivanov, epeter, roland --- src/hotspot/share/opto/library_call.cpp | 5 +- test/hotspot/jtreg/ProblemList.txt | 1 - .../TestUnsafeArrayAccessWithNullBase.java | 113 ++++++++++++++++++ 3 files changed, 116 insertions(+), 3 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/parsing/TestUnsafeArrayAccessWithNullBase.java diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index dd4f0b94af6ee..4d182e06a5657 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -2052,7 +2052,7 @@ LibraryCallKit::classify_unsafe_addr(Node* &base, Node* &offset, BasicType type) if (base_type == nullptr) { // Unknown type. return Type::AnyPtr; - } else if (base_type == TypePtr::NULL_PTR) { + } else if (_gvn.type(base->uncast()) == TypePtr::NULL_PTR) { // Since this is a null+long form, we have to switch to a rawptr. base = _gvn.transform(new CastX2PNode(offset)); offset = MakeConX(0); @@ -2370,8 +2370,9 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c SafePointNode* old_map = clone_map(); Node* adr = make_unsafe_address(base, offset, type, kind == Relaxed); + assert(!stopped(), "Inlining of unsafe access failed: address construction stopped unexpectedly"); - if (_gvn.type(base)->isa_ptr() == TypePtr::NULL_PTR) { + if (_gvn.type(base->uncast())->isa_ptr() == TypePtr::NULL_PTR) { if (type != T_OBJECT) { decorators |= IN_NATIVE; // off-heap primitive access } else { diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index aefe09fd3aec2..0e75009ac8a1a 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -43,7 +43,6 @@ # :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 diff --git a/test/hotspot/jtreg/compiler/parsing/TestUnsafeArrayAccessWithNullBase.java b/test/hotspot/jtreg/compiler/parsing/TestUnsafeArrayAccessWithNullBase.java new file mode 100644 index 0000000000000..28eb4f3c165d4 --- /dev/null +++ b/test/hotspot/jtreg/compiler/parsing/TestUnsafeArrayAccessWithNullBase.java @@ -0,0 +1,113 @@ +/* + * 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 8320308 + * @summary Unsafe::getShortUnaligned with base null hidden behind CheckCastPP nodes + * @library /test/lib + * @modules java.base/jdk.internal.misc + * @run main/othervm -Xbatch -XX:CompileCommand=quiet -XX:TypeProfileLevel=222 + * -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline + * -XX:CompileCommand=compileonly,compiler.parsing.TestUnsafeArrayAccessWithNullBase::test* + * -XX:-TieredCompilation compiler.parsing.TestUnsafeArrayAccessWithNullBase + * @run main compiler.parsing.TestUnsafeArrayAccessWithNullBase + */ + +package compiler.parsing; + +import java.lang.reflect.*; +import jdk.internal.misc.Unsafe; + +public class TestUnsafeArrayAccessWithNullBase { + + /* + Trigger bug when handling Unsafe.getShortUnaligned with null checks and inlined methods. + The bug appears when the method is incrementally inlined and optimized based on the argument profile information. + + Warmup Phase: By warming up with non-null values, the argument profile for the helper methods records non-null types. + - insert CheckCastPP: speculative=byte[int:>=0] for return of getSmall/getLarge + - insert CheckCastPP: speculative=byte[int:>=0] for argument `Object array` in helperSmall/helperLarge + Trigger Phase: Calling test causes LibraryCallKit::inline_unsafe_access(..) for Unsafe::getShortUnaligned to fail: + Reason: UNSAFE.getShortUnaligned(array, offset) is called with array=null, + but ConP null is now hidden by two CheckCastPP with speculative=byte[int:>=0] in the graph + */ + + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); + + private static final Object byteArray = new byte[1_050_000]; + + public static Object getLarge(boolean useNull) { + return useNull ? null : byteArray; + } + + public static Object getSmall(boolean useNull) { + return useNull ? null : new byte[10]; + } + + // use a helper to delay inlining of UNSAFE.getShortUnaligned + public static int helperLarge(Object array, boolean run) { + // offset >= os::vm_page_size(): LibraryCallKit::classify_unsafe_addr returns Type::AnyPtr + return run ? UNSAFE.getShortUnaligned(array, 1_049_000) : 0; // after warmup CheckCastPP: speculative=byte[int:>=0] + } + + public static int accessLargeArray(boolean useNull, boolean run) { + Object array = getLarge(useNull); // after warmup CheckCastPP: speculative=byte[int:>=0] + // getLarge() ensures null is only visible after helperLarge was (incrementally) inlined + return helperLarge(array, run); + } + + // use a helper to delay inlining of UNSAFE.getShortUnaligned + // warmup adds argument profile information for array: CheckCastPP with type non null + public static int helperSmall(Object array, boolean run) { + // 0 <= offset < os::vm_page_size(): LibraryCallKit::classify_unsafe_addr returns Type::OopPtr + return run ? UNSAFE.getShortUnaligned(array, 1) : 0; // after warmup CheckCastPP: speculative=byte[int:>=0] + } + + public static int accessSmallArray(boolean useNull, boolean run) { + Object array = getSmall(useNull); // after warmup CheckCastPP: speculative=byte[int:>=0] + return helperSmall(array, run); + } + + public static int test1(boolean run) { + return accessLargeArray(true, run); + } + + public static int test2(boolean run) { + return accessSmallArray(true, run); + } + + public static void main(String[] args) { + // Warmup to collect speculative types + for (int i = 0; i < 10_000; i++) { + accessLargeArray(false, true); + accessSmallArray(false, true); + } + + // Trigger Compilation + for (int i = 0; i < 10_000; ++i) { + test1(false); + test2(false); + } + } +} From 0f381137cb9338453a7d77a7ebdfaa9b34b5028b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirik=20Bj=C3=B8rsn=C3=B8s?= Date: Wed, 2 Oct 2024 01:27:03 +0000 Subject: [PATCH 269/307] 8341243: Use ArraySupport.SOFT_MAX_ARRAY_LENGTH for max array size in java.base Reviewed-by: jpai, smarks --- src/java.base/share/classes/java/io/InputStream.java | 11 +++++------ src/java.base/share/classes/java/util/ArrayDeque.java | 8 +++----- src/java.base/share/classes/java/util/BitSet.java | 4 ++-- src/java.base/share/classes/java/util/Hashtable.java | 10 ++++------ .../java/util/concurrent/ConcurrentHashMap.java | 3 ++- .../share/classes/java/util/regex/Pattern.java | 4 ++-- .../share/classes/java/util/stream/Nodes.java | 6 ++++-- .../internal/foreign/AbstractMemorySegmentImpl.java | 2 +- .../sun/security/util/SignatureFileVerifier.java | 7 ++++--- test/jdk/java/lang/StringBuffer/HugeCapacity.java | 7 +++++-- test/jdk/java/lang/StringBuilder/HugeCapacity.java | 7 +++++-- .../nio/charset/CharsetDecoder/XcodeOverflow.java | 8 +++++--- .../java/util/Base64/TestEncodingDecodingLength.java | 4 +++- .../jdk/java/util/concurrent/tck/ArrayDeque8Test.java | 3 ++- test/jdk/java/util/concurrent/tck/JSR166TestCase.java | 8 ++++---- 15 files changed, 51 insertions(+), 41 deletions(-) diff --git a/src/java.base/share/classes/java/io/InputStream.java b/src/java.base/share/classes/java/io/InputStream.java index 736b6ebd90435..a87870bfce0dd 100644 --- a/src/java.base/share/classes/java/io/InputStream.java +++ b/src/java.base/share/classes/java/io/InputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved. * 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.io; +import jdk.internal.util.ArraysSupport; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -305,12 +307,9 @@ public int read(byte[] b, int off, int len) throws IOException { } /** - * The maximum size of array to allocate. - * Some VMs reserve some header words in an array. - * Attempts to allocate larger arrays may result in - * OutOfMemoryError: Requested array size exceeds VM limit + * The maximum size of array to allocate */ - private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8; + private static final int MAX_BUFFER_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; /** * Reads all remaining bytes from the input stream. This method blocks until diff --git a/src/java.base/share/classes/java/util/ArrayDeque.java b/src/java.base/share/classes/java/util/ArrayDeque.java index 9997110b658ee..60bb3ed4a4572 100644 --- a/src/java.base/share/classes/java/util/ArrayDeque.java +++ b/src/java.base/share/classes/java/util/ArrayDeque.java @@ -38,6 +38,7 @@ import java.util.function.Consumer; import java.util.function.Predicate; import jdk.internal.access.SharedSecrets; +import jdk.internal.util.ArraysSupport; /** * Resizable-array implementation of the {@link Deque} interface. Array @@ -124,12 +125,9 @@ public class ArrayDeque extends AbstractCollection transient int tail; /** - * The maximum size of array to allocate. - * Some VMs reserve some header words in an array. - * Attempts to allocate larger arrays may result in - * OutOfMemoryError: Requested array size exceeds VM limit + * The maximum size of array to allocate */ - private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; + private static final int MAX_ARRAY_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; /** * Increases the capacity of this deque by at least the given amount. diff --git a/src/java.base/share/classes/java/util/BitSet.java b/src/java.base/share/classes/java/util/BitSet.java index fea9693d7ed0d..de4910b20c6d5 100644 --- a/src/java.base/share/classes/java/util/BitSet.java +++ b/src/java.base/share/classes/java/util/BitSet.java @@ -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 @@ -1184,7 +1184,7 @@ private void readObject(ObjectInputStream s) public String toString() { checkInvariants(); - final int MAX_INITIAL_CAPACITY = Integer.MAX_VALUE - 8; + final int MAX_INITIAL_CAPACITY = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; int numBits = (wordsInUse > 128) ? cardinality() : wordsInUse * BITS_PER_WORD; // Avoid overflow in the case of a humongous numBits diff --git a/src/java.base/share/classes/java/util/Hashtable.java b/src/java.base/share/classes/java/util/Hashtable.java index 1fd56d5a258e5..ddff8f7a0ab68 100644 --- a/src/java.base/share/classes/java/util/Hashtable.java +++ b/src/java.base/share/classes/java/util/Hashtable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved. * 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.util.function.Function; import java.util.function.BiFunction; import jdk.internal.access.SharedSecrets; +import jdk.internal.util.ArraysSupport; /** * This class implements a hash table, which maps keys to values. Any @@ -390,12 +391,9 @@ public synchronized V get(Object key) { } /** - * The maximum size of array to allocate. - * Some VMs reserve some header words in an array. - * Attempts to allocate larger arrays may result in - * OutOfMemoryError: Requested array size exceeds VM limit + * The maximum size of array to allocate */ - private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; + private static final int MAX_ARRAY_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; /** * Increases the capacity of and internally reorganizes this diff --git a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java index 4df4f73695f62..5a23fdb05a656 100644 --- a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java +++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java @@ -69,6 +69,7 @@ import java.util.function.ToLongFunction; import java.util.stream.Stream; import jdk.internal.misc.Unsafe; +import jdk.internal.util.ArraysSupport; /** * A hash table supporting full concurrency of retrievals and @@ -517,7 +518,7 @@ public class ConcurrentHashMap extends AbstractMap * The largest possible (non-power of two) array size. * Needed by toArray and related methods. */ - static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; + static final int MAX_ARRAY_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; /** * The default concurrency level for this table. Unused but diff --git a/src/java.base/share/classes/java/util/regex/Pattern.java b/src/java.base/share/classes/java/util/regex/Pattern.java index 0e87bebdcbfec..654adb5376f48 100644 --- a/src/java.base/share/classes/java/util/regex/Pattern.java +++ b/src/java.base/share/classes/java/util/regex/Pattern.java @@ -1502,8 +1502,8 @@ public static String quote(String s) { return "\\Q" + s + "\\E"; int lenHint = s.length(); - lenHint = (lenHint < Integer.MAX_VALUE - 8 - lenHint) ? - (lenHint << 1) : (Integer.MAX_VALUE - 8); + lenHint = (lenHint < ArraysSupport.SOFT_MAX_ARRAY_LENGTH - lenHint) ? + (lenHint << 1) : ArraysSupport.SOFT_MAX_ARRAY_LENGTH; StringBuilder sb = new StringBuilder(lenHint); sb.append("\\Q"); diff --git a/src/java.base/share/classes/java/util/stream/Nodes.java b/src/java.base/share/classes/java/util/stream/Nodes.java index 7c06823b925e7..77d700917179e 100644 --- a/src/java.base/share/classes/java/util/stream/Nodes.java +++ b/src/java.base/share/classes/java/util/stream/Nodes.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.util.ArraysSupport; + import java.util.ArrayDeque; import java.util.Arrays; import java.util.Collection; @@ -57,7 +59,7 @@ private Nodes() { /** * The maximum size of an array that can be allocated. */ - static final long MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; + static final long MAX_ARRAY_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; // IllegalArgumentException messages static final String BAD_SIZE = "Stream size exceeds max array size"; 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 64994af5cb790..c3b6295853fc6 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java +++ b/src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java @@ -379,7 +379,7 @@ private int checkArraySize(String typeName, int elemSize) { throw new IllegalStateException(String.format("Segment size is not a multiple of %d. Size: %d", elemSize, length)); } long arraySize = length / elemSize; - if (arraySize > (Integer.MAX_VALUE - 8)) { //conservative check + if (arraySize > ArraysSupport.SOFT_MAX_ARRAY_LENGTH) { //conservative check throw new IllegalStateException(String.format("Segment is too large to wrap as %s. Size: %d", typeName, length)); } return (int)arraySize; diff --git a/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java b/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java index 1e204816bd65f..1576388b65322 100644 --- a/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java +++ b/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.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 @@ -36,6 +36,7 @@ import java.util.jar.Attributes; import java.util.jar.Manifest; +import jdk.internal.util.ArraysSupport; import sun.security.action.GetIntegerAction; import sun.security.jca.Providers; import sun.security.pkcs.PKCS7; @@ -87,8 +88,8 @@ public class SignatureFileVerifier { // the maximum allowed size in bytes for the signature-related files public static final int MAX_SIG_FILE_SIZE = initializeMaxSigFileSize(); - // The maximum size of array to allocate. Some VMs reserve some header words in an array. - private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; + // The maximum size of array to allocate + private static final int MAX_ARRAY_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; /** * Create the named SignatureFileVerifier. diff --git a/test/jdk/java/lang/StringBuffer/HugeCapacity.java b/test/jdk/java/lang/StringBuffer/HugeCapacity.java index e3c98496c50c8..d1ff51dddb2cf 100644 --- a/test/jdk/java/lang/StringBuffer/HugeCapacity.java +++ b/test/jdk/java/lang/StringBuffer/HugeCapacity.java @@ -1,5 +1,5 @@ /* - * 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 @@ -21,11 +21,14 @@ * questions. */ +import jdk.internal.util.ArraysSupport; + /** * @test * @bug 8218227 * @summary StringBuilder/StringBuffer constructor throws confusing * NegativeArraySizeException + * @modules java.base/jdk.internal.util * @requires (sun.arch.data.model == "64" & os.maxMemory >= 8G) * @run main/othervm -Xms6G -Xmx6G HugeCapacity */ @@ -43,7 +46,7 @@ public static void main(String[] args) { private static void testHugeInitialString() { try { - String str = "Z".repeat(Integer.MAX_VALUE - 8); + String str = "Z".repeat(ArraysSupport.SOFT_MAX_ARRAY_LENGTH); StringBuffer sb = new StringBuffer(str); } catch (OutOfMemoryError ignore) { } catch (Throwable unexpected) { diff --git a/test/jdk/java/lang/StringBuilder/HugeCapacity.java b/test/jdk/java/lang/StringBuilder/HugeCapacity.java index a584ce1f07a9d..a81f1614fe590 100644 --- a/test/jdk/java/lang/StringBuilder/HugeCapacity.java +++ b/test/jdk/java/lang/StringBuilder/HugeCapacity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, 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 @@ -21,11 +21,14 @@ * questions. */ +import jdk.internal.util.ArraysSupport; + /** * @test * @bug 8149330 8218227 * @summary Capacity should not get close to Integer.MAX_VALUE unless * necessary + * @modules java.base/jdk.internal.util * @requires (sun.arch.data.model == "64" & os.maxMemory >= 8G) * @run main/othervm -Xms6G -Xmx6G -XX:+CompactStrings HugeCapacity true * @run main/othervm -Xms6G -Xmx6G -XX:-CompactStrings HugeCapacity false @@ -75,7 +78,7 @@ private static void testUtf16() { private static void testHugeInitialString() { try { - String str = "Z".repeat(Integer.MAX_VALUE - 8); + String str = "Z".repeat(ArraysSupport.SOFT_MAX_ARRAY_LENGTH); StringBuilder sb = new StringBuilder(str); } catch (OutOfMemoryError ignore) { } catch (Throwable unexpected) { diff --git a/test/jdk/java/nio/charset/CharsetDecoder/XcodeOverflow.java b/test/jdk/java/nio/charset/CharsetDecoder/XcodeOverflow.java index 7570da3945cef..197b61c0ac561 100644 --- a/test/jdk/java/nio/charset/CharsetDecoder/XcodeOverflow.java +++ b/test/jdk/java/nio/charset/CharsetDecoder/XcodeOverflow.java @@ -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 @@ -27,6 +27,7 @@ * @summary Make sure IAE is not thrown on `int` overflow, turning negative * size. The test should either not throw any Throwable, or an OOME * with real Java heap space error (not "exceeds VM limit"). + * @modules java.base/jdk.internal.util * @requires sun.arch.data.model == "64" * @run junit/othervm XcodeOverflow */ @@ -37,6 +38,7 @@ import java.nio.charset.StandardCharsets; import java.util.stream.Stream; +import jdk.internal.util.ArraysSupport; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.Arguments; @@ -44,8 +46,8 @@ public class XcodeOverflow { private static Stream sizes() { return Stream.of( - // SOFT_MAX_ARRAY_LENGTH: copied from ArraysSupport. No overflow; no OOME. - Arguments.of(Integer.MAX_VALUE - 8), + // No overflow; no OOME. + Arguments.of(ArraysSupport.SOFT_MAX_ARRAY_LENGTH), // overflow case: OOME w/ "Java heap space" is thrown on decoding Arguments.of(Integer.MAX_VALUE - 1000000) diff --git a/test/jdk/java/util/Base64/TestEncodingDecodingLength.java b/test/jdk/java/util/Base64/TestEncodingDecodingLength.java index ce6d0db4adc5e..452f11ebea9e8 100644 --- a/test/jdk/java/util/Base64/TestEncodingDecodingLength.java +++ b/test/jdk/java/util/Base64/TestEncodingDecodingLength.java @@ -21,6 +21,7 @@ * questions. */ +import jdk.internal.util.ArraysSupport; import org.junit.jupiter.api.Test; import java.lang.reflect.InvocationTargetException; @@ -37,6 +38,7 @@ * Base64.Decoder.decode behavior with large, (Integer.MAX_VALUE) sized * input array/buffer. Tests the private methods "encodedOutLength" and * "decodedOutLength". + * @modules java.base/jdk.internal.util * @run junit/othervm --add-opens java.base/java.util=ALL-UNNAMED TestEncodingDecodingLength */ @@ -45,7 +47,7 @@ public class TestEncodingDecodingLength { // A value large enough to test the desired memory conditions in encode and decode - private static final int LARGE_MEM_SIZE = Integer.MAX_VALUE - 8; + private static final int LARGE_MEM_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; private static final Base64.Decoder DECODER = Base64.getDecoder(); private static final Base64.Encoder ENCODER = Base64.getEncoder(); diff --git a/test/jdk/java/util/concurrent/tck/ArrayDeque8Test.java b/test/jdk/java/util/concurrent/tck/ArrayDeque8Test.java index eb606b0c7818e..fb21ebfed36ff 100644 --- a/test/jdk/java/util/concurrent/tck/ArrayDeque8Test.java +++ b/test/jdk/java/util/concurrent/tck/ArrayDeque8Test.java @@ -36,6 +36,7 @@ import java.util.Collections; import java.util.Spliterator; +import jdk.internal.util.ArraysSupport; import junit.framework.Test; public class ArrayDeque8Test extends JSR166TestCase { @@ -86,7 +87,7 @@ public void testHugeCapacity() { return; final Item e = fortytwo; - final int maxArraySize = Integer.MAX_VALUE - 8; + final int maxArraySize = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; assertThrows(OutOfMemoryError.class, () -> new ArrayDeque(Integer.MAX_VALUE)); diff --git a/test/jdk/java/util/concurrent/tck/JSR166TestCase.java b/test/jdk/java/util/concurrent/tck/JSR166TestCase.java index 451864bcf5d89..19897fa0785ef 100644 --- a/test/jdk/java/util/concurrent/tck/JSR166TestCase.java +++ b/test/jdk/java/util/concurrent/tck/JSR166TestCase.java @@ -38,7 +38,7 @@ * @test id=default * @summary Conformance testing variant of JSR-166 tck tests. * @build * - * @modules java.management + * @modules java.management java.base/jdk.internal.util * @run junit/othervm/timeout=1000 JSR166TestCase */ @@ -47,7 +47,7 @@ * @summary Conformance testing variant of JSR-166 tck tests * with java security manager set to allow. * @build * - * @modules java.management + * @modules java.management java.base/jdk.internal.util * @run junit/othervm/timeout=1000 -Djava.security.manager=allow JSR166TestCase */ @@ -56,7 +56,7 @@ * @summary Test implementation details variant of JSR-166 * tck tests with ForkJoinPool common parallelism. * @build * - * @modules java.management + * @modules java.management java.base/jdk.internal.util * @run junit/othervm/timeout=1000 * --add-opens java.base/java.util.concurrent=ALL-UNNAMED * --add-opens java.base/java.lang=ALL-UNNAMED @@ -78,7 +78,7 @@ * JSR-166 tck tests apart from ForkJoinPool common * parallelism. * @build * - * @modules java.management + * @modules java.management java.base/jdk.internal.util * @run junit/othervm/timeout=1000 * --add-opens java.base/java.util.concurrent=ALL-UNNAMED * --add-opens java.base/java.lang=ALL-UNNAMED From 39c17b392699007496816f788fca9fbe670dd6f8 Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Wed, 2 Oct 2024 03:30:02 +0000 Subject: [PATCH 270/307] 8341277: Validate slot argument for instruction factories Reviewed-by: asotona --- .../java/lang/classfile/CodeBuilder.java | 25 +++ .../instruction/DiscontinuedInstruction.java | 6 +- .../instruction/IncrementInstruction.java | 1 + .../instruction/LoadInstruction.java | 8 +- .../classfile/instruction/LocalVariable.java | 2 + .../instruction/LocalVariableType.java | 2 + .../instruction/NewMultiArrayInstruction.java | 3 + .../instruction/StoreInstruction.java | 8 +- .../classfile/impl/AbstractInstruction.java | 8 +- .../impl/AbstractPseudoInstruction.java | 1 + .../classfile/impl/BytecodeHelpers.java | 131 ++++++++++++- .../jdk/internal/classfile/impl/CodeImpl.java | 4 +- .../classfile/impl/DirectCodeBuilder.java | 14 +- .../classfile/InstructionValidationTest.java | 182 ++++++++++++++++++ .../jdk/classfile/OpcodesValidationTest.java | 51 ----- 15 files changed, 366 insertions(+), 80 deletions(-) create mode 100644 test/jdk/jdk/classfile/InstructionValidationTest.java delete mode 100644 test/jdk/jdk/classfile/OpcodesValidationTest.java 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 16f513801a249..7b27238bbdfae 100644 --- a/src/java.base/share/classes/java/lang/classfile/CodeBuilder.java +++ b/src/java.base/share/classes/java/lang/classfile/CodeBuilder.java @@ -429,6 +429,8 @@ default CodeBuilder trying(Consumer tryHandler, * @param tk the load type * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code tk} is {@link TypeKind#VOID void} + * or {@code slot} is out of range * @since 23 */ default CodeBuilder loadLocal(TypeKind tk, int slot) { @@ -440,6 +442,8 @@ default CodeBuilder loadLocal(TypeKind tk, int slot) { * @param tk the store type * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code tk} is {@link TypeKind#VOID void} + * or {@code slot} is out of range * @since 23 */ default CodeBuilder storeLocal(TypeKind tk, int slot) { @@ -793,6 +797,7 @@ default CodeBuilder characterRange(Label startScope, Label endScope, int charact * @param startScope the start scope of the variable * @param endScope the end scope of the variable * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder localVariable(int slot, Utf8Entry nameEntry, Utf8Entry descriptorEntry, Label startScope, Label endScope) { return with(LocalVariable.of(slot, nameEntry, descriptorEntry, startScope, endScope)); @@ -806,6 +811,7 @@ default CodeBuilder localVariable(int slot, Utf8Entry nameEntry, Utf8Entry descr * @param startScope the start scope of the variable * @param endScope the end scope of the variable * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder localVariable(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope) { return localVariable(slot, @@ -822,6 +828,7 @@ default CodeBuilder localVariable(int slot, String name, ClassDesc descriptor, L * @param startScope the start scope of the variable * @param endScope the end scope of the variable * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder localVariableType(int slot, Utf8Entry nameEntry, Utf8Entry signatureEntry, Label startScope, Label endScope) { return with(LocalVariableType.of(slot, nameEntry, signatureEntry, startScope, endScope)); @@ -835,6 +842,7 @@ default CodeBuilder localVariableType(int slot, Utf8Entry nameEntry, Utf8Entry s * @param startScope the start scope of the variable * @param endScope the end scope of the variable * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder localVariableType(int slot, String name, Signature signature, Label startScope, Label endScope) { return localVariableType(slot, @@ -877,6 +885,7 @@ default CodeBuilder aastore() { * * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder aload(int slot) { return loadLocal(TypeKind.REFERENCE, slot); @@ -925,6 +934,7 @@ default CodeBuilder arraylength() { * * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder astore(int slot) { return storeLocal(TypeKind.REFERENCE, slot); @@ -958,6 +968,7 @@ default CodeBuilder bastore() { * Generate an instruction pushing an int in the range of byte onto the operand stack. * @param b the int in the range of byte * @return this builder + * @throws IllegalArgumentException if {@code b} is out of range of byte */ default CodeBuilder bipush(int b) { return with(ConstantInstruction.ofArgument(Opcode.BIPUSH, b)); @@ -1094,6 +1105,7 @@ default CodeBuilder ddiv() { * * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder dload(int slot) { return loadLocal(TypeKind.DOUBLE, slot); @@ -1139,6 +1151,7 @@ default CodeBuilder dreturn() { * * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder dstore(int slot) { return storeLocal(TypeKind.DOUBLE, slot); @@ -1306,6 +1319,7 @@ default CodeBuilder fdiv() { * * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder fload(int slot) { return loadLocal(TypeKind.FLOAT, slot); @@ -1351,6 +1365,7 @@ default CodeBuilder freturn() { * * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder fstore(int slot) { return storeLocal(TypeKind.FLOAT, slot); @@ -1726,6 +1741,7 @@ default CodeBuilder ifne(Label target) { * @param slot the local variable slot * @param val the increment value * @return this builder + * @throws IllegalArgumentException if {@code slot} or {@code val} is out of range */ default CodeBuilder iinc(int slot, int val) { return with(IncrementInstruction.of(slot, val)); @@ -1739,6 +1755,7 @@ default CodeBuilder iinc(int slot, int val) { * * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder iload(int slot) { return loadLocal(TypeKind.INT, slot); @@ -1997,6 +2014,7 @@ default CodeBuilder ishr() { * * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder istore(int slot) { return storeLocal(TypeKind.INT, slot); @@ -2159,6 +2177,7 @@ default CodeBuilder ldiv() { * * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder lload(int slot) { return loadLocal(TypeKind.LONG, slot); @@ -2228,6 +2247,7 @@ default CodeBuilder lshr() { * * @param slot the local variable slot * @return this builder + * @throws IllegalArgumentException if {@code slot} is out of range */ default CodeBuilder lstore(int slot) { return storeLocal(TypeKind.LONG, slot); @@ -2278,6 +2298,7 @@ default CodeBuilder monitorexit() { * @param array the array type * @param dims the number of dimensions * @return this builder + * @throws IllegalArgumentException if {@code dims} is out of range */ default CodeBuilder multianewarray(ClassEntry array, int dims) { return with(NewMultiArrayInstruction.of(array, dims)); @@ -2289,6 +2310,7 @@ default CodeBuilder multianewarray(ClassEntry array, int dims) { * @param dims the number of dimensions * @return this builder * @throws IllegalArgumentException if {@code array} represents a primitive type + * or if {@code dims} is out of range */ default CodeBuilder multianewarray(ClassDesc array, int dims) { return multianewarray(constantPool().classEntry(array), dims); @@ -2327,6 +2349,8 @@ default CodeBuilder new_(ClassDesc clazz) { * Generate an instruction to create a new array of a primitive type * @param typeKind the primitive array type * @return this builder + * @throws IllegalArgumentException when the {@code typeKind} is not a legal + * primitive array component type */ default CodeBuilder newarray(TypeKind typeKind) { return with(NewPrimitiveArrayInstruction.of(typeKind)); @@ -2423,6 +2447,7 @@ default CodeBuilder sastore() { * Generate an instruction pushing an int in the range of short onto the operand stack. * @param s the int in the range of short * @return this builder + * @throws IllegalArgumentException if {@code s} is out of range of short */ default CodeBuilder sipush(int s) { return with(ConstantInstruction.ofArgument(Opcode.SIPUSH, s)); diff --git a/src/java.base/share/classes/java/lang/classfile/instruction/DiscontinuedInstruction.java b/src/java.base/share/classes/java/lang/classfile/instruction/DiscontinuedInstruction.java index 61ea14c459884..84bead6d8ccb4 100644 --- a/src/java.base/share/classes/java/lang/classfile/instruction/DiscontinuedInstruction.java +++ b/src/java.base/share/classes/java/lang/classfile/instruction/DiscontinuedInstruction.java @@ -30,6 +30,7 @@ import java.lang.classfile.Label; import java.lang.classfile.Opcode; import jdk.internal.classfile.impl.AbstractInstruction; +import jdk.internal.classfile.impl.BytecodeHelpers; import jdk.internal.classfile.impl.Util; import jdk.internal.javac.PreviewFeature; @@ -112,10 +113,10 @@ sealed interface RetInstruction extends DiscontinuedInstruction * which must be of kind {@link Opcode.Kind#DISCONTINUED_RET} * @param slot the local variable slot to load return address from * @throws IllegalArgumentException if the opcode kind is not - * {@link Opcode.Kind#DISCONTINUED_RET}. + * {@link Opcode.Kind#DISCONTINUED_RET} or if {@code slot} is out of range */ static RetInstruction of(Opcode op, int slot) { - Util.checkKind(op, Opcode.Kind.DISCONTINUED_RET); + BytecodeHelpers.validateRet(op, slot); return new AbstractInstruction.UnboundRetInstruction(op, slot); } @@ -123,6 +124,7 @@ static RetInstruction of(Opcode op, int slot) { * {@return a RET instruction} * * @param slot the local variable slot to load return address from + * @throws IllegalArgumentException if {@code slot} is out of range */ static RetInstruction of(int slot) { return of(slot < 256 ? Opcode.RET : Opcode.RET_W, slot); diff --git a/src/java.base/share/classes/java/lang/classfile/instruction/IncrementInstruction.java b/src/java.base/share/classes/java/lang/classfile/instruction/IncrementInstruction.java index 3bde87ee48dbc..bebb101d7f326 100644 --- a/src/java.base/share/classes/java/lang/classfile/instruction/IncrementInstruction.java +++ b/src/java.base/share/classes/java/lang/classfile/instruction/IncrementInstruction.java @@ -58,6 +58,7 @@ public sealed interface IncrementInstruction extends Instruction * * @param slot the local variable slot to increment * @param constant the value to increment by + * @throws IllegalArgumentException if {@code slot} or {@code constant} is out of range */ static IncrementInstruction of(int slot, int constant) { return new AbstractInstruction.UnboundIncrementInstruction(slot, constant); diff --git a/src/java.base/share/classes/java/lang/classfile/instruction/LoadInstruction.java b/src/java.base/share/classes/java/lang/classfile/instruction/LoadInstruction.java index f4cc8bab794fb..ea10ba6a0d0fb 100644 --- a/src/java.base/share/classes/java/lang/classfile/instruction/LoadInstruction.java +++ b/src/java.base/share/classes/java/lang/classfile/instruction/LoadInstruction.java @@ -62,9 +62,12 @@ public sealed interface LoadInstruction extends Instruction * * @param kind the type of the value to be loaded * @param slot the local variable slot to load from + * @throws IllegalArgumentException if {@code kind} is + * {@link TypeKind#VOID void} or {@code slot} is out of range */ static LoadInstruction of(TypeKind kind, int slot) { - return of(BytecodeHelpers.loadOpcode(kind, slot), slot); + var opcode = BytecodeHelpers.loadOpcode(kind, slot); // validates slot, trusted + return new AbstractInstruction.UnboundLoadInstruction(opcode, slot); } /** @@ -74,10 +77,11 @@ static LoadInstruction of(TypeKind kind, int slot) { * which must be of kind {@link Opcode.Kind#LOAD} * @param slot the local variable slot to load from * @throws IllegalArgumentException if the opcode kind is not - * {@link Opcode.Kind#LOAD}. + * {@link Opcode.Kind#LOAD} or {@code slot} is out of range */ static LoadInstruction of(Opcode op, int slot) { Util.checkKind(op, Opcode.Kind.LOAD); + BytecodeHelpers.validateSlot(op, slot, true); return new AbstractInstruction.UnboundLoadInstruction(op, slot); } } 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 84a8599315218..390034bd6663d 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 @@ -92,6 +92,7 @@ default ClassDesc typeSymbol() { * @param descriptorEntry the local variable descriptor * @param startScope the start range of the local variable scope * @param endScope the end range of the local variable scope + * @throws IllegalArgumentException if {@code slot} is out of range */ static LocalVariable of(int slot, Utf8Entry nameEntry, Utf8Entry descriptorEntry, Label startScope, Label endScope) { return new AbstractPseudoInstruction.UnboundLocalVariable(slot, nameEntry, descriptorEntry, @@ -106,6 +107,7 @@ static LocalVariable of(int slot, Utf8Entry nameEntry, Utf8Entry descriptorEntry * @param descriptor the local variable descriptor * @param startScope the start range of the local variable scope * @param endScope the end range of the local variable scope + * @throws IllegalArgumentException if {@code slot} is out of range */ static LocalVariable of(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope) { return of(slot, diff --git a/src/java.base/share/classes/java/lang/classfile/instruction/LocalVariableType.java b/src/java.base/share/classes/java/lang/classfile/instruction/LocalVariableType.java index 4409abe6db272..d0d2cd1581fe0 100644 --- a/src/java.base/share/classes/java/lang/classfile/instruction/LocalVariableType.java +++ b/src/java.base/share/classes/java/lang/classfile/instruction/LocalVariableType.java @@ -89,6 +89,7 @@ default Signature signatureSymbol() { * @param signatureEntry the local variable signature * @param startScope the start range of the local variable scope * @param endScope the end range of the local variable scope + * @throws IllegalArgumentException if {@code slot} is out of range */ static LocalVariableType of(int slot, Utf8Entry nameEntry, Utf8Entry signatureEntry, Label startScope, Label endScope) { return new AbstractPseudoInstruction.UnboundLocalVariableType(slot, nameEntry, signatureEntry, @@ -103,6 +104,7 @@ static LocalVariableType of(int slot, Utf8Entry nameEntry, Utf8Entry signatureEn * @param signature the local variable signature * @param startScope the start range of the local variable scope * @param endScope the end range of the local variable scope + * @throws IllegalArgumentException if {@code slot} is out of range */ static LocalVariableType of(int slot, String name, Signature signature, Label startScope, Label endScope) { return of(slot, diff --git a/src/java.base/share/classes/java/lang/classfile/instruction/NewMultiArrayInstruction.java b/src/java.base/share/classes/java/lang/classfile/instruction/NewMultiArrayInstruction.java index 2f45b96760361..2c572c607b4f4 100644 --- a/src/java.base/share/classes/java/lang/classfile/instruction/NewMultiArrayInstruction.java +++ b/src/java.base/share/classes/java/lang/classfile/instruction/NewMultiArrayInstruction.java @@ -29,6 +29,7 @@ import java.lang.classfile.constantpool.ClassEntry; import java.lang.classfile.Instruction; import jdk.internal.classfile.impl.AbstractInstruction; +import jdk.internal.classfile.impl.BytecodeHelpers; import jdk.internal.javac.PreviewFeature; /** @@ -58,9 +59,11 @@ public sealed interface NewMultiArrayInstruction extends Instruction * * @param arrayTypeEntry the type of the array * @param dimensions the number of dimensions of the array + * @throws IllegalArgumentException if {@code dimensions} is out of range */ static NewMultiArrayInstruction of(ClassEntry arrayTypeEntry, int dimensions) { + BytecodeHelpers.validateMultiArrayDimensions(dimensions); return new AbstractInstruction.UnboundNewMultidimensionalArrayInstruction(arrayTypeEntry, dimensions); } } diff --git a/src/java.base/share/classes/java/lang/classfile/instruction/StoreInstruction.java b/src/java.base/share/classes/java/lang/classfile/instruction/StoreInstruction.java index 278bf8c0ec399..5bfe13421da35 100644 --- a/src/java.base/share/classes/java/lang/classfile/instruction/StoreInstruction.java +++ b/src/java.base/share/classes/java/lang/classfile/instruction/StoreInstruction.java @@ -61,9 +61,12 @@ public sealed interface StoreInstruction extends Instruction * * @param kind the type of the value to be stored * @param slot the local variable slot to store to + * @throws IllegalArgumentException if {@code kind} is {@link + * TypeKind#VOID void} or {@code slot} is out of range */ static StoreInstruction of(TypeKind kind, int slot) { - return of(BytecodeHelpers.storeOpcode(kind, slot), slot); + var opcode = BytecodeHelpers.storeOpcode(kind, slot); // validates slot + return new AbstractInstruction.UnboundStoreInstruction(opcode, slot); } /** @@ -73,10 +76,11 @@ static StoreInstruction of(TypeKind kind, int slot) { * which must be of kind {@link Opcode.Kind#STORE} * @param slot the local variable slot to store to * @throws IllegalArgumentException if the opcode kind is not - * {@link Opcode.Kind#STORE}. + * {@link Opcode.Kind#STORE} or {@code slot} is out of range */ static StoreInstruction of(Opcode op, int slot) { Util.checkKind(op, Opcode.Kind.STORE); + BytecodeHelpers.validateSlot(op, slot, false); return new AbstractInstruction.UnboundStoreInstruction(op, slot); } } diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractInstruction.java b/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractInstruction.java index edcd6a7abff25..d325842793705 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractInstruction.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractInstruction.java @@ -848,9 +848,9 @@ public static final class UnboundIncrementInstruction final int constant; public UnboundIncrementInstruction(int slot, int constant) { - super(slot <= 255 && constant < 128 && constant > -127 - ? Opcode.IINC - : Opcode.IINC_W); + super(BytecodeHelpers.validateAndIsWideIinc(slot, constant) + ? Opcode.IINC_W + : Opcode.IINC); this.slot = slot; this.constant = constant; } @@ -867,7 +867,7 @@ public int constant() { @Override public void writeTo(DirectCodeBuilder writer) { - writer.writeIncrement(slot, constant); + writer.writeIncrement(op == Opcode.IINC_W, slot, constant); } @Override diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPseudoInstruction.java b/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPseudoInstruction.java index 00d817b8cb0cb..dc170ce72b501 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPseudoInstruction.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPseudoInstruction.java @@ -163,6 +163,7 @@ private abstract static sealed class AbstractLocalPseudo extends AbstractPseudoI protected final Label endScope; public AbstractLocalPseudo(int slot, Utf8Entry name, Utf8Entry descriptor, Label startScope, Label endScope) { + BytecodeHelpers.validateSlot(slot); this.slot = slot; this.name = name; this.descriptor = descriptor; diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/BytecodeHelpers.java b/src/java.base/share/classes/jdk/internal/classfile/impl/BytecodeHelpers.java index a5b4b55b05b27..6994a62c0ab06 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/BytecodeHelpers.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/BytecodeHelpers.java @@ -45,6 +45,7 @@ import java.lang.classfile.constantpool.MemberRefEntry; import java.lang.classfile.constantpool.MethodHandleEntry; import java.lang.classfile.constantpool.NameAndTypeEntry; +import java.util.Objects; import static jdk.internal.classfile.impl.RawBytecodeHelper.*; @@ -60,6 +61,14 @@ public static IllegalArgumentException cannotConvertException(TypeKind from, Typ return new IllegalArgumentException(String.format("convert %s -> %s", from, to)); } + public static IllegalArgumentException slotOutOfBounds(int slot) { + return new IllegalArgumentException("Invalid slot index :".concat(Integer.toString(slot))); + } + + public static IllegalArgumentException slotOutOfBounds(Opcode opcode, int slot) { + return new IllegalArgumentException("Invalid slot index %d for %s".formatted(slot, opcode)); + } + public static Opcode loadOpcode(TypeKind tk, int slot) { return switch (tk) { case INT, SHORT, BYTE, CHAR, BOOLEAN @@ -78,7 +87,13 @@ public static Opcode aload(int slot) { case 1 -> Opcode.ALOAD_1; case 2 -> Opcode.ALOAD_2; case 3 -> Opcode.ALOAD_3; - default -> (slot < 256) ? Opcode.ALOAD : Opcode.ALOAD_W; + default -> { + if ((slot & 0xFF) == slot) + yield Opcode.ALOAD; + if ((slot & 0xFFFF) == slot) + yield Opcode.ALOAD_W; + throw slotOutOfBounds(slot); + } }; } @@ -88,7 +103,13 @@ public static Opcode fload(int slot) { case 1 -> Opcode.FLOAD_1; case 2 -> Opcode.FLOAD_2; case 3 -> Opcode.FLOAD_3; - default -> (slot < 256) ? Opcode.FLOAD : Opcode.FLOAD_W; + default -> { + if ((slot & 0xFF) == slot) + yield Opcode.FLOAD; + if ((slot & 0xFFFF) == slot) + yield Opcode.FLOAD_W; + throw slotOutOfBounds(slot); + } }; } @@ -98,7 +119,13 @@ public static Opcode dload(int slot) { case 1 -> Opcode.DLOAD_1; case 2 -> Opcode.DLOAD_2; case 3 -> Opcode.DLOAD_3; - default -> (slot < 256) ? Opcode.DLOAD : Opcode.DLOAD_W; + default -> { + if ((slot & 0xFF) == slot) + yield Opcode.DLOAD; + if ((slot & 0xFFFF) == slot) + yield Opcode.DLOAD_W; + throw slotOutOfBounds(slot); + } }; } @@ -108,7 +135,13 @@ public static Opcode lload(int slot) { case 1 -> Opcode.LLOAD_1; case 2 -> Opcode.LLOAD_2; case 3 -> Opcode.LLOAD_3; - default -> (slot < 256) ? Opcode.LLOAD : Opcode.LLOAD_W; + default -> { + if ((slot & 0xFF) == slot) + yield Opcode.LLOAD; + if ((slot & 0xFFFF) == slot) + yield Opcode.LLOAD_W; + throw slotOutOfBounds(slot); + } }; } @@ -118,7 +151,13 @@ public static Opcode iload(int slot) { case 1 -> Opcode.ILOAD_1; case 2 -> Opcode.ILOAD_2; case 3 -> Opcode.ILOAD_3; - default -> (slot < 256) ? Opcode.ILOAD : Opcode.ILOAD_W; + default -> { + if ((slot & 0xFF) == slot) + yield Opcode.ILOAD; + if ((slot & 0xFFFF) == slot) + yield Opcode.ILOAD_W; + throw slotOutOfBounds(slot); + } }; } @@ -140,7 +179,13 @@ public static Opcode astore(int slot) { case 1 -> Opcode.ASTORE_1; case 2 -> Opcode.ASTORE_2; case 3 -> Opcode.ASTORE_3; - default -> (slot < 256) ? Opcode.ASTORE : Opcode.ASTORE_W; + default -> { + if ((slot & 0xFF) == slot) + yield Opcode.ASTORE; + if ((slot & 0xFFFF) == slot) + yield Opcode.ASTORE_W; + throw slotOutOfBounds(slot); + } }; } @@ -150,7 +195,13 @@ public static Opcode fstore(int slot) { case 1 -> Opcode.FSTORE_1; case 2 -> Opcode.FSTORE_2; case 3 -> Opcode.FSTORE_3; - default -> (slot < 256) ? Opcode.FSTORE : Opcode.FSTORE_W; + default -> { + if ((slot & 0xFF) == slot) + yield Opcode.FSTORE; + if ((slot & 0xFFFF) == slot) + yield Opcode.FSTORE_W; + throw slotOutOfBounds(slot); + } }; } @@ -160,7 +211,13 @@ public static Opcode dstore(int slot) { case 1 -> Opcode.DSTORE_1; case 2 -> Opcode.DSTORE_2; case 3 -> Opcode.DSTORE_3; - default -> (slot < 256) ? Opcode.DSTORE : Opcode.DSTORE_W; + default -> { + if ((slot & 0xFF) == slot) + yield Opcode.DSTORE; + if ((slot & 0xFFFF) == slot) + yield Opcode.DSTORE_W; + throw slotOutOfBounds(slot); + } }; } @@ -170,7 +227,13 @@ public static Opcode lstore(int slot) { case 1 -> Opcode.LSTORE_1; case 2 -> Opcode.LSTORE_2; case 3 -> Opcode.LSTORE_3; - default -> (slot < 256) ? Opcode.LSTORE : Opcode.LSTORE_W; + default -> { + if ((slot & 0xFF) == slot) + yield Opcode.LSTORE; + if ((slot & 0xFFFF) == slot) + yield Opcode.LSTORE_W; + throw slotOutOfBounds(slot); + } }; } @@ -180,7 +243,13 @@ public static Opcode istore(int slot) { case 1 -> Opcode.ISTORE_1; case 2 -> Opcode.ISTORE_2; case 3 -> Opcode.ISTORE_3; - default -> (slot < 256) ? Opcode.ISTORE : Opcode.ISTORE_W; + default -> { + if ((slot & 0xFF) == slot) + yield Opcode.ISTORE; + if ((slot & 0xFFFF) == slot) + yield Opcode.ISTORE_W; + throw slotOutOfBounds(slot); + } }; } @@ -305,6 +374,48 @@ public static TypeKind convertToType(Opcode opcode) { }; } + public static void validateSlot(Opcode opcode, int slot, boolean load) { + int size = opcode.sizeIfFixed(); + if (size == 1 && slot == (load ? intrinsicLoadSlot(opcode) : intrinsicStoreSlot(opcode)) || + size == 2 && slot == (slot & 0xFF) || + size == 4 && slot == (slot & 0xFFFF)) + return; + throw slotOutOfBounds(opcode, slot); + } + + public static void validateSlot(int slot) { + if ((slot & 0xFFFF) != slot) + throw slotOutOfBounds(slot); + } + + public static boolean validateAndIsWideIinc(int slot, int val) { + var ret = false; + if ((slot & 0xFF) != slot) { + validateSlot(slot); + ret = true; + } + if ((byte) val != val) { + if ((short) val != val) { + throw new IllegalArgumentException("cannot encode as S2: ".concat(String.valueOf(val))); + } + ret = true; + } + return ret; + } + + public static void validateRet(Opcode opcode, int slot) { + if (opcode == Opcode.RET && slot == (slot & 0xFF) || + opcode == Opcode.RET_W && slot == (slot & 0xFFFF)) + return; + Objects.requireNonNull(opcode); + throw slotOutOfBounds(opcode, slot); + } + + public static void validateMultiArrayDimensions(int value) { + if (value < 1 || value > 0xFF) + throw new IllegalArgumentException("Not a valid array dimension: ".concat(String.valueOf(value))); + } + public static void validateSipush(int value) { if (value != (short) value) throw new IllegalArgumentException( diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/CodeImpl.java b/src/java.base/share/classes/jdk/internal/classfile/impl/CodeImpl.java index 48394d3da96c3..aa9603b150855 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/CodeImpl.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/CodeImpl.java @@ -55,13 +55,13 @@ public final class CodeImpl case ARRAY_STORE -> ArrayStoreInstruction.of(o); case CONSTANT -> ConstantInstruction.ofIntrinsic(o); case CONVERT -> ConvertInstruction.of(o); - case LOAD -> LoadInstruction.of(o, BytecodeHelpers.intrinsicLoadSlot(o)); + case LOAD -> new AbstractInstruction.UnboundLoadInstruction(o, BytecodeHelpers.intrinsicLoadSlot(o)); case MONITOR -> MonitorInstruction.of(o); case NOP -> NopInstruction.of(); case OPERATOR -> OperatorInstruction.of(o); case RETURN -> ReturnInstruction.of(o); case STACK -> StackInstruction.of(o); - case STORE -> StoreInstruction.of(o, BytecodeHelpers.intrinsicStoreSlot(o)); + case STORE -> new AbstractInstruction.UnboundStoreInstruction(o, BytecodeHelpers.intrinsicStoreSlot(o)); case THROW_EXCEPTION -> ThrowInstruction.of(); default -> throw new AssertionError("invalid opcode: " + o); }; diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java b/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java index 301b61241f71e..ee312a97dad80 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java @@ -506,12 +506,12 @@ public void writeLocalVar(Opcode opcode, int localVar) { } } - public void writeIncrement(int slot, int val) { - Opcode opcode = (slot < 256 && val < 128 && val > -127) - ? IINC - : IINC_W; - writeBytecode(opcode); - if (opcode.isWide()) { + public void writeIncrement(boolean wide, int slot, int val) { + if (wide) { + bytecodesBufWriter.writeU1(RawBytecodeHelper.WIDE); + } + bytecodesBufWriter.writeU1(RawBytecodeHelper.IINC); + if (wide) { bytecodesBufWriter.writeU2(slot); bytecodesBufWriter.writeU2(val); } else { @@ -1216,7 +1216,7 @@ public CodeBuilder idiv() { @Override public CodeBuilder iinc(int slot, int val) { - writeIncrement(slot, val); + writeIncrement(validateAndIsWideIinc(slot, val), slot, val); return this; } diff --git a/test/jdk/jdk/classfile/InstructionValidationTest.java b/test/jdk/jdk/classfile/InstructionValidationTest.java new file mode 100644 index 0000000000000..17210e1173b3a --- /dev/null +++ b/test/jdk/jdk/classfile/InstructionValidationTest.java @@ -0,0 +1,182 @@ +/* + * 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 + * 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 8341277 + * @summary Testing ClassFile instruction argument validation. + * @run junit InstructionValidationTest + */ + +import java.lang.classfile.*; +import java.lang.classfile.constantpool.ClassEntry; +import java.lang.classfile.constantpool.ConstantPoolBuilder; +import java.lang.classfile.instruction.*; +import java.util.List; +import java.util.function.ObjIntConsumer; +import java.util.stream.Stream; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.function.Executable; + +import static java.lang.constant.ConstantDescs.*; +import static org.junit.jupiter.api.Assertions.*; +import static java.lang.classfile.Opcode.*; +import static org.junit.jupiter.api.Assertions.assertThrows; + +class InstructionValidationTest { + + @Test + void testArgumentConstant() { + assertDoesNotThrow(() -> ConstantInstruction.ofArgument(SIPUSH, 0)); + assertDoesNotThrow(() -> ConstantInstruction.ofArgument(SIPUSH, Short.MIN_VALUE)); + assertDoesNotThrow(() -> ConstantInstruction.ofArgument(SIPUSH, Short.MAX_VALUE)); + assertDoesNotThrow(() -> ConstantInstruction.ofArgument(BIPUSH, 0)); + assertDoesNotThrow(() -> ConstantInstruction.ofArgument(BIPUSH, Byte.MIN_VALUE)); + assertDoesNotThrow(() -> ConstantInstruction.ofArgument(BIPUSH, Byte.MAX_VALUE)); + + assertThrows(IllegalArgumentException.class, () -> ConstantInstruction.ofArgument(SIPUSH, (int) Short.MIN_VALUE - 1)); + assertThrows(IllegalArgumentException.class, () -> ConstantInstruction.ofArgument(SIPUSH, (int) Short.MAX_VALUE + 1)); + assertThrows(IllegalArgumentException.class, () -> ConstantInstruction.ofArgument(BIPUSH, (int) Byte.MIN_VALUE - 1)); + assertThrows(IllegalArgumentException.class, () -> ConstantInstruction.ofArgument(BIPUSH, (int) Byte.MAX_VALUE + 1)); + } + + /** + * Tests the bad slot argument IAE for load, store, increment, and ret. + */ + @Test + void testSlots() { + record Result(boolean shouldFail, int slot) { + } + + List badSlots = List.of(-1, 72694, -42, 0x10000, Integer.MIN_VALUE, Integer.MAX_VALUE); + List u2OnlySlots = List.of(0x100, 1000, 0xFFFF); + List u1Slots = List.of(0, 2, 15, 0xFF); + + List badU1Slots = Stream.concat(badSlots.stream(), u2OnlySlots.stream()).toList(); + List u2Slots = Stream.concat(u1Slots.stream(), u2OnlySlots.stream()).toList(); + List u2Cases = Stream.concat( + badSlots.stream().map(i -> new Result(true, i)), + u2Slots.stream().map(i -> new Result(false, i)) + ).toList(); + List u1Cases = Stream.concat( + badU1Slots.stream().map(i -> new Result(true, i)), + u1Slots.stream().map(i -> new Result(false, i)) + ).toList(); + List nonIntrinsicValues = Stream.of(badSlots, u2Slots, u1Slots).mapMulti(List::forEach) + .filter(i -> i < 0 || i > 3).toList(); + + Label[] capture = new Label[1]; + ClassFile.of().build(CD_Object, clb -> clb.withMethodBody("test", MTD_void, 0, cob -> { + capture[0] = cob.startLabel(); + cob.return_(); + })); + Label dummyLabel = capture[0]; + + List> cbFactories = List.of( + CodeBuilder::aload, + CodeBuilder::iload, + CodeBuilder::lload, + CodeBuilder::dload, + CodeBuilder::fload, + CodeBuilder::astore, + CodeBuilder::istore, + CodeBuilder::lstore, + CodeBuilder::dstore, + CodeBuilder::fstore + ); + + for (var r : u2Cases) { + var fails = r.shouldFail; + var i = r.slot; + for (var fac : cbFactories) { + //check(fails, () -> execute(cob -> fac.accept(cob, i))); + } + for (TypeKind tk : TypeKind.values()) { + if (tk == TypeKind.VOID) + continue; + //check(fails, () -> execute(cob -> cob.loadLocal(tk, i))); + //check(fails, () -> execute(cob -> cob.storeLocal(tk, i))); + check(fails, () -> LoadInstruction.of(tk, i)); + check(fails, () -> StoreInstruction.of(tk, i)); + } + //check(fails, () -> execute(cob -> cob.iinc(i, 1))); + check(fails, () -> IncrementInstruction.of(i, 1)); + check(fails, () -> DiscontinuedInstruction.RetInstruction.of(i)); + check(fails, () -> DiscontinuedInstruction.RetInstruction.of(RET_W, i)); + check(fails, () -> LocalVariable.of(i, "test", CD_Object, dummyLabel, dummyLabel)); + check(fails, () -> LocalVariableType.of(i, "test", Signature.of(CD_Object), dummyLabel, dummyLabel)); + } + + for (var r : u1Cases) { + var fails = r.shouldFail; + var i = r.slot; + for (var u1Op : List.of(ALOAD, ILOAD, LLOAD, FLOAD, DLOAD)) + check(fails, () -> LoadInstruction.of(u1Op, i)); + for (var u1Op : List.of(ASTORE, ISTORE, LSTORE, FSTORE, DSTORE)) + check(fails, () -> StoreInstruction.of(u1Op, i)); + check(fails, () -> DiscontinuedInstruction.RetInstruction.of(RET, i)); + } + + for (var i : nonIntrinsicValues) { + for (var intrinsicOp : List.of(ALOAD_0, ILOAD_0, LLOAD_0, FLOAD_0, DLOAD_0, ALOAD_1, ILOAD_1, LLOAD_1, FLOAD_1, DLOAD_1, + ALOAD_2, ILOAD_2, LLOAD_2, FLOAD_2, DLOAD_2, ALOAD_3, ILOAD_3, LLOAD_3, FLOAD_3, DLOAD_3)) { + assertThrows(IllegalArgumentException.class, () -> LoadInstruction.of(intrinsicOp, i)); + } + for (var intrinsicOp : List.of(ASTORE_0, ISTORE_0, LSTORE_0, FSTORE_0, DSTORE_0, ASTORE_1, ISTORE_1, LSTORE_1, FSTORE_1, DSTORE_1, + ASTORE_2, ISTORE_2, LSTORE_2, FSTORE_2, DSTORE_2, ASTORE_3, ISTORE_3, LSTORE_3, FSTORE_3, DSTORE_3)) { + assertThrows(IllegalArgumentException.class, () -> StoreInstruction.of(intrinsicOp, i)); + } + } + } + + static void check(boolean fails, Executable exec) { + if (fails) { + assertThrows(IllegalArgumentException.class, exec); + } else { + assertDoesNotThrow(exec); + } + } + + @Test + void testIincConstant() { + IncrementInstruction.of(0, 2); + IncrementInstruction.of(0, Short.MAX_VALUE); + IncrementInstruction.of(0, Short.MIN_VALUE); + assertThrows(IllegalArgumentException.class, () -> IncrementInstruction.of(0, Short.MAX_VALUE + 1)); + assertThrows(IllegalArgumentException.class, () -> IncrementInstruction.of(0, Short.MIN_VALUE - 1)); + } + + @Test + void testNewMultiArrayDimension() { + ClassEntry ce = ConstantPoolBuilder.of().classEntry(CD_Class); + NewMultiArrayInstruction.of(ce, 1); + NewMultiArrayInstruction.of(ce, 13); + NewMultiArrayInstruction.of(ce, 0xFF); + assertThrows(IllegalArgumentException.class, () -> NewMultiArrayInstruction.of(ce, 0)); + assertThrows(IllegalArgumentException.class, () -> NewMultiArrayInstruction.of(ce, 0x100)); + assertThrows(IllegalArgumentException.class, () -> NewMultiArrayInstruction.of(ce, -1)); + assertThrows(IllegalArgumentException.class, () -> NewMultiArrayInstruction.of(ce, Integer.MIN_VALUE)); + assertThrows(IllegalArgumentException.class, () -> NewMultiArrayInstruction.of(ce, Integer.MAX_VALUE)); + } +} diff --git a/test/jdk/jdk/classfile/OpcodesValidationTest.java b/test/jdk/jdk/classfile/OpcodesValidationTest.java deleted file mode 100644 index 2470fcf132c54..0000000000000 --- a/test/jdk/jdk/classfile/OpcodesValidationTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 - * 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 Testing ClassFile constant instruction argument validation. - * @run junit OpcodesValidationTest - */ -import java.lang.classfile.instruction.ConstantInstruction; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; -import static java.lang.classfile.Opcode.*; - -class OpcodesValidationTest { - - @Test - void testArgumentConstant() { - assertDoesNotThrow(() -> ConstantInstruction.ofArgument(SIPUSH, 0)); - assertDoesNotThrow(() -> ConstantInstruction.ofArgument(SIPUSH, Short.MIN_VALUE)); - assertDoesNotThrow(() -> ConstantInstruction.ofArgument(SIPUSH, Short.MAX_VALUE)); - assertDoesNotThrow(() -> ConstantInstruction.ofArgument(BIPUSH, 0)); - assertDoesNotThrow(() -> ConstantInstruction.ofArgument(BIPUSH, Byte.MIN_VALUE)); - assertDoesNotThrow(() -> ConstantInstruction.ofArgument(BIPUSH, Byte.MAX_VALUE)); - - assertThrows(IllegalArgumentException.class, () -> ConstantInstruction.ofArgument(SIPUSH, (int)Short.MIN_VALUE - 1)); - assertThrows(IllegalArgumentException.class, () -> ConstantInstruction.ofArgument(SIPUSH, (int)Short.MAX_VALUE + 1)); - assertThrows(IllegalArgumentException.class, () -> ConstantInstruction.ofArgument(BIPUSH, (int)Byte.MIN_VALUE - 1)); - assertThrows(IllegalArgumentException.class, () -> ConstantInstruction.ofArgument(BIPUSH, (int)Byte.MAX_VALUE + 1)); - } -} From 90c944fefe4a7827c08a8e6a81f137c3157a749b Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Wed, 2 Oct 2024 07:11:10 +0000 Subject: [PATCH 271/307] 8340824: C2: Memory for TypeInterfaces not reclaimed by hashcons() Reviewed-by: vlivanov, qamai --- src/hotspot/share/opto/type.cpp | 143 ++++++++++++++++---------------- src/hotspot/share/opto/type.hpp | 10 +-- 2 files changed, 78 insertions(+), 75 deletions(-) diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp index 967b4a815d09e..73f852c0f047d 100644 --- a/src/hotspot/share/opto/type.cpp +++ b/src/hotspot/share/opto/type.cpp @@ -3260,23 +3260,28 @@ void TypeRawPtr::dump2( Dict &d, uint depth, outputStream *st ) const { // Convenience common pre-built type. const TypeOopPtr *TypeOopPtr::BOTTOM; -TypeInterfaces::TypeInterfaces() - : Type(Interfaces), _list(Compile::current()->type_arena(), 0, 0, nullptr), +TypeInterfaces::TypeInterfaces(ciInstanceKlass** interfaces_base, int nb_interfaces) + : Type(Interfaces), _interfaces(interfaces_base, nb_interfaces), _hash(0), _exact_klass(nullptr) { - DEBUG_ONLY(_initialized = true); -} - -TypeInterfaces::TypeInterfaces(GrowableArray* interfaces) - : Type(Interfaces), _list(Compile::current()->type_arena(), interfaces->length(), 0, nullptr), - _hash(0), _exact_klass(nullptr) { - for (int i = 0; i < interfaces->length(); i++) { - add(interfaces->at(i)); - } + _interfaces.sort(compare); initialize(); } const TypeInterfaces* TypeInterfaces::make(GrowableArray* interfaces) { - TypeInterfaces* result = (interfaces == nullptr) ? new TypeInterfaces() : new TypeInterfaces(interfaces); + // hashcons() can only delete the last thing that was allocated: to + // make sure all memory for the newly created TypeInterfaces can be + // freed if an identical one exists, allocate space for the array of + // interfaces right after the TypeInterfaces object so that they + // form a contiguous piece of memory. + int nb_interfaces = interfaces == nullptr ? 0 : interfaces->length(); + size_t total_size = sizeof(TypeInterfaces) + nb_interfaces * sizeof(ciInstanceKlass*); + + void* allocated_mem = operator new(total_size); + ciInstanceKlass** interfaces_base = (ciInstanceKlass**)((char*)allocated_mem + sizeof(TypeInterfaces)); + for (int i = 0; i < nb_interfaces; ++i) { + interfaces_base[i] = interfaces->at(i); + } + TypeInterfaces* result = ::new (allocated_mem) TypeInterfaces(interfaces_base, nb_interfaces); return (const TypeInterfaces*)result->hashcons(); } @@ -3295,20 +3300,18 @@ int TypeInterfaces::compare(ciInstanceKlass* const& k1, ciInstanceKlass* const& return 0; } -void TypeInterfaces::add(ciInstanceKlass* interface) { - assert(interface->is_interface(), "for interfaces only"); - _list.insert_sorted(interface); - verify(); +int TypeInterfaces::compare(ciInstanceKlass** k1, ciInstanceKlass** k2) { + return compare(*k1, *k2); } bool TypeInterfaces::eq(const Type* t) const { const TypeInterfaces* other = (const TypeInterfaces*)t; - if (_list.length() != other->_list.length()) { + if (_interfaces.length() != other->_interfaces.length()) { return false; } - for (int i = 0; i < _list.length(); i++) { - ciKlass* k1 = _list.at(i); - ciKlass* k2 = other->_list.at(i); + for (int i = 0; i < _interfaces.length(); i++) { + ciKlass* k1 = _interfaces.at(i); + ciKlass* k2 = other->_interfaces.at(i); if (!k1->equals(k2)) { return false; } @@ -3319,12 +3322,12 @@ bool TypeInterfaces::eq(const Type* t) const { bool TypeInterfaces::eq(ciInstanceKlass* k) const { assert(k->is_loaded(), "should be loaded"); GrowableArray* interfaces = k->transitive_interfaces(); - if (_list.length() != interfaces->length()) { + if (_interfaces.length() != interfaces->length()) { return false; } for (int i = 0; i < interfaces->length(); i++) { bool found = false; - _list.find_sorted(interfaces->at(i), found); + _interfaces.find_sorted(interfaces->at(i), found); if (!found) { return false; } @@ -3344,8 +3347,8 @@ const Type* TypeInterfaces::xdual() const { void TypeInterfaces::compute_hash() { uint hash = 0; - for (int i = 0; i < _list.length(); i++) { - ciKlass* k = _list.at(i); + for (int i = 0; i < _interfaces.length(); i++) { + ciKlass* k = _interfaces.at(i); hash += k->hash(); } _hash = hash; @@ -3356,13 +3359,13 @@ static int compare_interfaces(ciInstanceKlass** k1, ciInstanceKlass** k2) { } void TypeInterfaces::dump(outputStream* st) const { - if (_list.length() == 0) { + if (_interfaces.length() == 0) { return; } ResourceMark rm; st->print(" ("); GrowableArray interfaces; - interfaces.appendAll(&_list); + interfaces.appendAll(&_interfaces); // Sort the interfaces so they are listed in the same order from one run to the other of the same compilation interfaces.sort(compare_interfaces); for (int i = 0; i < interfaces.length(); i++) { @@ -3377,9 +3380,9 @@ void TypeInterfaces::dump(outputStream* st) const { #ifdef ASSERT void TypeInterfaces::verify() const { - for (int i = 1; i < _list.length(); i++) { - ciInstanceKlass* k1 = _list.at(i-1); - ciInstanceKlass* k2 = _list.at(i); + for (int i = 1; i < _interfaces.length(); i++) { + ciInstanceKlass* k1 = _interfaces.at(i-1); + ciInstanceKlass* k2 = _interfaces.at(i); assert(compare(k2, k1) > 0, "should be ordered"); assert(k1 != k2, "no duplicate"); } @@ -3390,23 +3393,23 @@ const TypeInterfaces* TypeInterfaces::union_with(const TypeInterfaces* other) co GrowableArray result_list; int i = 0; int j = 0; - while (i < _list.length() || j < other->_list.length()) { - while (i < _list.length() && - (j >= other->_list.length() || - compare(_list.at(i), other->_list.at(j)) < 0)) { - result_list.push(_list.at(i)); + while (i < _interfaces.length() || j < other->_interfaces.length()) { + while (i < _interfaces.length() && + (j >= other->_interfaces.length() || + compare(_interfaces.at(i), other->_interfaces.at(j)) < 0)) { + result_list.push(_interfaces.at(i)); i++; } - while (j < other->_list.length() && - (i >= _list.length() || - compare(other->_list.at(j), _list.at(i)) < 0)) { - result_list.push(other->_list.at(j)); + while (j < other->_interfaces.length() && + (i >= _interfaces.length() || + compare(other->_interfaces.at(j), _interfaces.at(i)) < 0)) { + result_list.push(other->_interfaces.at(j)); j++; } - if (i < _list.length() && - j < other->_list.length() && - _list.at(i) == other->_list.at(j)) { - result_list.push(_list.at(i)); + if (i < _interfaces.length() && + j < other->_interfaces.length() && + _interfaces.at(i) == other->_interfaces.at(j)) { + result_list.push(_interfaces.at(i)); i++; j++; } @@ -3414,14 +3417,14 @@ const TypeInterfaces* TypeInterfaces::union_with(const TypeInterfaces* other) co const TypeInterfaces* result = TypeInterfaces::make(&result_list); #ifdef ASSERT result->verify(); - for (int i = 0; i < _list.length(); i++) { - assert(result->_list.contains(_list.at(i)), "missing"); + for (int i = 0; i < _interfaces.length(); i++) { + assert(result->_interfaces.contains(_interfaces.at(i)), "missing"); } - for (int i = 0; i < other->_list.length(); i++) { - assert(result->_list.contains(other->_list.at(i)), "missing"); + for (int i = 0; i < other->_interfaces.length(); i++) { + assert(result->_interfaces.contains(other->_interfaces.at(i)), "missing"); } - for (int i = 0; i < result->_list.length(); i++) { - assert(_list.contains(result->_list.at(i)) || other->_list.contains(result->_list.at(i)), "missing"); + for (int i = 0; i < result->_interfaces.length(); i++) { + assert(_interfaces.contains(result->_interfaces.at(i)) || other->_interfaces.contains(result->_interfaces.at(i)), "missing"); } #endif return result; @@ -3431,21 +3434,21 @@ const TypeInterfaces* TypeInterfaces::intersection_with(const TypeInterfaces* ot GrowableArray result_list; int i = 0; int j = 0; - while (i < _list.length() || j < other->_list.length()) { - while (i < _list.length() && - (j >= other->_list.length() || - compare(_list.at(i), other->_list.at(j)) < 0)) { + while (i < _interfaces.length() || j < other->_interfaces.length()) { + while (i < _interfaces.length() && + (j >= other->_interfaces.length() || + compare(_interfaces.at(i), other->_interfaces.at(j)) < 0)) { i++; } - while (j < other->_list.length() && - (i >= _list.length() || - compare(other->_list.at(j), _list.at(i)) < 0)) { + while (j < other->_interfaces.length() && + (i >= _interfaces.length() || + compare(other->_interfaces.at(j), _interfaces.at(i)) < 0)) { j++; } - if (i < _list.length() && - j < other->_list.length() && - _list.at(i) == other->_list.at(j)) { - result_list.push(_list.at(i)); + if (i < _interfaces.length() && + j < other->_interfaces.length() && + _interfaces.at(i) == other->_interfaces.at(j)) { + result_list.push(_interfaces.at(i)); i++; j++; } @@ -3453,14 +3456,14 @@ const TypeInterfaces* TypeInterfaces::intersection_with(const TypeInterfaces* ot const TypeInterfaces* result = TypeInterfaces::make(&result_list); #ifdef ASSERT result->verify(); - for (int i = 0; i < _list.length(); i++) { - assert(!other->_list.contains(_list.at(i)) || result->_list.contains(_list.at(i)), "missing"); + for (int i = 0; i < _interfaces.length(); i++) { + assert(!other->_interfaces.contains(_interfaces.at(i)) || result->_interfaces.contains(_interfaces.at(i)), "missing"); } - for (int i = 0; i < other->_list.length(); i++) { - assert(!_list.contains(other->_list.at(i)) || result->_list.contains(other->_list.at(i)), "missing"); + for (int i = 0; i < other->_interfaces.length(); i++) { + assert(!_interfaces.contains(other->_interfaces.at(i)) || result->_interfaces.contains(other->_interfaces.at(i)), "missing"); } - for (int i = 0; i < result->_list.length(); i++) { - assert(_list.contains(result->_list.at(i)) && other->_list.contains(result->_list.at(i)), "missing"); + for (int i = 0; i < result->_interfaces.length(); i++) { + assert(_interfaces.contains(result->_interfaces.at(i)) && other->_interfaces.contains(result->_interfaces.at(i)), "missing"); } #endif return result; @@ -3473,13 +3476,13 @@ ciInstanceKlass* TypeInterfaces::exact_klass() const { } void TypeInterfaces::compute_exact_klass() { - if (_list.length() == 0) { + if (_interfaces.length() == 0) { _exact_klass = nullptr; return; } ciInstanceKlass* res = nullptr; - for (int i = 0; i < _list.length(); i++) { - ciInstanceKlass* interface = _list.at(i); + for (int i = 0; i < _interfaces.length(); i++) { + ciInstanceKlass* interface = _interfaces.at(i); if (eq(interface)) { assert(res == nullptr, ""); res = interface; @@ -3490,8 +3493,8 @@ void TypeInterfaces::compute_exact_klass() { #ifdef ASSERT void TypeInterfaces::verify_is_loaded() const { - for (int i = 0; i < _list.length(); i++) { - ciKlass* interface = _list.at(i); + for (int i = 0; i < _interfaces.length(); i++) { + ciKlass* interface = _interfaces.at(i); assert(interface->is_loaded(), "Interface not loaded"); } } diff --git a/src/hotspot/share/opto/type.hpp b/src/hotspot/share/opto/type.hpp index b9883d5139136..902155e975d16 100644 --- a/src/hotspot/share/opto/type.hpp +++ b/src/hotspot/share/opto/type.hpp @@ -877,19 +877,18 @@ class TypeVectMask : public TypeVect { // Set of implemented interfaces. Referenced from TypeOopPtr and TypeKlassPtr. class TypeInterfaces : public Type { private: - GrowableArray _list; + GrowableArrayFromArray _interfaces; uint _hash; ciInstanceKlass* _exact_klass; DEBUG_ONLY(bool _initialized;) void initialize(); - void add(ciInstanceKlass* interface); void verify() const NOT_DEBUG_RETURN; void compute_hash(); void compute_exact_klass(); - TypeInterfaces(); - TypeInterfaces(GrowableArray* interfaces); + + TypeInterfaces(ciInstanceKlass** interfaces_base, int nb_interfaces); NONCOPYABLE(TypeInterfaces); public: @@ -904,12 +903,13 @@ class TypeInterfaces : public Type { bool contains(const TypeInterfaces* other) const { return intersection_with(other)->eq(other); } - bool empty() const { return _list.length() == 0; } + bool empty() const { return _interfaces.length() == 0; } ciInstanceKlass* exact_klass() const; void verify_is_loaded() const NOT_DEBUG_RETURN; static int compare(ciInstanceKlass* const& k1, ciInstanceKlass* const& k2); + static int compare(ciInstanceKlass** k1, ciInstanceKlass** k2); const Type* xmeet(const Type* t) const; From 52c2ea65c4ab6a2d25e9de465fbf20034fe79028 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Wed, 2 Oct 2024 07:48:22 +0000 Subject: [PATCH 272/307] 8340732: RISC-V: Refactor crc32 scalar version Reviewed-by: fyang --- .../cpu/riscv/macroAssembler_riscv.cpp | 62 ++++++++----------- src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 17 ++--- 2 files changed, 31 insertions(+), 48 deletions(-) diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index 32a446959a246..b99ba542423a1 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -1564,7 +1564,10 @@ 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_vector_entry, L_unroll_loop, L_unroll_loop_entry, L_by4, L_by4_loop, L_by1, L_by1_loop, L_exit; + Label L_vector_entry, + L_unroll_loop, + L_by4_loop_entry, L_by4_loop, + L_by1_loop, L_exit; const int64_t single_table_size = 256; const int64_t unroll = 16; @@ -1585,21 +1588,17 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len, bge(len, tmp1, L_vector_entry); } #endif // COMPILER2 - 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); - bgt(len, zr, L_by1_loop); - j(L_exit); + mv(tmp1, unroll_words); + blt(len, tmp1, L_by4_loop_entry); + + const Register loop_buf_end = tmp3; align(CodeEntryAlignment); - bind(L_unroll_loop_entry); - const Register buf_end = tmp3; - add(buf_end, buf, len); // buf_end will be used as endpoint for loop below + // Entry for L_unroll_loop + add(loop_buf_end, buf, len); // loop_buf_end will be used as endpoint for loop below andi(len, len, unroll_words-1); // len = (len % unroll_words) - sub(len, len, unroll_words); // Length after all iterations + sub(loop_buf_end, loop_buf_end, len); bind(L_unroll_loop); for (int i = 0; i < unroll; i++) { ld(tmp1, Address(buf, i*wordSize)); @@ -1608,57 +1607,50 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len, } addi(buf, buf, unroll_words); - ble(buf, buf_end, L_unroll_loop); - addiw(len, len, unroll_words-4); - bge(len, zr, L_by4_loop); - addiw(len, len, 4); - bgt(len, zr, L_by1_loop); - j(L_exit); - + blt(buf, loop_buf_end, L_unroll_loop); + + bind(L_by4_loop_entry); + mv(tmp1, 4); + blt(len, tmp1, L_by1_loop); + add(loop_buf_end, buf, len); // loop_buf_end will be used as endpoint for loop below + andi(len, len, 3); + sub(loop_buf_end, loop_buf_end, len); bind(L_by4_loop); lwu(tmp1, Address(buf)); update_word_crc32(crc, tmp1, tmp2, tmp4, tmp6, table0, table1, table2, table3, false); - subw(len, len, 4); addi(buf, buf, 4); - bge(len, zr, L_by4_loop); - addiw(len, len, 4); - ble(len, zr, L_exit); + blt(buf, loop_buf_end, L_by4_loop); bind(L_by1_loop); + beqz(len, L_exit); + subw(len, len, 1); lwu(tmp1, Address(buf)); andi(tmp2, tmp1, right_8_bits); update_byte_crc32(crc, tmp2, table0); - ble(len, zr, L_exit); + beqz(len, L_exit); subw(len, len, 1); srli(tmp2, tmp1, 8); andi(tmp2, tmp2, right_8_bits); update_byte_crc32(crc, tmp2, table0); - ble(len, zr, L_exit); + beqz(len, L_exit); subw(len, len, 1); srli(tmp2, tmp1, 16); andi(tmp2, tmp2, right_8_bits); update_byte_crc32(crc, tmp2, table0); - ble(len, zr, L_exit); - - srli(tmp2, tmp1, 24); - andi(tmp2, tmp2, right_8_bits); - update_byte_crc32(crc, tmp2, table0); #ifdef COMPILER2 // 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`. + // only need to jump exit when UseRVV == true, it's a jump from end of block `L_by1_loop`. + j(L_exit); 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); + bgtz(len, L_by4_loop_entry); } #endif // COMPILER2 diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index d4ec76da94315..5970111088fd1 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp @@ -6092,26 +6092,17 @@ static const int64_t right_3_bits = right_n_bits(3); address start = __ pc(); + // input parameters const Register crc = c_rarg0; // crc const Register buf = c_rarg1; // source java byte array address const Register len = c_rarg2; // length - const Register table0 = c_rarg3; // crc_table address - const Register table1 = c_rarg4; - const Register table2 = c_rarg5; - const Register table3 = c_rarg6; - - const Register tmp1 = c_rarg7; - const Register tmp2 = t2; - const Register tmp3 = x28; // t3 - const Register tmp4 = x29; // t4 - const Register tmp5 = x30; // t5 - const Register tmp6 = x31; // t6 BLOCK_COMMENT("Entry:"); __ enter(); // required for proper stackwalking of RuntimeStub frame - __ kernel_crc32(crc, buf, len, table0, table1, table2, - table3, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); + __ kernel_crc32(crc, buf, len, + c_rarg3, c_rarg4, c_rarg5, c_rarg6, // tmp's for tables + c_rarg7, t2, x28, x29, x30, x31); // misc tmps __ leave(); // required for proper stackwalking of RuntimeStub frame __ ret(); From efe3573b9b4ecec0630fdc1c61c765713a5b68e6 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Wed, 2 Oct 2024 07:58:17 +0000 Subject: [PATCH 273/307] 8340109: Ubsan: ciEnv.cpp:1660:65: runtime error: member call on null pointer of type 'struct CompileTask' Reviewed-by: kvn, lucy --- src/hotspot/share/ci/ciEnv.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp index 9caf89628ccfd..155ce032400e8 100644 --- a/src/hotspot/share/ci/ciEnv.cpp +++ b/src/hotspot/share/ci/ciEnv.cpp @@ -1616,7 +1616,10 @@ void ciEnv::dump_replay_data_helper(outputStream* out) { for (int i = 0; i < objects->length(); i++) { objects->at(i)->dump_replay_data(out); } - dump_compile_data(out); + + if (this->task() != nullptr) { + dump_compile_data(out); + } out->flush(); } From c8c4ff2035c4e19a71f4395d23f036ba88d2e291 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Wed, 2 Oct 2024 08:14:48 +0000 Subject: [PATCH 274/307] 8341135: Incorrect format string after JDK-8339475 Reviewed-by: shade, clanger, alanb --- src/java.base/macosx/native/libjli/java_md_macosx.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 d8742aa1204d5..7aeb32be859f2 100644 --- a/src/java.base/macosx/native/libjli/java_md_macosx.m +++ b/src/java.base/macosx/native/libjli/java_md_macosx.m @@ -312,12 +312,12 @@ static void MacOSXStartup(int argc, char *argv[]) { pthread_t main_thr; rc = pthread_create(&main_thr, NULL, &apple_main, &args); if (rc != 0) { - JLI_ReportErrorMessageSys("Could not create main thread, return code: %s\n", rc); + JLI_ReportErrorMessageSys("Could not create main thread, return code: %d\n", rc); exit(1); } rc = pthread_detach(main_thr); if (rc != 0) { - JLI_ReportErrorMessage("pthread_detach() failed, return code: %s\n", rc); + JLI_ReportErrorMessage("pthread_detach() failed, return code: %d\n", rc); exit(1); } From a4ca6267e17815153f8fa119db19b97b1da2bd84 Mon Sep 17 00:00:00 2001 From: Feilong Jiang Date: Wed, 2 Oct 2024 09:14:31 +0000 Subject: [PATCH 275/307] 8341146: RISC-V: Unnecessary fences used for load-acquire in template interpreter Reviewed-by: fyang, rehn --- src/hotspot/cpu/riscv/templateTable_riscv.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/hotspot/cpu/riscv/templateTable_riscv.cpp b/src/hotspot/cpu/riscv/templateTable_riscv.cpp index 078f54adc3682..2e6902180a892 100644 --- a/src/hotspot/cpu/riscv/templateTable_riscv.cpp +++ b/src/hotspot/cpu/riscv/templateTable_riscv.cpp @@ -178,7 +178,6 @@ void TemplateTable::patch_bytecode(Bytecodes::Code bc, Register bc_reg, __ la(temp_reg, Address(temp_reg, in_bytes(ResolvedFieldEntry::put_code_offset()))); } // Load-acquire the bytecode to match store-release in ResolvedFieldEntry::fill_in() - __ membar(MacroAssembler::AnyAny); __ lbu(temp_reg, Address(temp_reg, 0)); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ mv(bc_reg, bc); @@ -320,7 +319,6 @@ void TemplateTable::ldc(LdcType type) { // get type __ addi(x13, x11, tags_offset); __ add(x13, x10, x13); - __ membar(MacroAssembler::AnyAny); __ lbu(x13, Address(x13, 0)); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); @@ -2189,7 +2187,6 @@ void TemplateTable::resolve_cache_and_index_for_method(int byte_no, break; } // Load-acquire the bytecode to match store-release in InterpreterRuntime - __ membar(MacroAssembler::AnyAny); __ lbu(temp, Address(temp, 0)); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); @@ -2241,7 +2238,6 @@ void TemplateTable::resolve_cache_and_index_for_field(int byte_no, __ la(temp, Address(Rcache, in_bytes(ResolvedFieldEntry::put_code_offset()))); } // Load-acquire the bytecode to match store-release in ResolvedFieldEntry::fill_in() - __ membar(MacroAssembler::AnyAny); __ lbu(temp, Address(temp, 0)); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ mv(t0, (int) code); // have we resolved this bytecode? @@ -2403,7 +2399,6 @@ void TemplateTable::load_invokedynamic_entry(Register method) { Label resolved; __ load_resolved_indy_entry(cache, index); - __ membar(MacroAssembler::AnyAny); __ ld(method, Address(cache, in_bytes(ResolvedIndyEntry::method_offset()))); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); @@ -2418,7 +2413,6 @@ void TemplateTable::load_invokedynamic_entry(Register method) { __ call_VM(noreg, entry, method); // Update registers with resolved info __ load_resolved_indy_entry(cache, index); - __ membar(MacroAssembler::AnyAny); __ ld(method, Address(cache, in_bytes(ResolvedIndyEntry::method_offset()))); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); @@ -3533,7 +3527,6 @@ void TemplateTable::_new() { const int tags_offset = Array::base_offset_in_bytes(); __ add(t0, x10, x13); __ la(t0, Address(t0, tags_offset)); - __ membar(MacroAssembler::AnyAny); __ lbu(t0, t0); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ sub(t1, t0, (u1)JVM_CONSTANT_Class); @@ -3651,7 +3644,6 @@ void TemplateTable::checkcast() { // See if bytecode has already been quicked __ add(t0, x13, Array::base_offset_in_bytes()); __ add(x11, t0, x9); - __ membar(MacroAssembler::AnyAny); __ lbu(x11, x11); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ sub(t0, x11, (u1)JVM_CONSTANT_Class); @@ -3707,7 +3699,6 @@ void TemplateTable::instanceof() { // See if bytecode has already been quicked __ add(t0, x13, Array::base_offset_in_bytes()); __ add(x11, t0, x9); - __ membar(MacroAssembler::AnyAny); __ lbu(x11, x11); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ sub(t0, x11, (u1)JVM_CONSTANT_Class); From d6820d1324711eac95a297dd68ec94e6f6be4b35 Mon Sep 17 00:00:00 2001 From: fabioromano1 <51378941+fabioromano1@users.noreply.github.com> Date: Wed, 2 Oct 2024 09:45:43 +0000 Subject: [PATCH 276/307] 8336274: MutableBigInteger.leftShift(int) optimization Reviewed-by: rgiulietti --- .../classes/java/math/MutableBigInteger.java | 133 +++++++----- .../MutableBigIntegerShiftTests.java | 191 ++++++++++++++++++ .../java/math/MutableBigIntegerBox.java | 180 +++++++++++++++++ 3 files changed, 451 insertions(+), 53 deletions(-) create mode 100644 test/jdk/java/math/BigInteger/MutableBigIntegerShiftTests.java create mode 100644 test/jdk/java/math/BigInteger/java.base/java/math/MutableBigIntegerBox.java diff --git a/src/java.base/share/classes/java/math/MutableBigInteger.java b/src/java.base/share/classes/java/math/MutableBigInteger.java index b84e50f567eb7..6ff435ba1ed3d 100644 --- a/src/java.base/share/classes/java/math/MutableBigInteger.java +++ b/src/java.base/share/classes/java/math/MutableBigInteger.java @@ -597,44 +597,52 @@ void leftShift(int n) { */ if (intLen == 0) return; + int nInts = n >>> 5; - int nBits = n&0x1F; - int bitsInHighWord = BigInteger.bitLengthForInt(value[offset]); + int nBits = n & 0x1F; + int leadingZeros = Integer.numberOfLeadingZeros(value[offset]); // If shift can be done without moving words, do so - if (n <= (32-bitsInHighWord)) { + if (n <= leadingZeros) { primitiveLeftShift(nBits); return; } - int newLen = intLen + nInts +1; - if (nBits <= (32-bitsInHighWord)) - newLen--; - if (value.length < newLen) { - // The array must grow - int[] result = new int[newLen]; - for (int i=0; i < intLen; i++) - result[i] = value[offset+i]; - setValue(result, newLen); - } else if (value.length - offset >= newLen) { - // Use space on right - for(int i=0; i < newLen - intLen; i++) - value[offset+intLen+i] = 0; + int newLen = intLen + nInts; + if (nBits > leadingZeros) + newLen++; + + int[] result; + final int newOffset; + if (value.length < newLen) { // The array must grow + result = new int[newLen]; + newOffset = 0; } else { - // Must use space on left - for (int i=0; i < intLen; i++) - value[i] = value[offset+i]; - for (int i=intLen; i < newLen; i++) - value[i] = 0; - offset = 0; + result = value; + newOffset = value.length - offset >= newLen ? offset : 0; } + + int trailingZerosPos = newOffset + intLen; + if (nBits != 0) { + // Do primitive shift directly for speed + if (nBits <= leadingZeros) { + primitiveLeftShift(nBits, result, newOffset); // newOffset <= offset + } else { + int lastInt = value[offset + intLen - 1]; + primitiveRightShift(32 - nBits, result, newOffset); // newOffset <= offset + result[trailingZerosPos++] = lastInt << nBits; + } + } else if (result != value || newOffset != offset) { + System.arraycopy(value, offset, result, newOffset, intLen); + } + + // Add trailing zeros + if (result == value) + Arrays.fill(result, trailingZerosPos, newOffset + newLen, 0); + + value = result; intLen = newLen; - if (nBits == 0) - return; - if (nBits <= (32-bitsInHighWord)) - primitiveLeftShift(nBits); - else - primitiveRightShift(32 -nBits); + offset = newOffset; } /** @@ -698,15 +706,30 @@ private int mulsubBorrow(int[] q, int[] a, int x, int len, int offset) { * less than 32. * Assumes that intLen > 0, n > 0 for speed */ - private final void primitiveRightShift(int n) { + private void primitiveRightShift(int n) { + primitiveRightShift(n, value, offset); + } + + /** + * Right shift this MutableBigInteger n bits, where n is + * less than 32, placing the result in the specified array. + * Assumes that intLen > 0, n > 0 for speed. + * The result can be the value array of this MutableBigInteger, + * but for speed the copy is not performed safely, so, in that case + * the caller has to make sure that + * {@code (resFrom <= offset || resFrom >= offset + intLen)}. + */ + private void primitiveRightShift(int n, int[] result, int resFrom) { int[] val = value; int n2 = 32 - n; - for (int i=offset+intLen-1, c=val[i]; i > offset; i--) { - int b = c; - c = val[i-1]; - val[i] = (c << n2) | (b >>> n); + + int b = val[offset]; + result[resFrom] = b >>> n; + for (int i = 1; i < intLen; i++) { + int c = b; + b = val[offset + i]; + result[resFrom + i] = (c << n2) | (b >>> n); } - val[offset] >>>= n; } /** @@ -714,15 +737,30 @@ private final void primitiveRightShift(int n) { * less than 32. * Assumes that intLen > 0, n > 0 for speed */ - private final void primitiveLeftShift(int n) { + private void primitiveLeftShift(int n) { + primitiveLeftShift(n, value, offset); + } + + /** + * Left shift this MutableBigInteger n bits, where n is + * less than 32, placing the result in the specified array. + * Assumes that intLen > 0, n > 0 for speed. + * The result can be the value array of this MutableBigInteger, + * but for speed the copy is not performed safely, so, in that case + * the caller has to make sure that + * {@code (resFrom <= offset || resFrom >= offset + intLen)}. + */ + private void primitiveLeftShift(int n, int[] result, int resFrom) { int[] val = value; int n2 = 32 - n; - for (int i=offset, c=val[i], m=i+intLen-1; i < m; i++) { - int b = c; - c = val[i+1]; - val[i] = (b << n) | (c >>> n2); + final int m = intLen - 1; + int b = val[offset]; + for (int i = 0; i < m; i++) { + int c = val[offset + i + 1]; + result[resFrom + i] = (b << n) | (c >>> n2); + b = c; } - val[offset+intLen-1] <<= n; + result[resFrom + m] = b << n; } /** @@ -1511,17 +1549,6 @@ long divide(long v, MutableBigInteger quotient) { } } - private static void copyAndShift(int[] src, int srcFrom, int srcLen, int[] dst, int dstFrom, int shift) { - int n2 = 32 - shift; - int c=src[srcFrom]; - for (int i=0; i < srcLen-1; i++) { - int b = c; - c = src[++srcFrom]; - dst[dstFrom+i] = (b << shift) | (c >>> n2); - } - dst[dstFrom+srcLen-1] = c << shift; - } - /** * Divide this MutableBigInteger by the divisor. * The quotient will be placed into the provided quotient object & @@ -1539,13 +1566,13 @@ private MutableBigInteger divideMagnitude(MutableBigInteger div, MutableBigInteger rem; // Remainder starts as dividend with space for a leading zero if (shift > 0) { divisor = new int[dlen]; - copyAndShift(div.value,div.offset,dlen,divisor,0,shift); + div.primitiveLeftShift(shift, divisor, 0); if (Integer.numberOfLeadingZeros(value[offset]) >= shift) { int[] remarr = new int[intLen + 1]; rem = new MutableBigInteger(remarr); rem.intLen = intLen; rem.offset = 1; - copyAndShift(value,offset,intLen,remarr,1,shift); + this.primitiveLeftShift(shift, remarr, 1); } else { int[] remarr = new int[intLen + 2]; rem = new MutableBigInteger(remarr); diff --git a/test/jdk/java/math/BigInteger/MutableBigIntegerShiftTests.java b/test/jdk/java/math/BigInteger/MutableBigIntegerShiftTests.java new file mode 100644 index 0000000000000..e64cae480d3f0 --- /dev/null +++ b/test/jdk/java/math/BigInteger/MutableBigIntegerShiftTests.java @@ -0,0 +1,191 @@ +/* + * 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. + */ + +import jdk.test.lib.RandomFactory; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.Arguments; + +import java.math.BigInteger; +import java.math.MutableBigIntegerBox; +import java.util.Arrays; +import java.util.Random; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static java.math.MutableBigIntegerBox.*; + +/** + * @test + * @bug 8336274 + * @summary Tests for correctness of MutableBigInteger.leftShift(int) + * @library /test/lib + * @build jdk.test.lib.RandomFactory + * @build java.base/java.math.MutableBigIntegerBox + * @key randomness + * @run junit MutableBigIntegerShiftTests + */ +public class MutableBigIntegerShiftTests { + + private static final int ORDER_SMALL = 60; + private static final int ORDER_MEDIUM = 100; + + private static final Random random = RandomFactory.getRandom(); + + private static int[] orders() { + return new int[] { ORDER_SMALL, ORDER_MEDIUM }; + } + + @ParameterizedTest + @MethodSource("orders") + public void shift(int order) { + for (int i = 0; i < 100; i++) { + test(fetchNumber(order), random.nextInt(200)); + } + } + + @ParameterizedTest + @MethodSource("pathTargetedCases") + public void test(MutableBigIntegerBox x, int n) { + leftShiftAssertions(x, n); + } + + private static Arguments[] pathTargetedCases() { + return new Arguments[] { + // intLen == 0 + Arguments.of(MutableBigIntegerBox.ZERO, + random.nextInt(33)), + // intLen != 0 && n <= leadingZeros + Arguments.of(new MutableBigIntegerBox(new int[] { (int) random.nextLong(1L, 1L << 16) }), + random.nextInt(1, 17)), + // intLen != 0 && n > leadingZeros && nBits <= leadingZeros && value.length < newLen && nBits == 0 + Arguments.of(new MutableBigIntegerBox(new int[] { (int) random.nextLong(1L, 1L << 32) }), + 32), + // intLen != 0 && n > leadingZeros && nBits <= leadingZeros && value.length < newLen && nBits != 0 + Arguments.of(new MutableBigIntegerBox(new int[] { (int) random.nextLong(1L, 1L << 16) }), + 32 + random.nextInt(1, 17)), + // intLen != 0 && n > leadingZeros && nBits <= leadingZeros && value.length >= newLen && nBits == 0 + // && newOffset != offset + Arguments.of(new MutableBigIntegerBox(new int[] { random.nextInt(), (int) random.nextLong(1L, 1L << 32) }, 1, 1), + 32), + // intLen != 0 && n > leadingZeros && nBits <= leadingZeros && value.length >= newLen && nBits == 0 + // && newOffset == offset + Arguments.of(new MutableBigIntegerBox(new int[] { (int) random.nextLong(1L, 1L << 32), random.nextInt() }, 0, 1), + 32), + // intLen != 0 && n > leadingZeros && nBits <= leadingZeros && value.length >= newLen && nBits != 0 + // && newOffset != offset + Arguments.of(new MutableBigIntegerBox(new int[] { random.nextInt(), (int) random.nextLong(1L, 1L << 16) }, 1, 1), + 32 + random.nextInt(1, 17)), + // intLen != 0 && n > leadingZeros && nBits <= leadingZeros && value.length >= newLen && nBits != 0 + // && newOffset == offset + Arguments.of(new MutableBigIntegerBox(new int[] { (int) random.nextLong(1L, 1L << 16), random.nextInt() }, 0, 1), + 32 + random.nextInt(1, 17)), + // intLen != 0 && n > leadingZeros && nBits > leadingZeros && value.length < newLen + Arguments.of(new MutableBigIntegerBox(new int[] { (int) random.nextLong(1L << 15, 1L << 32) }), + random.nextInt(17, 32)), + // intLen != 0 && n > leadingZeros && nBits > leadingZeros && value.length >= newLen && newOffset != offset + Arguments.of(new MutableBigIntegerBox(new int[] { random.nextInt(), (int) random.nextLong(1L << 15, 1L << 32) }, 1, 1), + random.nextInt(17, 32)), + // intLen != 0 && n > leadingZeros && nBits > leadingZeros && value.length >= newLen && newOffset == offset + Arguments.of(new MutableBigIntegerBox(new int[] { (int) random.nextLong(1L << 15, 1L << 32), random.nextInt() }, 0, 1), + random.nextInt(17, 32)), + }; + } + + private static void leftShiftAssertions(MutableBigIntegerBox x, int n) { + MutableBigIntegerBox xShifted = x.shiftLeft(n); + assertEquals(x.multiply(new MutableBigIntegerBox(BigInteger.TWO.pow(n))), xShifted); + assertEquals(x, xShifted.shiftRight(n)); + } + + /* + * Get a random or boundary-case number. This is designed to provide + * a lot of numbers that will find failure points, such as max sized + * numbers, empty MutableBigIntegers, etc. + * + * If order is less than 2, order is changed to 2. + */ + private static MutableBigIntegerBox fetchNumber(int order) { + int numType = random.nextInt(8); + MutableBigIntegerBox result = null; + if (order < 2) order = 2; + + int[] val; + switch (numType) { + case 0: // Empty + result = MutableBigIntegerBox.ZERO; + break; + + case 1: // One + result = MutableBigIntegerBox.ONE; + break; + + case 2: // All bits set in number + int numInts = (order + 31) >> 5; + int[] fullBits = new int[numInts]; + Arrays.fill(fullBits, -1); + + fullBits[0] &= -1 >>> -order; + result = new MutableBigIntegerBox(fullBits); + break; + + case 3: // One bit in number + result = MutableBigIntegerBox.ONE.shiftLeft(random.nextInt(order)); + break; + + case 4: // Random bit density + val = new int[(order + 31) >> 5]; + int iterations = random.nextInt(order); + for (int i = 0; i < iterations; i++) { + int bitIdx = random.nextInt(order); + val[bitIdx >> 5] |= 1 << bitIdx; + } + result = new MutableBigIntegerBox(val); + break; + case 5: // Runs of consecutive ones and zeros + result = ZERO; + int remaining = order; + int bit = random.nextInt(2); + while (remaining > 0) { + int runLength = Math.min(remaining, random.nextInt(order)); + result = result.shiftLeft(runLength); + if (bit > 0) + result = result.add(ONE.shiftLeft(runLength).subtract(ONE)); + remaining -= runLength; + bit = 1 - bit; + } + break; + case 6: // random bits with trailing space + int len = random.nextInt((order + 31) >> 5) + 1; + int offset = random.nextInt(len); + val = new int[len << 1]; + for (int i = 0; i < val.length; i++) + val[i] = random.nextInt(); + result = new MutableBigIntegerBox(val, offset, len); + break; + default: // random bits + result = new MutableBigIntegerBox(new BigInteger(order, random)); + } + + return result; + } +} diff --git a/test/jdk/java/math/BigInteger/java.base/java/math/MutableBigIntegerBox.java b/test/jdk/java/math/BigInteger/java.base/java/math/MutableBigIntegerBox.java new file mode 100644 index 0000000000000..1f82e4491987f --- /dev/null +++ b/test/jdk/java/math/BigInteger/java.base/java/math/MutableBigIntegerBox.java @@ -0,0 +1,180 @@ +/* + * 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 java.math; + +import java.util.Arrays; + +/** + * A class for tests. + */ +public class MutableBigIntegerBox { + + /** + * Constant zero + */ + public static final MutableBigIntegerBox ZERO = new MutableBigIntegerBox(new MutableBigInteger()); + + /** + * Constant one + */ + public static final MutableBigIntegerBox ONE = new MutableBigIntegerBox(MutableBigInteger.ONE); + + /** + * Constant two + */ + public static final MutableBigIntegerBox TWO = new MutableBigIntegerBox(new MutableBigInteger(2)); + + private MutableBigInteger val; + + MutableBigIntegerBox(MutableBigInteger val) { + this.val = val; + } + + /** + * Construct MutableBigIntegerBox from magnitude, starting from + * offset and with a length of intLen ints. + * The value is normalized. + * @param mag the magnitude + * @param offset the offset where the value starts + * @param intLen the length of the value, in int words. + */ + public MutableBigIntegerBox(int[] mag, int offset, int intLen) { + this(new MutableBigInteger(mag)); + val.offset = offset; + val.intLen = intLen; + val.normalize(); + } + + /** + * Construct MutableBigIntegerBox from magnitude. + * The value is normalized. + * @param mag the magnitude + */ + public MutableBigIntegerBox(int[] mag) { + this(mag, 0, mag.length); + } + + /** + * Construct MutableBigIntegerBox from BigInteger val + * @param val the value + */ + public MutableBigIntegerBox(BigInteger val) { + this(val.mag); + } + + /** + * Returns the bit length of this MutableBigInteger value + * @return the bit length of this MutableBigInteger value + */ + public long bitLength() { + return val.bitLength(); + } + + /** + * Return {@code this << n} + * @return {@code this << n} + * @param n the shift + */ + public MutableBigIntegerBox shiftLeft(int n) { + MutableBigIntegerBox res = new MutableBigIntegerBox(val.value.clone(), val.offset, val.intLen); + res.val.safeLeftShift(n); + return res; + } + + /** + * Return {@code this >> n} + * @return {@code this >> n} + * @param n the shift + */ + public MutableBigIntegerBox shiftRight(int n) { + MutableBigInteger res = new MutableBigInteger(val); + res.safeRightShift(n); + return new MutableBigIntegerBox(res); + } + + /** + * Return this + addend + * @return this + addend + * @param addend the addend + */ + public MutableBigIntegerBox add(MutableBigIntegerBox addend) { + MutableBigInteger res = new MutableBigInteger(val); + res.add(addend.val); + return new MutableBigIntegerBox(res); + } + + /** + * Return this - subtraend + * @return this - subtraend + * @param subtraend the subtraend + */ + public MutableBigIntegerBox subtract(MutableBigIntegerBox subtraend) { + MutableBigInteger res = new MutableBigInteger(val); + res.subtract(subtraend.val); + return new MutableBigIntegerBox(res); + } + + /** + * Return this * multiplier + * @return this * multiplier + * @param multiplier the multiplier + */ + public MutableBigIntegerBox multiply(MutableBigIntegerBox multiplier) { + MutableBigInteger res = new MutableBigInteger(); + if (!(val.isZero() || multiplier.val.isZero())) + val.multiply(multiplier.val, res); + + return new MutableBigIntegerBox(res); + } + + /** + * Compare the magnitude of two MutableBigIntegers. Returns -1, 0 or 1 + * as this is numerically less than, equal to, or greater than {@code b}. + * @return -1, 0 or 1 as this is numerically less than, equal to, or + * greater than {@code b}. + * @param b the value to compare + */ + public int compare(MutableBigIntegerBox b) { + return val.compare(b.val); + } + + /** + * Compares this MutableBigIntegerBox with the specified Object for equality. + * + * @param x Object to which this MutableBigIntegerBox is to be compared. + * @return {@code true} if and only if the specified Object is a + * MutableBigIntegerBox whose value is numerically equal to this MutableBigIntegerBox. + */ + @Override + public boolean equals(Object x) { + return (x instanceof MutableBigIntegerBox xInt) + && Arrays.equals(val.value, val.offset, val.offset + val.intLen, + xInt.val.value, xInt.val.offset, xInt.val.offset + xInt.val.intLen); + } + + @Override + public String toString() { + return val.toString(); + } +} From 855c8a7def21025bc2fc47594f7285a55924c213 Mon Sep 17 00:00:00 2001 From: Ramkumar Sunderbabu Date: Wed, 2 Oct 2024 10:48:21 +0000 Subject: [PATCH 277/307] 8334305: Remove all code for nsk.share.Log verbose mode Reviewed-by: mli, cjplummer, lmesnik --- .../jit/escape/LockElision/MatMul/MatMul.java | 4 +- .../launchnosuspend/launchnosuspend001.java | 1 - .../filter_tagged/HeapFilter.java | 3 +- .../isexceeded001.java | 3 +- .../isexceeded001.java | 3 +- .../monitoring/stress/lowmem/lowmem001.java | 4 +- .../jtreg/vmTestbase/nsk/share/Log.java | 122 ++---------------- .../nsk/share/aod/AODTestRunner.java | 4 +- .../nsk/share/aod/AbstractJarAgent.java | 4 +- .../nsk/share/aod/DummyTargetApplication.java | 2 +- .../aod/TargetApplicationWaitingAgents.java | 2 +- .../vmTestbase/nsk/share/jvmti/JVMTITest.java | 4 +- .../coverage/parentheses/Parentheses.java | 4 +- 13 files changed, 30 insertions(+), 130 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/jit/escape/LockElision/MatMul/MatMul.java b/test/hotspot/jtreg/vmTestbase/jit/escape/LockElision/MatMul/MatMul.java index cf20b0df8a073..8d1a5fac9aefa 100644 --- a/test/hotspot/jtreg/vmTestbase/jit/escape/LockElision/MatMul/MatMul.java +++ b/test/hotspot/jtreg/vmTestbase/jit/escape/LockElision/MatMul/MatMul.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, 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 @@ -85,7 +85,7 @@ public static void main(String[] args) { } public int run() { - log = new Log(System.out, verbose); + log = new Log(System.out); log.display("Parallel matrix multiplication test"); Matrix a = Matrix.randomMatrix(dim); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/LaunchingConnector/launchnosuspend/launchnosuspend001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/LaunchingConnector/launchnosuspend/launchnosuspend001.java index 015643f3a1892..142d6387610f6 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/LaunchingConnector/launchnosuspend/launchnosuspend001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/LaunchingConnector/launchnosuspend/launchnosuspend001.java @@ -73,7 +73,6 @@ private launchnosuspend001 (String args[], PrintStream out) { argHandler = new ArgumentHandler(args); log = new Log(this.out, argHandler); - //log.enableVerbose(true); } private PrintStream out; diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateThroughHeap/filter_tagged/HeapFilter.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateThroughHeap/filter_tagged/HeapFilter.java index 91f315ee7a968..b690955307ef7 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateThroughHeap/filter_tagged/HeapFilter.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateThroughHeap/filter_tagged/HeapFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, 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 @@ -49,7 +49,6 @@ public int runTest(String args[], PrintStream out) { log = new Log(out, argHandler); testObjects = new Object[]{new TaggedClass(), new UntaggedClass()}; - log.enableVerbose(true); log.display("Verifying reachable objects."); status = checkStatus(status); testObjects = null; diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded001.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded001.java index 702a5a793791a..a9e75bb7cecee 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2023, 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 @@ -40,7 +40,6 @@ public static void main(String[] argv) { public static int run(String[] argv, PrintStream out) { ArgumentHandler argHandler = new ArgumentHandler(argv); Log log = new Log(out, argHandler); - log.enableVerbose(true); monitor = Monitor.getMemoryMonitor(log, argHandler); List pools = monitor.getMemoryPoolMBeans(); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001.java index 390bfdd625188..a684c03e67a38 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001.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 @@ -47,7 +47,6 @@ public static void main(String[] argv) { public static int run(String[] argv, PrintStream out) { ArgumentHandler argHandler = new ArgumentHandler(argv); Log log = new Log(out, argHandler); - log.enableVerbose(true); // show log output MemoryMonitor monitor = Monitor.getMemoryMonitor(log, argHandler); List pools = monitor.getMemoryPoolMBeans(); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/lowmem/lowmem001.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/lowmem/lowmem001.java index d698e5aec837f..67f0d17f56109 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/lowmem/lowmem001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/lowmem/lowmem001.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 @@ -58,7 +58,7 @@ public static void main(String[] args) { @Override public void run() { - Log log = new Log(System.out, true); + Log log = new Log(System.out); // System.err is duplicated into buffer // it should be empty MyStream stream = new MyStream(System.err); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java b/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java index e575018249533..dbaa1e6646cef 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java @@ -29,22 +29,15 @@ import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringReader; -import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.HashSet; import java.util.Vector; -import nsk.share.test.LazyFormatString; /** - * This class helps to print test-execution trace messages - * and filter them when execution mode is not verbose. - *

        - * Verbose mode if defined by providing -verbose command line - * option, handled by ArgumentParser. Use verbose() - * method to determine which mode is used. + * This class helps to print test-execution trace messages. *

        * Log provides with two main methods to print messages: *

          @@ -60,7 +53,6 @@ * To provide printing messages from different sources into one log * with distinct prefixes use internal Log.Logger class. * - * @see #verbose() * @see #complain(String) * @see #display(String) * @see ArgumentParser @@ -72,18 +64,6 @@ public class Log { */ private PrintStream out = null; - /** - * Is log-mode verbose? - * Always enabled. - */ - private final boolean verbose = true; - - /** - * Should log messages prefixed with timestamps? - * Always enabled. - */ - private final boolean timestamp = true; - /** * Names for trace levels */ @@ -188,41 +168,14 @@ public Log(PrintStream stream) { /** * Incarnate new Log for the given stream; and - * either for verbose or for non-verbose mode accordingly to - * the given verbose key. - */ - public Log(PrintStream stream, boolean verbose) { - this(stream); - } - - /** - * Incarnate new Log for the given stream; and - * either for verbose or for non-verbose mode accordingly to * the given argsHandler. */ public Log(PrintStream stream, ArgumentParser argsParser) { - this(stream, argsParser.verbose()); traceLevel = argsParser.getTraceLevel(); } ///////////////////////////////////////////////////////////////// - /** - * Return true if log mode is verbose. - */ - public boolean verbose() { - return verbose; - } - - /** - * Enable or disable verbose mode for printing messages. - */ - public void enableVerbose(boolean enable) { - if (!enable) { - throw new RuntimeException("The non-verbose logging is not supported."); - } - } - public int getTraceLevel() { return traceLevel; } @@ -266,9 +219,6 @@ public static String printExceptionToString(Object prefix, Throwable exception) @Deprecated public synchronized void println(String message) { doPrint(message); - if (!verbose()) { - keepLog(composeLine(message)); - } } /** @@ -282,9 +232,6 @@ public synchronized void println(String message) { */ @Deprecated public synchronized void comment(String message) { - if (!verbose()) { - doPrint(message); - } } /** @@ -314,17 +261,10 @@ public void trace(int level, Object message, Throwable exception) { } /** - * Print message to the assigned output stream, - * if log mode is verbose. The message will be lost, - * if execution mode is non-verbose, and there is no error messages - * printed. + * Print message to the assigned output stream. */ public synchronized void display(Object message) { - if (verbose()) { - doPrint(message.toString()); - } else { - keepLog(composeLine(message.toString())); - } + doPrint(message.toString()); } /** @@ -333,15 +273,6 @@ public synchronized void display(Object message) { * into errorsBuffer. */ public synchronized void complain(Object message) { - if (!verbose()) { - PrintStream stream = findOutStream(); - stream.println("#> "); - stream.println("#> WARNING: switching log to verbose mode,"); - stream.println("#> because error is complained"); - stream.println("#> "); - stream.flush(); - enableVerbose(true); - } String msgStr = message.toString(); printError(msgStr); @@ -406,10 +337,7 @@ private void logExceptionForFailureAnalysis(String msg) { ///////////////////////////////////////////////////////////////// /** - * Redirect log to the given stream, and switch - * log mode to verbose. - * Prints errors summary to current stream, cancel current stream - * and switches to new stream. Turns on verbose mode for new stream. + * Redirect log to the given stream. * * @deprecated This method is obsolete. */ @@ -430,20 +358,6 @@ public synchronized void clearLogBuffer() { logBuffer.clear(); } - /** - * Print all messages from log buffer which were hidden because - * of non-verbose mode, - */ - private synchronized void flushLogBuffer() { - if (!logBuffer.isEmpty()) { - PrintStream stream = findOutStream(); - for (int i = 0; i < logBuffer.size(); i++) { - stream.println(logBuffer.elementAt(i)); - } - stream.flush(); - } - } - /** * Return out stream if defined or Sytem.err otherwise; * print a warning message when System.err is used first time. @@ -468,18 +382,15 @@ private synchronized PrintStream findOutStream() { * Compose line to print possible prefixing it with timestamp. */ private String composeLine(String message) { - if (timestamp) { - long time = System.currentTimeMillis(); - long ms = time % 1000; - time /= 1000; - long secs = time % 60; - time /= 60; - long mins = time % 60; - time /= 60; - long hours = time % 24; - return "[" + hours + ":" + mins + ":" + secs + "." + ms + "] " + message; - } - return message; + long time = System.currentTimeMillis(); + long ms = time % 1000; + time /= 1000; + long secs = time % 60; + time /= 60; + long mins = time % 60; + time /= 60; + long hours = time % 24; + return "[" + hours + ":" + mins + ":" + secs + "." + ms + "] " + message; } /** @@ -513,13 +424,6 @@ private synchronized void printError(String message) { } } - /** - * Keep the given log message into logBuffer. - */ - private synchronized void keepLog(String message) { - logBuffer.addElement(message); - } - /** * This class can be used as a base for each class that use Log * for print messages and errors. diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AODTestRunner.java b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AODTestRunner.java index bde40cc7e2021..9899c762a7a90 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AODTestRunner.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AODTestRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2021, 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 @@ -68,7 +68,7 @@ public class AODTestRunner { protected AODRunnerArgParser argParser; protected AODTestRunner(String[] args) { - log = new Log(System.out, true); + log = new Log(System.out); argParser = createArgParser(args); } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AbstractJarAgent.java b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AbstractJarAgent.java index 3fa3141a8cd9e..fb02327a42224 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AbstractJarAgent.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/AbstractJarAgent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, 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 @@ -157,7 +157,7 @@ private void defaultInit(String[] args) { if (name == null) throw new TestBug("Agent name wasn't specified"); - log = new Log(System.out, true); + log = new Log(System.out); } /* diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java index bb726453e9bd3..c8fb3bf266324 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/DummyTargetApplication.java @@ -39,7 +39,7 @@ */ public class DummyTargetApplication { - protected Log log = new Log(System.out, true); + protected Log log = new Log(System.out); protected AODTargetArgParser argParser; diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java index 6f80033dff504..0b5acfb24ba00 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/aod/TargetApplicationWaitingAgents.java @@ -213,7 +213,7 @@ private void initTargetApplication(String[] args) { if (targetApplicationInitialized) throw new TestBug("TargetApplication already initialized"); - log = new Log(System.out, true); + log = new Log(System.out); argParser = createArgParser(args); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/JVMTITest.java b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/JVMTITest.java index c8d26b6ea1f5e..d9b847e110dc0 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/JVMTITest.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/JVMTITest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, 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 @@ -87,7 +87,7 @@ static void attachAgent(String[] args) { AgentsAttacher attacher = new AgentsAttacher(Utils.findCurrentVMIdUsingJPS(jdkPath), agents, - new Log(System.out, true)); + new Log(System.out)); attacher.attachAgents(); } } diff --git a/test/hotspot/jtreg/vmTestbase/vm/compiler/coverage/parentheses/Parentheses.java b/test/hotspot/jtreg/vmTestbase/vm/compiler/coverage/parentheses/Parentheses.java index 66546e9b13f15..219af51045a23 100644 --- a/test/hotspot/jtreg/vmTestbase/vm/compiler/coverage/parentheses/Parentheses.java +++ b/test/hotspot/jtreg/vmTestbase/vm/compiler/coverage/parentheses/Parentheses.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, 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 @@ -69,7 +69,7 @@ public static void main(String[] args) throws Exception { public void run() throws IOException, ReflectiveOperationException { - log = new Log(System.out, verbose); + log = new Log(System.out); InstructionSequence instructionSequence = null; for (int i = 0; i < iterations * stressOptions.getIterationsFactor(); i++) { From 5e9800721a29dbb85be76a6f56c2e2677a3274f2 Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Wed, 2 Oct 2024 13:27:57 +0000 Subject: [PATCH 278/307] 8307532: Implement LM_LIGHTWEIGHT for Zero Reviewed-by: aboldtch, jwaters --- src/hotspot/cpu/zero/vm_version_zero.cpp | 5 --- src/hotspot/cpu/zero/zeroInterpreter_zero.cpp | 34 +++++++++++-------- src/hotspot/share/runtime/arguments.cpp | 11 ------ .../share/runtime/basicLock.inline.hpp | 2 +- 4 files changed, 20 insertions(+), 32 deletions(-) diff --git a/src/hotspot/cpu/zero/vm_version_zero.cpp b/src/hotspot/cpu/zero/vm_version_zero.cpp index 1fcf4b1086253..7312dd116468c 100644 --- a/src/hotspot/cpu/zero/vm_version_zero.cpp +++ b/src/hotspot/cpu/zero/vm_version_zero.cpp @@ -116,11 +116,6 @@ void VM_Version::initialize() { FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); } - if ((LockingMode != LM_LEGACY) && (LockingMode != LM_MONITOR)) { - warning("Unsupported locking mode for this CPU."); - FLAG_SET_DEFAULT(LockingMode, LM_LEGACY); - } - // Enable error context decoding on known platforms #if defined(IA32) || defined(AMD64) || defined(ARM) || \ defined(AARCH64) || defined(PPC) || defined(RISCV) || \ diff --git a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp index 2b53042ef1017..aab43e733964e 100644 --- a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp +++ b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp @@ -485,26 +485,30 @@ int ZeroInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) { // Unlock if necessary if (monitor) { - BasicLock *lock = monitor->lock(); - markWord header = lock->displaced_header(); - oop rcvr = monitor->obj(); - monitor->set_obj(nullptr); - - bool dec_monitor_count = true; - if (header.to_pointer() != nullptr) { - markWord old_header = markWord::encode(lock); - if (rcvr->cas_set_mark(header, old_header) != old_header) { - monitor->set_obj(rcvr); - dec_monitor_count = false; - InterpreterRuntime::monitorexit(monitor); + bool success = false; + if (LockingMode == LM_LEGACY) { + BasicLock* lock = monitor->lock(); + oop rcvr = monitor->obj(); + monitor->set_obj(nullptr); + success = true; + markWord header = lock->displaced_header(); + if (header.to_pointer() != nullptr) { // Check for recursive lock + markWord old_header = markWord::encode(lock); + if (rcvr->cas_set_mark(header, old_header) != old_header) { + monitor->set_obj(rcvr); + success = false; + } + } + if (success) { + THREAD->dec_held_monitor_count(); } } - if (dec_monitor_count) { - THREAD->dec_held_monitor_count(); + if (!success) { + InterpreterRuntime::monitorexit(monitor); } } - unwind_and_return: + unwind_and_return: // Unwind the current activation thread->pop_zero_frame(); diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 0d0b58412aefa..0df3492f92557 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -1817,17 +1817,6 @@ bool Arguments::check_vm_args_consistency() { } #endif -#if !defined(X86) && !defined(AARCH64) && !defined(RISCV64) && !defined(ARM) && !defined(PPC64) && !defined(S390) - if (LockingMode == LM_LIGHTWEIGHT) { - FLAG_SET_CMDLINE(LockingMode, LM_LEGACY); - warning("New lightweight locking not supported on this platform"); - } - if (UseObjectMonitorTable) { - FLAG_SET_CMDLINE(UseObjectMonitorTable, false); - warning("UseObjectMonitorTable not supported on this platform"); - } -#endif - if (UseObjectMonitorTable && LockingMode != LM_LIGHTWEIGHT) { // ObjectMonitorTable requires lightweight locking. FLAG_SET_CMDLINE(UseObjectMonitorTable, false); diff --git a/src/hotspot/share/runtime/basicLock.inline.hpp b/src/hotspot/share/runtime/basicLock.inline.hpp index 30abd575da46a..1090241c3e1f0 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) || defined(PPC64) || defined(S390) +#if !defined(ZERO) && (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, From 883804841ef9319a18f90a852272c69bc54f5395 Mon Sep 17 00:00:00 2001 From: Matias Saavedra Silva Date: Wed, 2 Oct 2024 14:45:56 +0000 Subject: [PATCH 279/307] 8324259: Classes used by CDS at runtime should be archived Reviewed-by: iklam, ccheung --- src/hotspot/share/cds/metaspaceShared.cpp | 11 ++++ test/hotspot/jtreg/TEST.groups | 1 + .../cds/appcds/DumpRuntimeClassesTest.java | 65 +++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/DumpRuntimeClassesTest.java diff --git a/src/hotspot/share/cds/metaspaceShared.cpp b/src/hotspot/share/cds/metaspaceShared.cpp index c66398cefac5a..b6f5d2be50f22 100644 --- a/src/hotspot/share/cds/metaspaceShared.cpp +++ b/src/hotspot/share/cds/metaspaceShared.cpp @@ -77,6 +77,7 @@ #include "runtime/globals.hpp" #include "runtime/globals_extension.hpp" #include "runtime/handles.inline.hpp" +#include "runtime/javaCalls.hpp" #include "runtime/os.inline.hpp" #include "runtime/safepointVerifiers.hpp" #include "runtime/sharedRuntime.hpp" @@ -794,6 +795,16 @@ void MetaspaceShared::preload_and_dump_impl(StaticArchiveBuilder& builder, TRAPS } #endif + // Dummy call to load classes used at CDS runtime + JavaValue result(T_OBJECT); + Handle path_string = java_lang_String::create_from_str("dummy.jar", CHECK); + JavaCalls::call_static(&result, + vmClasses::jdk_internal_loader_ClassLoaders_klass(), + vmSymbols::toFileURL_name(), + vmSymbols::toFileURL_signature(), + path_string, + CHECK); + VM_PopulateDumpSharedSpace op(builder); VMThread::execute(&op); diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index 4ab4ba68692c1..37bcb6883a4c6 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -454,6 +454,7 @@ hotspot_appcds_dynamic = \ -runtime/cds/appcds/BadBSM.java \ -runtime/cds/appcds/DumpClassList.java \ -runtime/cds/appcds/DumpClassListWithLF.java \ + -runtime/cds/appcds/DumpRuntimeClassesTest.java \ -runtime/cds/appcds/DumpingWithNoCoops.java \ -runtime/cds/appcds/ExtraSymbols.java \ -runtime/cds/appcds/LambdaContainsOldInf.java \ diff --git a/test/hotspot/jtreg/runtime/cds/appcds/DumpRuntimeClassesTest.java b/test/hotspot/jtreg/runtime/cds/appcds/DumpRuntimeClassesTest.java new file mode 100644 index 0000000000000..2e530a8d6ddab --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/DumpRuntimeClassesTest.java @@ -0,0 +1,65 @@ +/* + * 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 + * @summary Classes used by CDS at runtime should be in the archived + * @bug 8324259 + * @requires vm.cds + * @library /test/lib + * @compile test-classes/Hello.java + * @run driver DumpRuntimeClassesTest + */ + +import jdk.test.lib.cds.CDSOptions; +import jdk.test.lib.cds.CDSTestUtils; + +public class DumpRuntimeClassesTest { + public static void main(String[] args) throws Exception { + // build The app + String appClass = "Hello"; + String classList = "hello.classlist"; + String archiveName = "hello.jsa"; + JarBuilder.build("hello", appClass); + String appJar = TestCommon.getTestJar("hello.jar"); + + // Dump class list + CDSTestUtils.dumpClassList(classList, "-cp", appJar, appClass); + + // Dump archive + CDSOptions opts = (new CDSOptions()) + .addPrefix("-cp", appJar, "-XX:SharedClassListFile=" + classList) + .setArchiveName(archiveName); + CDSTestUtils.createArchive(opts); + + // Run with archive and ensure all the classes used were in the archive + CDSOptions runOpts = (new CDSOptions()) + .addPrefix("-cp", appJar, "-Xlog:class+load,cds=debug") + .setArchiveName(archiveName) + .setUseVersion(false) + .addSuffix(appClass); + CDSTestUtils.runWithArchive(runOpts) + .shouldNotContain("source: jrt:/java.base"); + } +} From 49501fe9c4d0fc4d6285ba4f5d403754e5a147bd Mon Sep 17 00:00:00 2001 From: Ramkumar Sunderbabu Date: Wed, 2 Oct 2024 15:13:27 +0000 Subject: [PATCH 280/307] 8341412: Various test failures after JDK-8334305 Reviewed-by: lmesnik, dcubed --- test/hotspot/jtreg/vmTestbase/nsk/share/Log.java | 1 + 1 file changed, 1 insertion(+) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java b/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java index dbaa1e6646cef..99467fc033412 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/Log.java @@ -171,6 +171,7 @@ public Log(PrintStream stream) { * the given argsHandler. */ public Log(PrintStream stream, ArgumentParser argsParser) { + this(stream); traceLevel = argsParser.getTraceLevel(); } From 85f0442727201e0d36ed0a71d2199e602501c98d Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Wed, 2 Oct 2024 15:16:32 +0000 Subject: [PATCH 281/307] 8317116: Provide layouts for multiple test UI in PassFailJFrame Reviewed-by: azvegint, prr --- .../awt/regtesthelpers/PassFailJFrame.java | 86 ++++++- .../awt/regtesthelpers/WindowLayouts.java | 237 ++++++++++++++++++ 2 files changed, 319 insertions(+), 4 deletions(-) create mode 100644 test/jdk/java/awt/regtesthelpers/WindowLayouts.java diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index 45cd191ae39db..5a9e7671e3958 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -170,6 +170,11 @@ public final class PassFailJFrame { private static final int ROWS = 10; private static final int COLUMNS = 40; + /** + * A gap between windows. + */ + public static final int WINDOW_GAP = 8; + /** * Prefix for the user-provided failure reason. */ @@ -1007,13 +1012,13 @@ private static void positionInstructionFrame(final Position position) { switch (position) { case HORIZONTAL: - int newX = ((screenSize.width / 2) - frame.getWidth()); + int newX = (((screenSize.width + WINDOW_GAP) / 2) - frame.getWidth()); frame.setLocation((newX + screenInsets.left), (frame.getY() + screenInsets.top)); break; case VERTICAL: - int newY = ((screenSize.height / 2) - frame.getHeight()); + int newY = (((screenSize.height + WINDOW_GAP) / 2) - frame.getHeight()); frame.setLocation((frame.getX() + screenInsets.left), (newY + screenInsets.top)); break; @@ -1061,13 +1066,13 @@ public static void positionTestWindow(Window testWindow, Position position) { switch (position) { case HORIZONTAL: case TOP_LEFT_CORNER: - testWindow.setLocation((frame.getX() + frame.getWidth() + 5), + testWindow.setLocation((frame.getX() + frame.getWidth() + WINDOW_GAP), frame.getY()); break; case VERTICAL: testWindow.setLocation(frame.getX(), - (frame.getY() + frame.getHeight() + 5)); + (frame.getY() + frame.getHeight() + WINDOW_GAP)); break; } } @@ -1370,6 +1375,7 @@ 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. @@ -1393,6 +1399,77 @@ public Builder positionTestUI(PositionWindows positionWindows) { return this; } + /** + * Positions the test UI windows in a row to the right of + * the instruction frame. The top of the windows is aligned to + * that of the instruction frame. + * + * @return this builder + */ + public Builder positionTestUIRightRow() { + return position(Position.HORIZONTAL) + .positionTestUI(WindowLayouts::rightOneRow); + } + + /** + * Positions the test UI windows in a column to the right of + * the instruction frame. The top of the first window is aligned to + * that of the instruction frame. + * + * @return this builder + */ + public Builder positionTestUIRightColumn() { + return position(Position.HORIZONTAL) + .positionTestUI(WindowLayouts::rightOneColumn); + } + + /** + * Positions the test UI windows in a column to the right of + * the instruction frame centering the stack of the windows. + * + * @return this builder + */ + public Builder positionTestUIRightColumnCentered() { + return position(Position.HORIZONTAL) + .positionTestUI(WindowLayouts::rightOneColumnCentered); + } + + /** + * Positions the test UI windows in a row to the bottom of + * the instruction frame. The left of the first window is aligned to + * that of the instruction frame. + * + * @return this builder + */ + public Builder positionTestUIBottomRow() { + return position(Position.VERTICAL) + .positionTestUI(WindowLayouts::bottomOneRow); + } + + /** + * Positions the test UI windows in a row to the bottom of + * the instruction frame centering the row of the windows. + * + * @return this builder + */ + public Builder positionTestUIBottomRowCentered() { + return position(Position.VERTICAL) + .positionTestUI(WindowLayouts::bottomOneRowCentered); + } + + /** + * Positions the test UI windows in a column to the bottom of + * the instruction frame. The left of the first window is aligned to + * that of the instruction frame. + * + * @return this builder + */ + public Builder positionTestUIBottomColumn() { + return position(Position.VERTICAL) + .positionTestUI(WindowLayouts::bottomOneColumn); + } + + /** * Adds a {@code WindowListCreator} which the framework will use * to create a list of test UI windows. @@ -1495,6 +1572,7 @@ public Builder testUI(PanelCreator panelCreator) { return this; } + /** * Adds a {@code PanelCreator} which the framework will use * to create a component with test UI and display it in a split pane. diff --git a/test/jdk/java/awt/regtesthelpers/WindowLayouts.java b/test/jdk/java/awt/regtesthelpers/WindowLayouts.java new file mode 100644 index 0000000000000..4368e3a59432f --- /dev/null +++ b/test/jdk/java/awt/regtesthelpers/WindowLayouts.java @@ -0,0 +1,237 @@ +/* + * 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 + * 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.Component; +import java.awt.Dimension; +import java.awt.GraphicsConfiguration; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Window; +import java.util.List; + +import static java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment; +import static java.awt.Toolkit.getDefaultToolkit; + +/** + * A utility class which provides standard window layouts for multi-window + * manual tests using the {@link PassFailJFrame} framework. + * The layout methods {@code right-} and {@code bottom-} implement the + * {@link PassFailJFrame.PositionWindows PositionWindows} interface and + * can be used directly or via builder methods. + *

          + * There are several helper methods, such as + * {@link #getScreenCenter() getScreenCenter}, which could help you + * implement customized windows layouts. + */ +public final class WindowLayouts { + + /** Private constructor to prevent instantiating the utility class. */ + private WindowLayouts() { + } + + /** A gap between windows. (Local copy makes expressions shorter.) */ + private static final int WINDOW_GAP = PassFailJFrame.WINDOW_GAP; + + /** + * Lays out the window list in one row to the right of + * the instruction frame. The top of the windows is aligned to + * that of the instruction frame. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void rightOneRow(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutRow(instructionUI.getLocation().x + + instructionUI.getSize().width + + WINDOW_GAP, + instructionUI.getLocation().y, + windows); + } + + /** + * Lays out the window list in one column to the right of + * the instruction frame. The top of the first window is aligned to + * that of the instruction frame. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void rightOneColumn(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutColumn(instructionUI.getLocation().x + + instructionUI.getSize().width + + WINDOW_GAP, + instructionUI.getLocation().y, + windows); + } + + /** + * Lays out the window list in one column to the right of + * the instruction frame centering the stack of the windows. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void rightOneColumnCentered(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutColumn(instructionUI.getLocation().x + + instructionUI.getSize().width + + WINDOW_GAP, + getScreenCenter().y + - getWindowListHeight(windows) / 2, + windows); + } + + + /** + * Lays out the window list in one row to the bottom of + * the instruction frame. The left of the first window is aligned to + * that of the instruction frame. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void bottomOneRow(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutRow(instructionUI.getLocation().x, + instructionUI.getLocation().y + + instructionUI.getSize().height + + WINDOW_GAP, + windows); + } + + /** + * Lays out the window list in one row to the bottom of + * the instruction frame centering the row of the windows. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void bottomOneRowCentered(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutRow(getScreenCenter().x + - getWindowListWidth(windows) / 2, + instructionUI.getLocation().y + + instructionUI.getSize().height + + WINDOW_GAP, + windows); + } + + /** + * Lays out the window list in one column to the bottom of + * the instruction frame. The left of the first window is aligned to + * that of the instruction frame. + * + * @param windows the list of windows to lay out + * @param instructionUI information about the instruction frame + */ + public static void bottomOneColumn(final List windows, + final PassFailJFrame.InstructionUI instructionUI) { + layoutColumn(instructionUI.getLocation().x, + instructionUI.getLocation().y + + instructionUI.getSize().height + + WINDOW_GAP, + windows); + } + + + /** + * Lays out the window list in one row starting at + * ({@code x0}, {@code y}). + * + * @param x0 the starting x coordinate of the windows + * @param y the y coordinate of the windows + * @param windows the list of windows to lay out + */ + public static void layoutRow(final int x0, + final int y, + final List windows) { + int x = x0; + for (Window w : windows) { + w.setLocation(x, y); + x += w.getWidth() + WINDOW_GAP; + } + } + + /** + * Lays out the window list in one column starting at + * ({@code x}, {@code y0}). + * + * @param x the x coordinate of the windows + * @param y0 the starting y coordinate of the windows + * @param windows the list of windows to lay out + */ + public static void layoutColumn(final int x, + final int y0, + final List windows) { + int y = y0; + for (Window w : windows) { + w.setLocation(x, y); + y += w.getHeight() + WINDOW_GAP; + } + } + + + /** + * {@return the center point of the main screen} + */ + public static Point getScreenCenter() { + GraphicsConfiguration gc = getLocalGraphicsEnvironment() + .getDefaultScreenDevice() + .getDefaultConfiguration(); + Dimension size = gc.getBounds() + .getSize(); + Insets insets = getDefaultToolkit() + .getScreenInsets(gc); + + return new Point((size.width - insets.left - insets.right) / 2, + (size.height - insets.top - insets.bottom) / 2); + } + + /** + * {@return width of the windows in the list, taking into account + * the gap between windows} + * + * @param windows the list of windows to get the width of + */ + public static int getWindowListWidth(final List windows) { + return windows.stream() + .mapToInt(Component::getWidth) + .sum() + + WINDOW_GAP * (windows.size() - 1); + } + + /** + * {@return height of the windows in the list, taking into account + * the gap between windows} + * + * @param windows the list of windows to get the height of + */ + public static int getWindowListHeight(final List windows) { + return windows.stream() + .mapToInt(Component::getHeight) + .sum() + + WINDOW_GAP * (windows.size() - 1); + } +} From 5063494f5b0859a396b4e41096793c777d4650b8 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Wed, 2 Oct 2024 15:16:55 +0000 Subject: [PATCH 282/307] 8340785: Update description of PassFailJFrame and samples Reviewed-by: prr --- .../awt/regtesthelpers/PassFailJFrame.java | 192 +++++++++++++++--- 1 file changed, 159 insertions(+), 33 deletions(-) diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index 5a9e7671e3958..feb5da43a5ced 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -79,15 +79,77 @@ import static javax.swing.SwingUtilities.isEventDispatchThread; /** - * Provides a framework for manual tests to display test instructions and - * Pass/Fail buttons. + * A framework for manual tests to display test instructions and + * Pass / Fail buttons. The framework automatically + * creates a frame to display the instructions, provides buttons + * to select the test result, and handles test timeout. + * + *

          + * The instruction UI frame displays a timer at the top which indicates + * how much time is left. The timer can be paused using the Pause + * button to the right of the time; the title of the button changes to + * Resume. To resume the timer, use the Resume button. + * + *

          + * In the center, the instruction UI frame displays instructions for the + * tester. The instructions can be either plain text or HTML. If the + * text of the instructions starts with {@code ""}, the + * instructions are displayed as HTML, as supported by Swing, which + * provides richer formatting options. + *

          + * The instructions are displayed in a text component with word-wrapping + * so that there's no horizontal scroll bar. If the text doesn't fit, a + * vertical scroll bar is shown. Use {@code rows} and {@code columns} + * parameters to change the size of this text component. + * If possible, choose the number of rows and columns so that + * the instructions fit and no scroll bars are shown. + * + *

          + * At the bottom, the instruction UI frame displays the + * Pass and Fail buttons. The tester clicks either Pass + * or Fail button to finish the test. When the tester clicks the + * Fail button, the framework displays a dialog box prompting for + * a reason why the test fails. The tester enters the reason and clicks + * OK to close the dialog and fail the test, + * or simply closes the dialog to fail the test without providing any reason. + * + *

          + * If you enable the screenshot feature, a Screenshot button is + * added to the right of the Fail button. The tester can choose either + * Capture Full Screen (default) or Capture Frames and click the + * Screenshot button to take a screenshot. + * If there are multiple screens, screenshots of each screen are created. + * If the tester selects the Capture Frames mode, screenshots of all + * the windows or frames registered in the {@code PassFailJFrame} framework + * are created. + * + *

          + * If you enable a log area, the instruction UI frame adds a text component + * to display log messages below the buttons. + * Use {@link #log(String) log}, {@link #logSet(String) logSet} + * and {@link #logClear() logClear} static methods of {@code PassFailJFrame} + * to add or clear messages from the log area. + * + *

          + * After you create an instance of {@code PassFailJFrame}, call the + * {@link #awaitAndCheck() awaitAndCheck} method to stop the current thread + * (usually the main thread) and wait until the tester clicks + * either Pass or Fail button, + * or until the test times out. *

          - * Instructions for the user can be either plain text or HTML as supported - * by Swing. If the instructions start with {@code }, the - * instructions are displayed as HTML. + * The call to the {@code awaitAndCheck} method is usually the last + * statement in the {@code main} method of your test. + * If the test fails, an exception is thrown to signal the failure to jtreg. + * The test fails if the tester clicks the Fail button, + * if the timeout occurs, + * or if any window or frame is closed. *

          + * Before returning from {@code awaitAndCheck}, the framework disposes of + * all the windows and frames. + * + *

          Sample Manual Test

          * A simple test would look like this: - *
          {@code
          + * {@snippet id='sampleManualTestCode' lang='java':
            * public class SampleManualTest {
            *     private static final String INSTRUCTIONS =
            *             "Click Pass, or click Fail if the test failed.";
          @@ -95,7 +157,7 @@
            *     public static void main(String[] args) throws Exception {
            *         PassFailJFrame.builder()
            *                       .instructions(INSTRUCTIONS)
          - *                       .testUI(() -> createTestUI())
          + *                       .testUI(SampleManualTest::createTestUI)
            *                       .build()
            *                       .awaitAndCheck();
            *     }
          @@ -106,39 +168,87 @@
            *         return testUI;
            *     }
            * }
          - * }
          + * } *

          - * The above example uses the {@link Builder Builder} to set the parameters of - * the instruction frame. It is the recommended way. + * The above example uses the {@link Builder Builder} class to set + * the parameters of the instruction frame. + * It is the recommended way. + * *

          - * The framework will create instruction UI, it will call - * the provided {@code createTestUI} on the Event Dispatch Thread (EDT), - * and it will automatically position the test UI and make it visible. + * The framework will create an instruction UI frame, it will call + * the provided {@code createTestUI} on the Event Dispatch Thread (EDT), + * and it will automatically position the test UI frame and make it visible. + * + *

          + * Add the following jtreg tags before the test class declaration + * {@snippet : + * /* + * * @test + * * @summary Sample manual test + * * @library /java/awt/regtesthelpers + * * @build PassFailJFrame + * * @run main/manual SampleManualTest + * } + * and the closing comment tag */. *

          + * The {@code @library} tag points to the location of the + * {@code PassFailJFrame} class in the source code; + * the {@code @build} tag makes jtreg compile the {@code PassFailJFrame} class, + * and finally the {@code @run} tag specifies it is a manual + * test and the class to run. + * + *

          Using {@code Builder}

          + * Use methods of the {@link Builder Builder} class to set or change + * parameters of {@code PassFailJFrame} and its instruction UI: + *
            + *
          • {@link Builder#title(String) title} sets + * the title of the instruction UI + * (the default is {@value #TITLE});
          • + *
          • {@link Builder#testTimeOut(long) testTimeOut} sets + * the timeout of the test + * (the default is {@value #TEST_TIMEOUT});
          • + *
          • {@link Builder#rows(int) rows} and + * {@link Builder#columns(int) columns} control the size + * the text component which displays the instructions + * (the default number of rows is the number of lines in the text + * of the instructions, + * the default number of columns is {@value #COLUMNS});
          • + *
          • {@link Builder#logArea() logArea} adds a log area;
          • + *
          • {@link Builder#screenCapture() screenCapture} + * enables screenshots.
          • + *
          + * + *

          Using {@code testUI} and {@code splitUI}

          * The {@code Builder.testUI} methods accept interfaces which create one window * or a list of windows if the test needs multiple windows, * or directly a single window, an array of windows or a list of windows. *

          - * For simple test UI, use {@code Builder.splitUI}, or explicitly - * {@code Builder.splitUIRight} or {@code Builder.splitUIBottom} with - * a {@code PanelCreator}. The framework will call the provided - * {@code createUIPanel} to create the component with test UI and + * For simple test UI, use {@link Builder#splitUI(PanelCreator) splitUI}, + * or explicitly + * {@link Builder#splitUIRight(PanelCreator) splitUIRight} or + * {@link Builder#splitUIBottom(PanelCreator) splitUIBottom} with + * a {@link PanelCreator PanelCreator}. + * The framework will call the provided + * {@code createUIPanel} method to create the component with test UI and * will place it as the right or bottom component in a split pane * along with instruction UI. *

          + * Note: support for multiple windows is incomplete. + * + *

          Obsolete Sample Test

          * Alternatively, use one of the {@code PassFailJFrame} constructors to * create an object, then create secondary test UI, register it * with {@code PassFailJFrame}, position it and make it visible. * The following sample demonstrates it: - *
          {@code
          - * public class SampleOldManualTest {
          + * {@snippet id='obsoleteSampleTestCode' lang='java':
          + * public class ObsoleteManualTest {
            *     private static final String INSTRUCTIONS =
            *             "Click Pass, or click Fail if the test failed.";
            *
            *     public static void main(String[] args) throws Exception {
            *         PassFailJFrame passFail = new PassFailJFrame(INSTRUCTIONS);
            *
          - *         SwingUtilities.invokeAndWait(() -> createTestUI());
          + *         SwingUtilities.invokeAndWait(ObsoleteManualTest::createTestUI);
            *
            *         passFail.awaitAndCheck();
            *     }
          @@ -151,17 +261,29 @@
            *         testUI.setVisible(true);
            *     }
            * }
          - * }
          + * } *

          - * Use methods of the {@code Builder} class or constructors of the - * {@code PassFailJFrame} class to control other parameters: - *

            - *
          • 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 enable screenshots.
          • - *
          + * This sample uses {@link #PassFailJFrame(String) a constructor} of + * {@code PassFailJFrame} to create its instance, + * there are several overloads provided which allow changing other parameters. + *

          + * When you use the constructors, you have to explicitly create + * your test UI window on EDT. After you create the window, + * you need to register it with the framework using + * {@link #addTestWindow(Window) addTestWindow} + * to ensure the window is disposed of when the test completes. + * Before showing the window, you have to call + * {@link #positionTestWindow(Window, Position) positionTestWindow} + * to position the test window near the instruction UI frame provided + * by the framework. And finally you have to explicitly show the test UI + * window by calling {@code setVisible(true)}. + *

          + * To avoid the complexity, use the {@link Builder Builder} class + * which provides a streamlined way to configure and create an + * instance of {@code PassFailJFrame}. + *

          + * Consider updating tests which use {@code PassFailJFrame} constructors to + * use the builder pattern. */ public final class PassFailJFrame { @@ -541,7 +663,11 @@ private static JComponent createInstructionUIPanel(String instructions, : configurePlainText(instructions, rows, columns); text.setEditable(false); - main.add(new JScrollPane(text), BorderLayout.CENTER); + JPanel textPanel = new JPanel(new BorderLayout()); + textPanel.setBorder(createEmptyBorder(4, 0, 0, 0)); + textPanel.add(new JScrollPane(text), BorderLayout.CENTER); + + main.add(textPanel, BorderLayout.CENTER); JButton btnPass = new JButton("Pass"); btnPass.addActionListener((e) -> { @@ -822,7 +948,7 @@ public void windowClosing(WindowEvent e) { private static JComponent createCapturePanel() { JComboBox screenShortType = new JComboBox<>(CaptureType.values()); - JButton capture = new JButton("ScreenShot"); + JButton capture = new JButton("Screenshot"); capture.addActionListener((e) -> captureScreen((CaptureType) screenShortType.getSelectedItem())); @@ -834,7 +960,7 @@ private static JComponent createCapturePanel() { private enum CaptureType { FULL_SCREEN("Capture Full Screen"), - WINDOWS("Capture Individual Frame"); + WINDOWS("Capture Frames"); private final String type; CaptureType(String type) { From 9fc1c684421043ac8df9ac7cd10fefd2a75e7a6b Mon Sep 17 00:00:00 2001 From: Sorin Basca Date: Wed, 2 Oct 2024 15:30:21 +0000 Subject: [PATCH 283/307] 8339850: Restore the interrupt status in FileSystemPreferences.lockFile() Reviewed-by: bpb, djelinski, vtewari --- .../unix/classes/java/util/prefs/FileSystemPreferences.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java b/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java index ed76ce57f9472..5f0531c0ff7de 100644 --- a/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java +++ b/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.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 @@ -957,6 +957,8 @@ private boolean lockFile(boolean shared) throws SecurityException{ try { Thread.sleep(sleepTime); } catch(InterruptedException e) { + // Don't lose the interrupt. + Thread.currentThread().interrupt(); checkLockFile0ErrorCode(errorCode); return false; } From 0bdfe88e4c5d2f2364b07b803aae16ca0ba7b9d2 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Wed, 2 Oct 2024 15:51:56 +0000 Subject: [PATCH 284/307] 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time Reviewed-by: alanb, dholmes, iklam --- src/hotspot/share/cds/cdsConfig.cpp | 2 +- src/hotspot/share/cds/filemap.cpp | 66 ++- src/hotspot/share/cds/filemap.hpp | 2 + src/hotspot/share/cds/heapShared.cpp | 20 + src/hotspot/share/cds/metaspaceShared.cpp | 4 + src/hotspot/share/classfile/classLoader.cpp | 2 + .../share/classfile/classLoaderExt.cpp | 49 ++- .../share/classfile/classLoaderExt.hpp | 11 + src/hotspot/share/runtime/arguments.cpp | 5 + src/hotspot/share/runtime/arguments.hpp | 1 + .../internal/loader/BuiltinClassLoader.java | 3 + .../jdk/internal/loader/ClassLoaders.java | 7 - .../jdk/internal/module/ModuleBootstrap.java | 33 +- .../jdk/internal/module/ModuleReferences.java | 21 +- test/hotspot/jtreg/TEST.groups | 2 + .../appcds/dynamicArchive/MainModuleOnly.java | 6 +- .../jigsaw/modulepath/MainModuleOnly.java | 6 +- .../jigsaw/modulepath/ModulePathAndFMG.java | 385 ++++++++++++++++++ .../OptimizeModuleHandlingTest.java | 17 +- 19 files changed, 591 insertions(+), 51 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/ModulePathAndFMG.java diff --git a/src/hotspot/share/cds/cdsConfig.cpp b/src/hotspot/share/cds/cdsConfig.cpp index a0a562eca21a0..5915424c4fe87 100644 --- a/src/hotspot/share/cds/cdsConfig.cpp +++ b/src/hotspot/share/cds/cdsConfig.cpp @@ -236,7 +236,7 @@ void CDSConfig::init_shared_archive_paths() { } void CDSConfig::check_internal_module_property(const char* key, const char* value) { - if (Arguments::is_internal_module_property(key)) { + if (Arguments::is_internal_module_property(key) && !Arguments::is_module_path_property(key)) { stop_using_optimized_module_handling(); log_info(cds)("optimized module handling: disabled due to incompatible property: %s=%s", key, value); } diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index 78613ae4b36c4..715fce5f3fc86 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -781,12 +781,12 @@ bool FileMapInfo::check_paths(int shared_path_start_idx, int num_paths, Growable assert(strlen(rp_array->at(i)) > (size_t)runtime_prefix_len, "sanity"); const char* runtime_path = rp_array->at(i) + runtime_prefix_len; if (!os::same_files(dumptime_path, runtime_path)) { - return true; + return false; } i++; j++; } - return false; + return true; } bool FileMapInfo::validate_boot_class_paths() { @@ -810,7 +810,7 @@ bool FileMapInfo::validate_boot_class_paths() { char* rp = skip_first_path_entry(runtime_boot_path); assert(shared_path(0)->is_modules_image(), "first shared_path must be the modules image"); int dp_len = header()->app_class_paths_start_index() - 1; // ignore the first path to the module image - bool mismatch = false; + bool match = true; bool relaxed_check = !header()->has_platform_or_app_classes(); if (dp_len == 0 && rp == nullptr) { @@ -823,7 +823,7 @@ bool FileMapInfo::validate_boot_class_paths() { if (check_paths_existence(rp)) { // If a path exists in the runtime boot paths, it is considered a mismatch // since there's no boot path specified during dump time. - mismatch = true; + match = false; } } } else if (dp_len > 0 && rp != nullptr) { @@ -840,16 +840,16 @@ bool FileMapInfo::validate_boot_class_paths() { // check the full runtime boot path, must match with dump time num = rp_len; } - mismatch = check_paths(1, num, rp_array, 0, 0); + match = check_paths(1, num, rp_array, 0, 0); } else { // create_path_array() ignores non-existing paths. Although the dump time and runtime boot classpath lengths // are the same initially, after the call to create_path_array(), the runtime boot classpath length could become // shorter. We consider boot classpath mismatch in this case. - mismatch = true; + match = false; } } - if (mismatch) { + if (!match) { // The paths are different return classpath_failure("[BOOT classpath mismatch, actual =", runtime_boot_path); } @@ -860,7 +860,7 @@ bool FileMapInfo::validate_app_class_paths(int shared_app_paths_len) { const char *appcp = Arguments::get_appclasspath(); assert(appcp != nullptr, "null app classpath"); int rp_len = num_paths(appcp); - bool mismatch = false; + bool match = false; if (rp_len < shared_app_paths_len) { return classpath_failure("Run time APP classpath is shorter than the one at dump time: ", appcp); } @@ -889,8 +889,8 @@ bool FileMapInfo::validate_app_class_paths(int shared_app_paths_len) { // run 2: -cp x.jar:NE4:b.jar -> x.jar:b.jar -> mismatched int j = header()->app_class_paths_start_index(); - mismatch = check_paths(j, shared_app_paths_len, rp_array, 0, 0); - if (mismatch) { + match = check_paths(j, shared_app_paths_len, rp_array, 0, 0); + if (!match) { // To facilitate app deployment, we allow the JAR files to be moved *together* to // a different location, as long as they are still stored under the same directory // structure. E.g., the following is OK. @@ -901,10 +901,10 @@ bool FileMapInfo::validate_app_class_paths(int shared_app_paths_len) { if (dumptime_prefix_len != 0 || runtime_prefix_len != 0) { log_info(class, path)("LCP length for app classpath (dumptime: %u, runtime: %u)", dumptime_prefix_len, runtime_prefix_len); - mismatch = check_paths(j, shared_app_paths_len, rp_array, + match = check_paths(j, shared_app_paths_len, rp_array, dumptime_prefix_len, runtime_prefix_len); } - if (mismatch) { + if (!match) { return classpath_failure("[APP classpath mismatch, actual: -Djava.class.path=", appcp); } } @@ -926,15 +926,35 @@ void FileMapInfo::log_paths(const char* msg, int start_idx, int end_idx) { } } +void FileMapInfo::extract_module_paths(const char* runtime_path, GrowableArray* module_paths) { + GrowableArray* path_array = create_path_array(runtime_path); + int num_paths = path_array->length(); + for (int i = 0; i < num_paths; i++) { + const char* name = path_array->at(i); + ClassLoaderExt::extract_jar_files_from_path(name, module_paths); + } + // module paths are stored in sorted order in the CDS archive. + module_paths->sort(ClassLoaderExt::compare_module_path_by_name); +} + bool FileMapInfo::check_module_paths() { - const char* rp = Arguments::get_property("jdk.module.path"); - int num_paths = CDSConfig::num_archives(rp); - if (num_paths != header()->num_module_paths()) { + const char* runtime_path = Arguments::get_property("jdk.module.path"); + int archived_num_module_paths = header()->num_module_paths(); + if (runtime_path == nullptr && archived_num_module_paths == 0) { + return true; + } + if ((runtime_path == nullptr && archived_num_module_paths > 0) || + (runtime_path != nullptr && archived_num_module_paths == 0)) { return false; } ResourceMark rm; - GrowableArray* rp_array = create_path_array(rp); - return check_paths(header()->app_module_paths_start_index(), num_paths, rp_array, 0, 0); + GrowableArray* module_paths = new GrowableArray(3); + extract_module_paths(runtime_path, module_paths); + int num_paths = module_paths->length(); + if (num_paths != archived_num_module_paths) { + return false; + } + return check_paths(header()->app_module_paths_start_index(), num_paths, module_paths, 0, 0); } bool FileMapInfo::validate_shared_path_table() { @@ -944,6 +964,16 @@ bool FileMapInfo::validate_shared_path_table() { // Load the shared path table info from the archive header _shared_path_table = header()->shared_path_table(); + + bool matched_module_paths = true; + if (CDSConfig::is_dumping_dynamic_archive() || header()->has_full_module_graph()) { + matched_module_paths = check_module_paths(); + } + if (header()->has_full_module_graph() && !matched_module_paths) { + CDSConfig::stop_using_optimized_module_handling(); + log_info(cds)("optimized module handling: disabled because of mismatched module paths"); + } + if (CDSConfig::is_dumping_dynamic_archive()) { // Only support dynamic dumping with the usage of the default CDS archive // or a simple base archive. @@ -959,7 +989,7 @@ bool FileMapInfo::validate_shared_path_table() { "Dynamic archiving is disabled because base layer archive has appended boot classpath"); } if (header()->num_module_paths() > 0) { - if (!check_module_paths()) { + if (!matched_module_paths) { CDSConfig::disable_dumping_dynamic_archive(); log_warning(cds)( "Dynamic archiving is disabled because base layer archive has a different module path"); diff --git a/src/hotspot/share/cds/filemap.hpp b/src/hotspot/share/cds/filemap.hpp index 1bf2510a3351c..6650f52440881 100644 --- a/src/hotspot/share/cds/filemap.hpp +++ b/src/hotspot/share/cds/filemap.hpp @@ -271,6 +271,7 @@ class FileMapHeader: private CDSFileMapHeaderBase { bool compressed_oops() const { return _compressed_oops; } bool compressed_class_pointers() const { return _compressed_class_ptrs; } HeapRootSegments heap_root_segments() const { return _heap_root_segments; } + bool has_full_module_graph() const { return _has_full_module_graph; } 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; } @@ -554,6 +555,7 @@ class FileMapInfo : public CHeapObj { GrowableArray* rp_array, unsigned int dumptime_prefix_len, unsigned int runtime_prefix_len) NOT_CDS_RETURN_(false); + void extract_module_paths(const char* runtime_path, GrowableArray* module_paths); bool validate_boot_class_paths() NOT_CDS_RETURN_(false); bool validate_app_class_paths(int shared_app_paths_len) NOT_CDS_RETURN_(false); bool map_heap_region_impl() NOT_CDS_JAVA_HEAP_RETURN_(false); diff --git a/src/hotspot/share/cds/heapShared.cpp b/src/hotspot/share/cds/heapShared.cpp index 1fddcb0d81f8a..1f07e972f059a 100644 --- a/src/hotspot/share/cds/heapShared.cpp +++ b/src/hotspot/share/cds/heapShared.cpp @@ -33,6 +33,7 @@ #include "cds/heapShared.hpp" #include "cds/metaspaceShared.hpp" #include "classfile/classLoaderData.hpp" +#include "classfile/classLoaderExt.hpp" #include "classfile/javaClasses.inline.hpp" #include "classfile/modules.hpp" #include "classfile/stringTable.hpp" @@ -55,6 +56,7 @@ #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.inline.hpp" #include "prims/jvmtiExport.hpp" +#include "runtime/arguments.hpp" #include "runtime/fieldDescriptor.inline.hpp" #include "runtime/init.hpp" #include "runtime/javaCalls.hpp" @@ -875,6 +877,17 @@ void HeapShared::initialize_from_archived_subgraph(JavaThread* current, Klass* k return; // nothing to do } + if (k->name()->equals("jdk/internal/module/ArchivedModuleGraph") && + !CDSConfig::is_using_optimized_module_handling() && + // archive was created with --module-path + ClassLoaderExt::num_module_paths() > 0) { + // ArchivedModuleGraph was created with a --module-path that's different than the runtime --module-path. + // Thus, it might contain references to modules that do not exist at runtime. We cannot use it. + log_info(cds, heap)("Skip initializing ArchivedModuleGraph subgraph: is_using_optimized_module_handling=%s num_module_paths=%d", + BOOL_TO_STR(CDSConfig::is_using_optimized_module_handling()), ClassLoaderExt::num_module_paths()); + return; + } + ExceptionMark em(THREAD); const ArchivedKlassSubGraphInfoRecord* record = resolve_or_init_classes_for_subgraph_of(k, /*do_init=*/true, THREAD); @@ -1123,6 +1136,13 @@ bool HeapShared::archive_reachable_objects_from(int level, // these objects that are referenced (directly or indirectly) by static fields. ResourceMark rm; log_error(cds, heap)("Cannot archive object of class %s", orig_obj->klass()->external_name()); + if (log_is_enabled(Trace, cds, heap)) { + WalkOopAndArchiveClosure* walker = WalkOopAndArchiveClosure::current(); + if (walker != nullptr) { + LogStream ls(Log(cds, heap)::trace()); + CDSHeapVerifier::trace_to_root(&ls, walker->referencing_obj()); + } + } MetaspaceShared::unrecoverable_writing_error(); } diff --git a/src/hotspot/share/cds/metaspaceShared.cpp b/src/hotspot/share/cds/metaspaceShared.cpp index b6f5d2be50f22..6f646e162ecac 100644 --- a/src/hotspot/share/cds/metaspaceShared.cpp +++ b/src/hotspot/share/cds/metaspaceShared.cpp @@ -301,6 +301,7 @@ void MetaspaceShared::post_initialize(TRAPS) { } ClassLoaderExt::init_paths_start_index(info->app_class_paths_start_index()); ClassLoaderExt::init_app_module_paths_start_index(info->app_module_paths_start_index()); + ClassLoaderExt::init_num_module_paths(info->header()->num_module_paths()); } } } @@ -792,6 +793,9 @@ void MetaspaceShared::preload_and_dump_impl(StaticArchiveBuilder& builder, TRAPS // Do this at the very end, when no Java code will be executed. Otherwise // some new strings may be added to the intern table. StringTable::allocate_shared_strings_array(CHECK); + } else { + log_info(cds)("Not dumping heap, reset CDSConfig::_is_using_optimized_module_handling"); + CDSConfig::stop_using_optimized_module_handling(); } #endif diff --git a/src/hotspot/share/classfile/classLoader.cpp b/src/hotspot/share/classfile/classLoader.cpp index 487d69a6f4fc9..9a68e2640443f 100644 --- a/src/hotspot/share/classfile/classLoader.cpp +++ b/src/hotspot/share/classfile/classLoader.cpp @@ -582,6 +582,8 @@ void ClassLoader::setup_module_search_path(JavaThread* current, const char* path new_entry = create_class_path_entry(current, path, &st, false /*is_boot_append */, false /* from_class_path_attr */); if (new_entry != nullptr) { + // ClassLoaderExt::process_module_table() filters out non-jar entries before calling this function. + assert(new_entry->is_jar_file(), "module path entry %s is not a jar file", new_entry->name()); add_to_module_path_entries(path, new_entry); } } diff --git a/src/hotspot/share/classfile/classLoaderExt.cpp b/src/hotspot/share/classfile/classLoaderExt.cpp index 997f9d76676fa..16981669deb3a 100644 --- a/src/hotspot/share/classfile/classLoaderExt.cpp +++ b/src/hotspot/share/classfile/classLoaderExt.cpp @@ -55,6 +55,7 @@ jshort ClassLoaderExt::_app_class_paths_start_index = ClassLoaderExt::max_classpath_index; jshort ClassLoaderExt::_app_module_paths_start_index = ClassLoaderExt::max_classpath_index; jshort ClassLoaderExt::_max_used_path_index = 0; +int ClassLoaderExt::_num_module_paths = 0; bool ClassLoaderExt::_has_app_classes = false; bool ClassLoaderExt::_has_platform_classes = false; bool ClassLoaderExt::_has_non_jar_in_classpath = false; @@ -89,21 +90,25 @@ void ClassLoaderExt::setup_app_search_path(JavaThread* current) { os::free(app_class_path); } +int ClassLoaderExt::compare_module_path_by_name(const char** p1, const char** p2) { + return strcmp(*p1, *p2); +} + void ClassLoaderExt::process_module_table(JavaThread* current, ModuleEntryTable* met) { ResourceMark rm(current); - GrowableArray* module_paths = new GrowableArray(5); + GrowableArray* module_paths = new GrowableArray(5); class ModulePathsGatherer : public ModuleClosure { JavaThread* _current; - GrowableArray* _module_paths; + GrowableArray* _module_paths; public: - ModulePathsGatherer(JavaThread* current, GrowableArray* module_paths) : + ModulePathsGatherer(JavaThread* current, GrowableArray* module_paths) : _current(current), _module_paths(module_paths) {} void do_module(ModuleEntry* m) { char* uri = m->location()->as_C_string(); if (strncmp(uri, "file:", 5) == 0) { char* path = ClassLoader::uri_to_path(uri); - _module_paths->append(path); + extract_jar_files_from_path(path, _module_paths); } } }; @@ -114,6 +119,10 @@ void ClassLoaderExt::process_module_table(JavaThread* current, ModuleEntryTable* met->modules_do(&gatherer); } + // Sort the module paths before storing into CDS archive for simpler + // checking at runtime. + module_paths->sort(compare_module_path_by_name); + for (int i = 0; i < module_paths->length(); i++) { ClassLoader::setup_module_search_path(current, module_paths->at(i)); } @@ -129,6 +138,38 @@ void ClassLoaderExt::setup_module_paths(JavaThread* current) { process_module_table(current, met); } +bool ClassLoaderExt::has_jar_suffix(const char* filename) { + // In jdk.internal.module.ModulePath.readModule(), it checks for the ".jar" suffix. + // Performing the same check here. + const char* dot = strrchr(filename, '.'); + if (dot != nullptr && strcmp(dot + 1, "jar") == 0) { + return true; + } + return false; +} + +void ClassLoaderExt::extract_jar_files_from_path(const char* path, GrowableArray* module_paths) { + DIR* dirp = os::opendir(path); + if (dirp == nullptr && errno == ENOTDIR && has_jar_suffix(path)) { + module_paths->append(path); + } else { + if (dirp != nullptr) { + struct dirent* dentry; + while ((dentry = os::readdir(dirp)) != nullptr) { + const char* file_name = dentry->d_name; + if (has_jar_suffix(file_name)) { + size_t full_name_len = strlen(path) + strlen(file_name) + strlen(os::file_separator()) + 1; + char* full_name = NEW_RESOURCE_ARRAY(char, full_name_len); + int n = os::snprintf(full_name, full_name_len, "%s%s%s", path, os::file_separator(), file_name); + assert((size_t)n == full_name_len - 1, "Unexpected number of characters in string"); + module_paths->append(full_name); + } + } + os::closedir(dirp); + } + } +} + char* ClassLoaderExt::read_manifest(JavaThread* current, ClassPathEntry* entry, jint *manifest_size, bool clean_text) { const char* name = "META-INF/MANIFEST.MF"; diff --git a/src/hotspot/share/classfile/classLoaderExt.hpp b/src/hotspot/share/classfile/classLoaderExt.hpp index b76ce3ff33a32..c3c0b00d55e43 100644 --- a/src/hotspot/share/classfile/classLoaderExt.hpp +++ b/src/hotspot/share/classfile/classLoaderExt.hpp @@ -53,12 +53,15 @@ class ClassLoaderExt: public ClassLoader { // AllStatic static jshort _app_module_paths_start_index; // the largest path index being used during CDS dump time static jshort _max_used_path_index; + // number of module paths + static int _num_module_paths; static bool _has_app_classes; static bool _has_platform_classes; static bool _has_non_jar_in_classpath; static char* read_manifest(JavaThread* current, ClassPathEntry* entry, jint *manifest_size, bool clean_text); + static bool has_jar_suffix(const char* filename); public: static void process_jar_manifest(JavaThread* current, ClassPathEntry* entry); @@ -68,6 +71,8 @@ class ClassLoaderExt: public ClassLoader { // AllStatic static void setup_search_paths(JavaThread* current); static void setup_module_paths(JavaThread* current); + static void extract_jar_files_from_path(const char* path, GrowableArray* module_paths); + static int compare_module_path_by_name(const char** p1, const char** p2); static char* read_manifest(JavaThread* current, ClassPathEntry* entry, jint *manifest_size) { // Remove all the new-line continuations (which wrap long lines at 72 characters, see @@ -87,6 +92,8 @@ class ClassLoaderExt: public ClassLoader { // AllStatic static jshort max_used_path_index() { return _max_used_path_index; } + static int num_module_paths() { return _num_module_paths; } + static void set_max_used_path_index(jshort used_index) { _max_used_path_index = used_index; } @@ -99,6 +106,10 @@ class ClassLoaderExt: public ClassLoader { // AllStatic _app_module_paths_start_index = module_start; } + static void init_num_module_paths(int num_module_paths) { + _num_module_paths = num_module_paths; + } + static bool is_boot_classpath(int classpath_index) { return classpath_index < _app_class_paths_start_index; } diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 0df3492f92557..fe9641063b33e 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -336,6 +336,11 @@ bool Arguments::is_internal_module_property(const char* property) { return false; } +// Return true if the key matches the --module-path property name ("jdk.module.path"). +bool Arguments::is_module_path_property(const char* key) { + return (strcmp(key, MODULE_PROPERTY_PREFIX PATH) == 0); +} + // Process java launcher properties. void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) { // See if sun.java.launcher or sun.java.launcher.is_altjvm is defined. diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp index 8251db3d0d59a..e1bfc0438dc90 100644 --- a/src/hotspot/share/runtime/arguments.hpp +++ b/src/hotspot/share/runtime/arguments.hpp @@ -461,6 +461,7 @@ class Arguments : AllStatic { static int PropertyList_readable_count(SystemProperty* pl); static bool is_internal_module_property(const char* option); + static bool is_module_path_property(const char* key); // Miscellaneous System property value getter and setters. static void set_dll_dir(const char *value) { _sun_boot_library_path->set_value(value); } diff --git a/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java b/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java index 1f7df79009f51..84e5c50672d81 100644 --- a/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java +++ b/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java @@ -1084,5 +1084,8 @@ private static URL checkURL(URL url) { private void resetArchivedStates() { ucp = null; resourceCache = null; + if (!moduleToReader.isEmpty()) { + moduleToReader.clear(); + } } } diff --git a/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java b/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java index 7b0f4d13e4096..ab4aa3fb90734 100644 --- a/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java +++ b/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java @@ -210,13 +210,6 @@ void appendToClassPathForInstrumentation(String path) { protected Package defineOrCheckPackage(String pn, Manifest man, URL url) { return super.defineOrCheckPackage(pn, man, url); } - - /** - * Called by the VM, during -Xshare:dump - */ - private void resetArchivedStates() { - setClassPath(null); - } } /** 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 04d607d06bb21..656104e2455fc 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java @@ -33,6 +33,7 @@ import java.lang.module.ModuleReference; import java.lang.module.ResolvedModule; import java.net.URI; +import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; @@ -139,7 +140,6 @@ public static ModuleFinder limitedFinder() { */ private static boolean canUseArchivedBootLayer() { return getProperty("jdk.module.upgrade.path") == null && - getProperty("jdk.module.path") == null && getProperty("jdk.module.patch.0") == null && // --patch-module getProperty("jdk.module.addmods.0") == null && // --add-modules getProperty("jdk.module.limitmods") == null && // --limit-modules @@ -203,7 +203,8 @@ private static ModuleLayer boot2() { SystemModules systemModules = null; ModuleFinder systemModuleFinder; - boolean haveModulePath = (appModulePath != null || upgradeModulePath != null); + boolean haveUpgradeModulePath = (upgradeModulePath != null); + boolean haveModulePath = (appModulePath != null || haveUpgradeModulePath); boolean needResolution = true; boolean mayContainSplitPackages = true; boolean mayContainIncubatorModules = true; @@ -463,7 +464,10 @@ private static ModuleLayer boot2() { // Step 8: CDS dump phase - if (CDS.isDumpingStaticArchive() && !haveModulePath && addModules.isEmpty()) { + if (CDS.isDumpingStaticArchive() + && !haveUpgradeModulePath + && addModules.isEmpty() + && allJrtOrModularJar(cf)) { assert !isPatched; // Archive module graph and maybe boot layer @@ -510,6 +514,29 @@ private static void loadModules(Configuration cf, } } + /** + * Returns true if all modules in the configuration are in the run-time image or + * modular JAR files. + */ + private static boolean allJrtOrModularJar(Configuration cf) { + return !cf.modules().stream() + .map(m -> m.reference().location().orElseThrow()) + .anyMatch(uri -> !uri.getScheme().equalsIgnoreCase("jrt") + && !isJarFile(uri)); + } + + /** + * Returns true if the given URI locates a jar file on the file system. + */ + private static boolean isJarFile(URI uri) { + if ("file".equalsIgnoreCase(uri.getScheme())) { + Path path = Path.of(uri); + return path.toString().endsWith(".jar") && Files.isRegularFile(path); + } else { + return false; + } + } + /** * Returns true if the configuration contains modules with overlapping packages. */ diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java b/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java index 346838b47d995..a5ad79eb7c603 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java @@ -91,8 +91,19 @@ static ModuleReference newJarModule(ModuleInfo.Attributes attrs, ModulePatcher patcher, Path file) { URI uri = file.toUri(); - Supplier supplier = () -> new JarModuleReader(file, uri); - HashSupplier hasher = (a) -> ModuleHashes.computeHash(supplier, a); + String fileString = file.toString(); + Supplier supplier = new Supplier<>() { + @Override + public ModuleReader get() { + return new JarModuleReader(fileString, uri); + } + }; + HashSupplier hasher = new HashSupplier() { + @Override + public byte[] generate(String algorithm) { + return ModuleHashes.computeHash(supplier, algorithm); + } + }; return newModule(attrs, uri, supplier, patcher, hasher); } @@ -222,9 +233,9 @@ static class JarModuleReader extends SafeCloseModuleReader { private final JarFile jf; private final URI uri; - static JarFile newJarFile(Path path) { + static JarFile newJarFile(String path) { try { - return new JarFile(new File(path.toString()), + return new JarFile(new File(path), true, // verify ZipFile.OPEN_READ, JarFile.runtimeVersion()); @@ -233,7 +244,7 @@ static JarFile newJarFile(Path path) { } } - JarModuleReader(Path path, URI uri) { + JarModuleReader(String path, URI uri) { this.jf = newJarFile(path); this.uri = uri; } diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index 37bcb6883a4c6..f54dc79fcfc8f 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -438,6 +438,8 @@ hotspot_appcds_dynamic = \ -runtime/cds/appcds/complexURI \ -runtime/cds/appcds/customLoader \ -runtime/cds/appcds/dynamicArchive \ + -runtime/cds/appcds/jigsaw/modulepath/ModulePathAndFMG.java \ + -runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java \ -runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java \ -runtime/cds/appcds/javaldr/ArrayTest.java \ -runtime/cds/appcds/javaldr/ExceptionDuringDumpAtObjectsInitPhase.java \ diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/MainModuleOnly.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/MainModuleOnly.java index 0dd4af2e4509e..e74229869edce 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/MainModuleOnly.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/MainModuleOnly.java @@ -213,8 +213,10 @@ public static void doTest(String topArchiveName) throws Exception { "-cp", destJar.toString(), "--module-path", MODS_DIR.toString(), "-m", TEST_MODULE1 + "/" + MAIN_CLASS) - .assertAbnormalExit(output -> { - output.shouldMatch("Error: non-empty directory.*com.simple"); + // After JDK-8328313, non-empty module path directory won't be included + // in the shared paths table. + .assertNormalExit(output -> { + output.shouldNotMatch("Error: non-empty directory.*com.simple"); }); // test module path with very long length diff --git a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/MainModuleOnly.java b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/MainModuleOnly.java index 50191b91e1ef5..ac9bb5adc006d 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/MainModuleOnly.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/MainModuleOnly.java @@ -194,8 +194,10 @@ public static void main(String... args) throws Exception { output = TestCommon.createArchive(destJar.toString(), appClasses, "--module-path", MODS_DIR.toString(), "-m", mainModule); - output.shouldHaveExitValue(1) - .shouldMatch("Error: non-empty directory.*com.simple"); + // After JDK-8328313, non-empty module path directory won't be included + // in the shared paths table. + output.shouldHaveExitValue(0) + .shouldNotMatch("Error: non-empty directory.*com.simple"); // test module path with very long length // diff --git a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/ModulePathAndFMG.java b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/ModulePathAndFMG.java new file mode 100644 index 0000000000000..fe77714204670 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/ModulePathAndFMG.java @@ -0,0 +1,385 @@ +/* + * 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 8328313 + * @requires vm.cds & !vm.graal.enabled & vm.cds.write.archived.java.heap + * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds + * @run driver ModulePathAndFMG + * @summary test module path changes for full module graph handling. + * + */ + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; + +import jdk.test.lib.cds.CDSTestUtils; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class ModulePathAndFMG { + private static final String JAVA_HOME = System.getProperty("java.home"); + + private static final Path USER_DIR = Paths.get(CDSTestUtils.getOutputDir()); + + private static final String TEST_SRC = System.getProperty("test.src"); + + private static final Path SRC_DIR = Paths.get(TEST_SRC, "src"); + private static final Path MODS_DIR = Paths.get("mody"); + private static final Path JMOD_DIR = Paths.get("jmod_dir"); + + // the module name of the test module + private static final String MAIN_MODULE = "com.bars"; + private static final String TEST_MODULE = "com.foos"; + private static final String DUP_MODULE = "com.foos3"; + + // the module main class + private static final String MAIN_CLASS = "com.bars.Main"; + private static final String TEST_CLASS = "com.foos.Test"; + + private static String PATH_LIBS = "modylibs"; + private static String DUP_LIBS = "duplibs"; + private static Path libsDir = null; + private static Path dupDir = null; + private static Path jmodDir = null; + private static Path mainJar = null; + private static Path testJar = null; + private static Path dupJar = null; + private static Path badJar = null; + + private static String CLASS_FOUND_MESSAGE = "com.foos.Test found"; + private static String CLASS_NOT_FOUND_MESSAGE = "java.lang.ClassNotFoundException: com.foos.Test"; + private static String FIND_EXCEPTION_MESSAGE = "java.lang.module.FindException: Module com.foos not found, required by com.bars"; + private static String MODULE_NOT_RECOGNIZED = "Module format not recognized:.*modylibs.*com.bars.JAR"; + private static String OPTIMIZE_ENABLED = "] optimized module handling: enabled"; + private static String OPTIMIZE_DISABLED = "] optimized module handling: disabled"; + private static String FMG_ENABLED = "] full module graph: enabled"; + private static String FMG_DISABLED = "] full module graph: disabled"; + private static String MAIN_FROM_JAR = "class,load.*com.bars.Main.*[.]jar"; + private static String MAIN_FROM_CDS = "class,load.*com.bars.Main.*shared objects file"; + private static String MAIN_FROM_MODULE = "class,load.*com.bars.Main.*mody/com.bars"; + private static String TEST_FROM_JAR = "class,load.*com.foos.Test.*[.]jar"; + private static String TEST_FROM_CDS = "class,load.*com.foos.Test.*shared objects file"; + private static String MAP_FAILED = "Unable to use shared archive"; + private static String PATH_SEPARATOR = File.pathSeparator; + private static String appClasses[] = {MAIN_CLASS, TEST_CLASS}; + private static String prefix[] = {"-Djava.class.path=", "-Xlog:cds,class+load,class+path=info"}; + + public static void buildTestModule() throws Exception { + + // javac -d mods/$TESTMODULE src/$TESTMODULE/** + JarBuilder.compileModule(SRC_DIR.resolve(TEST_MODULE), + MODS_DIR.resolve(TEST_MODULE), + null); + + // javac -d mods/$TESTMODULE --module-path MOD_DIR src/$TESTMODULE/** + JarBuilder.compileModule(SRC_DIR.resolve(MAIN_MODULE), + MODS_DIR.resolve(MAIN_MODULE), + MODS_DIR.toString()); + + libsDir = Files.createTempDirectory(USER_DIR, PATH_LIBS); + mainJar = libsDir.resolve(MAIN_MODULE + ".jar"); + testJar = libsDir.resolve(TEST_MODULE + ".jar"); + + // modylibs contains both modules com.foos.jar, com.bars.jar + // build com.foos.jar + String classes = MODS_DIR.resolve(TEST_MODULE).toString(); + JarBuilder.createModularJar(testJar.toString(), classes, TEST_CLASS); + + // build com.bars.jar + classes = MODS_DIR.resolve(MAIN_MODULE).toString(); + JarBuilder.createModularJar(mainJar.toString(), classes, MAIN_CLASS); + + dupDir = Files.createTempDirectory(USER_DIR, DUP_LIBS); + dupJar = dupDir.resolve(DUP_MODULE + ".jar"); + Files.copy(testJar, dupJar, StandardCopyOption.REPLACE_EXISTING); + + badJar = libsDir.resolve(MAIN_MODULE + ".JAR"); + Files.copy(mainJar, badJar, StandardCopyOption.REPLACE_EXISTING); + } + + public static void buildJmod() throws Exception { + Path jmod = Paths.get(JAVA_HOME, "bin", "jmod"); + jmodDir = Files.createDirectory(Paths.get(USER_DIR.toString() + File.separator + JMOD_DIR.toString())); + OutputAnalyzer output = ProcessTools.executeProcess(jmod.toString(), + "create", + "--class-path", Paths.get(USER_DIR.toString(), MODS_DIR.toString(), TEST_MODULE).toString(), + "--module-version", "1.0", + "--main-class", TEST_CLASS, + jmodDir.toString() + File.separator + TEST_MODULE + ".jmod"); + output.shouldHaveExitValue(0); + } + + public static void main(String... args) throws Exception { + runWithModulePath(); + runWithExplodedModule(); + runWithJmodAndBadJar(); + } + + private static void tty(String... args) { + for (String s : args) { + System.out.print(s + " "); + } + System.out.print("\n"); + } + + public static void runWithModulePath() throws Exception { + // compile the modules and create the modular jar files + buildTestModule(); + // create an archive with the classes in the modules built in the + // previous step + OutputAnalyzer output = TestCommon.createArchive( + null, appClasses, + "--module-path", + libsDir.toString(), + "-m", MAIN_MODULE); + TestCommon.checkDump(output); + + tty("1. run with CDS on, with module path same as dump time"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + libsDir.toString(), // --module-path + MAIN_MODULE) // -m + .assertNormalExit(out -> { + out.shouldNotContain(OPTIMIZE_DISABLED) + .shouldContain(OPTIMIZE_ENABLED) + .shouldNotContain(FMG_DISABLED) + .shouldContain(FMG_ENABLED) + .shouldMatch(MAIN_FROM_CDS) // archived Main class is for module only + .shouldContain(CLASS_FOUND_MESSAGE); + }); + + tty("2. run with CDS on, with jar on path"); + TestCommon.run("-Xlog:cds", + "-Xlog:class+load", + "-cp", mainJar.toString() + PATH_SEPARATOR + testJar.toString(), + MAIN_CLASS) + .assertNormalExit(out -> { + out.shouldContain(CLASS_FOUND_MESSAGE) + .shouldMatch(MAIN_FROM_JAR) + .shouldMatch(TEST_FROM_JAR) + .shouldContain(OPTIMIZE_DISABLED) + .shouldNotContain(OPTIMIZE_ENABLED) + .shouldContain(FMG_DISABLED) + .shouldNotContain(FMG_ENABLED); + }); + + tty("3. run with CDS on, with --module-path, with jar should fail"); + TestCommon.run("-Xlog:cds", + "-Xlog:class+load", + "-p", libsDir.toString(), + "-cp", mainJar.toString(), + MAIN_CLASS) + .assertNormalExit(out -> { + out.shouldContain(CLASS_NOT_FOUND_MESSAGE) + .shouldMatch(MAIN_FROM_JAR) + .shouldNotContain(FMG_ENABLED) + .shouldNotContain(OPTIMIZE_ENABLED); + }); + + final String modularJarPath = mainJar.toString() + PATH_SEPARATOR + testJar.toString(); + + tty("4. run with CDS on, with modular jars specified --module-path, should pass"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + modularJarPath, // --module-path + MAIN_MODULE) // -m + .assertNormalExit(out -> { + out.shouldNotContain(OPTIMIZE_DISABLED) + .shouldContain(OPTIMIZE_ENABLED) + .shouldNotContain(FMG_DISABLED) + .shouldContain(FMG_ENABLED) + .shouldMatch(MAIN_FROM_CDS); // archived Main class is for module only + }); + + final String extraModulePath = libsDir.toString() + PATH_SEPARATOR + dupDir.toString(); + // create an archive with an extra module which is not referenced + output = TestCommon.createArchive( + null, appClasses, + "--module-path", + extraModulePath, + "-m", MAIN_MODULE); + TestCommon.checkDump(output); + + tty("5. run with CDS on, without the extra module specified in dump time, should pass"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + libsDir.toString(), // --module-path + MAIN_MODULE) // -m + .assertNormalExit(out -> { + out.shouldNotContain(OPTIMIZE_DISABLED) + .shouldContain(OPTIMIZE_ENABLED) + .shouldNotContain(FMG_DISABLED) + .shouldContain(FMG_ENABLED) + .shouldMatch(MAIN_FROM_CDS) // archived Main class is for module only + .shouldContain(CLASS_FOUND_MESSAGE); + }); + tty("6. run with CDS on, with the extra module specified in dump time"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + extraModulePath, // --module-path + MAIN_MODULE) // -m + .assertNormalExit(out -> { + out.shouldNotContain(OPTIMIZE_ENABLED) + .shouldContain(OPTIMIZE_DISABLED) + .shouldNotContain(FMG_ENABLED) + .shouldContain(FMG_DISABLED) + .shouldMatch(MAIN_FROM_CDS) // archived Main class is for module only + .shouldContain(CLASS_FOUND_MESSAGE); + }); + + final String extraJarPath = modularJarPath + PATH_SEPARATOR + dupJar.toString(); + + // create an archive by specifying modular jars in the --module-path with an extra module which is not referenced + output = TestCommon.createArchive( + null, appClasses, + "--module-path", + extraJarPath, + "-m", MAIN_MODULE); + TestCommon.checkDump(output); + tty("7. run with CDS on, without the extra module specified in dump time, should pass"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + modularJarPath, // --module-path + MAIN_MODULE) // -m + .assertNormalExit(out -> { + out.shouldNotContain(OPTIMIZE_DISABLED) + .shouldContain(OPTIMIZE_ENABLED) + .shouldNotContain(FMG_DISABLED) + .shouldContain(FMG_ENABLED) + .shouldMatch(MAIN_FROM_CDS) // archived Main class is for module only + .shouldContain(CLASS_FOUND_MESSAGE); + }); + + tty("8. run with CDS on, with the extra module specified in dump time"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + extraJarPath, // --module-path + MAIN_MODULE) // -m + .assertNormalExit(out -> { + out.shouldNotContain(OPTIMIZE_ENABLED) + .shouldContain(OPTIMIZE_DISABLED) + .shouldNotContain(FMG_ENABLED) + .shouldContain(FMG_DISABLED) + .shouldMatch(MAIN_FROM_CDS) // archived Main class is for module only + .shouldContain(CLASS_FOUND_MESSAGE); + }); + tty("9. same as test case 8 but with paths instead of modular jars in the --module-path"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + extraModulePath, // --module-path + MAIN_MODULE) // -m + .assertNormalExit(out -> { + out.shouldNotContain(OPTIMIZE_ENABLED) + .shouldContain(OPTIMIZE_DISABLED) + .shouldNotContain(FMG_ENABLED) + .shouldContain(FMG_DISABLED) + .shouldMatch(MAIN_FROM_CDS) // archived Main class is for module only + .shouldContain(CLASS_FOUND_MESSAGE); + }); + } + + public static void runWithExplodedModule() throws Exception { + // create an archive with an exploded module in the module path. + OutputAnalyzer output = TestCommon.createArchive( + null, appClasses, + "--module-path", + MODS_DIR.toString(), + "-m", MAIN_MODULE + "/" + MAIN_CLASS); + TestCommon.checkDump(output); + + tty("10. run with CDS on, with exploded module in the module path"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + MODS_DIR.toString(), // --module-path + MAIN_MODULE + "/" + MAIN_CLASS) // -m + .assertNormalExit(out -> { + out.shouldContain(FMG_DISABLED) + .shouldMatch(MAIN_FROM_MODULE) // Main class loaded from the exploded module + .shouldContain(CLASS_FOUND_MESSAGE); + }); + } + + public static void runWithJmodAndBadJar() throws Exception { + buildJmod(); + + final String modularJarPath = mainJar.toString() + PATH_SEPARATOR + testJar.toString(); + // create an archive with --module-path com.bars.jar:com.foos.jar + OutputAnalyzer output = TestCommon.createArchive( + null, appClasses, + "--module-path", + modularJarPath, + "-m", MAIN_MODULE); + TestCommon.checkDump(output); + + String runModulePath = mainJar.toString() + PATH_SEPARATOR + + jmodDir.toString() + TEST_MODULE + ".jmod"; + tty("11. run with CDS on, with module path com.bars.jar:com.foos.jmod"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + runModulePath, // --module-path + MAIN_MODULE) // -m + .assertAbnormalExit(out -> { + out.shouldContain(OPTIMIZE_DISABLED) + .shouldNotContain(OPTIMIZE_ENABLED) + .shouldContain(FMG_DISABLED) + .shouldNotContain(FMG_ENABLED) + .shouldContain(FIND_EXCEPTION_MESSAGE); + }); + + runModulePath += PATH_SEPARATOR + testJar.toString(); + tty("12. run with CDS on, with module path com.bars.jar:com.foos.jmod:com.foos.jar"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + runModulePath, // --module-path + MAIN_MODULE) // -m + .assertNormalExit(out -> { + out.shouldNotContain(OPTIMIZE_DISABLED) + .shouldContain(OPTIMIZE_ENABLED) + .shouldNotContain(FMG_DISABLED) + .shouldContain(FMG_ENABLED) + .shouldMatch(TEST_FROM_CDS) + .shouldMatch(MAIN_FROM_CDS) + .shouldContain(CLASS_FOUND_MESSAGE); + }); + + runModulePath = badJar.toString() + PATH_SEPARATOR + testJar.toString(); + tty("13. run with CDS on, with module path com.bars.JAR:com.foos.jar"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + runModulePath, // --module-path + TEST_MODULE) // -m + .assertAbnormalExit(out -> { + out.shouldContain(OPTIMIZE_DISABLED) + .shouldNotContain(OPTIMIZE_ENABLED) + .shouldContain(FMG_DISABLED) + .shouldNotContain(FMG_ENABLED) + .shouldMatch(MODULE_NOT_RECOGNIZED); + }); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java index aeb5696830df4..cf6f4cd7fd3d5 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java @@ -24,7 +24,7 @@ /** * @test - * @requires vm.cds & !vm.graal.enabled + * @requires vm.cds & !vm.graal.enabled & vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @run driver OptimizeModuleHandlingTest * @summary test module path changes for optimization of @@ -64,8 +64,8 @@ public class OptimizeModuleHandlingTest { private static String CLASS_FOUND_MESSAGE = "com.foos.Test found"; private static String CLASS_NOT_FOUND_MESSAGE = "java.lang.ClassNotFoundException: com.foos.Test"; - private static String OPTIMIZE_ENABLED = "optimized module handling: enabled"; - private static String OPTIMIZE_DISABLED = "optimized module handling: disabled"; + private static String OPTIMIZE_ENABLED = "] optimized module handling: enabled"; + private static String OPTIMIZE_DISABLED = "] optimized module handling: disabled"; private static String MAIN_FROM_JAR = "class,load.*com.bars.Main.*[.]jar"; private static String MAIN_FROM_CDS = "class,load.*com.bars.Main.*shared objects file"; private static String TEST_FROM_JAR = "class,load.*com.foos.Test.*[.]jar"; @@ -154,14 +154,14 @@ public static void runWithModulePath(String... extraRuntimeArgs) throws Exceptio // Following 5 - 10 test with CDS on tty("5. run with CDS on, with module path"); - String prefix[] = {"-Djava.class.path=", "-Xlog:cds", "-Xlog:class+load"}; + String prefix[] = {"-Djava.class.path=", "-Xlog:cds,class+load,class+path=info"}; TestCommon.runWithModules(prefix, null, // --upgrade-module-path libsDir.toString(), // --module-path MAIN_MODULE) // -m .assertNormalExit(out -> { - out.shouldNotContain(OPTIMIZE_ENABLED) - .shouldContain(OPTIMIZE_DISABLED) + out.shouldNotContain(OPTIMIZE_DISABLED) + .shouldContain(OPTIMIZE_ENABLED) .shouldMatch(MAIN_FROM_CDS) // // archived Main class is for module only .shouldContain(CLASS_FOUND_MESSAGE); }); @@ -174,8 +174,8 @@ public static void runWithModulePath(String... extraRuntimeArgs) throws Exceptio out.shouldContain(CLASS_FOUND_MESSAGE) .shouldMatch(MAIN_FROM_CDS) .shouldMatch(TEST_FROM_CDS) - .shouldContain(OPTIMIZE_DISABLED) - .shouldNotContain(OPTIMIZE_ENABLED); + .shouldContain(OPTIMIZE_ENABLED) + .shouldNotContain(OPTIMIZE_DISABLED); }); tty("7. run with CDS on, with jar on path"); TestCommon.run("-Xlog:cds", @@ -231,7 +231,6 @@ public static void runWithModulePath(String... extraRuntimeArgs) throws Exceptio MAIN_CLASS) .assertAbnormalExit(out -> { out.shouldNotContain(CLASS_FOUND_MESSAGE) - .shouldContain(OPTIMIZE_DISABLED) // mapping info .shouldContain("shared class paths mismatch"); }); } From 76283dd2701ca4ad5c1c99a66f3e8e3d0fe55d44 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Wed, 2 Oct 2024 16:07:10 +0000 Subject: [PATCH 285/307] 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 Reviewed-by: kevinw, sgehwolf --- test/jdk/com/sun/tools/attach/java.policy.allow | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/jdk/com/sun/tools/attach/java.policy.allow b/test/jdk/com/sun/tools/attach/java.policy.allow index 3e63a207f61ff..1d4b714c90297 100644 --- a/test/jdk/com/sun/tools/attach/java.policy.allow +++ b/test/jdk/com/sun/tools/attach/java.policy.allow @@ -1,6 +1,4 @@ /* - * - * * Policy file used by unit tests for attach API */ grant { @@ -15,7 +13,10 @@ grant { permission java.lang.RuntimePermission "loadLibrary.attach"; permission java.util.PropertyPermission "sun.jvmstat.*", "read"; - /* to read configuration file in META-INF/services, and write/delete .attach_pid */ - permission java.io.FilePermission "<>", "read,write,delete"; + /* + * To read configuration file in META-INF/services, write/delete .attach_pid, + * and read symbolic link of /proc/self/ns/mnt. + */ + permission java.io.FilePermission "<>", "read,write,delete,readlink"; }; From c43202baf6eb7e49ec458037971a9efa392d053e Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Wed, 2 Oct 2024 16:10:48 +0000 Subject: [PATCH 286/307] 8341037: Use standard layouts in DefaultFrameIconTest.java and MenuCrash.java Reviewed-by: azvegint, prr --- test/jdk/java/awt/Frame/DefaultFrameIconTest.java | 12 +----------- test/jdk/java/awt/Frame/MenuCrash.java | 12 +----------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/test/jdk/java/awt/Frame/DefaultFrameIconTest.java b/test/jdk/java/awt/Frame/DefaultFrameIconTest.java index 3ca3b70dbd1a1..f8b48c6df2ca5 100644 --- a/test/jdk/java/awt/Frame/DefaultFrameIconTest.java +++ b/test/jdk/java/awt/Frame/DefaultFrameIconTest.java @@ -50,21 +50,11 @@ public static void main(String[] args) throws Exception { .instructions(INSTRUCTIONS) .columns(45) .testUI(DefaultFrameIconTest::createAndShowUI) - .positionTestUI(DefaultFrameIconTest::positionTestWindows) + .positionTestUIRightRow() .build() .awaitAndCheck(); } - private static void positionTestWindows(List testWindows, - PassFailJFrame.InstructionUI instructionUI) { - int gap = 5; - int x = instructionUI.getLocation().x + instructionUI.getSize().width + gap; - for (Window w : testWindows) { - w.setLocation(x, instructionUI.getLocation().y); - x += w.getWidth() + gap; - } - } - private static List createAndShowUI() { Frame testFrame = new Frame("Frame DefaultFrameIconTest"); Dialog testDialog = new Dialog(testFrame, "Dialog DefaultFrameIconTest"); diff --git a/test/jdk/java/awt/Frame/MenuCrash.java b/test/jdk/java/awt/Frame/MenuCrash.java index f41408ecdadfb..f68dd4ad00002 100644 --- a/test/jdk/java/awt/Frame/MenuCrash.java +++ b/test/jdk/java/awt/Frame/MenuCrash.java @@ -62,7 +62,7 @@ public static void main(String[] args) throws Exception { .instructions(INSTRUCTIONS) .columns(45) .testUI(MenuCrash::createAndShowUI) - .positionTestUI(MenuCrash::positionTestWindows) + .positionTestUIRightRow() .build() .awaitAndCheck(); } @@ -81,16 +81,6 @@ private static List createAndShowUI() { return List.of(frame1, frame2); } - private static void positionTestWindows(List testWindows, - PassFailJFrame.InstructionUI instructionUI) { - int gap = 5; - int x = instructionUI.getLocation().x + instructionUI.getSize().width + gap; - for (Window w : testWindows) { - w.setLocation(x, instructionUI.getLocation().y); - x += w.getWidth() + gap; - } - } - static class MenuFrame extends Frame { private final TextField field; From dc0ce1b2f2ebf457de9524adcbce2b473749e815 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Wed, 2 Oct 2024 21:58:26 +0000 Subject: [PATCH 287/307] 8341336: Fix -Wzero-as-null-pointer-constant warnings in PRODUCT-only code Reviewed-by: stefank, iwalulya, shade --- src/hotspot/share/c1/c1_LIR.hpp | 5 +++-- .../share/interpreter/templateInterpreterGenerator.hpp | 4 ++-- src/hotspot/share/oops/constantPool.hpp | 3 ++- src/hotspot/share/opto/memnode.hpp | 6 +----- src/hotspot/share/utilities/macros.hpp | 2 ++ 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/hotspot/share/c1/c1_LIR.hpp b/src/hotspot/share/c1/c1_LIR.hpp index d9c3e9d3cb68f..c568caeca4b30 100644 --- a/src/hotspot/share/c1/c1_LIR.hpp +++ b/src/hotspot/share/c1/c1_LIR.hpp @@ -29,6 +29,7 @@ #include "c1/c1_ValueType.hpp" #include "oops/method.hpp" #include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" class BlockBegin; class BlockList; @@ -1122,7 +1123,7 @@ class LIR_Op: public CompilationResourceObj { } #endif - virtual const char * name() const PRODUCT_RETURN0; + virtual const char * name() const PRODUCT_RETURN_NULL; virtual void visit(LIR_OpVisitState* state); int id() const { return _id; } @@ -1400,7 +1401,7 @@ class LIR_Op1: public LIR_Op { virtual bool is_patching() { return _patch != lir_patch_none; } virtual void emit_code(LIR_Assembler* masm); virtual LIR_Op1* as_Op1() { return this; } - virtual const char * name() const PRODUCT_RETURN0; + virtual const char * name() const PRODUCT_RETURN_NULL; void set_in_opr(LIR_Opr opr) { _opr = opr; } diff --git a/src/hotspot/share/interpreter/templateInterpreterGenerator.hpp b/src/hotspot/share/interpreter/templateInterpreterGenerator.hpp index bcccff2fe82ec..b0afcb5279522 100644 --- a/src/hotspot/share/interpreter/templateInterpreterGenerator.hpp +++ b/src/hotspot/share/interpreter/templateInterpreterGenerator.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 @@ -74,7 +74,7 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { void set_safepoints_for_all_bytes(); // Helpers for generate_and_dispatch - address generate_trace_code(TosState state) PRODUCT_RETURN0; + address generate_trace_code(TosState state) PRODUCT_RETURN_NULL; void count_bytecode() PRODUCT_RETURN; void histogram_bytecode(Template* t) PRODUCT_RETURN; void histogram_bytecode_pair(Template* t) PRODUCT_RETURN; diff --git a/src/hotspot/share/oops/constantPool.hpp b/src/hotspot/share/oops/constantPool.hpp index 7a17c62ddaf99..bcc9a08dd6ca0 100644 --- a/src/hotspot/share/oops/constantPool.hpp +++ b/src/hotspot/share/oops/constantPool.hpp @@ -37,6 +37,7 @@ #include "utilities/align.hpp" #include "utilities/bytes.hpp" #include "utilities/constantTag.hpp" +#include "utilities/macros.hpp" #include "utilities/resourceHash.hpp" // A ConstantPool is an array containing class constants as described in the @@ -781,7 +782,7 @@ class ConstantPool : public Metadata { int pre_resolve_shared_klasses(TRAPS); // Debugging - const char* printable_name_at(int cp_index) PRODUCT_RETURN0; + const char* printable_name_at(int cp_index) PRODUCT_RETURN_NULL; private: diff --git a/src/hotspot/share/opto/memnode.hpp b/src/hotspot/share/opto/memnode.hpp index 85d206749f6be..323ab3dba7d65 100644 --- a/src/hotspot/share/opto/memnode.hpp +++ b/src/hotspot/share/opto/memnode.hpp @@ -124,11 +124,7 @@ class MemNode : public Node { // Raw access function, to allow copying of adr_type efficiently in // product builds and retain the debug info for debug builds. const TypePtr *raw_adr_type() const { -#ifdef ASSERT - return _adr_type; -#else - return 0; -#endif + return DEBUG_ONLY(_adr_type) NOT_DEBUG(nullptr); } // Return the barrier data of n, if available, or 0 otherwise. diff --git a/src/hotspot/share/utilities/macros.hpp b/src/hotspot/share/utilities/macros.hpp index 1034dec0d9aaa..23094c9e8c4ac 100644 --- a/src/hotspot/share/utilities/macros.hpp +++ b/src/hotspot/share/utilities/macros.hpp @@ -338,6 +338,7 @@ #define NOT_PRODUCT_ARG(arg) #define PRODUCT_RETURN {} #define PRODUCT_RETURN0 { return 0; } +#define PRODUCT_RETURN_NULL { return nullptr; } #define PRODUCT_RETURN_(code) { code } #else // PRODUCT #define PRODUCT_ONLY(code) @@ -345,6 +346,7 @@ #define NOT_PRODUCT_ARG(arg) arg, #define PRODUCT_RETURN /*next token must be ;*/ #define PRODUCT_RETURN0 /*next token must be ;*/ +#define PRODUCT_RETURN_NULL /* next token must be ;*/ #define PRODUCT_RETURN_(code) /*next token must be ;*/ #endif // PRODUCT From 57c1db5843db5f2c864318f3234767f436a836e3 Mon Sep 17 00:00:00 2001 From: William Kemper Date: Wed, 2 Oct 2024 22:54:18 +0000 Subject: [PATCH 288/307] 8332697: ubsan: shenandoahSimpleBitMap.inline.hpp:68:23: runtime error: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long int' Reviewed-by: phh, kdnilsen --- .../gc/shenandoah/shenandoahSimpleBitMap.cpp | 34 +++++++++---------- .../gc/shenandoah/shenandoahSimpleBitMap.hpp | 12 +++---- .../shenandoahSimpleBitMap.inline.hpp | 15 +++++--- 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.cpp index c3e8108752fed..127e6324fb01e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.cpp @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "gc/shenandoah/shenandoahSimpleBitMap.hpp" +#include "gc/shenandoah/shenandoahSimpleBitMap.inline.hpp" ShenandoahSimpleBitMap::ShenandoahSimpleBitMap(size_t num_bits) : _num_bits(num_bits), @@ -43,8 +43,8 @@ size_t ShenandoahSimpleBitMap::count_leading_ones(idx_t start_idx) const { assert((start_idx >= 0) && (start_idx < _num_bits), "precondition"); size_t array_idx = start_idx >> LogBitsPerWord; uintx element_bits = _bitmap[array_idx]; - uintx bit_number = start_idx & right_n_bits(LogBitsPerWord); - uintx mask = ~right_n_bits(bit_number); + uintx bit_number = start_idx & (BitsPerWord - 1); + uintx mask = ~tail_mask(bit_number); size_t counted_ones = 0; while ((element_bits & mask) == mask) { // All bits numbered >= bit_number are set @@ -54,7 +54,7 @@ size_t ShenandoahSimpleBitMap::count_leading_ones(idx_t start_idx) const { // Strength reduction: array_idx = (start_idx >> LogBitsPerWord) array_idx++; element_bits = _bitmap[array_idx]; - // Constant folding: bit_number = start_idx & right_n_bits(LogBitsPerWord); + // Constant folding: bit_number = start_idx & (BitsPerWord - 1); bit_number = 0; // Constant folding: mask = ~right_n_bits(bit_number); mask = ~0; @@ -70,9 +70,9 @@ size_t ShenandoahSimpleBitMap::count_trailing_ones(idx_t last_idx) const { assert((last_idx >= 0) && (last_idx < _num_bits), "precondition"); size_t array_idx = last_idx >> LogBitsPerWord; uintx element_bits = _bitmap[array_idx]; - uintx bit_number = last_idx & right_n_bits(LogBitsPerWord); + uintx bit_number = last_idx & (BitsPerWord - 1); // All ones from bit 0 to the_bit - uintx mask = right_n_bits(bit_number + 1); + uintx mask = tail_mask(bit_number + 1); size_t counted_ones = 0; while ((element_bits & mask) == mask) { // All bits numbered <= bit_number are set @@ -81,7 +81,7 @@ size_t ShenandoahSimpleBitMap::count_trailing_ones(idx_t last_idx) const { // Dead code: do not need to compute: last_idx -= found_ones; array_idx--; element_bits = _bitmap[array_idx]; - // Constant folding: bit_number = last_idx & right_n_bits(LogBitsPerWord); + // Constant folding: bit_number = last_idx & (BitsPerWord - 1); bit_number = BitsPerWord - 1; // Constant folding: mask = right_n_bits(bit_number + 1); mask = ~0; @@ -99,7 +99,7 @@ bool ShenandoahSimpleBitMap::is_forward_consecutive_ones(idx_t start_idx, idx_t start_idx, count); assert(start_idx + count <= (idx_t) _num_bits, "precondition"); size_t array_idx = start_idx >> LogBitsPerWord; - uintx bit_number = start_idx & right_n_bits(LogBitsPerWord); + uintx bit_number = start_idx & (BitsPerWord - 1); uintx element_bits = _bitmap[array_idx]; uintx bits_to_examine = BitsPerWord - bit_number; element_bits >>= bit_number; @@ -128,7 +128,7 @@ bool ShenandoahSimpleBitMap::is_backward_consecutive_ones(idx_t last_idx, idx_t assert((last_idx >= 0) && (last_idx < _num_bits), "precondition"); assert(last_idx - count >= -1, "precondition"); size_t array_idx = last_idx >> LogBitsPerWord; - uintx bit_number = last_idx & right_n_bits(LogBitsPerWord); + uintx bit_number = last_idx & (BitsPerWord - 1); uintx element_bits = _bitmap[array_idx]; uintx bits_to_examine = bit_number + 1; element_bits <<= (BitsPerWord - bits_to_examine); @@ -161,10 +161,10 @@ idx_t ShenandoahSimpleBitMap::find_first_consecutive_set_bits(idx_t beg, idx_t e return end; } uintx array_idx = beg >> LogBitsPerWord; - uintx bit_number = beg & right_n_bits(LogBitsPerWord); + uintx bit_number = beg & (BitsPerWord - 1); uintx element_bits = _bitmap[array_idx]; if (bit_number > 0) { - uintx mask_out = right_n_bits(bit_number); + uintx mask_out = tail_mask(bit_number); element_bits &= ~mask_out; } @@ -222,9 +222,9 @@ idx_t ShenandoahSimpleBitMap::find_first_consecutive_set_bits(idx_t beg, idx_t e } array_idx = beg >> LogBitsPerWord; element_bits = _bitmap[array_idx]; - bit_number = beg & right_n_bits(LogBitsPerWord); + bit_number = beg & (BitsPerWord - 1); if (bit_number > 0) { - size_t mask_out = right_n_bits(bit_number); + size_t mask_out = tail_mask(bit_number); element_bits &= ~mask_out; } } @@ -242,10 +242,10 @@ idx_t ShenandoahSimpleBitMap::find_last_consecutive_set_bits(const idx_t beg, id } size_t array_idx = end >> LogBitsPerWord; - uintx bit_number = end & right_n_bits(LogBitsPerWord); + uintx bit_number = end & (BitsPerWord - 1); uintx element_bits = _bitmap[array_idx]; if (bit_number < BitsPerWord - 1) { - uintx mask_in = right_n_bits(bit_number + 1); + uintx mask_in = tail_mask(bit_number + 1); element_bits &= mask_in; } @@ -280,10 +280,10 @@ idx_t ShenandoahSimpleBitMap::find_last_consecutive_set_bits(const idx_t beg, id return beg; } array_idx = end >> LogBitsPerWord; - bit_number = end & right_n_bits(LogBitsPerWord); + bit_number = end & (BitsPerWord - 1); element_bits = _bitmap[array_idx]; if (bit_number < BitsPerWord - 1){ - size_t mask_in = right_n_bits(bit_number + 1); + size_t mask_in = tail_mask(bit_number + 1); element_bits &= mask_in; } } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.hpp b/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.hpp index c22e952700204..6b95303fb3341 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.hpp @@ -50,7 +50,7 @@ typedef ssize_t idx_t; // ShenandoahSimpleBitMap resembles CHeapBitMap but adds missing support for find_first_consecutive_set_bits() and // find_last_consecutive_set_bits. An alternative refactoring of code would subclass CHeapBitMap, but this might // break abstraction rules, because efficient implementation requires assumptions about superclass internals that -// might be violatee through future software maintenance. +// might be violated through future software maintenance. class ShenandoahSimpleBitMap { const idx_t _num_bits; const size_t _num_words; @@ -84,7 +84,7 @@ class ShenandoahSimpleBitMap { inline idx_t aligned_index(idx_t idx) const { assert((idx >= 0) && (idx < _num_bits), "precondition"); - idx_t array_idx = idx & ~right_n_bits(LogBitsPerWord); + idx_t array_idx = idx & ~(BitsPerWord - 1); return array_idx; } @@ -107,7 +107,7 @@ class ShenandoahSimpleBitMap { inline void set_bit(idx_t idx) { assert((idx >= 0) && (idx < _num_bits), "precondition"); size_t array_idx = idx >> LogBitsPerWord; - uintx bit_number = idx & right_n_bits(LogBitsPerWord); + uintx bit_number = idx & (BitsPerWord - 1); uintx the_bit = nth_bit(bit_number); _bitmap[array_idx] |= the_bit; } @@ -116,7 +116,7 @@ class ShenandoahSimpleBitMap { assert((idx >= 0) && (idx < _num_bits), "precondition"); assert(idx >= 0, "precondition"); size_t array_idx = idx >> LogBitsPerWord; - uintx bit_number = idx & right_n_bits(LogBitsPerWord); + uintx bit_number = idx & (BitsPerWord - 1); uintx the_bit = nth_bit(bit_number); _bitmap[array_idx] &= ~the_bit; } @@ -125,9 +125,9 @@ class ShenandoahSimpleBitMap { assert((idx >= 0) && (idx < _num_bits), "precondition"); assert(idx >= 0, "precondition"); size_t array_idx = idx >> LogBitsPerWord; - uintx bit_number = idx & right_n_bits(LogBitsPerWord); + uintx bit_number = idx & (BitsPerWord - 1); uintx the_bit = nth_bit(bit_number); - return (_bitmap[array_idx] & the_bit)? true: false; + return (_bitmap[array_idx] & the_bit) != 0; } // Return the index of the first set bit in the range [beg, size()), or size() if none found. diff --git a/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.inline.hpp index 3e602ed11e0c0..c047e1ed66349 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.inline.hpp @@ -27,15 +27,22 @@ #include "gc/shenandoah/shenandoahSimpleBitMap.hpp" +inline uintx tail_mask(uintx bit_number) { + if (bit_number >= BitsPerWord) { + return -1; + } + return (uintx(1) << bit_number) - 1; +} + inline idx_t ShenandoahSimpleBitMap::find_first_set_bit(idx_t beg, idx_t end) const { assert((beg >= 0) && (beg < _num_bits), "precondition"); assert((end > beg) && (end <= _num_bits), "precondition"); do { size_t array_idx = beg >> LogBitsPerWord; - uintx bit_number = beg & right_n_bits(LogBitsPerWord); + uintx bit_number = beg & (BitsPerWord - 1); uintx element_bits = _bitmap[array_idx]; if (bit_number > 0) { - uintx mask_out = right_n_bits(bit_number); + uintx mask_out = tail_mask(bit_number); element_bits &= ~mask_out; } if (element_bits) { @@ -62,10 +69,10 @@ inline idx_t ShenandoahSimpleBitMap::find_last_set_bit(idx_t beg, idx_t end) con assert((beg >= -1) && (beg < end), "precondition"); do { idx_t array_idx = end >> LogBitsPerWord; - uintx bit_number = end & right_n_bits(LogBitsPerWord); + uint8_t bit_number = end & (BitsPerWord - 1); uintx element_bits = _bitmap[array_idx]; if (bit_number < BitsPerWord - 1){ - uintx mask_in = right_n_bits(bit_number + 1); + uintx mask_in = tail_mask(bit_number + 1); element_bits &= mask_in; } if (element_bits) { From bdfb41f977258831e4b0ceaef5d016d095ab6e7f Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 2 Oct 2024 22:55:50 +0000 Subject: [PATCH 289/307] 8309841: Jarsigner should print a warning if an entry is removed Reviewed-by: mullan, hchao --- .../sun/security/tools/jarsigner/Main.java | 16 ++++ .../security/tools/jarsigner/Resources.java | 2 + .../tools/jarsigner/RemovedFiles.java | 94 +++++++++++++++++++ .../jdk/test/lib/util/JarUtilsTest.java | 77 +++++++++++++++ test/lib/jdk/test/lib/util/JarUtils.java | 53 ++++++++++- 5 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 test/jdk/sun/security/tools/jarsigner/RemovedFiles.java create mode 100644 test/lib-test/jdk/test/lib/util/JarUtilsTest.java diff --git a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java index 78a03a4332d47..014b420e1a237 100644 --- a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java +++ b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java @@ -197,6 +197,7 @@ public ExitException(int errorCode) { private boolean hasExpiringCert = false; private boolean hasExpiringTsaCert = false; private boolean noTimestamp = true; + private boolean hasNonexistentEntries = false; // Expiration date. The value could be null if signed by a trusted cert. private Date expireDate = null; @@ -735,6 +736,7 @@ void verifyJar(String jarName) Map sigMap = new HashMap<>(); Map sigNameMap = new HashMap<>(); Map unparsableSignatures = new HashMap<>(); + Map> entriesInSF = new HashMap<>(); try { jf = new JarFile(jarName, true); @@ -782,6 +784,7 @@ void verifyJar(String jarName) break; } } + entriesInSF.put(alias, sf.getEntries().keySet()); if (!found) { unparsableSignatures.putIfAbsent(alias, String.format( @@ -881,6 +884,9 @@ void verifyJar(String jarName) sb.append('\n'); } } + for (var signed : entriesInSF.values()) { + signed.remove(name); + } } else if (showcerts && !verbose.equals("all")) { // Print no info for unsigned entries when -verbose:all, // to be consistent with old behavior. @@ -1076,6 +1082,13 @@ void verifyJar(String jarName) if (verbose != null) { System.out.println(history); } + var signed = entriesInSF.get(s); + if (!signed.isEmpty()) { + if (verbose != null) { + System.out.println(rb.getString("history.nonexistent.entries") + signed); + } + hasNonexistentEntries = true; + } } else { unparsableSignatures.putIfAbsent(s, String.format( rb.getString("history.nobk"), s)); @@ -1311,6 +1324,9 @@ private void displayMessagesAndResult(boolean isSigning) { } } + if (hasNonexistentEntries) { + warnings.add(rb.getString("nonexistent.entries.found")); + } if (externalFileAttributesDetected) { warnings.add(rb.getString("external.file.attributes.detected")); } diff --git a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java index 6a86b72ad1b10..810bd107bdebc 100644 --- a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java +++ b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java @@ -164,6 +164,7 @@ public class Resources extends java.util.ListResourceBundle { {"history.with.ts", "- Signed by \"%1$s\"\n Digest algorithm: %2$s\n Signature algorithm: %3$s, %4$s\n Timestamped by \"%6$s\" on %5$tc\n Timestamp digest algorithm: %7$s\n Timestamp signature algorithm: %8$s, %9$s"}, {"history.without.ts", "- Signed by \"%1$s\"\n Digest algorithm: %2$s\n Signature algorithm: %3$s, %4$s"}, + {"history.nonexistent.entries", " Warning: nonexistent signed entries: "}, {"history.unparsable", "- Unparsable signature-related file %s"}, {"history.nosf", "- Missing signature-related file META-INF/%s.SF"}, {"history.nobk", "- Missing block file for signature-related file META-INF/%s.SF"}, @@ -178,6 +179,7 @@ public class Resources extends java.util.ListResourceBundle { {"key.bit.disabled", "%d-bit key (disabled)"}, {"key.bit.eccurve.disabled", "%1$d-bit %2$s key (disabled)"}, {"unknown.size", "unknown size"}, + {"nonexistent.entries.found", "This jar contains signed entries for files that do not exist. See the -verbose output for more details."}, {"external.file.attributes.detected", "POSIX file permission and/or symlink attributes detected. These attributes are ignored when signing and are not protected by the signature."}, {"jarsigner.", "jarsigner: "}, diff --git a/test/jdk/sun/security/tools/jarsigner/RemovedFiles.java b/test/jdk/sun/security/tools/jarsigner/RemovedFiles.java new file mode 100644 index 0000000000000..598e25a9a709b --- /dev/null +++ b/test/jdk/sun/security/tools/jarsigner/RemovedFiles.java @@ -0,0 +1,94 @@ +/* + * 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 8309841 + * @summary Jarsigner should print a warning if an entry is removed + * @library /test/lib + */ + +import jdk.test.lib.SecurityTools; +import jdk.test.lib.util.JarUtils; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.jar.Attributes; +import java.util.jar.Manifest; + +public class RemovedFiles { + + private static final String NONEXISTENT_ENTRIES_FOUND + = "This jar contains signed entries for files that do not exist. See the -verbose output for more details."; + + public static void main(String[] args) throws Exception { + JarUtils.createJarFile( + Path.of("a.jar"), + Path.of("."), + Files.writeString(Path.of("a"), "a"), + Files.writeString(Path.of("b"), "b")); + SecurityTools.keytool("-genkeypair -storepass changeit -keystore ks -alias x -dname CN=x -keyalg ed25519"); + SecurityTools.jarsigner("-storepass changeit -keystore ks a.jar x"); + + // All is fine at the beginning. + SecurityTools.jarsigner("-verify a.jar") + .shouldNotContain(NONEXISTENT_ENTRIES_FOUND); + + // Remove an entry after signing. There will be a warning. + JarUtils.deleteEntries(Path.of("a.jar"), "a"); + SecurityTools.jarsigner("-verify a.jar") + .shouldContain(NONEXISTENT_ENTRIES_FOUND); + SecurityTools.jarsigner("-verify -verbose a.jar") + .shouldContain(NONEXISTENT_ENTRIES_FOUND) + .shouldContain("Warning: nonexistent signed entries: [a]"); + + // Remove one more entry. + JarUtils.deleteEntries(Path.of("a.jar"), "b"); + SecurityTools.jarsigner("-verify a.jar") + .shouldContain(NONEXISTENT_ENTRIES_FOUND); + SecurityTools.jarsigner("-verify -verbose a.jar") + .shouldContain(NONEXISTENT_ENTRIES_FOUND) + .shouldContain("Warning: nonexistent signed entries: [a, b]"); + + // Re-sign will not clear the warning. + SecurityTools.jarsigner("-storepass changeit -keystore ks a.jar x"); + SecurityTools.jarsigner("-verify a.jar") + .shouldContain(NONEXISTENT_ENTRIES_FOUND); + + // Unfortunately, if there is a non-file entry in manifest, there will be + // a false alarm. See https://bugs.openjdk.org/browse/JDK-8334261. + var man = new Manifest(); + man.getMainAttributes().putValue("Manifest-Version", "1.0"); + man.getEntries().computeIfAbsent("Hello", _ -> new Attributes()) + .putValue("Foo", "Bar"); + JarUtils.createJarFile(Path.of("b.jar"), + man, + Path.of("."), + Path.of("a")); + SecurityTools.jarsigner("-storepass changeit -keystore ks b.jar x"); + SecurityTools.jarsigner("-verbose -verify b.jar") + .shouldContain("Warning: nonexistent signed entries: [Hello]") + .shouldContain(NONEXISTENT_ENTRIES_FOUND); + + } +} diff --git a/test/lib-test/jdk/test/lib/util/JarUtilsTest.java b/test/lib-test/jdk/test/lib/util/JarUtilsTest.java new file mode 100644 index 0000000000000..eb9dced32569a --- /dev/null +++ b/test/lib-test/jdk/test/lib/util/JarUtilsTest.java @@ -0,0 +1,77 @@ +/* + * 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 8309841 + * @summary Unit Test for a common Test API in jdk.test.lib.util.JarUtils + * @library /test/lib + */ + +import jdk.test.lib.Asserts; +import jdk.test.lib.util.JarUtils; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Set; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.stream.Collectors; + +public class JarUtilsTest { + public static void main(String[] args) throws Exception { + Files.createDirectory(Path.of("bx")); + JarUtils.createJarFile(Path.of("a.jar"), + Path.of("."), + Files.writeString(Path.of("a"), ""), + Files.writeString(Path.of("b1"), ""), + Files.writeString(Path.of("b2"), ""), + Files.writeString(Path.of("bx/x"), ""), + Files.writeString(Path.of("c"), ""), + Files.writeString(Path.of("e1"), ""), + Files.writeString(Path.of("e2"), "")); + checkContent("a", "b1", "b2", "bx/x", "c", "e1", "e2"); + + JarUtils.deleteEntries(Path.of("a.jar"), "a"); + checkContent("b1", "b2", "bx/x", "c", "e1", "e2"); + + // Note: b* covers everything starting with b, even bx/x + JarUtils.deleteEntries(Path.of("a.jar"), "b*"); + checkContent("c", "e1", "e2"); + + // d* does not match + JarUtils.deleteEntries(Path.of("a.jar"), "d*"); + checkContent("c", "e1", "e2"); + + // multiple patterns + JarUtils.deleteEntries(Path.of("a.jar"), "d*", "e*"); + checkContent("c"); + } + + static void checkContent(String... expected) throws IOException { + try (var jf = new JarFile("a.jar")) { + Asserts.assertEquals(Set.of(expected), + jf.stream().map(JarEntry::getName).collect(Collectors.toSet())); + } + } +} diff --git a/test/lib/jdk/test/lib/util/JarUtils.java b/test/lib/jdk/test/lib/util/JarUtils.java index e1b3ccac19fc5..3aa4ada5197ad 100644 --- a/test/lib/jdk/test/lib/util/JarUtils.java +++ b/test/lib/jdk/test/lib/util/JarUtils.java @@ -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 @@ -320,6 +320,57 @@ public static void updateManifest(String src, String dest, Manifest man) updateJar(src, dest, Map.of(JarFile.MANIFEST_NAME, bout.toByteArray())); } + /** + * Remove entries from a ZIP file. + * + * Each entry can be a name or a name ending with "*". + * + * @return number of removed entries + * @throws IOException if there is any I/O error + */ + public static int deleteEntries(Path jarfile, String... patterns) + throws IOException { + Path tmpfile = Files.createTempFile("jar", "jar"); + int count = 0; + + try (OutputStream out = Files.newOutputStream(tmpfile); + JarOutputStream jos = new JarOutputStream(out)) { + try (JarFile jf = new JarFile(jarfile.toString())) { + Enumeration jentries = jf.entries(); + top: while (jentries.hasMoreElements()) { + JarEntry jentry = jentries.nextElement(); + String name = jentry.getName(); + for (String pattern : patterns) { + if (pattern.endsWith("*")) { + if (name.startsWith(pattern.substring( + 0, pattern.length() - 1))) { + // Go directly to next entry. This + // one is not written into `jos` and + // therefore removed. + count++; + continue top; + } + } else { + if (name.equals(pattern)) { + // Same as above + count++; + continue top; + } + } + } + // No pattern matched, file retained + jos.putNextEntry(copyEntry(jentry)); + jf.getInputStream(jentry).transferTo(jos); + } + } + } + + // replace the original JAR file + Files.move(tmpfile, jarfile, StandardCopyOption.REPLACE_EXISTING); + + return count; + } + private static void updateEntry(JarOutputStream jos, String name, Object content) throws IOException { if (content instanceof Boolean) { From 602408e4f3848b30299ea94264e88ead5361a310 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Thu, 3 Oct 2024 02:51:23 +0000 Subject: [PATCH 290/307] 8341177: Opensource few List and a Window test Reviewed-by: prr --- .../awt/List/ActionEventWhenHitEnterTest.java | 126 ++++++++++++++++++ test/jdk/java/awt/List/ListAddPerfTest.java | 99 ++++++++++++++ ...MouseDraggedOriginatedByScrollBarTest.java | 103 ++++++++++++++ test/jdk/java/awt/Window/bug4189244.java | 120 +++++++++++++++++ 4 files changed, 448 insertions(+) create mode 100644 test/jdk/java/awt/List/ActionEventWhenHitEnterTest.java create mode 100644 test/jdk/java/awt/List/ListAddPerfTest.java create mode 100644 test/jdk/java/awt/List/MouseDraggedOriginatedByScrollBarTest.java create mode 100644 test/jdk/java/awt/Window/bug4189244.java diff --git a/test/jdk/java/awt/List/ActionEventWhenHitEnterTest.java b/test/jdk/java/awt/List/ActionEventWhenHitEnterTest.java new file mode 100644 index 0000000000000..232189ef53bbb --- /dev/null +++ b/test/jdk/java/awt/List/ActionEventWhenHitEnterTest.java @@ -0,0 +1,126 @@ +/* + * 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 4234245 + * @summary the actionEvent is not invoked when hit enter on list. + * @key headful + * @run main ActionEventWhenHitEnterTest + */ + +import java.awt.BorderLayout; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.IllegalComponentStateException; +import java.awt.List; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.KeyEvent; + +public class ActionEventWhenHitEnterTest + implements ActionListener, ItemListener { + + volatile boolean passed1; + volatile boolean passed2; + volatile Point pt; + List list; + Frame frame; + + public static void main(final String[] args) throws Exception { + ActionEventWhenHitEnterTest app = new ActionEventWhenHitEnterTest(); + app.doTest(); + } + + public ActionEventWhenHitEnterTest() { + list = new List(7); + for (int i = 0; i < 10; i++) { + list.add("Item " + i); + } + list.addItemListener(this); + list.addActionListener(this); + } + + public void actionPerformed(ActionEvent ae) { + passed1 = true; + System.out.println("--> Action event invoked: " + ae.getSource()); + } + + public void itemStateChanged(ItemEvent ie) { + passed2 = true; + System.out.println("--> Item state changed:" + ie.getSource()); + } + + public void doTest() throws Exception { + EventQueue.invokeAndWait(() -> { + frame = new Frame("ActionEventWhenHitEnterTest"); + frame.add(list); + frame.setSize(200, 200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + }); + + try { + Robot robot = new Robot(); + robot.setAutoDelay(100); + robot.waitForIdle(); + robot.delay(1000); + + EventQueue.invokeAndWait(() -> { + pt = list.getLocationOnScreen(); + }); + + if (pt.x != 0 || pt.y != 0) { + robot.mouseMove(pt.x + list.getWidth() / 2, + pt.y + list.getHeight() / 2); + robot.waitForIdle(); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + + robot.keyPress(KeyEvent.VK_ENTER); + robot.keyRelease(KeyEvent.VK_ENTER); + } + + robot.waitForIdle(); + } finally { + EventQueue.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + + if (!passed1 || !passed2) { + throw new RuntimeException("ActionEventWhenHitEnterTest FAILED"); + } + System.out.println("Test PASSED"); + + } + +} diff --git a/test/jdk/java/awt/List/ListAddPerfTest.java b/test/jdk/java/awt/List/ListAddPerfTest.java new file mode 100644 index 0000000000000..7ff3eaf882c62 --- /dev/null +++ b/test/jdk/java/awt/List/ListAddPerfTest.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. + */ + +/* + * @test + * @bug 4117288 + * @summary JDKversion1.2beta3-J List's add() method is much slower. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ListAddPerfTest + */ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Frame; +import java.awt.List; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +public class ListAddPerfTest { + + static Button button; + static List list; + + private static final String INSTRUCTIONS = """ + It is used to check the performance of List add operation. + + Instructions: + Click on the Remove All button. + The list should be cleared. + The button is now named "Add Items". + Click on the "Add Items" button. + 800 items should be added to the list. + Notice not only how fast or slow this is, but also how + 'smooth' it goes as well i.e. without any flashing. + + Press pass if the list performance is acceptable."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("ListAddPerfTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int)INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(ListAddPerfTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame frame = new Frame("ListAddPerfTest"); + frame.setLayout(new BorderLayout()); + + button = new Button("Remove All"); + button.addActionListener((ActionEvent e) -> { + if (list.getItemCount() > 0) { + list.removeAll(); + list.invalidate(); + button.setLabel("Add Items"); + } else { + for (int i = 0; i < 800; i ++) { + list.add("My number is " + i); + } + button.setLabel("Remove All"); + } + }); + + list = new List(15); + for (int i = 0; i < 800; i ++) { + list.add("My number is " + i); + } + + frame.add("North", button); + frame.add("South", list); + + frame.pack(); + return frame; + } +} diff --git a/test/jdk/java/awt/List/MouseDraggedOriginatedByScrollBarTest.java b/test/jdk/java/awt/List/MouseDraggedOriginatedByScrollBarTest.java new file mode 100644 index 0000000000000..600d38fe39380 --- /dev/null +++ b/test/jdk/java/awt/List/MouseDraggedOriginatedByScrollBarTest.java @@ -0,0 +1,103 @@ +/* + * 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. + */ + +/* + * @test + * @bug 6240151 + * @summary XToolkit: Dragging the List scrollbar initiates DnD + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MouseDraggedOriginatedByScrollBarTest +*/ + +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.List; +import java.awt.event.MouseMotionAdapter; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class MouseDraggedOriginatedByScrollBarTest { + + private static final String INSTRUCTIONS = """ + 1) Click and drag the scrollbar of the list. + 2) Keep dragging till the mouse pointer goes out the scrollbar. + 3) The test failed if you see messages about events. The test passed if you don't."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("MouseDraggedOriginatedByScrollBarTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(MouseDraggedOriginatedByScrollBarTest::createTestUI) + .logArea() + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame frame = new Frame(); + List list = new List(4, false); + + list.add("000"); + list.add("111"); + list.add("222"); + list.add("333"); + list.add("444"); + list.add("555"); + list.add("666"); + list.add("777"); + list.add("888"); + list.add("999"); + + frame.add(list); + + list.addMouseMotionListener( + new MouseMotionAdapter(){ + @Override + public void mouseDragged(MouseEvent me){ + PassFailJFrame.log(me.toString()); + } + }); + + list.addMouseListener( + new MouseAdapter() { + public void mousePressed(MouseEvent me) { + PassFailJFrame.log(me.toString()); + } + + public void mouseReleased(MouseEvent me) { + PassFailJFrame.log(me.toString()); + } + + public void mouseClicked(MouseEvent me){ + PassFailJFrame.log(me.toString()); + } + }); + + frame.setLayout(new FlowLayout()); + frame.pack(); + return frame; + } +} diff --git a/test/jdk/java/awt/Window/bug4189244.java b/test/jdk/java/awt/Window/bug4189244.java new file mode 100644 index 0000000000000..df37d2fce0e2b --- /dev/null +++ b/test/jdk/java/awt/Window/bug4189244.java @@ -0,0 +1,120 @@ +/* + * 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 4189244 + * @summary Swing Popup menu is not being refreshed (cleared) under a Dialog + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @requires (os.family == "windows") + * @run main/manual bug4189244 +*/ + +import java.awt.BorderLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; + +public class bug4189244 { + + private static final String INSTRUCTIONS = """ + This is Windows only test! + + Click right button on frame to show popup menu. + (menu should be placed inside frame otherwise bug is not reproducible) + click on any menu item (dialog will be shown). + close dialog. + if you see part of popupmenu, under dialog, before it is closed, + then test failed, else passed."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("bug4189244 Instructions") + .instructions(INSTRUCTIONS) + .rows((int)INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(bug4189244::createTestUI) + .build() + .awaitAndCheck(); + } + + + private static JFrame createTestUI() { + RefreshBug panel = new RefreshBug(); + JFrame frame = new JFrame("Popup refresh bug"); + + frame.add(panel, BorderLayout.CENTER); + panel.init(); + frame.setSize(400, 400); + return frame; + } +} + +class RefreshBug extends JPanel implements ActionListener { + JPopupMenu _jPopupMenu = new JPopupMenu(); + + public void init() { + JMenuItem menuItem; + JButton jb = new JButton("Bring the popup here and select an item"); + + this.add(jb, BorderLayout.CENTER); + + for(int i = 1; i < 10; i++) { + menuItem = new JMenuItem("Item " + i); + menuItem.addActionListener(this); + _jPopupMenu.add(menuItem); + } + + MouseListener ml = new MouseAdapter() { + public void mouseReleased(MouseEvent e) { + if (e.isPopupTrigger()) { + _jPopupMenu.show(e.getComponent(), + e.getX(), e.getY()); + } + } + }; + this.addMouseListener(ml); + + jb.addMouseListener(ml); + + } + + // An action is requested by the user + public void actionPerformed(java.awt.event.ActionEvent e) { + JOptionPane.showMessageDialog(this, + "Check if there is some popup left under me\n"+ + "if not, retry and let the popup appear where i am", + "WARNING", + JOptionPane.WARNING_MESSAGE); + + } +} From 50ec169116b486a49dc2dcb4218264bd48db79cc Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 3 Oct 2024 04:16:10 +0000 Subject: [PATCH 291/307] 8341191: Open source few more AWT FileDialog tests Reviewed-by: prr, psadhukhan --- .../FileDialog/KeyboardInteractionTest.java | 87 +++++++++++++++++++ .../awt/FileDialog/PathChoiceDisposeTest.java | 76 ++++++++++++++++ .../FileDialog/PathChoiceWorkArrowsTest.java | 86 ++++++++++++++++++ .../java/awt/FileDialog/SavedDirInitTest.java | 79 +++++++++++++++++ 4 files changed, 328 insertions(+) create mode 100644 test/jdk/java/awt/FileDialog/KeyboardInteractionTest.java create mode 100644 test/jdk/java/awt/FileDialog/PathChoiceDisposeTest.java create mode 100644 test/jdk/java/awt/FileDialog/PathChoiceWorkArrowsTest.java create mode 100644 test/jdk/java/awt/FileDialog/SavedDirInitTest.java diff --git a/test/jdk/java/awt/FileDialog/KeyboardInteractionTest.java b/test/jdk/java/awt/FileDialog/KeyboardInteractionTest.java new file mode 100644 index 0000000000000..f919a8a338af8 --- /dev/null +++ b/test/jdk/java/awt/FileDialog/KeyboardInteractionTest.java @@ -0,0 +1,87 @@ +/* + * 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.FileDialog; +import java.awt.Frame; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/* + * @test + * @bug 6259434 + * @summary PIT: Choice in FileDialog is not responding to keyboard interactions, XToolkit + * @requires (os.family == "linux") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual KeyboardInteractionTest + */ + +public class KeyboardInteractionTest { + public static void main(String[] args) throws Exception { + System.setProperty("sun.awt.disableGtkFileDialogs", "true"); + String INSTRUCTIONS = """ + 1) Click on 'Show File Dialog' button to bring up the FileDialog window. + A file dialog will come up. + 2) You will see a text field 'Enter full path or filename'. + Right next to it, you will see a button. + Transfer the focus on this button using 'TAB'. + Make sure that the popup choice is not shown. + 3) Press 'ESC'. If file dialog isn't disposed, then the test failed. + 4) Again, click on 'Show File Dialog' to bring up the file dialog. + A file dialog will come up. + 5) You will see a text field 'Enter full path or filename'. + Right next to it, you will see a button. + Click on this button. The popup choice will appear. + 6) Look at the popup choice. Change the current item in the popup + choice by the arrow keys. + If the text in the 'Enter full path or filename' text field isn't + changed, then the test failed. + 7) The test passed. + """; + + PassFailJFrame.builder() + .title("KeyboardInteractionTest Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(KeyboardInteractionTest::createUI) + .build() + .awaitAndCheck(); + } + + public static Frame createUI() { + Frame f = new Frame("KeyboardInteractionTest Test"); + Button b = new Button("Show File Dialog"); + FileDialog fd = new FileDialog(f); + b.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + fd.setVisible(true); + } + }); + f.add(b); + f.setSize(300, 200); + return f; + } +} diff --git a/test/jdk/java/awt/FileDialog/PathChoiceDisposeTest.java b/test/jdk/java/awt/FileDialog/PathChoiceDisposeTest.java new file mode 100644 index 0000000000000..267b2a807cff8 --- /dev/null +++ b/test/jdk/java/awt/FileDialog/PathChoiceDisposeTest.java @@ -0,0 +1,76 @@ +/* + * 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.FileDialog; +import java.awt.Frame; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/* + * @test + * @bug 6240084 + * @summary Test that disposing unfurled list by the pressing ESC + * in FileDialog is working properly on XToolkit + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual PathChoiceDisposeTest + */ + +public class PathChoiceDisposeTest { + public static void main(String[] args) throws Exception { + System.setProperty("sun.awt.disableGtkFileDialogs", "true"); + String INSTRUCTIONS = """ + 1) Click on 'Show File Dialog' button to bring up the FileDialog window. + 2) Open the directory selection choice by clicking button next to + 'Enter Path or Folder Name'. A drop-down will appear. + 3) Press 'ESC'. + 4) If you see that the dialog gets disposed and the popup + still remains on the screen, the test failed, otherwise passed. + """; + + PassFailJFrame.builder() + .title("PathChoiceDisposeTest Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(PathChoiceDisposeTest::createUI) + .build() + .awaitAndCheck(); + } + + public static Frame createUI() { + Frame f = new Frame("PathChoiceDisposeTest Test"); + Button b = new Button("Show File Dialog"); + FileDialog fd = new FileDialog(f); + b.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + fd.setVisible(true); + } + }); + f.add(b); + f.setSize(300, 200); + return f; + } +} diff --git a/test/jdk/java/awt/FileDialog/PathChoiceWorkArrowsTest.java b/test/jdk/java/awt/FileDialog/PathChoiceWorkArrowsTest.java new file mode 100644 index 0000000000000..17aee8abb800a --- /dev/null +++ b/test/jdk/java/awt/FileDialog/PathChoiceWorkArrowsTest.java @@ -0,0 +1,86 @@ +/* + * 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.FileDialog; +import java.awt.Frame; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/* + * @test + * @bug 6240074 + * @summary Test that file drop-down field in FileDialog is working properly on XToolkit + * @requires (os.family == "linux") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual PathChoiceWorkArrowsTest + */ + +public class PathChoiceWorkArrowsTest { + public static void main(String[] args) throws Exception { + System.setProperty("sun.awt.disableGtkFileDialogs", "true"); + String INSTRUCTIONS = """ + This is only XAWT test. + + 1) Click on 'Show File Dialog' to bring up the FileDialog window. + A file dialog would come up. + 2) Click on the button next to 'Enter folder name' field. + A drop-down will appear. After this, there are 2 scenarios. + 3) Press the down arrow one by one. You will see a '/' being + appended as soon as the current entry is removed. + Keep pressing till the last entry is reached. Now the drop-down + will stop responding to arrow keys. If yes, the test failed. + 4) Press the up arrow. The cursor will directly go to the last + entry ('/') and navigation will stop there. You will see 2 + entries being selected at the same time. + If yes, the test failed. + """; + + PassFailJFrame.builder() + .title("PathChoiceWorkArrowsTest Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(PathChoiceWorkArrowsTest::createUI) + .build() + .awaitAndCheck(); + } + + public static Frame createUI() { + Frame f = new Frame("PathChoiceWorkArrowsTest Test"); + Button b = new Button("Show File Dialog"); + FileDialog fd = new FileDialog(f); + b.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + fd.setSize(200, 200); + fd.setLocation(200, 200); + fd.setVisible(true); + } + }); + f.add(b); + f.setSize(300, 200); + return f; + } +} diff --git a/test/jdk/java/awt/FileDialog/SavedDirInitTest.java b/test/jdk/java/awt/FileDialog/SavedDirInitTest.java new file mode 100644 index 0000000000000..7a3b33f55fe16 --- /dev/null +++ b/test/jdk/java/awt/FileDialog/SavedDirInitTest.java @@ -0,0 +1,79 @@ +/* + * 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.FileDialog; +import java.awt.Frame; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/* + * @test + * @bug 6260650 + * @summary FileDialog.getDirectory() does not return null when file dialog is cancelled + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual SavedDirInitTest + */ + +public class SavedDirInitTest { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + Click on 'Show File Dialog' button to bring up the FileDialog window. + 1) A file dialog will come up. + 2) Press 'Cancel' button to cancel the file dialog. + 3) The result (passed or failed) will be shown in the message window below. + """; + + PassFailJFrame.builder() + .title("SavedDirInitTest Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(SavedDirInitTest::createUI) + .logArea(2) + .build() + .awaitAndCheck(); + } + + public static Frame createUI() { + Frame f = new Frame("SavedDirInitTest Test"); + Button b = new Button("Show File Dialog"); + FileDialog fd = new FileDialog(f); + b.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + fd.setVisible(true); + if (fd.getDirectory() == null && fd.getFile() == null) { + PassFailJFrame.log("TEST PASSED"); + } else { + PassFailJFrame.log("TEST FAILED. dir = " + fd.getDirectory() + + " , file = " + fd.getFile()); + } + } + }); + f.add(b); + f.setSize(300, 200); + return f; + } +} From ff3e849b8a1de3741dcd728636e1a804996f96fe Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Thu, 3 Oct 2024 05:31:10 +0000 Subject: [PATCH 292/307] 8341239: Open source closed frame tests # 3 Reviewed-by: prr --- .../jdk/java/awt/Frame/FrameMenuPackTest.java | 99 +++++++++++++++++ .../FrameResizeTest/FrameResizeTest_3.java | 86 ++++++++++++++ .../FrameResizeTest/FrameResizeTest_4.java | 76 +++++++++++++ .../FrameResizeTest/FrameResizeTest_5.java | 105 ++++++++++++++++++ 4 files changed, 366 insertions(+) create mode 100644 test/jdk/java/awt/Frame/FrameMenuPackTest.java create mode 100644 test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_3.java create mode 100644 test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_4.java create mode 100644 test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_5.java diff --git a/test/jdk/java/awt/Frame/FrameMenuPackTest.java b/test/jdk/java/awt/Frame/FrameMenuPackTest.java new file mode 100644 index 0000000000000..c034acd8eb710 --- /dev/null +++ b/test/jdk/java/awt/Frame/FrameMenuPackTest.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.BorderLayout; +import java.awt.Frame; +import java.awt.Label; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.ScrollPane; +import java.awt.Window; +import java.util.List; + +/* + * @test + * @bug 4084766 + * @summary Test for bug(s): 4084766 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual FrameMenuPackTest + */ + +public class FrameMenuPackTest { + private static final String INSTRUCTIONS = """ + Check that both frames that appear are properly packed with + the scrollpane visible. + """; + + public static void main(String[] argv) throws Exception { + PassFailJFrame.builder() + .title("FrameMenuPackTest Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .testUI(FrameMenuPackTest::createAndShowUI) + .positionTestUIRightRow() + .build() + .awaitAndCheck(); + } + + private static List createAndShowUI() { + // Frame without menu, packs correctly + PackedFrame f1 = new PackedFrame(false); + f1.pack(); + + // Frame with menu, doesn't pack right + PackedFrame f2 = new PackedFrame(true); + f2.pack(); + + return List.of(f1, f2); + } + + private static class PackedFrame extends Frame { + public PackedFrame(boolean withMenu) { + super("PackedFrame"); + + MenuBar menubar; + Menu fileMenu; + MenuItem foo; + ScrollPane sp; + + sp = new ScrollPane(); + sp.add(new Label("Label in ScrollPane")); + System.out.println(sp.getMinimumSize()); + + this.setLayout(new BorderLayout()); + this.add(sp, "Center"); + this.add(new Label("Label in Frame"), "South"); + + if (withMenu) { + menubar = new MenuBar(); + fileMenu = new Menu("File"); + foo = new MenuItem("foo"); + fileMenu.add(foo); + menubar.add(fileMenu); + this.setMenuBar(menubar); + } + } + } +} diff --git a/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_3.java b/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_3.java new file mode 100644 index 0000000000000..6fdef005775a5 --- /dev/null +++ b/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_3.java @@ -0,0 +1,86 @@ +/* + * 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.Window; +import java.awt.event.ActionListener; + +/* + * @test + * @bug 4097207 + * @summary setSize() on a Frame does not resize its content + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual FrameResizeTest_3 +*/ + +public class FrameResizeTest_3 { + + private static final String INSTRUCTIONS = """ + 1. You would see a frame titled 'TestFrame' with 2 buttons + named 'setSize(500,500)' and 'setSize(400,400)' + 2. Click any button and you would see the frame resized + 3. If the buttons get resized along with the frame + (ie., to fit the frame), press Pass else press Fail. + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("FrameResizeTest_3 Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .logArea(6) + .testUI(FrameResizeTest_3::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Window createTestUI() { + Frame frame = new Frame("TestFrame"); + frame.setLayout(new GridLayout(2, 1)); + + Button butSize500 = new Button("setSize(500,500)"); + Button butSize400 = new Button("setSize(400,400)"); + + ActionListener actionListener = e -> { + if (e.getSource() instanceof Button) { + if (e.getSource() == butSize500) { + frame.setSize(500, 500); + PassFailJFrame.log("New bounds: " + frame.getBounds()); + } else if (e.getSource() == butSize400) { + frame.setSize(400, 400); + PassFailJFrame.log("New bounds: " + frame.getBounds()); + } + } + }; + butSize500.addActionListener(actionListener); + butSize400.addActionListener(actionListener); + frame.add(butSize500); + frame.add(butSize400); + + frame.setSize(270, 200); + return frame; + } +} diff --git a/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_4.java b/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_4.java new file mode 100644 index 0000000000000..4428feee3355b --- /dev/null +++ b/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_4.java @@ -0,0 +1,76 @@ +/* + * 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. + */ + +/* Note that although this test makes use of Swing classes, like JFrame and */ +/* JButton, it is really an AWT test, because it tests mechanism of sending */ +/* paint events. */ + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; +import java.awt.BorderLayout; + +/* + * @test + * @bug 4174831 + * @summary Tests that frame do not flicker on diagonal resize + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual FrameResizeTest_4 + */ + +public class FrameResizeTest_4 { + private static final String INSTRUCTIONS = """ + Try enlarging the frame diagonally. + If buttons inside frame excessively repaint themselves and flicker + while you enlarge frame, the test fails. + Otherwise, it passes. + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("FrameResizeTest_4 Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .testUI(FrameResizeTest_4::createTestUI) + .build() + .awaitAndCheck(); + } + + private static JFrame createTestUI() { + JFrame f = new JFrame("FrameResizeTest_4 Flickering Frame"); + + JPanel panel = new JPanel(new BorderLayout()); + panel.add(new JButton("West"), BorderLayout.WEST); + panel.add(new JButton("East"), BorderLayout.EAST); + panel.add(new JButton("North"), BorderLayout.NORTH); + panel.add(new JButton("South"), BorderLayout.SOUTH); + panel.add(new JButton("Center"), BorderLayout.CENTER); + f.setContentPane(panel); + + f.pack(); + f.setBounds(100, 50, 300, 200); + + return f; + } +} diff --git a/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_5.java b/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_5.java new file mode 100644 index 0000000000000..5a43b755a5212 --- /dev/null +++ b/test/jdk/java/awt/Frame/FrameResizeTest/FrameResizeTest_5.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.Button; +import java.awt.Frame; +import java.awt.GridLayout; + +/* + * @test + * @summary Test to make sure non-resizable Frames can be resized with the + * setSize() method. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual FrameResizeTest_5 +*/ + +public class FrameResizeTest_5 { + private static final String INSTRUCTIONS = """ + This tests the programmatic resizability of non-resizable Frames. + Even when a Frame is set to be non-resizable, it should still be + programmatically resizable using the setSize() method. + + Initially the Frame will be resizable. Try using the "Smaller" + and "Larger" buttons to verify that the Frame resizes correctly. + Then, click the "Toggle" button to make the Frame non-resizable. + Again, verify that clicking the "Larger" and "Smaller" buttons + causes the Frame to get larger and smaller. If the Frame does + not change size, or does not re-layout correctly, the test fails. + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("FrameResizeTest_5 Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .logArea(6) + .testUI(TestFrame::new) + .build() + .awaitAndCheck(); + } + + private static class TestFrame extends Frame { + Button bLarger, bSmaller, bCheck, bToggle; + + public TestFrame() { + super("Frame Resize Test"); + setSize(200, 200); + bLarger = new Button("Larger"); + bLarger.addActionListener(e -> { + setSize(400, 400); + validate(); + }); + bSmaller = new Button("Smaller"); + bSmaller.addActionListener(e -> { + setSize(200, 100); + validate(); + }); + bCheck = new Button("Resizable?"); + bCheck.addActionListener(e -> { + if (isResizable()) { + PassFailJFrame.log("Frame is resizable"); + setResizable(true); + } else { + PassFailJFrame.log("Frame is not resizable"); + setResizable(false); + } + }); + bToggle = new Button("Toggle"); + bToggle.addActionListener(e -> { + if (isResizable()) { + PassFailJFrame.log("Frame is now not resizable"); + setResizable(false); + } else { + PassFailJFrame.log("Frame is now resizable"); + setResizable(true); + } + }); + setLayout(new GridLayout(4, 1)); + add(bSmaller); + add(bLarger); + add(bCheck); + add(bToggle); + } + } +} From c6e7e551928c04b74775b5d4c03eb31232aeb2c9 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 3 Oct 2024 07:25:42 +0000 Subject: [PATCH 293/307] 8341091: CDS: Segmented roots array misses roots Reviewed-by: adinn, iklam --- src/hotspot/share/cds/archiveHeapLoader.cpp | 7 ++-- src/hotspot/share/cds/archiveHeapWriter.cpp | 4 ++- src/hotspot/share/cds/archiveUtils.hpp | 1 - src/hotspot/share/cds/heapShared.cpp | 37 +++++++++++++-------- src/hotspot/share/cds/heapShared.hpp | 7 ++-- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/src/hotspot/share/cds/archiveHeapLoader.cpp b/src/hotspot/share/cds/archiveHeapLoader.cpp index 6325fb6f49d73..0e7ef08064c37 100644 --- a/src/hotspot/share/cds/archiveHeapLoader.cpp +++ b/src/hotspot/share/cds/archiveHeapLoader.cpp @@ -376,13 +376,12 @@ void ArchiveHeapLoader::finish_initialization() { intptr_t bottom = is_loaded() ? _loaded_heap_bottom : _mapped_heap_bottom; // 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. + // The size of each segment (except for the last one) is max_size_in_{elems,bytes}. HeapRootSegments segments = FileMapInfo::current_info()->heap_root_segments(); - int max_size = segments.max_size_in_bytes(); - HeapShared::init_root_segment_sizes(max_size); + HeapShared::init_root_segment_sizes(segments.max_size_in_elems()); 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)); + oop segment_oop = cast_to_oop(first_segment_addr + (c * segments.max_size_in_bytes())); 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 853d459c691dd..710e693bfdb14 100644 --- a/src/hotspot/share/cds/archiveHeapWriter.cpp +++ b/src/hotspot/share/cds/archiveHeapWriter.cpp @@ -223,6 +223,7 @@ void ArchiveHeapWriter::copy_roots_to_buffer(GrowableArrayCHeapat(root_index++)); @@ -245,6 +245,8 @@ void ArchiveHeapWriter::copy_roots_to_buffer(GrowableArrayCHeaplength(), "Post-condition: All roots are handled"); + _heap_root_segments = segments; } diff --git a/src/hotspot/share/cds/archiveUtils.hpp b/src/hotspot/share/cds/archiveUtils.hpp index 2e361ab0c4650..5a78bc26ee627 100644 --- a/src/hotspot/share/cds/archiveUtils.hpp +++ b/src/hotspot/share/cds/archiveUtils.hpp @@ -277,7 +277,6 @@ class 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; diff --git a/src/hotspot/share/cds/heapShared.cpp b/src/hotspot/share/cds/heapShared.cpp index 1f07e972f059a..81aa7ac94dc21 100644 --- a/src/hotspot/share/cds/heapShared.cpp +++ b/src/hotspot/share/cds/heapShared.cpp @@ -136,8 +136,7 @@ static ArchivableStaticFieldInfo fmg_archive_subgraph_entry_fields[] = { KlassSubGraphInfo* HeapShared::_default_subgraph_info; GrowableArrayCHeap* HeapShared::_pending_roots = nullptr; GrowableArrayCHeap* HeapShared::_root_segments; -int HeapShared::_root_segment_max_size_shift; -int HeapShared::_root_segment_max_size_mask; +int HeapShared::_root_segment_max_size_elems; OopHandle HeapShared::_scratch_basic_type_mirrors[T_VOID+1]; MetaspaceObjToOopHandleTable* HeapShared::_scratch_java_mirror_table = nullptr; MetaspaceObjToOopHandleTable* HeapShared::_scratch_references_table = nullptr; @@ -244,15 +243,29 @@ objArrayOop HeapShared::root_segment(int segment_idx) { return segment; } +void HeapShared::get_segment_indexes(int idx, int& seg_idx, int& int_idx) { + assert(_root_segment_max_size_elems > 0, "sanity"); + + // Try to avoid divisions for the common case. + if (idx < _root_segment_max_size_elems) { + seg_idx = 0; + int_idx = idx; + } else { + seg_idx = idx / _root_segment_max_size_elems; + int_idx = idx % _root_segment_max_size_elems; + } + + assert(idx == seg_idx * _root_segment_max_size_elems + int_idx, + "sanity: %d index maps to %d segment and %d internal", idx, seg_idx, int_idx); +} + // 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(!_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; + int seg_idx, int_idx; + get_segment_indexes(index, seg_idx, int_idx); oop result = root_segment(seg_idx)->obj_at(int_idx); if (clear) { clear_root(index); @@ -264,10 +277,8 @@ 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; + int seg_idx, int_idx; + get_segment_indexes(index, seg_idx, int_idx); if (log_is_enabled(Debug, cds, heap)) { oop old = root_segment(seg_idx)->obj_at(int_idx); log_debug(cds, heap)("Clearing root %d: was " PTR_FORMAT, index, p2i(old)); @@ -787,10 +798,8 @@ void HeapShared::add_root_segment(objArrayOop segment_oop) { _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::init_root_segment_sizes(int max_size_elems) { + _root_segment_max_size_elems = max_size_elems; } void HeapShared::serialize_tables(SerializeClosure* soc) { diff --git a/src/hotspot/share/cds/heapShared.hpp b/src/hotspot/share/cds/heapShared.hpp index 01610ebe64e15..01d664945ee74 100644 --- a/src/hotspot/share/cds/heapShared.hpp +++ b/src/hotspot/share/cds/heapShared.hpp @@ -291,8 +291,7 @@ class HeapShared: AllStatic { static GrowableArrayCHeap* _pending_roots; static GrowableArrayCHeap* _root_segments; - static int _root_segment_max_size_shift; - static int _root_segment_max_size_mask; + static int _root_segment_max_size_elems; static OopHandle _scratch_basic_type_mirrors[T_VOID+1]; static MetaspaceObjToOopHandleTable* _scratch_java_mirror_table; static MetaspaceObjToOopHandleTable* _scratch_references_table; @@ -407,6 +406,8 @@ class HeapShared: AllStatic { // Run-time only static void clear_root(int index); + static void get_segment_indexes(int index, int& segment_index, int& internal_index); + static void setup_test_class(const char* test_class_name) PRODUCT_RETURN; #endif // INCLUDE_CDS_JAVA_HEAP @@ -425,7 +426,7 @@ 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 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 init_root_segment_sizes(int max_size_elems) NOT_CDS_JAVA_HEAP_RETURN; static void serialize_tables(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN; #ifndef PRODUCT From 0b467e902d591ae9feeec1669918d1588987cd1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Casta=C3=B1eda=20Lozano?= Date: Thu, 3 Oct 2024 08:36:33 +0000 Subject: [PATCH 294/307] 8334060: Implementation of Late Barrier Expansion for G1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Roberto Castañeda Lozano Co-authored-by: Erik Österlund Co-authored-by: Siyao Liu Co-authored-by: Kim Barrett Co-authored-by: Amit Kumar Co-authored-by: Martin Doerr Co-authored-by: Feilong Jiang Co-authored-by: Sergey Nazarkin Reviewed-by: kvn, tschatzl, fyang, ayang, kbarrett --- make/hotspot/gensrc/GensrcAdlc.gmk | 7 + src/hotspot/cpu/aarch64/aarch64.ad | 24 +- src/hotspot/cpu/aarch64/cas.m4 | 4 + .../gc/g1/g1BarrierSetAssembler_aarch64.cpp | 268 ++-- .../gc/g1/g1BarrierSetAssembler_aarch64.hpp | 23 + src/hotspot/cpu/aarch64/gc/g1/g1_aarch64.ad | 680 ++++++++++ src/hotspot/cpu/aarch64/gc/g1/g1_aarch64.m4 | 384 ++++++ src/hotspot/cpu/arm/arm.ad | 4 + src/hotspot/cpu/arm/assembler_arm_32.hpp | 23 +- .../arm/gc/g1/g1BarrierSetAssembler_arm.cpp | 292 +++-- .../arm/gc/g1/g1BarrierSetAssembler_arm.hpp | 26 +- src/hotspot/cpu/arm/gc/g1/g1_arm.ad | 201 +++ .../arm/gc/shared/barrierSetAssembler_arm.cpp | 56 +- .../arm/gc/shared/barrierSetAssembler_arm.hpp | 24 + src/hotspot/cpu/arm/register_arm.hpp | 25 + .../ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp | 294 +++-- .../ppc/gc/g1/g1BarrierSetAssembler_ppc.hpp | 25 + src/hotspot/cpu/ppc/gc/g1/g1_ppc.ad | 684 ++++++++++ src/hotspot/cpu/ppc/ppc.ad | 20 +- src/hotspot/cpu/ppc/register_ppc.hpp | 9 + .../gc/g1/g1BarrierSetAssembler_riscv.cpp | 274 ++-- .../gc/g1/g1BarrierSetAssembler_riscv.hpp | 25 +- src/hotspot/cpu/riscv/gc/g1/g1_riscv.ad | 564 ++++++++ src/hotspot/cpu/riscv/riscv.ad | 19 +- .../s390/gc/g1/g1BarrierSetAssembler_s390.cpp | 279 +++- .../s390/gc/g1/g1BarrierSetAssembler_s390.hpp | 28 +- src/hotspot/cpu/s390/gc/g1/g1_s390.ad | 457 +++++++ .../gc/shared/barrierSetAssembler_s390.cpp | 92 +- .../gc/shared/barrierSetAssembler_s390.hpp | 38 +- src/hotspot/cpu/s390/macroAssembler_s390.cpp | 3 +- src/hotspot/cpu/s390/register_s390.hpp | 8 + src/hotspot/cpu/s390/s390.ad | 18 +- .../x86/gc/g1/g1BarrierSetAssembler_x86.cpp | 289 +++-- .../x86/gc/g1/g1BarrierSetAssembler_x86.hpp | 23 + src/hotspot/cpu/x86/gc/g1/g1_x86_64.ad | 371 ++++++ src/hotspot/cpu/x86/x86.ad | 4 + src/hotspot/cpu/x86/x86_64.ad | 16 +- src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp | 1134 +++++------------ src/hotspot/share/gc/g1/c2/g1BarrierSetC2.hpp | 126 +- .../share/gc/g1/g1BarrierSetRuntime.cpp | 8 + .../share/gc/g1/g1BarrierSetRuntime.hpp | 4 + .../share/gc/shared/c2/barrierSetC2.cpp | 4 + .../share/gc/shared/c2/barrierSetC2.hpp | 4 + .../gc/shared/c2/cardTableBarrierSetC2.cpp | 29 - .../gc/shared/c2/cardTableBarrierSetC2.hpp | 2 - src/hotspot/share/opto/buildOopMap.cpp | 7 + src/hotspot/share/opto/lcm.cpp | 8 + src/hotspot/share/opto/matcher.cpp | 20 + src/hotspot/share/opto/matcher.hpp | 2 + src/hotspot/share/opto/memnode.cpp | 5 + src/hotspot/share/opto/output.cpp | 2 + .../compiler/c2/aarch64/TestVolatiles.java | 44 +- .../AllocationMergesTests.java | 9 +- .../gcbarriers/TestG1BarrierGeneration.java | 639 ++++++++++ .../compiler/lib/ir_framework/IRNode.java | 102 ++ .../TestMachTempsAcrossSafepoints.java | 98 ++ .../src/sun/hotspot/tools/ctw/CtwRunner.java | 5 +- test/jdk/java/lang/invoke/BigArityTest.java | 2 +- 58 files changed, 6387 insertions(+), 1448 deletions(-) create mode 100644 src/hotspot/cpu/aarch64/gc/g1/g1_aarch64.ad create mode 100644 src/hotspot/cpu/aarch64/gc/g1/g1_aarch64.m4 create mode 100644 src/hotspot/cpu/arm/gc/g1/g1_arm.ad create mode 100644 src/hotspot/cpu/ppc/gc/g1/g1_ppc.ad create mode 100644 src/hotspot/cpu/riscv/gc/g1/g1_riscv.ad create mode 100644 src/hotspot/cpu/s390/gc/g1/g1_s390.ad create mode 100644 src/hotspot/cpu/x86/gc/g1/g1_x86_64.ad create mode 100644 test/hotspot/jtreg/compiler/gcbarriers/TestG1BarrierGeneration.java create mode 100644 test/hotspot/jtreg/compiler/runtime/safepoints/TestMachTempsAcrossSafepoints.java diff --git a/make/hotspot/gensrc/GensrcAdlc.gmk b/make/hotspot/gensrc/GensrcAdlc.gmk index 8dada3cec0a1d..ddb2c3e33e513 100644 --- a/make/hotspot/gensrc/GensrcAdlc.gmk +++ b/make/hotspot/gensrc/GensrcAdlc.gmk @@ -200,6 +200,13 @@ ifeq ($(call check-jvm-feature, compiler2), true) ))) endif + ifeq ($(call check-jvm-feature, g1gc), true) + AD_SRC_FILES += $(call uniq, $(wildcard $(foreach d, $(AD_SRC_ROOTS), \ + $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/gc/g1/g1_$(HOTSPOT_TARGET_CPU).ad \ + $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/gc/g1/g1_$(HOTSPOT_TARGET_CPU_ARCH).ad \ + ))) + endif + SINGLE_AD_SRCFILE := $(ADLC_SUPPORT_DIR)/all-ad-src.ad INSERT_FILENAME_AWK_SCRIPT := \ diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 39eae43a287e7..7d2a35cefd86a 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -2620,7 +2620,8 @@ static bool is_vector_bitwise_not_pattern(Node* n, Node* m) { bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) { if (is_vshift_con_pattern(n, m) || is_vector_bitwise_not_pattern(n, m) || - is_valid_sve_arith_imm_pattern(n, m)) { + is_valid_sve_arith_imm_pattern(n, m) || + is_encode_and_store_pattern(n, m)) { mstack.push(m, Visit); return true; } @@ -6410,7 +6411,7 @@ instruct loadP(iRegPNoSp dst, memory mem) instruct loadN(iRegNNoSp dst, memory mem) %{ match(Set dst (LoadN mem)); - predicate(!needs_acquiring_load(n)); + predicate(!needs_acquiring_load(n) && n->as_Load()->barrier_data() == 0); ins_cost(4 * INSN_COST); format %{ "ldrw $dst, $mem\t# compressed ptr" %} @@ -6839,7 +6840,7 @@ instruct storeimmP0(immP0 zero, memory mem) instruct storeN(iRegN src, memory mem) %{ match(Set mem (StoreN mem src)); - predicate(!needs_releasing_store(n)); + predicate(!needs_releasing_store(n) && n->as_Store()->barrier_data() == 0); ins_cost(INSN_COST); format %{ "strw $src, $mem\t# compressed ptr" %} @@ -6852,7 +6853,7 @@ instruct storeN(iRegN src, memory mem) instruct storeImmN0(immN0 zero, memory mem) %{ match(Set mem (StoreN mem zero)); - predicate(!needs_releasing_store(n)); + predicate(!needs_releasing_store(n) && n->as_Store()->barrier_data() == 0); ins_cost(INSN_COST); format %{ "strw zr, $mem\t# compressed ptr" %} @@ -7086,6 +7087,7 @@ instruct loadP_volatile(iRegPNoSp dst, /* sync_memory*/indirect mem) instruct loadN_volatile(iRegNNoSp dst, /* sync_memory*/indirect mem) %{ match(Set dst (LoadN mem)); + predicate(n->as_Load()->barrier_data() == 0); ins_cost(VOLATILE_REF_COST); format %{ "ldarw $dst, $mem\t# compressed ptr" %} @@ -7253,6 +7255,7 @@ instruct storeimmP0_volatile(immP0 zero, /* sync_memory*/indirect mem) instruct storeN_volatile(iRegN src, /* sync_memory*/indirect mem) %{ match(Set mem (StoreN mem src)); + predicate(n->as_Store()->barrier_data() == 0); ins_cost(VOLATILE_REF_COST); format %{ "stlrw $src, $mem\t# compressed ptr" %} @@ -7265,6 +7268,7 @@ instruct storeN_volatile(iRegN src, /* sync_memory*/indirect mem) instruct storeimmN0_volatile(immN0 zero, /* sync_memory*/indirect mem) %{ match(Set mem (StoreN mem zero)); + predicate(n->as_Store()->barrier_data() == 0); ins_cost(VOLATILE_REF_COST); format %{ "stlrw zr, $mem\t# compressed ptr" %} @@ -8061,6 +8065,7 @@ instruct compareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval instruct compareAndSwapN(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoSp newval, rFlagsReg cr) %{ match(Set res (CompareAndSwapN mem (Binary oldval newval))); + predicate(n->as_LoadStore()->barrier_data() == 0); ins_cost(2 * VOLATILE_REF_COST); effect(KILL cr); @@ -8175,7 +8180,7 @@ instruct compareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP new instruct compareAndSwapNAcq(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoSp newval, rFlagsReg cr) %{ - predicate(needs_acquiring_load_exclusive(n)); + predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0); match(Set res (CompareAndSwapN mem (Binary oldval newval))); ins_cost(VOLATILE_REF_COST); @@ -8280,6 +8285,7 @@ instruct compareAndExchangeL(iRegLNoSp res, indirect mem, iRegL oldval, iRegL ne // This pattern is generated automatically from cas.m4. // DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct compareAndExchangeN(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{ + predicate(n->as_LoadStore()->barrier_data() == 0); match(Set res (CompareAndExchangeN mem (Binary oldval newval))); ins_cost(2 * VOLATILE_REF_COST); effect(TEMP_DEF res, KILL cr); @@ -8389,7 +8395,7 @@ instruct compareAndExchangeLAcq(iRegLNoSp res, indirect mem, iRegL oldval, iRegL // This pattern is generated automatically from cas.m4. // DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct compareAndExchangeNAcq(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{ - predicate(needs_acquiring_load_exclusive(n)); + predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0); match(Set res (CompareAndExchangeN mem (Binary oldval newval))); ins_cost(VOLATILE_REF_COST); effect(TEMP_DEF res, KILL cr); @@ -8501,6 +8507,7 @@ instruct weakCompareAndSwapL(iRegINoSp res, indirect mem, iRegL oldval, iRegL ne // This pattern is generated automatically from cas.m4. // DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct weakCompareAndSwapN(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{ + predicate(n->as_LoadStore()->barrier_data() == 0); match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); ins_cost(2 * VOLATILE_REF_COST); effect(KILL cr); @@ -8620,7 +8627,7 @@ instruct weakCompareAndSwapLAcq(iRegINoSp res, indirect mem, iRegL oldval, iRegL // This pattern is generated automatically from cas.m4. // DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct weakCompareAndSwapNAcq(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{ - predicate(needs_acquiring_load_exclusive(n)); + predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0); match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); ins_cost(VOLATILE_REF_COST); effect(KILL cr); @@ -8681,6 +8688,7 @@ instruct get_and_setL(indirect mem, iRegL newv, iRegLNoSp prev) %{ %} instruct get_and_setN(indirect mem, iRegN newv, iRegINoSp prev) %{ + predicate(n->as_LoadStore()->barrier_data() == 0); match(Set prev (GetAndSetN mem newv)); ins_cost(2 * VOLATILE_REF_COST); format %{ "atomic_xchgw $prev, $newv, [$mem]" %} @@ -8724,7 +8732,7 @@ instruct get_and_setLAcq(indirect mem, iRegL newv, iRegLNoSp prev) %{ %} instruct get_and_setNAcq(indirect mem, iRegN newv, iRegINoSp prev) %{ - predicate(needs_acquiring_load_exclusive(n)); + predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0); match(Set prev (GetAndSetN mem newv)); ins_cost(VOLATILE_REF_COST); format %{ "atomic_xchgw_acq $prev, $newv, [$mem]" %} diff --git a/src/hotspot/cpu/aarch64/cas.m4 b/src/hotspot/cpu/aarch64/cas.m4 index f8aac0c4939fa..7e13e153db18a 100644 --- a/src/hotspot/cpu/aarch64/cas.m4 +++ b/src/hotspot/cpu/aarch64/cas.m4 @@ -45,7 +45,9 @@ define(`CAS_INSN', // DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct compareAndExchange$1$6(iReg$2NoSp res, indirect mem, iReg$2 oldval, iReg$2 newval, rFlagsReg cr) %{ ifelse($1$6,PAcq,INDENT(predicate(needs_acquiring_load_exclusive(n) && (n->as_LoadStore()->barrier_data() == 0));), + $1$6,NAcq,INDENT(predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0);), $1,P,INDENT(predicate(n->as_LoadStore()->barrier_data() == 0);), + $1,N,INDENT(predicate(n->as_LoadStore()->barrier_data() == 0);), $6,Acq,INDENT(predicate(needs_acquiring_load_exclusive(n));), `dnl') match(Set res (CompareAndExchange$1 mem (Binary oldval newval))); @@ -122,7 +124,9 @@ define(`CAS_INSN3', // DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct weakCompareAndSwap$1$6(iRegINoSp res, indirect mem, iReg$2 oldval, iReg$2 newval, rFlagsReg cr) %{ ifelse($1$6,PAcq,INDENT(predicate(needs_acquiring_load_exclusive(n) && (n->as_LoadStore()->barrier_data() == 0));), + $1$6,NAcq,INDENT(predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0);), $1,P,INDENT(predicate(n->as_LoadStore()->barrier_data() == 0);), + $1,N,INDENT(predicate(n->as_LoadStore()->barrier_data() == 0);), $6,Acq,INDENT(predicate(needs_acquiring_load_exclusive(n));), `dnl') match(Set res (WeakCompareAndSwap$1 mem (Binary oldval newval))); diff --git a/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp index d02038b6e9193..b978c350ce131 100644 --- a/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp @@ -38,7 +38,10 @@ #include "c1/c1_LIRAssembler.hpp" #include "c1/c1_MacroAssembler.hpp" #include "gc/g1/c1/g1BarrierSetC1.hpp" -#endif +#endif // COMPILER1 +#ifdef COMPILER2 +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#endif // COMPILER2 #define __ masm-> @@ -95,6 +98,54 @@ void G1BarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* mas __ pop(saved_regs, sp); } +static void generate_queue_test_and_insertion(MacroAssembler* masm, ByteSize index_offset, ByteSize buffer_offset, Label& runtime, + const Register thread, const Register value, const Register temp1, const Register temp2) { + // Can we store a value in the given thread's buffer? + // (The index field is typed as size_t.) + __ ldr(temp1, Address(thread, in_bytes(index_offset))); // temp1 := *(index address) + __ cbz(temp1, runtime); // jump to runtime if index == 0 (full buffer) + // The buffer is not full, store value into it. + __ sub(temp1, temp1, wordSize); // temp1 := next index + __ str(temp1, Address(thread, in_bytes(index_offset))); // *(index address) := next index + __ ldr(temp2, Address(thread, in_bytes(buffer_offset))); // temp2 := buffer address + __ str(value, Address(temp2, temp1)); // *(buffer address + next index) := value +} + +static void generate_pre_barrier_fast_path(MacroAssembler* masm, + const Register thread, + const Register tmp1) { + Address in_progress(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset())); + // Is marking active? + if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { + __ ldrw(tmp1, in_progress); + } else { + assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); + __ ldrb(tmp1, in_progress); + } +} + +static void generate_pre_barrier_slow_path(MacroAssembler* masm, + const Register obj, + const Register pre_val, + const Register thread, + const Register tmp1, + const Register tmp2, + Label& done, + Label& runtime) { + // Do we need to load the previous value? + if (obj != noreg) { + __ load_heap_oop(pre_val, Address(obj, 0), noreg, noreg, AS_RAW); + } + // Is the previous value null? + __ cbz(pre_val, done); + generate_queue_test_and_insertion(masm, + G1ThreadLocalData::satb_mark_queue_index_offset(), + G1ThreadLocalData::satb_mark_queue_buffer_offset(), + runtime, + thread, pre_val, tmp1, tmp2); + __ b(done); +} + void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Register obj, Register pre_val, @@ -115,43 +166,10 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, assert_different_registers(obj, pre_val, tmp1, tmp2); assert(pre_val != noreg && tmp1 != noreg && tmp2 != noreg, "expecting a register"); - Address in_progress(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset())); - Address index(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset())); - Address buffer(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset())); - - // Is marking active? - if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { - __ ldrw(tmp1, in_progress); - } else { - assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); - __ ldrb(tmp1, in_progress); - } + generate_pre_barrier_fast_path(masm, thread, tmp1); + // If marking is not active (*(mark queue active address) == 0), jump to done __ cbzw(tmp1, done); - - // Do we need to load the previous value? - if (obj != noreg) { - __ load_heap_oop(pre_val, Address(obj, 0), noreg, noreg, AS_RAW); - } - - // Is the previous value null? - __ cbz(pre_val, done); - - // Can we store original value in the thread's buffer? - // Is index == 0? - // (The index field is typed as size_t.) - - __ ldr(tmp1, index); // tmp := *index_adr - __ cbz(tmp1, runtime); // tmp == 0? - // If yes, goto runtime - - __ sub(tmp1, tmp1, wordSize); // tmp := tmp - wordSize - __ str(tmp1, index); // *index_adr := tmp - __ ldr(tmp2, buffer); - __ add(tmp1, tmp1, tmp2); // tmp := tmp + *buffer_adr - - // Record the previous value - __ str(pre_val, Address(tmp1, 0)); - __ b(done); + generate_pre_barrier_slow_path(masm, obj, pre_val, thread, tmp1, tmp2, done, runtime); __ bind(runtime); @@ -182,6 +200,50 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, } +static void generate_post_barrier_fast_path(MacroAssembler* masm, + const Register store_addr, + const Register new_val, + const Register tmp1, + const Register tmp2, + Label& done, + bool new_val_may_be_null) { + // Does store cross heap regions? + __ eor(tmp1, store_addr, new_val); // tmp1 := store address ^ new value + __ lsr(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); // tmp1 := ((store address ^ new value) >> LogOfHRGrainBytes) + __ cbz(tmp1, done); + // Crosses regions, storing null? + if (new_val_may_be_null) { + __ cbz(new_val, done); + } + // Storing region crossing non-null, is card young? + __ lsr(tmp1, store_addr, CardTable::card_shift()); // tmp1 := card address relative to card table base + __ load_byte_map_base(tmp2); // tmp2 := card table base address + __ add(tmp1, tmp1, tmp2); // tmp1 := card address + __ ldrb(tmp2, Address(tmp1)); // tmp2 := card + __ cmpw(tmp2, (int)G1CardTable::g1_young_card_val()); // tmp2 := card == young_card_val? +} + +static void generate_post_barrier_slow_path(MacroAssembler* masm, + const Register thread, + const Register tmp1, + const Register tmp2, + Label& done, + Label& runtime) { + __ membar(Assembler::StoreLoad); // StoreLoad membar + __ ldrb(tmp2, Address(tmp1)); // tmp2 := card + __ cbzw(tmp2, done); + // Storing a region crossing, non-null oop, card is clean. + // Dirty card and log. + STATIC_ASSERT(CardTable::dirty_card_val() == 0); + __ strb(zr, Address(tmp1)); // *(card address) := dirty_card_val + generate_queue_test_and_insertion(masm, + G1ThreadLocalData::dirty_card_queue_index_offset(), + G1ThreadLocalData::dirty_card_queue_buffer_offset(), + runtime, + thread, tmp1, tmp2, rscratch1); + __ b(done); +} + void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Register store_addr, Register new_val, @@ -194,70 +256,116 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, assert(store_addr != noreg && new_val != noreg && tmp1 != noreg && tmp2 != noreg, "expecting a register"); - Address queue_index(thread, in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset())); - Address buffer(thread, in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset())); - - BarrierSet* bs = BarrierSet::barrier_set(); - CardTableBarrierSet* ctbs = barrier_set_cast(bs); - CardTable* ct = ctbs->card_table(); - Label done; Label runtime; - // Does store cross heap regions? + generate_post_barrier_fast_path(masm, store_addr, new_val, tmp1, tmp2, done, true /* new_val_may_be_null */); + // If card is young, jump to done + __ br(Assembler::EQ, done); + generate_post_barrier_slow_path(masm, thread, tmp1, tmp2, done, runtime); - __ eor(tmp1, store_addr, new_val); - __ lsr(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); - __ cbz(tmp1, done); + __ bind(runtime); + // save the live input values + RegSet saved = RegSet::of(store_addr); + __ push(saved, sp); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), tmp1, thread); + __ pop(saved, sp); - // crosses regions, storing null? + __ bind(done); +} - __ cbz(new_val, done); +#if defined(COMPILER2) - // storing region crossing non-null, is card already dirty? +static void generate_c2_barrier_runtime_call(MacroAssembler* masm, G1BarrierStubC2* stub, const Register arg, const address runtime_path) { + SaveLiveRegisters save_registers(masm, stub); + if (c_rarg0 != arg) { + __ mov(c_rarg0, arg); + } + __ mov(c_rarg1, rthread); + __ mov(rscratch1, runtime_path); + __ blr(rscratch1); +} - const Register card_addr = tmp1; +void G1BarrierSetAssembler::g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register thread, + Register tmp1, + Register tmp2, + G1PreBarrierStubC2* stub) { + assert(thread == rthread, "must be"); + assert_different_registers(obj, pre_val, tmp1, tmp2); + assert(pre_val != noreg && tmp1 != noreg && tmp2 != noreg, "expecting a register"); - __ lsr(card_addr, store_addr, CardTable::card_shift()); + stub->initialize_registers(obj, pre_val, thread, tmp1, tmp2); - // get the address of the card - __ load_byte_map_base(tmp2); - __ add(card_addr, card_addr, tmp2); - __ ldrb(tmp2, Address(card_addr)); - __ cmpw(tmp2, (int)G1CardTable::g1_young_card_val()); - __ br(Assembler::EQ, done); + generate_pre_barrier_fast_path(masm, thread, tmp1); + // If marking is active (*(mark queue active address) != 0), jump to stub (slow path) + __ cbnzw(tmp1, *stub->entry()); - assert((int)CardTable::dirty_card_val() == 0, "must be 0"); + __ bind(*stub->continuation()); +} - __ membar(Assembler::StoreLoad); +void G1BarrierSetAssembler::generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const { + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + Label runtime; + Register obj = stub->obj(); + Register pre_val = stub->pre_val(); + Register thread = stub->thread(); + Register tmp1 = stub->tmp1(); + Register tmp2 = stub->tmp2(); - __ ldrb(tmp2, Address(card_addr)); - __ cbzw(tmp2, done); + __ bind(*stub->entry()); + generate_pre_barrier_slow_path(masm, obj, pre_val, thread, tmp1, tmp2, *stub->continuation(), runtime); - // storing a region crossing, non-null oop, card is clean. - // dirty card and log. + __ bind(runtime); + generate_c2_barrier_runtime_call(masm, stub, pre_val, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry)); + __ b(*stub->continuation()); +} - __ strb(zr, Address(card_addr)); +void G1BarrierSetAssembler::g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register thread, + Register tmp1, + Register tmp2, + G1PostBarrierStubC2* stub) { + assert(thread == rthread, "must be"); + assert_different_registers(store_addr, new_val, thread, tmp1, tmp2, + rscratch1); + assert(store_addr != noreg && new_val != noreg && tmp1 != noreg + && tmp2 != noreg, "expecting a register"); - __ ldr(rscratch1, queue_index); - __ cbz(rscratch1, runtime); - __ sub(rscratch1, rscratch1, wordSize); - __ str(rscratch1, queue_index); + stub->initialize_registers(thread, tmp1, tmp2); - __ ldr(tmp2, buffer); - __ str(card_addr, Address(tmp2, rscratch1)); - __ b(done); + bool new_val_may_be_null = (stub->barrier_data() & G1C2BarrierPostNotNull) == 0; + generate_post_barrier_fast_path(masm, store_addr, new_val, tmp1, tmp2, *stub->continuation(), new_val_may_be_null); + // If card is not young, jump to stub (slow path) + __ br(Assembler::NE, *stub->entry()); - __ bind(runtime); - // save the live input values - RegSet saved = RegSet::of(store_addr); - __ push(saved, sp); - __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), card_addr, thread); - __ pop(saved, sp); + __ bind(*stub->continuation()); +} - __ bind(done); +void G1BarrierSetAssembler::generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const { + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + Label runtime; + Register thread = stub->thread(); + Register tmp1 = stub->tmp1(); // tmp1 holds the card address. + Register tmp2 = stub->tmp2(); + assert(stub->tmp3() == noreg, "not needed in this platform"); + + __ bind(*stub->entry()); + generate_post_barrier_slow_path(masm, thread, tmp1, tmp2, *stub->continuation(), runtime); + + __ bind(runtime); + generate_c2_barrier_runtime_call(masm, stub, tmp1, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry)); + __ b(*stub->continuation()); } +#endif // COMPILER2 + void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register dst, Address src, Register tmp1, Register tmp2) { bool on_oop = is_reference_type(type); diff --git a/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.hpp index 7b4bc8cdc49de..4baa18cb94544 100644 --- a/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.hpp @@ -33,6 +33,8 @@ class LIR_Assembler; class StubAssembler; class G1PreBarrierStub; class G1PostBarrierStub; +class G1PreBarrierStubC2; +class G1PostBarrierStubC2; class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { protected: @@ -69,6 +71,27 @@ class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { void generate_c1_post_barrier_runtime_stub(StubAssembler* sasm); #endif +#ifdef COMPILER2 + void g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register thread, + Register tmp1, + Register tmp2, + G1PreBarrierStubC2* c2_stub); + void generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const; + void g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register thread, + Register tmp1, + Register tmp2, + G1PostBarrierStubC2* c2_stub); + void generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const; +#endif + void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register dst, Address src, Register tmp1, Register tmp2); }; diff --git a/src/hotspot/cpu/aarch64/gc/g1/g1_aarch64.ad b/src/hotspot/cpu/aarch64/gc/g1/g1_aarch64.ad new file mode 100644 index 0000000000000..081a67d68807b --- /dev/null +++ b/src/hotspot/cpu/aarch64/gc/g1/g1_aarch64.ad @@ -0,0 +1,680 @@ +// +// 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. +// + +source_hpp %{ + +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#include "gc/shared/gc_globals.hpp" + +%} + +source %{ + +#include "gc/g1/g1BarrierSetAssembler_aarch64.hpp" +#include "gc/g1/g1BarrierSetRuntime.hpp" + +static void write_barrier_pre(MacroAssembler* masm, + const MachNode* node, + Register obj, + Register pre_val, + Register tmp1, + Register tmp2, + RegSet preserve = RegSet(), + RegSet no_preserve = RegSet()) { + if (!G1PreBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PreBarrierStubC2* const stub = G1PreBarrierStubC2::create(node); + for (RegSetIterator reg = preserve.begin(); *reg != noreg; ++reg) { + stub->preserve(*reg); + } + for (RegSetIterator reg = no_preserve.begin(); *reg != noreg; ++reg) { + stub->dont_preserve(*reg); + } + g1_asm->g1_write_barrier_pre_c2(masm, obj, pre_val, rthread, tmp1, tmp2, stub); +} + +static void write_barrier_post(MacroAssembler* masm, + const MachNode* node, + Register store_addr, + Register new_val, + Register tmp1, + Register tmp2) { + if (!G1PostBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PostBarrierStubC2* const stub = G1PostBarrierStubC2::create(node); + g1_asm->g1_write_barrier_post_c2(masm, store_addr, new_val, rthread, tmp1, tmp2, stub); +} + +%} + +// BEGIN This section of the file is automatically generated. Do not edit -------------- + +// This section is generated from g1_aarch64.m4 + + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1StoreP(indirect mem, iRegP src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && !needs_releasing_store(n) && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreP mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(INSN_COST); + format %{ "str $src, $mem\t# ptr" %} + ins_encode %{ + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + __ str($src$$Register, $mem$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(istore_reg_mem); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1StorePVolatile(indirect mem, iRegP src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && needs_releasing_store(n) && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreP mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(VOLATILE_REF_COST); + format %{ "stlr $src, $mem\t# ptr" %} + ins_encode %{ + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + __ stlr($src$$Register, $mem$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_class_memory); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1StoreN(indirect mem, iRegN src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && !needs_releasing_store(n) && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(INSN_COST); + format %{ "strw $src, $mem\t# compressed ptr" %} + ins_encode %{ + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + __ strw($src$$Register, $mem$$Register); + if ((barrier_data() & G1C2BarrierPost) != 0) { + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ decode_heap_oop($tmp1$$Register, $src$$Register); + } else { + __ decode_heap_oop_not_null($tmp1$$Register, $src$$Register); + } + } + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(istore_reg_mem); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1StoreNVolatile(indirect mem, iRegN src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && needs_releasing_store(n) && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(VOLATILE_REF_COST); + format %{ "stlrw $src, $mem\t# compressed ptr" %} + ins_encode %{ + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + __ stlrw($src$$Register, $mem$$Register); + if ((barrier_data() & G1C2BarrierPost) != 0) { + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ decode_heap_oop($tmp1$$Register, $src$$Register); + } else { + __ decode_heap_oop_not_null($tmp1$$Register, $src$$Register); + } + } + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_class_memory); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1EncodePAndStoreN(indirect mem, iRegP src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && !needs_releasing_store(n) && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem (EncodeP src))); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(INSN_COST); + format %{ "encode_heap_oop $tmp1, $src\n\t" + "strw $tmp1, $mem\t# compressed ptr" %} + ins_encode %{ + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ encode_heap_oop($tmp1$$Register, $src$$Register); + } else { + __ encode_heap_oop_not_null($tmp1$$Register, $src$$Register); + } + __ strw($tmp1$$Register, $mem$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(istore_reg_mem); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1EncodePAndStoreNVolatile(indirect mem, iRegP src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && needs_releasing_store(n) && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem (EncodeP src))); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(VOLATILE_REF_COST); + format %{ "encode_heap_oop $tmp1, $src\n\t" + "stlrw $tmp1, $mem\t# compressed ptr" %} + ins_encode %{ + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ encode_heap_oop($tmp1$$Register, $src$$Register); + } else { + __ encode_heap_oop_not_null($tmp1$$Register, $src$$Register); + } + __ stlrw($tmp1$$Register, $mem$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_class_memory); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndExchangeP(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, rFlagsReg cr) +%{ + predicate(UseG1GC && !needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeP mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "cmpxchg $res = $mem, $oldval, $newval\t# ptr" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + // Pass $oldval to the pre-barrier (instead of loading from $mem), because + // $oldval is the only value that can be overwritten. + // The same holds for g1CompareAndSwapP and its Acq variant. + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::xword, + false /* acquire */, true /* release */, false /* weak */, $res$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, rFlagsReg cr) +%{ + predicate(UseG1GC && needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeP mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(VOLATILE_REF_COST); + format %{ "cmpxchg_acq $res = $mem, $oldval, $newval\t# ptr" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + // Pass $oldval to the pre-barrier (instead of loading from $mem), because + // $oldval is the only value that can be overwritten. + // The same holds for g1CompareAndSwapP and its Acq variant. + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::xword, + true /* acquire */, true /* release */, false /* weak */, $res$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndExchangeN(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && !needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeN mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "cmpxchg $res = $mem, $oldval, $newval\t# narrow oop" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::word, + false /* acquire */, true /* release */, false /* weak */, $res$$Register); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndExchangeNAcq(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeN mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(VOLATILE_REF_COST); + format %{ "cmpxchg_acq $res = $mem, $oldval, $newval\t# narrow oop" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::word, + true /* acquire */, true /* release */, false /* weak */, $res$$Register); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndSwapP(iRegINoSp res, indirect mem, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegP oldval, rFlagsReg cr) +%{ + predicate(UseG1GC && !needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapP mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "cmpxchg $mem, $oldval, $newval\t# (ptr)\n\t" + "cset $res, EQ" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::xword, + false /* acquire */, true /* release */, false /* weak */, noreg); + __ cset($res$$Register, Assembler::EQ); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegP oldval, rFlagsReg cr) +%{ + predicate(UseG1GC && needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapP mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(VOLATILE_REF_COST); + format %{ "cmpxchg_acq $mem, $oldval, $newval\t# (ptr)\n\t" + "cset $res, EQ" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::xword, + true /* acquire */, true /* release */, false /* weak */, noreg); + __ cset($res$$Register, Assembler::EQ); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndSwapN(iRegINoSp res, indirect mem, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, iRegN oldval, rFlagsReg cr) +%{ + predicate(UseG1GC && !needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapN mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "cmpxchg $mem, $oldval, $newval\t# (narrow oop)\n\t" + "cset $res, EQ" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::word, + false /* acquire */, true /* release */, false /* weak */, noreg); + __ cset($res$$Register, Assembler::EQ); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndSwapNAcq(iRegINoSp res, indirect mem, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, iRegN oldval, rFlagsReg cr) +%{ + predicate(UseG1GC && needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapN mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(VOLATILE_REF_COST); + format %{ "cmpxchg_acq $mem, $oldval, $newval\t# (narrow oop)\n\t" + "cset $res, EQ" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::word, + true /* acquire */, true /* release */, false /* weak */, noreg); + __ cset($res$$Register, Assembler::EQ); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1GetAndSetP(indirect mem, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp preval, rFlagsReg cr) +%{ + predicate(UseG1GC && !needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set preval (GetAndSetP mem newval)); + effect(TEMP preval, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "atomic_xchg $preval, $newval, [$mem]" %} + ins_encode %{ + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $preval$$Register /* pre_val (as a temporary register) */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $preval$$Register, $newval$$Register) /* preserve */); + __ atomic_xchg($preval$$Register, $newval$$Register, $mem$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_serial); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1GetAndSetPAcq(indirect mem, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp preval, rFlagsReg cr) +%{ + predicate(UseG1GC && needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set preval (GetAndSetP mem newval)); + effect(TEMP preval, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(VOLATILE_REF_COST); + format %{ "atomic_xchg_acq $preval, $newval, [$mem]" %} + ins_encode %{ + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $preval$$Register /* pre_val (as a temporary register) */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $preval$$Register, $newval$$Register) /* preserve */); + __ atomic_xchgal($preval$$Register, $newval$$Register, $mem$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_serial); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1GetAndSetN(indirect mem, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, iRegNNoSp preval, rFlagsReg cr) +%{ + predicate(UseG1GC && !needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set preval (GetAndSetN mem newval)); + effect(TEMP preval, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "atomic_xchgw $preval, $newval, [$mem]" %} + ins_encode %{ + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $preval$$Register, $newval$$Register) /* preserve */); + __ atomic_xchgw($preval$$Register, $newval$$Register, $mem$$Register); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_serial); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1GetAndSetNAcq(indirect mem, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, iRegNNoSp preval, rFlagsReg cr) +%{ + predicate(UseG1GC && needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set preval (GetAndSetN mem newval)); + effect(TEMP preval, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(VOLATILE_REF_COST); + format %{ "atomic_xchgw_acq $preval, $newval, [$mem]" %} + ins_encode %{ + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $preval$$Register, $newval$$Register) /* preserve */); + __ atomic_xchgalw($preval$$Register, $newval$$Register, $mem$$Register); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_serial); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1LoadP(iRegPNoSp dst, indirect mem, iRegPNoSp tmp1, iRegPNoSp tmp2, rFlagsReg cr) +%{ + // This instruction does not need an acquiring counterpart because it is only + // used for reference loading (Reference::get()). The same holds for g1LoadN. + predicate(UseG1GC && !needs_acquiring_load(n) && n->as_Load()->barrier_data() != 0); + match(Set dst (LoadP mem)); + effect(TEMP dst, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(4 * INSN_COST); + format %{ "ldr $dst, $mem\t# ptr" %} + ins_encode %{ + __ ldr($dst$$Register, $mem$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $dst$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(iload_reg_mem); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1LoadN(iRegNNoSp dst, indirect mem, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && !needs_acquiring_load(n) && n->as_Load()->barrier_data() != 0); + match(Set dst (LoadN mem)); + effect(TEMP dst, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(4 * INSN_COST); + format %{ "ldrw $dst, $mem\t# compressed ptr" %} + ins_encode %{ + __ ldrw($dst$$Register, $mem$$Register); + if ((barrier_data() & G1C2BarrierPre) != 0) { + __ decode_heap_oop($tmp1$$Register, $dst$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + } + %} + ins_pipe(iload_reg_mem); +%} + +// END This section of the file is automatically generated. Do not edit -------------- diff --git a/src/hotspot/cpu/aarch64/gc/g1/g1_aarch64.m4 b/src/hotspot/cpu/aarch64/gc/g1/g1_aarch64.m4 new file mode 100644 index 0000000000000..8fb1f7e8e428b --- /dev/null +++ b/src/hotspot/cpu/aarch64/gc/g1/g1_aarch64.m4 @@ -0,0 +1,384 @@ +dnl Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +dnl DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +dnl +dnl This code is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License version 2 only, as +dnl published by the Free Software Foundation. +dnl +dnl This code is distributed in the hope that it will be useful, but WITHOUT +dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl version 2 for more details (a copy is included in the LICENSE file that +dnl accompanied this code). +dnl +dnl You should have received a copy of the GNU General Public License version +dnl 2 along with this work; if not, write to the Free Software Foundation, +dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +dnl +dnl Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +dnl or visit www.oracle.com if you need additional information or have any +dnl questions. +dnl +// BEGIN This section of the file is automatically generated. Do not edit -------------- + +// This section is generated from g1_aarch64.m4 + +define(`STOREP_INSN', +` +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1StoreP$1(indirect mem, iRegP src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && ifelse($1,Volatile,'needs_releasing_store(n)`,'!needs_releasing_store(n)`) && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreP mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(ifelse($1,Volatile,VOLATILE_REF_COST,INSN_COST)); + format %{ "$2 $src, $mem\t# ptr" %} + ins_encode %{ + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + __ $2($src$$Register, $mem$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(ifelse($1,Volatile,pipe_class_memory,istore_reg_mem)); +%}')dnl +STOREP_INSN(,str) +STOREP_INSN(Volatile,stlr) +dnl +define(`STOREN_INSN', +` +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1StoreN$1(indirect mem, iRegN src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && ifelse($1,Volatile,'needs_releasing_store(n)`,'!needs_releasing_store(n)`) && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(ifelse($1,Volatile,VOLATILE_REF_COST,INSN_COST)); + format %{ "$2 $src, $mem\t# compressed ptr" %} + ins_encode %{ + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + __ $2($src$$Register, $mem$$Register); + if ((barrier_data() & G1C2BarrierPost) != 0) { + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ decode_heap_oop($tmp1$$Register, $src$$Register); + } else { + __ decode_heap_oop_not_null($tmp1$$Register, $src$$Register); + } + } + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(ifelse($1,Volatile,pipe_class_memory,istore_reg_mem)); +%}')dnl +STOREN_INSN(,strw) +STOREN_INSN(Volatile,stlrw) +dnl +define(`ENCODESTOREN_INSN', +` +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1EncodePAndStoreN$1(indirect mem, iRegP src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && ifelse($1,Volatile,'needs_releasing_store(n)`,'!needs_releasing_store(n)`) && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem (EncodeP src))); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(ifelse($1,Volatile,VOLATILE_REF_COST,INSN_COST)); + format %{ "encode_heap_oop $tmp1, $src\n\t" + "$2 $tmp1, $mem\t# compressed ptr" %} + ins_encode %{ + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ encode_heap_oop($tmp1$$Register, $src$$Register); + } else { + __ encode_heap_oop_not_null($tmp1$$Register, $src$$Register); + } + __ $2($tmp1$$Register, $mem$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(ifelse($1,Volatile,pipe_class_memory,istore_reg_mem)); +%}')dnl +ENCODESTOREN_INSN(,strw) +ENCODESTOREN_INSN(Volatile,stlrw) +dnl +define(`CAEP_INSN', +` +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndExchangeP$1(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, rFlagsReg cr) +%{ + predicate(UseG1GC && ifelse($1,Acq,'needs_acquiring_load_exclusive(n)`,'!needs_acquiring_load_exclusive(n)`) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeP mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(ifelse($1,Acq,VOLATILE_REF_COST,2 * VOLATILE_REF_COST)); + format %{ "cmpxchg$2 $res = $mem, $oldval, $newval\t# ptr" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + // Pass $oldval to the pre-barrier (instead of loading from $mem), because + // $oldval is the only value that can be overwritten. + // The same holds for g1CompareAndSwapP and its Acq variant. + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::xword, + $3 /* acquire */, true /* release */, false /* weak */, $res$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%}')dnl +CAEP_INSN(,,false) +CAEP_INSN(Acq,_acq,true) +dnl +define(`CAEN_INSN', +` +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndExchangeN$1(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && ifelse($1,Acq,'needs_acquiring_load_exclusive(n)`,'!needs_acquiring_load_exclusive(n)`) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeN mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(ifelse($1,Acq,VOLATILE_REF_COST,2 * VOLATILE_REF_COST)); + format %{ "cmpxchg$2 $res = $mem, $oldval, $newval\t# narrow oop" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::word, + $3 /* acquire */, true /* release */, false /* weak */, $res$$Register); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%}')dnl +CAEN_INSN(,,false) +CAEN_INSN(Acq,_acq,true) +dnl +define(`CASP_INSN', +` +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndSwapP$1(iRegINoSp res, indirect mem, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegP oldval, rFlagsReg cr) +%{ + predicate(UseG1GC && ifelse($1,Acq,'needs_acquiring_load_exclusive(n)`,'!needs_acquiring_load_exclusive(n)`) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapP mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(ifelse($1,Acq,VOLATILE_REF_COST,2 * VOLATILE_REF_COST)); + format %{ "cmpxchg$2 $mem, $oldval, $newval\t# (ptr)\n\t" + "cset $res, EQ" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::xword, + $3 /* acquire */, true /* release */, false /* weak */, noreg); + __ cset($res$$Register, Assembler::EQ); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%}')dnl +CASP_INSN(,,false) +CASP_INSN(Acq,_acq,true) +dnl +define(`CASN_INSN', +` +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1CompareAndSwapN$1(iRegINoSp res, indirect mem, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, iRegN oldval, rFlagsReg cr) +%{ + predicate(UseG1GC && ifelse($1,Acq,'needs_acquiring_load_exclusive(n)`,'!needs_acquiring_load_exclusive(n)`) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapN mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(ifelse($1,Acq,VOLATILE_REF_COST,2 * VOLATILE_REF_COST)); + format %{ "cmpxchg$2 $mem, $oldval, $newval\t# (narrow oop)\n\t" + "cset $res, EQ" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::word, + $3 /* acquire */, true /* release */, false /* weak */, noreg); + __ cset($res$$Register, Assembler::EQ); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%}')dnl +CASN_INSN(,,false) +CASN_INSN(Acq,_acq,true) +dnl +define(`XCHGP_INSN', +` +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1GetAndSetP$1(indirect mem, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp preval, rFlagsReg cr) +%{ + predicate(UseG1GC && ifelse($1,Acq,'needs_acquiring_load_exclusive(n)`,'!needs_acquiring_load_exclusive(n)`) && n->as_LoadStore()->barrier_data() != 0); + match(Set preval (GetAndSetP mem newval)); + effect(TEMP preval, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(ifelse($1,Acq,VOLATILE_REF_COST,2 * VOLATILE_REF_COST)); + format %{ "atomic_xchg$2 $preval, $newval, [$mem]" %} + ins_encode %{ + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $preval$$Register /* pre_val (as a temporary register) */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $preval$$Register, $newval$$Register) /* preserve */); + __ $3($preval$$Register, $newval$$Register, $mem$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_serial); +%}')dnl +XCHGP_INSN(,,atomic_xchg) +XCHGP_INSN(Acq,_acq,atomic_xchgal) +dnl +define(`XCHGN_INSN', +` +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1GetAndSetN$1(indirect mem, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, iRegNNoSp preval, rFlagsReg cr) +%{ + predicate(UseG1GC && ifelse($1,Acq,'needs_acquiring_load_exclusive(n)`,'!needs_acquiring_load_exclusive(n)`) && n->as_LoadStore()->barrier_data() != 0); + match(Set preval (GetAndSetN mem newval)); + effect(TEMP preval, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(ifelse($1,Acq,VOLATILE_REF_COST,2 * VOLATILE_REF_COST)); + format %{ "$2 $preval, $newval, [$mem]" %} + ins_encode %{ + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $preval$$Register, $newval$$Register) /* preserve */); + __ $3($preval$$Register, $newval$$Register, $mem$$Register); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_serial); +%}')dnl +XCHGN_INSN(,atomic_xchgw,atomic_xchgw) +XCHGN_INSN(Acq,atomic_xchgw_acq,atomic_xchgalw) + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1LoadP(iRegPNoSp dst, indirect mem, iRegPNoSp tmp1, iRegPNoSp tmp2, rFlagsReg cr) +%{ + // This instruction does not need an acquiring counterpart because it is only + // used for reference loading (Reference::get()). The same holds for g1LoadN. + predicate(UseG1GC && !needs_acquiring_load(n) && n->as_Load()->barrier_data() != 0); + match(Set dst (LoadP mem)); + effect(TEMP dst, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(4 * INSN_COST); + format %{ "ldr $dst, $mem\t# ptr" %} + ins_encode %{ + __ ldr($dst$$Register, $mem$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $dst$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(iload_reg_mem); +%} + +// This pattern is generated automatically from g1_aarch64.m4. +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct g1LoadN(iRegNNoSp dst, indirect mem, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && !needs_acquiring_load(n) && n->as_Load()->barrier_data() != 0); + match(Set dst (LoadN mem)); + effect(TEMP dst, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(4 * INSN_COST); + format %{ "ldrw $dst, $mem\t# compressed ptr" %} + ins_encode %{ + __ ldrw($dst$$Register, $mem$$Register); + if ((barrier_data() & G1C2BarrierPre) != 0) { + __ decode_heap_oop($tmp1$$Register, $dst$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + } + %} + ins_pipe(iload_reg_mem); +%} + +// END This section of the file is automatically generated. Do not edit -------------- diff --git a/src/hotspot/cpu/arm/arm.ad b/src/hotspot/cpu/arm/arm.ad index 2c7de0a58a204..716f6d87230e1 100644 --- a/src/hotspot/cpu/arm/arm.ad +++ b/src/hotspot/cpu/arm/arm.ad @@ -3890,6 +3890,7 @@ instruct loadRange(iRegI dst, memoryI mem) %{ instruct loadP(iRegP dst, memoryP mem) %{ + predicate(!(UseG1GC && n->as_Load()->barrier_data() != 0)); match(Set dst (LoadP mem)); ins_cost(MEMORY_REF_COST); size(4); @@ -4356,6 +4357,7 @@ instruct movSP(store_ptr_RegP dst, SPRegP src) %{ instruct storeP(memoryP mem, store_ptr_RegP src) %{ + predicate(!(UseG1GC && n->as_Store()->barrier_data() != 0)); match(Set mem (StoreP mem src)); ins_cost(MEMORY_REF_COST); size(4); @@ -5390,6 +5392,7 @@ instruct compareAndSwapI_bool(memoryex mem, iRegI oldval, iRegI newval, iRegI re %} instruct compareAndSwapP_bool(memoryex mem, iRegP oldval, iRegP newval, iRegI res, iRegI tmp, flagsReg ccr ) %{ + predicate(!(UseG1GC && n->as_LoadStore()->barrier_data() != 0)); match(Set res (CompareAndSwapP mem (Binary oldval newval))); effect( KILL ccr, TEMP tmp); size(28); @@ -5659,6 +5662,7 @@ instruct xchgL(memoryex mem, iRegLd newval, iRegLd res, iRegI tmp, flagsReg ccr) %} instruct xchgP(memoryex mem, iRegP newval, iRegP res, iRegI tmp, flagsReg ccr) %{ + predicate(!(UseG1GC && n->as_LoadStore()->barrier_data() != 0)); match(Set res (GetAndSetP mem newval)); effect(KILL ccr, TEMP tmp, TEMP res); size(16); diff --git a/src/hotspot/cpu/arm/assembler_arm_32.hpp b/src/hotspot/cpu/arm/assembler_arm_32.hpp index dd04ad1ab3a3c..e53eefac097ef 100644 --- a/src/hotspot/cpu/arm/assembler_arm_32.hpp +++ b/src/hotspot/cpu/arm/assembler_arm_32.hpp @@ -119,8 +119,9 @@ class RegisterSet { } friend RegisterSet operator | (const RegisterSet set1, const RegisterSet set2) { - assert((set1._encoding & set2._encoding) == 0, - "encoding constraint"); +// why so strong constraint? +// assert((set1._encoding & set2._encoding) == 0, +// "encoding constraint"); return RegisterSet(set1._encoding | set2._encoding); } @@ -142,6 +143,11 @@ class RegisterSet { } return count; } + + static RegisterSet from(RegSet set) { + assert(set.size(), "RegSet must not be empty"); + return RegisterSet(set.bits()); + } }; #if R9_IS_SCRATCHED @@ -157,6 +163,10 @@ class FloatRegisterSet { public: + FloatRegisterSet() { + _encoding = 0; + } + FloatRegisterSet(FloatRegister reg) { if (reg->hi_bit() == 0) { _encoding = reg->hi_bits() << 12 | reg->lo_bit() << 22 | 1; @@ -185,6 +195,15 @@ class FloatRegisterSet { return (_encoding & 0xFFFFFF00) | ((_encoding & 0xFF) << 1); } + static FloatRegisterSet from(FloatRegSet set) { + assert(set.size(), "FloatRegSet must not be empty"); + // the vector load/store instructions operate on a set of consecutive registers. + // for the sake of simplicity, write all registers between the first and last in the set + size_t range = (*set.rbegin())->encoding() - (*set.begin())->encoding() + 1; + // push_float stores float regisgters by pairs + return FloatRegisterSet(*set.begin(), (range+1)/2); + } + }; diff --git a/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp b/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp index 3c5e29aa8710f..56ae7707fbf38 100644 --- a/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp @@ -39,8 +39,10 @@ #include "c1/c1_LIRAssembler.hpp" #include "c1/c1_MacroAssembler.hpp" #include "gc/g1/c1/g1BarrierSetC1.hpp" -#endif - +#endif // COMPILER1 +#ifdef COMPILER2 +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#endif // COMPILER2 #define __ masm-> #ifdef PRODUCT @@ -106,70 +108,87 @@ void G1BarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* mas #endif // !R9_IS_SCRATCHED } -// G1 pre-barrier. -// Blows all volatile registers R0-R3, Rtemp, LR). -// If store_addr != noreg, then previous value is loaded from [store_addr]; -// in such case store_addr and new_val registers are preserved; -// otherwise pre_val register is preserved. -void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, - Register store_addr, - Register new_val, - Register pre_val, - Register tmp1, - Register tmp2) { - Label done; - Label runtime; - - if (store_addr != noreg) { - assert_different_registers(store_addr, new_val, pre_val, tmp1, tmp2, noreg); - } else { - assert (new_val == noreg, "should be"); - assert_different_registers(pre_val, tmp1, tmp2, noreg); - } - - Address in_progress(Rthread, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset())); - Address index(Rthread, in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset())); - Address buffer(Rthread, in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset())); +static void generate_queue_test_and_insertion(MacroAssembler* masm, ByteSize index_offset, ByteSize buffer_offset, Label& runtime, + const Register thread, const Register value, const Register temp1, const Register temp2) { + assert_different_registers(value, temp1, temp2); + // Can we store original value in the thread's buffer? + // (The index field is typed as size_t.) + __ ldr(temp1, Address(thread, in_bytes(index_offset))); // temp1 := *(index address) + __ cbz(temp1, runtime); // jump to runtime if index == 0 (full buffer) + // The buffer is not full, store value into it. + __ sub(temp1, temp1, wordSize); // temp1 := next index + __ str(temp1, Address(thread, in_bytes(index_offset))); // *(index address) := next index + __ ldr(temp2, Address(thread, in_bytes(buffer_offset))); // temp2 := buffer address + // Record the previous value + __ str(value, Address(temp2, temp1)); // *(buffer address + next index) := value + } +static void generate_pre_barrier_fast_path(MacroAssembler* masm, + const Register thread, + const Register tmp1) { + Address in_progress(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset())); // Is marking active? assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "adjust this code"); __ ldrb(tmp1, in_progress); - __ cbz(tmp1, done); +} +static void generate_pre_barrier_slow_path(MacroAssembler* masm, + const Register obj, + const Register pre_val, + const Register thread, + const Register tmp1, + const Register tmp2, + Label& done, + Label& runtime) { // Do we need to load the previous value? - if (store_addr != noreg) { - __ load_heap_oop(pre_val, Address(store_addr, 0)); + if (obj != noreg) { + __ load_heap_oop(pre_val, Address(obj, 0)); } // Is the previous value null? __ cbz(pre_val, done); - // Can we store original value in the thread's buffer? - // Is index == 0? - // (The index field is typed as size_t.) + generate_queue_test_and_insertion(masm, + G1ThreadLocalData::satb_mark_queue_index_offset(), + G1ThreadLocalData::satb_mark_queue_buffer_offset(), + runtime, + thread, pre_val, tmp1, tmp2); + __ b(done); +} - __ ldr(tmp1, index); // tmp1 := *index_adr - __ ldr(tmp2, buffer); +// G1 pre-barrier. +// Blows all volatile registers R0-R3, LR). +// If obj != noreg, then previous value is loaded from [obj]; +// in such case obj and pre_val registers is preserved; +// otherwise pre_val register is preserved. +void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, + Register obj, + Register pre_val, + Register tmp1, + Register tmp2) { + Label done; + Label runtime; - __ subs(tmp1, tmp1, wordSize); // tmp1 := tmp1 - wordSize - __ b(runtime, lt); // If negative, goto runtime + assert_different_registers(obj, pre_val, tmp1, tmp2, noreg); - __ str(tmp1, index); // *index_adr := tmp1 + generate_pre_barrier_fast_path(masm, Rthread, tmp1); + // If marking is not active (*(mark queue active address) == 0), jump to done + __ cbz(tmp1, done); - // Record the previous value - __ str(pre_val, Address(tmp2, tmp1)); - __ b(done); + generate_pre_barrier_slow_path(masm, obj, pre_val, Rthread, tmp1, tmp2, done, runtime); __ bind(runtime); // save the live input values - if (store_addr != noreg) { - // avoid raw_push to support any ordering of store_addr and new_val - __ push(RegisterSet(store_addr) | RegisterSet(new_val)); - } else { - __ push(pre_val); + RegisterSet set = RegisterSet(pre_val) | RegisterSet(R0, R3) | RegisterSet(R12); + // save the live input values + if (obj != noreg) { + // avoid raw_push to support any ordering of store_addr and pre_val + set = set | RegisterSet(obj); } + __ push(set); + if (pre_val != R0) { __ mov(R0, pre_val); } @@ -177,33 +196,17 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), R0, R1); - if (store_addr != noreg) { - __ pop(RegisterSet(store_addr) | RegisterSet(new_val)); - } else { - __ pop(pre_val); - } - + __ pop(set); __ bind(done); } -// G1 post-barrier. -// Blows all volatile registers R0-R3, Rtemp, LR). -void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, - Register store_addr, - Register new_val, - Register tmp1, - Register tmp2, - Register tmp3) { - - Address queue_index(Rthread, in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset())); - Address buffer(Rthread, in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset())); - - BarrierSet* bs = BarrierSet::barrier_set(); - CardTableBarrierSet* ctbs = barrier_set_cast(bs); - CardTable* ct = ctbs->card_table(); - Label done; - Label runtime; - +static void generate_post_barrier_fast_path(MacroAssembler* masm, + const Register store_addr, + const Register new_val, + const Register tmp1, + const Register tmp2, + Label& done, + bool new_val_may_be_null) { // Does store cross heap regions? __ eor(tmp1, store_addr, new_val); @@ -211,22 +214,31 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, __ b(done, eq); // crosses regions, storing null? - - __ cbz(new_val, done); - + if (new_val_may_be_null) { + __ cbz(new_val, done); + } // storing region crossing non-null, is card already dirty? const Register card_addr = tmp1; - __ mov_address(tmp2, (address)ct->byte_map_base()); + CardTableBarrierSet* ct = barrier_set_cast(BarrierSet::barrier_set()); + __ mov_address(tmp2, (address)ct->card_table()->byte_map_base()); __ add(card_addr, tmp2, AsmOperand(store_addr, lsr, CardTable::card_shift())); __ ldrb(tmp2, Address(card_addr)); __ cmp(tmp2, (int)G1CardTable::g1_young_card_val()); - __ b(done, eq); +} +static void generate_post_barrier_slow_path(MacroAssembler* masm, + const Register thread, + const Register tmp1, + const Register tmp2, + const Register tmp3, + Label& done, + Label& runtime) { __ membar(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreLoad), tmp2); - assert(CardTable::dirty_card_val() == 0, "adjust this code"); + // card_addr is loaded by generate_post_barrier_fast_path + const Register card_addr = tmp1; __ ldrb(tmp2, Address(card_addr)); __ cbz(tmp2, done); @@ -234,29 +246,139 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, // dirty card and log. __ strb(__ zero_register(tmp2), Address(card_addr)); + generate_queue_test_and_insertion(masm, + G1ThreadLocalData::dirty_card_queue_index_offset(), + G1ThreadLocalData::dirty_card_queue_buffer_offset(), + runtime, + thread, card_addr, tmp2, tmp3); + __ b(done); +} - __ ldr(tmp2, queue_index); - __ ldr(tmp3, buffer); - __ subs(tmp2, tmp2, wordSize); - __ b(runtime, lt); // go to runtime if now negative - - __ str(tmp2, queue_index); +// G1 post-barrier. +// Blows all volatile registers R0-R3, LR). +void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register tmp1, + Register tmp2, + Register tmp3) { + Label done; + Label runtime; - __ str(card_addr, Address(tmp3, tmp2)); - __ b(done); + generate_post_barrier_fast_path(masm, store_addr, new_val, tmp1, tmp2, done, true /* new_val_may_be_null */); + // If card is young, jump to done + // card_addr and card are loaded by generate_post_barrier_fast_path + const Register card = tmp2; + const Register card_addr = tmp1; + __ b(done, eq); + generate_post_barrier_slow_path(masm, Rthread, card_addr, tmp2, tmp3, done, runtime); __ bind(runtime); + RegisterSet set = RegisterSet(store_addr) | RegisterSet(R0, R3) | RegisterSet(R12); + __ push(set); + if (card_addr != R0) { __ mov(R0, card_addr); } __ mov(R1, Rthread); __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), R0, R1); + __ pop(set); + __ bind(done); } +#if defined(COMPILER2) + +static void generate_c2_barrier_runtime_call(MacroAssembler* masm, G1BarrierStubC2* stub, const Register arg, const address runtime_path, Register tmp1) { + SaveLiveRegisters save_registers(masm, stub); + if (c_rarg0 != arg) { + __ mov(c_rarg0, arg); + } + __ mov(c_rarg1, Rthread); + __ call_VM_leaf(runtime_path, R0, R1); +} + +void G1BarrierSetAssembler::g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register thread, + Register tmp1, + Register tmp2, + G1PreBarrierStubC2* stub) { + assert(thread == Rthread, "must be"); + assert_different_registers(obj, pre_val, tmp1, tmp2); + assert(pre_val != noreg && tmp1 != noreg && tmp2 != noreg, "expecting a register"); + + stub->initialize_registers(obj, pre_val, thread, tmp1, tmp2); + + generate_pre_barrier_fast_path(masm, thread, tmp1); + // If marking is active (*(mark queue active address) != 0), jump to stub (slow path) + __ cbnz(tmp1, *stub->entry()); + + __ bind(*stub->continuation()); +} + +void G1BarrierSetAssembler::generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const { + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + Label runtime; + Register obj = stub->obj(); + Register pre_val = stub->pre_val(); + Register thread = stub->thread(); + Register tmp1 = stub->tmp1(); + Register tmp2 = stub->tmp2(); + + __ bind(*stub->entry()); + generate_pre_barrier_slow_path(masm, obj, pre_val, thread, tmp1, tmp2, *stub->continuation(), runtime); + + __ bind(runtime); + generate_c2_barrier_runtime_call(masm, stub, pre_val, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), tmp1); + __ b(*stub->continuation()); +} + +void G1BarrierSetAssembler::g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register thread, + Register tmp1, + Register tmp2, + Register tmp3, + G1PostBarrierStubC2* stub) { + assert(thread == Rthread, "must be"); + assert_different_registers(store_addr, new_val, thread, tmp1, tmp2, noreg); + + stub->initialize_registers(thread, tmp1, tmp2, tmp3); + + bool new_val_may_be_null = (stub->barrier_data() & G1C2BarrierPostNotNull) == 0; + generate_post_barrier_fast_path(masm, store_addr, new_val, tmp1, tmp2, *stub->continuation(), new_val_may_be_null); + // If card is not young, jump to stub (slow path) + __ b(*stub->entry(), ne); + + __ bind(*stub->continuation()); +} + +void G1BarrierSetAssembler::generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const { + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + Label runtime; + Register thread = stub->thread(); + Register tmp1 = stub->tmp1(); // tmp1 holds the card address. + Register tmp2 = stub->tmp2(); + Register tmp3 = stub->tmp3(); + + __ bind(*stub->entry()); + generate_post_barrier_slow_path(masm, thread, tmp1, tmp2, tmp3, *stub->continuation(), runtime); + + __ bind(runtime); + generate_c2_barrier_runtime_call(masm, stub, tmp1, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), tmp2); + __ b(*stub->continuation()); +} + +#endif // COMPILER2 + void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register dst, Address src, Register tmp1, Register tmp2, Register tmp3) { bool on_oop = type == T_OBJECT || type == T_ARRAY; @@ -268,7 +390,7 @@ void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorator if (on_oop && on_reference) { // Generate the G1 pre-barrier code to log the value of // the referent field in an SATB buffer. - g1_write_barrier_pre(masm, noreg, noreg, dst, tmp1, tmp2); + g1_write_barrier_pre(masm, noreg, dst, tmp1, tmp2); } } @@ -295,7 +417,7 @@ void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet deco } if (needs_pre_barrier) { - g1_write_barrier_pre(masm, store_addr, new_val, tmp1, tmp2, tmp3); + g1_write_barrier_pre(masm, store_addr, tmp3 /*pre_val*/, tmp1, tmp2); } if (is_null) { diff --git a/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.hpp b/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.hpp index 52932faa3e4de..aefde19142e40 100644 --- a/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.hpp +++ b/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.hpp @@ -33,6 +33,8 @@ class LIR_Assembler; class StubAssembler; class G1PreBarrierStub; class G1PostBarrierStub; +class G1PreBarrierStubC2; +class G1PostBarrierStubC2; class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { protected: @@ -43,7 +45,6 @@ class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { void g1_write_barrier_pre(MacroAssembler* masm, Register store_addr, - Register new_val, Register pre_val, Register tmp1, Register tmp2); @@ -70,6 +71,29 @@ class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { void generate_c1_pre_barrier_runtime_stub(StubAssembler* sasm); void generate_c1_post_barrier_runtime_stub(StubAssembler* sasm); #endif + +#ifdef COMPILER2 + void g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register thread, + Register tmp1, + Register tmp2, + G1PreBarrierStubC2* c2_stub); + void generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const; + void g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register thread, + Register tmp1, + Register tmp2, + Register tmp3, + G1PostBarrierStubC2* c2_stub); + void generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const; +#endif + }; #endif // CPU_ARM_GC_G1_G1BARRIERSETASSEMBLER_ARM_HPP diff --git a/src/hotspot/cpu/arm/gc/g1/g1_arm.ad b/src/hotspot/cpu/arm/gc/g1/g1_arm.ad new file mode 100644 index 0000000000000..8a0a9e1aa531a --- /dev/null +++ b/src/hotspot/cpu/arm/gc/g1/g1_arm.ad @@ -0,0 +1,201 @@ +// +// 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. +// + +source_hpp %{ + +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#include "gc/shared/gc_globals.hpp" + +%} + +source %{ + +#include "gc/g1/g1BarrierSetAssembler_arm.hpp" +#include "gc/g1/g1BarrierSetRuntime.hpp" + +static void write_barrier_pre(MacroAssembler* masm, + const MachNode* node, + Register obj, + Register pre_val, + Register tmp1, + Register tmp2, + RegSet preserve = RegSet(), + RegSet no_preserve = RegSet()) { + if (!G1PreBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PreBarrierStubC2* const stub = G1PreBarrierStubC2::create(node); + for (RegSetIterator reg = preserve.begin(); *reg != noreg; ++reg) { + stub->preserve(*reg); + } + for (RegSetIterator reg = no_preserve.begin(); *reg != noreg; ++reg) { + stub->dont_preserve(*reg); + } + g1_asm->g1_write_barrier_pre_c2(masm, obj, pre_val, Rthread, tmp1, tmp2, stub); +} + +static void write_barrier_post(MacroAssembler* masm, + const MachNode* node, + Register store_addr, + Register new_val, + Register tmp1, + Register tmp2, + Register tmp3) { + if (!G1PostBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PostBarrierStubC2* const stub = G1PostBarrierStubC2::create(node); + g1_asm->g1_write_barrier_post_c2(masm, store_addr, new_val, Rthread, tmp1, tmp2, tmp3, stub); +} + +%} + +instruct g1StoreP(indirect mem, iRegP src, iRegP tmp1, iRegP tmp2, iRegP tmp3, flagsReg icc) +%{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreP mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL icc); + ins_cost(2 * (MEMORY_REF_COST + BRANCH_COST)); + format %{ "sd $src, $mem\t# ptr" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + __ str($src$$Register, Address($mem$$Register)); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + $tmp3$$Register /* tmp3 */); + %} + ins_pipe(istore_mem_reg); +%} + +instruct g1CompareAndSwapP(iRegI res, indirect mem, iRegP newval, iRegP tmp1, iRegP tmp2, iRegP tmp3, iRegP oldval, flagsReg ccr ) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapP mem (Binary oldval newval))); + effect(KILL ccr, TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(4 * (MEMORY_REF_COST + BRANCH_COST)); + format %{ "loop: \n\t" + "LDREX $tmp1, $mem\t! If $oldval==[$mem] Then store $newval into [$mem]\n\t" + "CMP $tmp1, $oldval\n\t" + "STREX.eq $tmp1, $newval, $mem\n\t" + "MOV.ne $tmp1, 0 \n\t" + "EORS.eq $tmp1,$tmp1, 1 \n\t" + "B.eq loop \n\t" + "MOV $res, $tmp1" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + Label loop; + __ bind(loop); + __ ldrex($tmp1$$Register,$mem$$Address); + __ cmp($tmp1$$Register, $oldval$$Register); + __ strex($tmp1$$Register, $newval$$Register, $mem$$Address, eq); + __ mov($tmp1$$Register, 0, ne); + __ eors($tmp1$$Register, $tmp1$$Register, 1, eq); + __ b(loop, eq); + __ mov($res$$Register, $tmp1$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + $tmp3$$Register /* tmp3 */); + %} + ins_pipe(long_memory_op); +%} + + +instruct g1GetAndSetP(indirect mem, iRegP newval, iRegP tmp1, iRegP tmp2, iRegP tmp3, iRegP preval, flagsReg ccr) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set preval (GetAndSetP mem newval)); + effect(KILL ccr, TEMP preval, TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(4 * (MEMORY_REF_COST + BRANCH_COST)); + format %{ "loop: \n\t" + "LDREX $preval, $mem\n\t" + "STREX $tmp1, $newval, $mem\n\t" + "CMP $tmp1, 0 \n\t" + "B.ne loop \n\t" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $preval$$Register /* pre_val (as a temporary register) */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $preval$$Register, $newval$$Register) /* preserve */); + Label loop; + __ bind(loop); + __ ldrex($preval$$Register,$mem$$Address); + __ strex($tmp1$$Register, $newval$$Register, $mem$$Address); + __ cmp($tmp1$$Register, 0); + __ b(loop, ne); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + $tmp3$$Register /* tmp3 */); + %} + ins_pipe(long_memory_op); +%} + +instruct g1LoadP(iRegP dst, indirect mem, iRegP tmp1, iRegP tmp2, flagsReg icc) +%{ + predicate(UseG1GC && n->as_Load()->barrier_data() != 0); + match(Set dst (LoadP mem)); + effect(TEMP dst, TEMP tmp1, TEMP tmp2, KILL icc); + ins_cost(MEMORY_REF_COST + BRANCH_COST); + format %{ "ld $dst, $mem\t# ptr" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + __ ldr($dst$$Register, Address($mem$$Register)); + write_barrier_pre(masm, this, + noreg /* obj */, + $dst$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(iload_mem); +%} diff --git a/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp b/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp index ea19730673cb6..c13a259a1b960 100644 --- a/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp @@ -31,6 +31,10 @@ #include "runtime/javaThread.hpp" #include "runtime/stubRoutines.hpp" +#ifdef COMPILER2 +#include "gc/shared/c2/barrierSetC2.hpp" +#endif // COMPILER2 + #define __ masm-> void BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, @@ -206,7 +210,57 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) { #ifdef COMPILER2 OptoReg::Name BarrierSetAssembler::refine_register(const Node* node, OptoReg::Name opto_reg) { - Unimplemented(); // This must be implemented to support late barrier expansion. + if (!OptoReg::is_reg(opto_reg)) { + return OptoReg::Bad; + } + + const VMReg vm_reg = OptoReg::as_VMReg(opto_reg); + if (!vm_reg->is_valid()){ + // skip APSR and FPSCR + return OptoReg::Bad; + } + + return opto_reg; } +void SaveLiveRegisters::initialize(BarrierStubC2* stub) { + // Record registers that needs to be saved/restored + RegMaskIterator rmi(stub->preserve_set()); + while (rmi.has_next()) { + const OptoReg::Name opto_reg = rmi.next(); + if (OptoReg::is_reg(opto_reg)) { + const VMReg vm_reg = OptoReg::as_VMReg(opto_reg); + if (vm_reg->is_Register()) { + gp_regs += RegSet::of(vm_reg->as_Register()); + } else if (vm_reg->is_FloatRegister()) { + fp_regs += FloatRegSet::of(vm_reg->as_FloatRegister()); + } else { + fatal("Unknown register type"); + } + } + } + // Remove C-ABI SOE registers that will be updated + gp_regs -= RegSet::range(R4, R11) + RegSet::of(R13, R15); + + // Remove C-ABI SOE fp registers + fp_regs -= FloatRegSet::range(S16, S31); +} + +SaveLiveRegisters::SaveLiveRegisters(MacroAssembler* masm, BarrierStubC2* stub) + : masm(masm), + gp_regs(), + fp_regs() { + // Figure out what registers to save/restore + initialize(stub); + + // Save registers + if (gp_regs.size() > 0) __ push(RegisterSet::from(gp_regs)); + if (fp_regs.size() > 0) __ fpush(FloatRegisterSet::from(fp_regs)); +} + +SaveLiveRegisters::~SaveLiveRegisters() { + // Restore registers + if (fp_regs.size() > 0) __ fpop(FloatRegisterSet::from(fp_regs)); + if (gp_regs.size() > 0) __ pop(RegisterSet::from(gp_regs)); +} #endif // COMPILER2 diff --git a/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.hpp b/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.hpp index 60021390ea26f..054d172f46340 100644 --- a/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.hpp +++ b/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.hpp @@ -31,7 +31,9 @@ #ifdef COMPILER2 #include "code/vmreg.hpp" #include "opto/optoreg.hpp" +#include "opto/regmask.hpp" +class BarrierStubC2; class Node; #endif // COMPILER2 @@ -69,4 +71,26 @@ class BarrierSetAssembler: public CHeapObj { #endif // COMPILER2 }; +#ifdef COMPILER2 +// This class saves and restores the registers that need to be preserved across +// the runtime call represented by a given C2 barrier stub. Use as follows: +// { +// SaveLiveRegisters save(masm, stub); +// .. +// __ bl(...); +// .. +// } +class SaveLiveRegisters { +private: + MacroAssembler* const masm; + RegSet gp_regs; + FloatRegSet fp_regs; + +public: + void initialize(BarrierStubC2* stub); + SaveLiveRegisters(MacroAssembler* masm, BarrierStubC2* stub); + ~SaveLiveRegisters(); +}; + +#endif // COMPILER2 #endif // CPU_ARM_GC_SHARED_BARRIERSETASSEMBLER_ARM_HPP diff --git a/src/hotspot/cpu/arm/register_arm.hpp b/src/hotspot/cpu/arm/register_arm.hpp index 9f486d2a62586..d8961fd293578 100644 --- a/src/hotspot/cpu/arm/register_arm.hpp +++ b/src/hotspot/cpu/arm/register_arm.hpp @@ -303,6 +303,31 @@ class ConcreteRegisterImpl : public AbstractRegisterImpl { static const int max_fpr; }; +typedef AbstractRegSet RegSet; +typedef AbstractRegSet FloatRegSet; + +template <> +inline Register AbstractRegSet::first() { + if (_bitset == 0) { return noreg; } + return as_Register(count_trailing_zeros(_bitset)); +} + + +template <> +inline FloatRegister AbstractRegSet::first() { + uint32_t first = _bitset & -_bitset; + return first ? as_FloatRegister(exact_log2(first)) : fnoreg; +} + +template <> +inline FloatRegister AbstractRegSet::last() { + if (_bitset == 0) { return fnoreg; } + int last = max_size() - 1 - count_leading_zeros(_bitset); + return as_FloatRegister(last); +} + + + class VFPSystemRegisterImpl; typedef VFPSystemRegisterImpl* VFPSystemRegister; class VFPSystemRegisterImpl : public AbstractRegisterImpl { diff --git a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp index 7d230d301c22b..39693bdf925bf 100644 --- a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp @@ -41,10 +41,20 @@ #include "c1/c1_LIRAssembler.hpp" #include "c1/c1_MacroAssembler.hpp" #include "gc/g1/c1/g1BarrierSetC1.hpp" -#endif +#endif // COMPILER1 +#ifdef COMPILER2 +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#endif // COMPILER2 #define __ masm-> +static void generate_marking_inactive_test(MacroAssembler* masm) { + int active_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()); + assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); + __ lbz(R0, active_offset, R16_thread); // tmp1 := *(mark queue active address) + __ cmpwi(CCR0, R0, 0); +} + void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators, Register from, Register to, Register count, Register preserve1, Register preserve2) { @@ -58,13 +68,7 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm Label filtered; // Is marking active? - if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { - __ lwz(R0, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()), R16_thread); - } else { - guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); - __ lbz(R0, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()), R16_thread); - } - __ cmpdi(CCR0, R0, 0); + generate_marking_inactive_test(masm); __ beq(CCR0, filtered); __ save_LR(R0); @@ -109,35 +113,48 @@ void G1BarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* mas __ restore_LR(R0); } +static void generate_queue_insertion(MacroAssembler* masm, ByteSize index_offset, ByteSize buffer_offset, Label& runtime, + const Register value, const Register temp) { + assert_different_registers(value, temp); + // Can we store a value in the given thread's buffer? + // (The index field is typed as size_t.) + __ ld(temp, in_bytes(index_offset), R16_thread); // temp := *(index address) + __ cmpdi(CCR0, temp, 0); // jump to runtime if index == 0 (full buffer) + __ beq(CCR0, runtime); + // The buffer is not full, store value into it. + __ ld(R0, in_bytes(buffer_offset), R16_thread); // R0 := buffer address + __ addi(temp, temp, -wordSize); // temp := next index + __ std(temp, in_bytes(index_offset), R16_thread); // *(index address) := next index + __ stdx(value, temp, R0); // *(buffer address + next index) := value +} + void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, DecoratorSet decorators, Register obj, RegisterOrConstant ind_or_offs, Register pre_val, Register tmp1, Register tmp2, MacroAssembler::PreservationLevel preservation_level) { + assert_different_registers(pre_val, tmp1, tmp2); + bool not_null = (decorators & IS_NOT_NULL) != 0, preloaded = obj == noreg; Register nv_save = noreg; - if (preloaded) { + // Determine necessary runtime invocation preservation measures + const bool needs_frame = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR; + const bool preserve_gp_registers = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR_GP_REGS; + const bool preserve_fp_registers = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR_GP_FP_REGS; + int nbytes_save = 0; + + if (pre_val->is_volatile() && preloaded && !preserve_gp_registers) { // We are not loading the previous value so make // sure that we don't trash the value in pre_val // with the code below. - assert_different_registers(pre_val, tmp1, tmp2); - if (pre_val->is_volatile()) { - nv_save = !tmp1->is_volatile() ? tmp1 : tmp2; - assert(!nv_save->is_volatile(), "need one nv temp register if pre_val lives in volatile register"); - } + nv_save = !tmp1->is_volatile() ? tmp1 : tmp2; + assert(!nv_save->is_volatile(), "need one nv temp register if pre_val lives in volatile register"); } Label runtime, filtered; - // Is marking active? - if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { - __ lwz(tmp1, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()), R16_thread); - } else { - guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); - __ lbz(tmp1, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()), R16_thread); - } - __ cmpdi(CCR0, tmp1, 0); + generate_marking_inactive_test(masm); __ beq(CCR0, filtered); // Do we need to load the previous value? @@ -175,28 +192,12 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Decorator // Can we store original value in the thread's buffer? // Is index == 0? // (The index field is typed as size_t.) - const Register Rbuffer = tmp1, Rindex = tmp2; - - __ ld(Rindex, in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset()), R16_thread); - __ cmpdi(CCR0, Rindex, 0); - __ beq(CCR0, runtime); // If index == 0, goto runtime. - __ ld(Rbuffer, in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset()), R16_thread); - - __ addi(Rindex, Rindex, -wordSize); // Decrement index. - __ std(Rindex, in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset()), R16_thread); - - // Record the previous value. - __ stdx(pre_val, Rbuffer, Rindex); + generate_queue_insertion(masm, G1ThreadLocalData::satb_mark_queue_index_offset(), G1ThreadLocalData::satb_mark_queue_buffer_offset(), + runtime, pre_val, tmp1); __ b(filtered); __ bind(runtime); - // Determine necessary runtime invocation preservation measures - const bool needs_frame = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR; - const bool preserve_gp_registers = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR_GP_REGS; - const bool preserve_fp_registers = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR_GP_FP_REGS; - int nbytes_save = 0; - // May need to preserve LR. Also needed if current frame is not compatible with C calling convention. if (needs_frame) { if (preserve_gp_registers) { @@ -210,11 +211,11 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Decorator __ push_frame_reg_args(nbytes_save, tmp2); } - if (pre_val->is_volatile() && preloaded && !preserve_gp_registers) { + if (nv_save != noreg) { __ mr(nv_save, pre_val); // Save pre_val across C call if it was preloaded. } __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), pre_val, R16_thread); - if (pre_val->is_volatile() && preloaded && !preserve_gp_registers) { + if (nv_save != noreg) { __ mr(pre_val, nv_save); // restore } @@ -230,6 +231,26 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Decorator __ bind(filtered); } +static void generate_region_crossing_test(MacroAssembler* masm, const Register store_addr, const Register new_val) { + __ xorr(R0, store_addr, new_val); // tmp1 := store address ^ new value + __ srdi_(R0, R0, G1HeapRegion::LogOfHRGrainBytes); // tmp1 := ((store address ^ new value) >> LogOfHRGrainBytes) +} + +static Address generate_card_young_test(MacroAssembler* masm, const Register store_addr, const Register tmp1, const Register tmp2) { + CardTableBarrierSet* ct = barrier_set_cast(BarrierSet::barrier_set()); + __ load_const_optimized(tmp1, (address)(ct->card_table()->byte_map_base()), tmp2); + __ srdi(tmp2, store_addr, CardTable::card_shift()); // tmp1 := card address relative to card table base + __ lbzx(R0, tmp1, tmp2); // tmp1 := card address + __ cmpwi(CCR0, R0, (int)G1CardTable::g1_young_card_val()); + return Address(tmp1, tmp2); // return card address +} + +static void generate_card_dirty_test(MacroAssembler* masm, Address card_addr) { + __ membar(Assembler::StoreLoad); // Must reload after StoreLoad membar due to concurrent refinement + __ lbzx(R0, card_addr.base(), card_addr.index()); // tmp2 := card + __ cmpwi(CCR0, R0, (int)G1CardTable::dirty_card_val()); // tmp2 := card == dirty_card_val? +} + void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, DecoratorSet decorators, Register store_addr, Register new_val, Register tmp1, Register tmp2, Register tmp3, @@ -241,9 +262,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato CardTableBarrierSet* ct = barrier_set_cast(BarrierSet::barrier_set()); - // Does store cross heap regions? - __ xorr(tmp1, store_addr, new_val); - __ srdi_(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); + generate_region_crossing_test(masm, store_addr, new_val); __ beq(CCR0, filtered); // Crosses regions, storing null? @@ -257,43 +276,22 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato __ beq(CCR0, filtered); } - // Storing region crossing non-null, is card already dirty? - const Register Rcard_addr = tmp1; - Register Rbase = tmp2; - __ load_const_optimized(Rbase, (address)(ct->card_table()->byte_map_base()), /*temp*/ tmp3); - - __ srdi(Rcard_addr, store_addr, CardTable::card_shift()); - - // Get the address of the card. - __ lbzx(/*card value*/ tmp3, Rbase, Rcard_addr); - __ cmpwi(CCR0, tmp3, (int)G1CardTable::g1_young_card_val()); + Address card_addr = generate_card_young_test(masm, store_addr, tmp1, tmp2); __ beq(CCR0, filtered); - __ membar(Assembler::StoreLoad); - __ lbzx(/*card value*/ tmp3, Rbase, Rcard_addr); // Reload after membar. - __ cmpwi(CCR0, tmp3 /* card value */, (int)G1CardTable::dirty_card_val()); + generate_card_dirty_test(masm, card_addr); __ beq(CCR0, filtered); - // Storing a region crossing, non-null oop, card is clean. - // Dirty card and log. - __ li(tmp3, (int)G1CardTable::dirty_card_val()); - //release(); // G1: oops are allowed to get visible after dirty marking. - __ stbx(tmp3, Rbase, Rcard_addr); - - __ add(Rcard_addr, Rbase, Rcard_addr); // This is the address which needs to get enqueued. - Rbase = noreg; // end of lifetime + __ li(R0, (int)G1CardTable::dirty_card_val()); + __ stbx(R0, card_addr.base(), card_addr.index()); // *(card address) := dirty_card_val - const Register Rqueue_index = tmp2, - Rqueue_buf = tmp3; - __ ld(Rqueue_index, in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset()), R16_thread); - __ cmpdi(CCR0, Rqueue_index, 0); - __ beq(CCR0, runtime); // index == 0 then jump to runtime - __ ld(Rqueue_buf, in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset()), R16_thread); + Register Rcard_addr = tmp3; + __ add(Rcard_addr, card_addr.base(), card_addr.index()); // This is the address which needs to get enqueued. - __ addi(Rqueue_index, Rqueue_index, -wordSize); // decrement index - __ std(Rqueue_index, in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset()), R16_thread); - - __ stdx(Rcard_addr, Rqueue_buf, Rqueue_index); // store card + generate_queue_insertion(masm, + G1ThreadLocalData::dirty_card_queue_index_offset(), + G1ThreadLocalData::dirty_card_queue_buffer_offset(), + runtime, Rcard_addr, tmp1); __ b(filtered); __ bind(runtime); @@ -392,6 +390,142 @@ void G1BarrierSetAssembler::resolve_jobject(MacroAssembler* masm, Register value __ bind(done); } +#ifdef COMPILER2 + +static void generate_c2_barrier_runtime_call(MacroAssembler* masm, G1BarrierStubC2* stub, const Register arg, const address runtime_path) { + SaveLiveRegisters save_registers(masm, stub); + __ call_VM_leaf(runtime_path, arg, R16_thread); +} + +void G1BarrierSetAssembler::g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register tmp1, + Register tmp2, + G1PreBarrierStubC2* stub) { + assert_different_registers(obj, tmp1, tmp2, R0); + assert_different_registers(pre_val, tmp1, R0); + assert(!UseCompressedOops || tmp2 != noreg, "tmp2 needed with CompressedOops"); + + stub->initialize_registers(obj, pre_val, R16_thread, tmp1, tmp2); + + generate_marking_inactive_test(masm); + __ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CCR0, Assembler::equal), *stub->entry()); + + __ bind(*stub->continuation()); +} + +void G1BarrierSetAssembler::generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const { + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + Label runtime; + Register obj = stub->obj(); + Register pre_val = stub->pre_val(); + Register tmp1 = stub->tmp1(); + + __ bind(*stub->entry()); + + if (obj != noreg) { + // Note: C2 currently doesn't use implicit null checks with barriers. + // Otherwise, obj could be null and the following instruction would raise a SIGSEGV. + if (UseCompressedOops) { + __ lwz(pre_val, 0, obj); + } else { + __ ld(pre_val, 0, obj); + } + } + __ cmpdi(CCR0, pre_val, 0); + __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), *stub->continuation()); + + Register pre_val_decoded = pre_val; + if (UseCompressedOops) { + pre_val_decoded = __ decode_heap_oop_not_null(stub->tmp2(), pre_val); + } + + generate_queue_insertion(masm, + G1ThreadLocalData::satb_mark_queue_index_offset(), + G1ThreadLocalData::satb_mark_queue_buffer_offset(), + runtime, pre_val_decoded, tmp1); + __ b(*stub->continuation()); + + __ bind(runtime); + generate_c2_barrier_runtime_call(masm, stub, pre_val_decoded, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry)); + __ b(*stub->continuation()); +} + +void G1BarrierSetAssembler::g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register tmp1, + Register tmp2, + G1PostBarrierStubC2* stub, + bool decode_new_val) { + assert_different_registers(store_addr, new_val, tmp1, R0); + assert_different_registers(store_addr, tmp1, tmp2, R0); + + stub->initialize_registers(R16_thread, tmp1, tmp2); + + bool null_check_required = (stub->barrier_data() & G1C2BarrierPostNotNull) == 0; + Register new_val_decoded = new_val; + + if (decode_new_val) { + assert(UseCompressedOops, "or should not be here"); + if (null_check_required && CompressedOops::base() != nullptr) { + // We prefer doing the null check after the region crossing check. + // Only compressed oop modes with base != null require a null check here. + __ cmpwi(CCR0, new_val, 0); + __ beq(CCR0, *stub->continuation()); + null_check_required = false; + } + new_val_decoded = __ decode_heap_oop_not_null(tmp2, new_val); + } + + generate_region_crossing_test(masm, store_addr, new_val_decoded); + __ beq(CCR0, *stub->continuation()); + + // crosses regions, storing null? + if (null_check_required) { + __ cmpdi(CCR0, new_val_decoded, 0); + __ beq(CCR0, *stub->continuation()); + } + + Address card_addr = generate_card_young_test(masm, store_addr, tmp1, tmp2); + assert(card_addr.base() == tmp1 && card_addr.index() == tmp2, "needed by post barrier stub"); + __ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CCR0, Assembler::equal), *stub->entry()); + + __ bind(*stub->continuation()); +} + +void G1BarrierSetAssembler::generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const { + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + Label runtime; + Address card_addr(stub->tmp1(), stub->tmp2()); // See above. + + __ bind(*stub->entry()); + + generate_card_dirty_test(masm, card_addr); + __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), *stub->continuation()); + + __ li(R0, (int)G1CardTable::dirty_card_val()); + __ stbx(R0, card_addr.base(), card_addr.index()); // *(card address) := dirty_card_val + + Register Rcard_addr = stub->tmp1(); + __ add(Rcard_addr, card_addr.base(), card_addr.index()); // This is the address which needs to get enqueued. + + generate_queue_insertion(masm, + G1ThreadLocalData::dirty_card_queue_index_offset(), + G1ThreadLocalData::dirty_card_queue_buffer_offset(), + runtime, Rcard_addr, stub->tmp2()); + __ b(*stub->continuation()); + + __ bind(runtime); + generate_c2_barrier_runtime_call(masm, stub, Rcard_addr, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry)); + __ b(*stub->continuation()); +} + +#endif // COMPILER2 + #ifdef COMPILER1 #undef __ @@ -470,13 +604,7 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler* __ std(tmp2, -24, R1_SP); // Is marking still active? - if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { - __ lwz(tmp, satb_q_active_byte_offset, R16_thread); - } else { - assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); - __ lbz(tmp, satb_q_active_byte_offset, R16_thread); - } - __ cmpdi(CCR0, tmp, 0); + generate_marking_inactive_test(sasm); __ beq(CCR0, marking_not_active); __ bind(restart); diff --git a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.hpp b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.hpp index d9a252ff6eaee..1c9fe8a5d106f 100644 --- a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.hpp @@ -30,10 +30,16 @@ #include "gc/shared/modRefBarrierSetAssembler.hpp" #include "utilities/macros.hpp" +#ifdef COMPILER2 +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#endif + class LIR_Assembler; class StubAssembler; class G1PreBarrierStub; class G1PostBarrierStub; +class G1PreBarrierStubC2; +class G1PostBarrierStubC2; class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { protected: @@ -59,6 +65,25 @@ class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { MacroAssembler::PreservationLevel preservation_level); public: +#ifdef COMPILER2 + void g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register tmp1, + Register tmp2, + G1PreBarrierStubC2* c2_stub); + void generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const; + void g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register tmp1, + Register tmp2, + G1PostBarrierStubC2* c2_stub, + bool decode_new_val); + void generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const; +#endif #ifdef COMPILER1 void gen_pre_barrier_stub(LIR_Assembler* ce, G1PreBarrierStub* stub); void gen_post_barrier_stub(LIR_Assembler* ce, G1PostBarrierStub* stub); diff --git a/src/hotspot/cpu/ppc/gc/g1/g1_ppc.ad b/src/hotspot/cpu/ppc/gc/g1/g1_ppc.ad new file mode 100644 index 0000000000000..f4163242cad7b --- /dev/null +++ b/src/hotspot/cpu/ppc/gc/g1/g1_ppc.ad @@ -0,0 +1,684 @@ +// +// Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 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 +// 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. +// + +source_hpp %{ + +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#include "gc/shared/gc_globals.hpp" + +%} + +source %{ + +#include "gc/g1/g1BarrierSetAssembler_ppc.hpp" +#include "gc/g1/g1BarrierSetRuntime.hpp" + +static void pre_write_barrier(MacroAssembler* masm, + const MachNode* node, + Register obj, + Register pre_val, + Register tmp1, + Register tmp2 = noreg, // only needed with CompressedOops when pre_val needs to be preserved + RegSet preserve = RegSet(), + RegSet no_preserve = RegSet()) { + if (!G1PreBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PreBarrierStubC2* const stub = G1PreBarrierStubC2::create(node); + for (RegSetIterator reg = preserve.begin(); *reg != noreg; ++reg) { + stub->preserve(*reg); + } + for (RegSetIterator reg = no_preserve.begin(); *reg != noreg; ++reg) { + stub->dont_preserve(*reg); + } + g1_asm->g1_write_barrier_pre_c2(masm, obj, pre_val, tmp1, (tmp2 != noreg) ? tmp2 : pre_val, stub); +} + +static void post_write_barrier(MacroAssembler* masm, + const MachNode* node, + Register store_addr, + Register new_val, + Register tmp1, + Register tmp2, + bool decode_new_val = false) { + if (!G1PostBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PostBarrierStubC2* const stub = G1PostBarrierStubC2::create(node); + g1_asm->g1_write_barrier_post_c2(masm, store_addr, new_val, tmp1, tmp2, stub, decode_new_val); +} + +%} + +instruct g1StoreP(indirect mem, iRegPsrc src, iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreP mem src)); + effect(TEMP tmp1, TEMP tmp2, KILL cr0); + ins_cost(2 * MEMORY_REF_COST); + format %{ "std $mem, $src\t# ptr" %} + ins_encode %{ + pre_write_barrier(masm, this, + $mem$$Register, + $tmp1$$Register, + $tmp2$$Register, + noreg, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + __ std($src$$Register, 0, $mem$$Register); + post_write_barrier(masm, this, + $mem$$Register, + $src$$Register /* new_val */, + $tmp1$$Register, + $tmp2$$Register); + %} + ins_pipe(pipe_class_default); +%} + +instruct g1StoreN(indirect mem, iRegNsrc src, iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem src)); + effect(TEMP tmp1, TEMP tmp2, KILL cr0); + ins_cost(2 * MEMORY_REF_COST); + format %{ "stw $mem, $src\t# ptr" %} + ins_encode %{ + pre_write_barrier(masm, this, + $mem$$Register, + $tmp1$$Register, + $tmp2$$Register, + noreg, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + __ stw($src$$Register, 0, $mem$$Register); + post_write_barrier(masm, this, + $mem$$Register, + $src$$Register /* new_val */, + $tmp1$$Register, + $tmp2$$Register, + true /* decode_new_val */); + %} + ins_pipe(pipe_class_default); +%} + +instruct g1EncodePAndStoreN(indirect mem, iRegPsrc src, iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem (EncodeP src))); + effect(TEMP tmp1, TEMP tmp2, KILL cr0); + ins_cost(2 * MEMORY_REF_COST); + format %{ "encode_heap_oop $src\n\t" + "stw $mem, $src\t# ptr" %} + ins_encode %{ + pre_write_barrier(masm, this, + $mem$$Register, + $tmp1$$Register, + $tmp2$$Register, + noreg, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + Register encoded_oop = noreg; + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + encoded_oop = __ encode_heap_oop($tmp2$$Register, $src$$Register); + } else { + encoded_oop = __ encode_heap_oop_not_null($tmp2$$Register, $src$$Register); + } + __ stw(encoded_oop, 0, $mem$$Register); + post_write_barrier(masm, this, + $mem$$Register, + $src$$Register /* new_val */, + $tmp1$$Register, + $tmp2$$Register); + %} + ins_pipe(pipe_class_default); +%} + +instruct g1CompareAndExchangeP(iRegPdst res, indirect mem, iRegPsrc oldval, iRegPsrc newval, iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndExchangeNode*)n)->order() != MemNode::acquire && ((CompareAndExchangeNode*)n)->order() != MemNode::seqcst)); + match(Set res (CompareAndExchangeP mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr0); + format %{ "cmpxchgd $newval, $mem" %} + ins_encode %{ + Label no_update; + __ cmpxchgd(CCR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register, + $tmp1$$Register, + $tmp2$$Register, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp1$$Register, + $tmp2$$Register); + __ bind(no_update); + %} + ins_pipe(pipe_class_default); +%} + +instruct g1CompareAndExchangeP_acq(iRegPdst res, indirect mem, iRegPsrc oldval, iRegPsrc newval, iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndExchangeNode*)n)->order() == MemNode::acquire || ((CompareAndExchangeNode*)n)->order() == MemNode::seqcst)); + match(Set res (CompareAndExchangeP mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr0); + format %{ "cmpxchgd acq $newval, $mem" %} + ins_encode %{ + Label no_update; + __ cmpxchgd(CCR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register, + $tmp1$$Register, + $tmp2$$Register, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp1$$Register, + $tmp2$$Register); + __ bind(no_update); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + // isync would be sufficient in case of CompareAndExchangeAcquire, but we currently don't optimize for that. + __ sync(); + } + %} + ins_pipe(pipe_class_default); +%} + +instruct g1CompareAndExchangeN(iRegNdst res, indirect mem, iRegNsrc oldval, iRegNsrc newval, iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndExchangeNode*)n)->order() != MemNode::acquire && ((CompareAndExchangeNode*)n)->order() != MemNode::seqcst)); + match(Set res (CompareAndExchangeN mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr0); + format %{ "cmpxchgw $newval, $mem" %} + ins_encode %{ + Label no_update; + __ cmpxchgw(CCR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register, + $tmp1$$Register, + $tmp2$$Register, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp1$$Register, + $tmp2$$Register, + true /* decode_new_val */); + __ bind(no_update); + %} + ins_pipe(pipe_class_default); +%} + +instruct g1CompareAndExchangeN_acq(iRegNdst res, indirect mem, iRegNsrc oldval, iRegNsrc newval, iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndExchangeNode*)n)->order() == MemNode::acquire || ((CompareAndExchangeNode*)n)->order() == MemNode::seqcst)); + match(Set res (CompareAndExchangeN mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr0); + format %{ "cmpxchgw acq $newval, $mem" %} + ins_encode %{ + Label no_update; + __ cmpxchgw(CCR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register, + $tmp1$$Register, + $tmp2$$Register, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp1$$Register, + $tmp2$$Register, + true /* decode_new_val */); + __ bind(no_update); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + // isync would be sufficient in case of CompareAndExchangeAcquire, but we currently don't optimize for that. + __ sync(); + } + %} + ins_pipe(pipe_class_default); +%} + +instruct g1CompareAndSwapP(iRegIdst res, indirect mem, iRegPsrc oldval, iRegPsrc newval, iRegPdst tmp, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndSwapNode*)n)->order() != MemNode::acquire && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst)); + match(Set res (CompareAndSwapP mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp, KILL cr0); + format %{ "CMPXCHGD $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + Label no_update; + __ li($res$$Register, 0); + __ cmpxchgd(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register /* pre_val */, + $tmp$$Register, + $res$$Register /* temp */, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp$$Register, + $res$$Register /* temp */); + __ li($res$$Register, 1); + __ bind(no_update); + %} + ins_pipe(pipe_class_default); +%} + +instruct g1CompareAndSwapP_acq(iRegIdst res, indirect mem, iRegPsrc oldval, iRegPsrc newval, iRegPdst tmp, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndSwapNode*)n)->order() == MemNode::acquire || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst)); + match(Set res (CompareAndSwapP mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp, KILL cr0); + format %{ "CMPXCHGD acq $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + Label no_update; + __ li($res$$Register, 0); + __ cmpxchgd(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register /* pre_val */, + $tmp$$Register, + $res$$Register /* temp */, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp$$Register, + $res$$Register /* temp */); + __ li($res$$Register, 1); + __ bind(no_update); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + // isync would be sufficient in case of CompareAndExchangeAcquire, but we currently don't optimize for that. + __ sync(); + } + %} + ins_pipe(pipe_class_default); +%} + +instruct g1CompareAndSwapN(iRegIdst res, indirect mem, iRegNsrc oldval, iRegNsrc newval, iRegPdst tmp, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndSwapNode*)n)->order() != MemNode::acquire && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst)); + match(Set res (CompareAndSwapN mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp, KILL cr0); + format %{ "CMPXCHGW $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + Label no_update; + __ li($res$$Register, 0); + __ cmpxchgw(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register /* pre_val */, + $tmp$$Register, + $res$$Register /* temp */, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp$$Register, + $res$$Register /* temp */, + true /* decode_new_val */); + __ li($res$$Register, 1); + __ bind(no_update); + %} + ins_pipe(pipe_class_default); +%} + +instruct g1CompareAndSwapN_acq(iRegIdst res, indirect mem, iRegNsrc oldval, iRegNsrc newval, iRegPdst tmp, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndSwapNode*)n)->order() == MemNode::acquire || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst)); + match(Set res (CompareAndSwapN mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp, KILL cr0); + format %{ "CMPXCHGW acq $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + Label no_update; + __ li($res$$Register, 0); + __ cmpxchgw(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register /* pre_val */, + $tmp$$Register, + $res$$Register /* temp */, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp$$Register, + $res$$Register /* temp */, + true /* decode_new_val */); + __ li($res$$Register, 1); + __ bind(no_update); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + // isync would be sufficient in case of CompareAndExchangeAcquire, but we currently don't optimize for that. + __ sync(); + } + %} + ins_pipe(pipe_class_default); +%} + +instruct weakG1CompareAndSwapP(iRegIdst res, indirect mem, iRegPsrc oldval, iRegPsrc newval, iRegPdst tmp, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndSwapNode*)n)->order() != MemNode::acquire && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst)); + match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp, KILL cr0); + format %{ "weak CMPXCHGD $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + Label no_update; + __ li($res$$Register, 0); + __ cmpxchgd(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register /* pre_val */, + $tmp$$Register, + $res$$Register /* temp */, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp$$Register, + $res$$Register /* temp */); + __ li($res$$Register, 1); + __ bind(no_update); + %} + ins_pipe(pipe_class_default); +%} + +instruct weakG1CompareAndSwapP_acq(iRegIdst res, indirect mem, iRegPsrc oldval, iRegPsrc newval, iRegPdst tmp, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndSwapNode*)n)->order() == MemNode::acquire || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst)); + match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp, KILL cr0); + format %{ "weak CMPXCHGD acq $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + Label no_update; + __ li($res$$Register, 0); + __ cmpxchgd(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register /* pre_val */, + $tmp$$Register, + $res$$Register /* temp */, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp$$Register, + $res$$Register /* temp */); + __ li($res$$Register, 1); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + // isync would be sufficient in case of CompareAndExchangeAcquire, but we currently don't optimize for that. + __ sync(); + } + __ bind(no_update); // weak version requires no memory barrier on failure + %} + ins_pipe(pipe_class_default); +%} + +instruct weakG1CompareAndSwapN(iRegIdst res, indirect mem, iRegNsrc oldval, iRegNsrc newval, iRegPdst tmp, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndSwapNode*)n)->order() != MemNode::acquire && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst)); + match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp, KILL cr0); + format %{ "weak CMPXCHGW $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + Label no_update; + __ li($res$$Register, 0); + __ cmpxchgw(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register /* pre_val */, + $tmp$$Register, + $res$$Register /* temp */, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp$$Register, + $res$$Register /* temp */, + true /* decode_new_val */); + __ li($res$$Register, 1); + __ bind(no_update); + %} + ins_pipe(pipe_class_default); +%} + +instruct weakG1CompareAndSwapN_acq(iRegIdst res, indirect mem, iRegNsrc oldval, iRegNsrc newval, iRegPdst tmp, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0 && + (((CompareAndSwapNode*)n)->order() == MemNode::acquire || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst)); + match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp, KILL cr0); + format %{ "weak CMPXCHGW acq $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + Label no_update; + __ li($res$$Register, 0); + __ cmpxchgw(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, &no_update, true, true); + // Pass oldval to SATB which is the only value which can get overwritten. + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg, + $oldval$$Register /* pre_val */, + $tmp$$Register, + $res$$Register /* temp */, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp$$Register, + $res$$Register /* temp */, + true /* decode_new_val */); + __ li($res$$Register, 1); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + // isync would be sufficient in case of CompareAndExchangeAcquire, but we currently don't optimize for that. + __ sync(); + } + __ bind(no_update); // weak version requires no memory barrier on failure + %} + ins_pipe(pipe_class_default); +%} + +instruct g1GetAndSetP(iRegPdst res, indirect mem, iRegPsrc newval, iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (GetAndSetP mem newval)); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr0); + format %{ "GetAndSetP $newval, $mem" %} + ins_encode %{ + assert_different_registers($mem$$Register, $newval$$Register); + __ getandsetd($res$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::cmpxchgx_hint_atomic_update()); + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg /* obj */, + $res$$Register /* res */, + $tmp1$$Register, + $tmp2$$Register, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp1$$Register, + $tmp2$$Register); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + __ sync(); + } + %} + ins_pipe(pipe_class_default); +%} + +instruct g1GetAndSetN(iRegNdst res, indirect mem, iRegNsrc newval, iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (GetAndSetN mem newval)); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr0); + format %{ "GetAndSetN $newval, $mem" %} + ins_encode %{ + assert_different_registers($mem$$Register, $newval$$Register); + __ getandsetw($res$$Register, $newval$$Register, $mem$$Register, + MacroAssembler::cmpxchgx_hint_atomic_update()); + // Can be done after cmpxchg because there's no safepoint here. + pre_write_barrier(masm, this, + noreg /* obj */, + $res$$Register /* res */, + $tmp1$$Register, + $tmp2$$Register, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */); + post_write_barrier(masm, this, + $mem$$Register, + $newval$$Register, + $tmp1$$Register, + $tmp2$$Register, + true /* decode_new_val */); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + __ sync(); + } + %} + ins_pipe(pipe_class_default); +%} + +instruct g1LoadP(iRegPdst dst, memoryAlg4 mem, iRegPdst tmp, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_Load()->is_unordered() && n->as_Load()->barrier_data() != 0); + // This instruction does not need an acquiring counterpart because it is only + // used for reference loading (Reference::get()). + match(Set dst (LoadP mem)); + effect(TEMP_DEF dst, TEMP tmp, KILL cr0); + ins_cost(2 * MEMORY_REF_COST); + format %{ "ld $dst, $mem\t# ptr" %} + ins_encode %{ + __ ld($dst$$Register, $mem$$disp, $mem$$base$$Register); + pre_write_barrier(masm, this, + noreg /* obj */, + $dst$$Register /* pre_val */, + $tmp$$Register); + %} + ins_pipe(pipe_class_default); +%} + +instruct g1LoadN(iRegNdst dst, memoryAlg4 mem, iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr0) +%{ + predicate(UseG1GC && n->as_Load()->is_unordered() && n->as_Load()->barrier_data() != 0); + // This instruction does not need an acquiring counterpart because it is only + // used for reference loading (Reference::get()). + match(Set dst (LoadN mem)); + effect(TEMP_DEF dst, TEMP tmp1, TEMP tmp2, KILL cr0); + ins_cost(2 * MEMORY_REF_COST); + format %{ "lwz $dst, $mem\t# ptr" %} + ins_encode %{ + __ lwz($dst$$Register, $mem$$disp, $mem$$base$$Register); + pre_write_barrier(masm, this, + noreg /* obj */, + $dst$$Register, + $tmp1$$Register, + $tmp2$$Register); + %} + ins_pipe(pipe_class_default); +%} diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index ca9abfa3719b4..d15f9929671ba 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -1000,6 +1000,10 @@ int MachNode::compute_padding(int current_offset) const { // Should the matcher clone input 'm' of node 'n'? bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) { + if (is_encode_and_store_pattern(n, m)) { + mstack.push(m, Visit); + return true; + } return false; } @@ -5407,7 +5411,7 @@ instruct loadRange(iRegIdst dst, memory mem) %{ // Load Compressed Pointer instruct loadN(iRegNdst dst, memory mem) %{ match(Set dst (LoadN mem)); - predicate(n->as_Load()->is_unordered() || followed_by_acquire(n)); + predicate((n->as_Load()->is_unordered() || followed_by_acquire(n)) && n->as_Load()->barrier_data() == 0); ins_cost(MEMORY_REF_COST); format %{ "LWZ $dst, $mem \t// load compressed ptr" %} @@ -5419,6 +5423,7 @@ instruct loadN(iRegNdst dst, memory mem) %{ // Load Compressed Pointer acquire. instruct loadN_ac(iRegNdst dst, memory mem) %{ match(Set dst (LoadN mem)); + predicate(n->as_Load()->barrier_data() == 0); ins_cost(3*MEMORY_REF_COST); format %{ "LWZ $dst, $mem \t// load acquire compressed ptr\n\t" @@ -5432,7 +5437,7 @@ instruct loadN_ac(iRegNdst dst, memory mem) %{ // Load Compressed Pointer and decode it if narrow_oop_shift == 0. instruct loadN2P_unscaled(iRegPdst dst, memory mem) %{ match(Set dst (DecodeN (LoadN mem))); - predicate(_kids[0]->_leaf->as_Load()->is_unordered() && CompressedOops::shift() == 0); + predicate(_kids[0]->_leaf->as_Load()->is_unordered() && CompressedOops::shift() == 0 && _kids[0]->_leaf->as_Load()->barrier_data() == 0); ins_cost(MEMORY_REF_COST); format %{ "LWZ $dst, $mem \t// DecodeN (unscaled)" %} @@ -6423,6 +6428,7 @@ instruct reinterpretX(vecX dst) %{ // Store Compressed Oop instruct storeN(memory dst, iRegN_P2N src) %{ match(Set dst (StoreN dst src)); + predicate(n->as_Store()->barrier_data() == 0); ins_cost(MEMORY_REF_COST); format %{ "STW $src, $dst \t// compressed oop" %} @@ -7477,6 +7483,7 @@ instruct compareAndSwapI_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc instruct compareAndSwapN_regP_regN_regN(iRegIdst res, iRegPdst mem_ptr, iRegNsrc src1, iRegNsrc src2, flagsRegCR0 cr0) %{ match(Set res (CompareAndSwapN mem_ptr (Binary src1 src2))); + predicate(n->as_LoadStore()->barrier_data() == 0); effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump format %{ "CMPXCHGW $res, $mem_ptr, $src1, $src2; as bool" %} ins_encode %{ @@ -7676,7 +7683,7 @@ instruct weakCompareAndSwapI_acq_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, instruct weakCompareAndSwapN_regP_regN_regN(iRegIdst res, iRegPdst mem_ptr, iRegNsrc src1, iRegNsrc src2, flagsRegCR0 cr0) %{ match(Set res (WeakCompareAndSwapN mem_ptr (Binary src1 src2))); - predicate(((CompareAndSwapNode*)n)->order() != MemNode::acquire && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst); + predicate(((CompareAndSwapNode*)n)->order() != MemNode::acquire && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst && n->as_LoadStore()->barrier_data() == 0); effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump format %{ "weak CMPXCHGW $res, $mem_ptr, $src1, $src2; as bool" %} ins_encode %{ @@ -7690,7 +7697,7 @@ instruct weakCompareAndSwapN_regP_regN_regN(iRegIdst res, iRegPdst mem_ptr, iReg instruct weakCompareAndSwapN_acq_regP_regN_regN(iRegIdst res, iRegPdst mem_ptr, iRegNsrc src1, iRegNsrc src2, flagsRegCR0 cr0) %{ match(Set res (WeakCompareAndSwapN mem_ptr (Binary src1 src2))); - predicate(((CompareAndSwapNode*)n)->order() == MemNode::acquire || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst); + predicate((((CompareAndSwapNode*)n)->order() == MemNode::acquire || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst) && n->as_LoadStore()->barrier_data() == 0); effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump format %{ "weak CMPXCHGW acq $res, $mem_ptr, $src1, $src2; as bool" %} ins_encode %{ @@ -7939,7 +7946,7 @@ instruct compareAndExchangeI_acq_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, instruct compareAndExchangeN_regP_regN_regN(iRegNdst res, iRegPdst mem_ptr, iRegNsrc src1, iRegNsrc src2, flagsRegCR0 cr0) %{ match(Set res (CompareAndExchangeN mem_ptr (Binary src1 src2))); - predicate(((CompareAndSwapNode*)n)->order() != MemNode::acquire && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst); + predicate(((CompareAndSwapNode*)n)->order() != MemNode::acquire && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst && n->as_LoadStore()->barrier_data() == 0); effect(TEMP_DEF res, TEMP cr0); format %{ "CMPXCHGW $res, $mem_ptr, $src1, $src2; as narrow oop" %} ins_encode %{ @@ -7953,7 +7960,7 @@ instruct compareAndExchangeN_regP_regN_regN(iRegNdst res, iRegPdst mem_ptr, iReg instruct compareAndExchangeN_acq_regP_regN_regN(iRegNdst res, iRegPdst mem_ptr, iRegNsrc src1, iRegNsrc src2, flagsRegCR0 cr0) %{ match(Set res (CompareAndExchangeN mem_ptr (Binary src1 src2))); - predicate(((CompareAndSwapNode*)n)->order() == MemNode::acquire || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst); + predicate((((CompareAndSwapNode*)n)->order() == MemNode::acquire || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst) && n->as_LoadStore()->barrier_data() == 0); effect(TEMP_DEF res, TEMP cr0); format %{ "CMPXCHGW acq $res, $mem_ptr, $src1, $src2; as narrow oop" %} ins_encode %{ @@ -8262,6 +8269,7 @@ instruct getAndSetP(iRegPdst res, iRegPdst mem_ptr, iRegPsrc src, flagsRegCR0 cr instruct getAndSetN(iRegNdst res, iRegPdst mem_ptr, iRegNsrc src, flagsRegCR0 cr0) %{ match(Set res (GetAndSetN mem_ptr src)); + predicate(n->as_LoadStore()->barrier_data() == 0); effect(TEMP_DEF res, TEMP cr0); format %{ "GetAndSetN $res, $mem_ptr, $src" %} ins_encode %{ diff --git a/src/hotspot/cpu/ppc/register_ppc.hpp b/src/hotspot/cpu/ppc/register_ppc.hpp index 302d49884fae3..b7ba4f053b5d6 100644 --- a/src/hotspot/cpu/ppc/register_ppc.hpp +++ b/src/hotspot/cpu/ppc/register_ppc.hpp @@ -27,6 +27,7 @@ #define CPU_PPC_REGISTER_PPC_HPP #include "asm/register.hpp" +#include "utilities/count_trailing_zeros.hpp" // forward declaration class VMRegImpl; @@ -555,4 +556,12 @@ constexpr Register R29_TOC = R29; constexpr Register R11_scratch1 = R11; constexpr Register R12_scratch2 = R12; +template <> +inline Register AbstractRegSet::first() { + if (_bitset == 0) { return noreg; } + return as_Register(count_trailing_zeros(_bitset)); +} + +typedef AbstractRegSet RegSet; + #endif // CPU_PPC_REGISTER_PPC_HPP diff --git a/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.cpp index 062f80290626f..7036c44d99dc9 100644 --- a/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2020, 2024, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,10 @@ #include "c1/c1_LIRAssembler.hpp" #include "c1/c1_MacroAssembler.hpp" #include "gc/g1/c1/g1BarrierSetC1.hpp" -#endif +#endif // COMPILER1 +#ifdef COMPILER2 +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#endif // COMPILER2 #define __ masm-> @@ -96,6 +99,55 @@ void G1BarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* mas __ pop_reg(saved_regs, sp); } +static void generate_queue_test_and_insertion(MacroAssembler* masm, ByteSize index_offset, ByteSize buffer_offset, Label& runtime, + const Register thread, const Register value, const Register tmp1, const Register tmp2) { + // Can we store a value in the given thread's buffer? + // (The index field is typed as size_t.) + __ ld(tmp1, Address(thread, in_bytes(index_offset))); // tmp1 := *(index address) + __ beqz(tmp1, runtime); // jump to runtime if index == 0 (full buffer) + // The buffer is not full, store value into it. + __ sub(tmp1, tmp1, wordSize); // tmp1 := next index + __ sd(tmp1, Address(thread, in_bytes(index_offset))); // *(index address) := next index + __ ld(tmp2, Address(thread, in_bytes(buffer_offset))); // tmp2 := buffer address + __ add(tmp2, tmp2, tmp1); + __ sd(value, Address(tmp2)); // *(buffer address + next index) := value +} + +static void generate_pre_barrier_fast_path(MacroAssembler* masm, + const Register thread, + const Register tmp1) { + Address in_progress(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset())); + // Is marking active? + if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { + __ lwu(tmp1, in_progress); + } else { + assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); + __ lbu(tmp1, in_progress); + } +} + +static void generate_pre_barrier_slow_path(MacroAssembler* masm, + const Register obj, + const Register pre_val, + const Register thread, + const Register tmp1, + const Register tmp2, + Label& done, + Label& runtime) { + // Do we need to load the previous value? + if (obj != noreg) { + __ load_heap_oop(pre_val, Address(obj, 0), noreg, noreg, AS_RAW); + } + // Is the previous value null? + __ beqz(pre_val, done, true); + generate_queue_test_and_insertion(masm, + G1ThreadLocalData::satb_mark_queue_index_offset(), + G1ThreadLocalData::satb_mark_queue_buffer_offset(), + runtime, + thread, pre_val, tmp1, tmp2); + __ j(done); +} + void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Register obj, Register pre_val, @@ -116,43 +168,10 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, assert_different_registers(obj, pre_val, tmp1, tmp2); assert(pre_val != noreg && tmp1 != noreg && tmp2 != noreg, "expecting a register"); - Address in_progress(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset())); - Address index(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset())); - Address buffer(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset())); - - // Is marking active? - if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { // 4-byte width - __ lwu(tmp1, in_progress); - } else { - assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); - __ lbu(tmp1, in_progress); - } + generate_pre_barrier_fast_path(masm, thread, tmp1); + // If marking is not active (*(mark queue active address) == 0), jump to done __ beqz(tmp1, done); - - // Do we need to load the previous value? - if (obj != noreg) { - __ load_heap_oop(pre_val, Address(obj, 0), noreg, noreg, AS_RAW); - } - - // Is the previous value null? - __ beqz(pre_val, done); - - // Can we store original value in the thread's buffer? - // Is index == 0? - // (The index field is typed as size_t.) - - __ ld(tmp1, index); // tmp := *index_adr - __ beqz(tmp1, runtime); // tmp == 0? - // If yes, goto runtime - - __ sub(tmp1, tmp1, wordSize); // tmp := tmp - wordSize - __ sd(tmp1, index); // *index_adr := tmp - __ ld(tmp2, buffer); - __ add(tmp1, tmp1, tmp2); // tmp := tmp + *buffer_adr - - // Record the previous value - __ sd(pre_val, Address(tmp1, 0)); - __ j(done); + generate_pre_barrier_slow_path(masm, obj, pre_val, thread, tmp1, tmp2, done, runtime); __ bind(runtime); @@ -171,6 +190,49 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, } +static void generate_post_barrier_fast_path(MacroAssembler* masm, + const Register store_addr, + const Register new_val, + const Register tmp1, + const Register tmp2, + Label& done, + bool new_val_may_be_null) { + // Does store cross heap regions? + __ xorr(tmp1, store_addr, new_val); // tmp1 := store address ^ new value + __ srli(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); // tmp1 := ((store address ^ new value) >> LogOfHRGrainBytes) + __ beqz(tmp1, done); + // Crosses regions, storing null? + if (new_val_may_be_null) { + __ beqz(new_val, done); + } + // Storing region crossing non-null, is card young? + __ srli(tmp1, store_addr, CardTable::card_shift()); // tmp1 := card address relative to card table base + __ load_byte_map_base(tmp2); // tmp2 := card table base address + __ add(tmp1, tmp1, tmp2); // tmp1 := card address + __ lbu(tmp2, Address(tmp1)); // tmp2 := card +} + +static void generate_post_barrier_slow_path(MacroAssembler* masm, + const Register thread, + const Register tmp1, + const Register tmp2, + Label& done, + Label& runtime) { + __ membar(MacroAssembler::StoreLoad); // StoreLoad membar + __ lbu(tmp2, Address(tmp1)); // tmp2 := card + __ beqz(tmp2, done, true); + // Storing a region crossing, non-null oop, card is clean. + // Dirty card and log. + STATIC_ASSERT(CardTable::dirty_card_val() == 0); + __ sb(zr, Address(tmp1)); // *(card address) := dirty_card_val + generate_queue_test_and_insertion(masm, + G1ThreadLocalData::dirty_card_queue_index_offset(), + G1ThreadLocalData::dirty_card_queue_buffer_offset(), + runtime, + thread, tmp1, tmp2, t0); + __ j(done); +} + void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Register store_addr, Register new_val, @@ -179,73 +241,119 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Register tmp2) { assert(thread == xthread, "must be"); assert_different_registers(store_addr, new_val, thread, tmp1, tmp2, t0); - assert(store_addr != noreg && new_val != noreg && tmp1 != noreg && - tmp2 != noreg, "expecting a register"); - - Address queue_index(thread, in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset())); - Address buffer(thread, in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset())); - - BarrierSet* bs = BarrierSet::barrier_set(); - CardTableBarrierSet* ctbs = barrier_set_cast(bs); + assert(store_addr != noreg && new_val != noreg && tmp1 != noreg && tmp2 != noreg, + "expecting a register"); Label done; Label runtime; - // Does store cross heap regions? + generate_post_barrier_fast_path(masm, store_addr, new_val, tmp1, tmp2, done, true /* new_val_may_be_null */); + // If card is young, jump to done (tmp2 holds the card value) + __ mv(t0, (int)G1CardTable::g1_young_card_val()); + __ beq(tmp2, t0, done); // card == young_card_val? + generate_post_barrier_slow_path(masm, thread, tmp1, tmp2, done, runtime); - __ xorr(tmp1, store_addr, new_val); - __ srli(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); - __ beqz(tmp1, done); + __ bind(runtime); + // save the live input values + RegSet saved = RegSet::of(store_addr); + __ push_reg(saved, sp); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), tmp1, thread); + __ pop_reg(saved, sp); - // crosses regions, storing null? + __ bind(done); +} - __ beqz(new_val, done); +#if defined(COMPILER2) - // storing region crossing non-null, is card already dirty? +static void generate_c2_barrier_runtime_call(MacroAssembler* masm, G1BarrierStubC2* stub, const Register arg, const address runtime_path) { + SaveLiveRegisters save_registers(masm, stub); + if (c_rarg0 != arg) { + __ mv(c_rarg0, arg); + } + __ mv(c_rarg1, xthread); + __ mv(t0, runtime_path); + __ jalr(t0); +} - const Register card_addr = tmp1; +void G1BarrierSetAssembler::g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register thread, + Register tmp1, + Register tmp2, + G1PreBarrierStubC2* stub) { + assert(thread == xthread, "must be"); + assert_different_registers(obj, pre_val, tmp1, tmp2); + assert(pre_val != noreg && tmp1 != noreg && tmp2 != noreg, "expecting a register"); - __ srli(card_addr, store_addr, CardTable::card_shift()); + stub->initialize_registers(obj, pre_val, thread, tmp1, tmp2); - // get the address of the card - __ load_byte_map_base(tmp2); - __ add(card_addr, card_addr, tmp2); - __ lbu(tmp2, Address(card_addr)); - __ mv(t0, (int)G1CardTable::g1_young_card_val()); - __ beq(tmp2, t0, done); + generate_pre_barrier_fast_path(masm, thread, tmp1); + // If marking is active (*(mark queue active address) != 0), jump to stub (slow path) + __ bnez(tmp1, *stub->entry(), true); - assert((int)CardTable::dirty_card_val() == 0, "must be 0"); + __ bind(*stub->continuation()); +} - __ membar(MacroAssembler::StoreLoad); +void G1BarrierSetAssembler::generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const { + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + Label runtime; + Register obj = stub->obj(); + Register pre_val = stub->pre_val(); + Register thread = stub->thread(); + Register tmp1 = stub->tmp1(); + Register tmp2 = stub->tmp2(); - __ lbu(tmp2, Address(card_addr)); - __ beqz(tmp2, done); + __ bind(*stub->entry()); + generate_pre_barrier_slow_path(masm, obj, pre_val, thread, tmp1, tmp2, *stub->continuation(), runtime); - // storing a region crossing, non-null oop, card is clean. - // dirty card and log. + __ bind(runtime); + generate_c2_barrier_runtime_call(masm, stub, pre_val, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry)); + __ j(*stub->continuation()); +} - __ sb(zr, Address(card_addr)); +void G1BarrierSetAssembler::g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register thread, + Register tmp1, + Register tmp2, + G1PostBarrierStubC2* stub) { + assert(thread == xthread, "must be"); + assert_different_registers(store_addr, new_val, thread, tmp1, tmp2, t0); + assert(store_addr != noreg && new_val != noreg && tmp1 != noreg && tmp2 != noreg, + "expecting a register"); - __ ld(t0, queue_index); - __ beqz(t0, runtime); - __ sub(t0, t0, wordSize); - __ sd(t0, queue_index); + stub->initialize_registers(thread, tmp1, tmp2); - __ ld(tmp2, buffer); - __ add(t0, tmp2, t0); - __ sd(card_addr, Address(t0, 0)); - __ j(done); + bool new_val_may_be_null = (stub->barrier_data() & G1C2BarrierPostNotNull) == 0; + generate_post_barrier_fast_path(masm, store_addr, new_val, tmp1, tmp2, *stub->continuation(), new_val_may_be_null); + // If card is not young, jump to stub (slow path) (tmp2 holds the card value) + __ mv(t0, (int)G1CardTable::g1_young_card_val()); + __ bne(tmp2, t0, *stub->entry(), true); - __ bind(runtime); - // save the live input values - RegSet saved = RegSet::of(store_addr); - __ push_reg(saved, sp); - __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), card_addr, thread); - __ pop_reg(saved, sp); + __ bind(*stub->continuation()); +} - __ bind(done); +void G1BarrierSetAssembler::generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const { + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + Label runtime; + Register thread = stub->thread(); + Register tmp1 = stub->tmp1(); // tmp1 holds the card address. + Register tmp2 = stub->tmp2(); + + __ bind(*stub->entry()); + generate_post_barrier_slow_path(masm, thread, tmp1, tmp2, *stub->continuation(), runtime); + + __ bind(runtime); + generate_c2_barrier_runtime_call(masm, stub, tmp1, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry)); + __ j(*stub->continuation()); } +#endif // COMPILER2 + void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register dst, Address src, Register tmp1, Register tmp2) { bool on_oop = is_reference_type(type); diff --git a/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.hpp b/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.hpp index 96568994079dd..c7bee2ef6f3a8 100644 --- a/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2020, 2024, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,8 @@ class LIR_Assembler; class StubAssembler; class G1PreBarrierStub; class G1PostBarrierStub; +class G1PreBarrierStubC2; +class G1PostBarrierStubC2; class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { protected: @@ -72,6 +74,27 @@ class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { void generate_c1_post_barrier_runtime_stub(StubAssembler* sasm); #endif +#ifdef COMPILER2 + void g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register thread, + Register tmp1, + Register tmp2, + G1PreBarrierStubC2* c2_stub); + void generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const; + void g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register thread, + Register tmp1, + Register tmp2, + G1PostBarrierStubC2* c2_stub); + void generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const; +#endif + void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register dst, Address src, Register tmp1, Register tmp2); }; diff --git a/src/hotspot/cpu/riscv/gc/g1/g1_riscv.ad b/src/hotspot/cpu/riscv/gc/g1/g1_riscv.ad new file mode 100644 index 0000000000000..1dc5834dbdc89 --- /dev/null +++ b/src/hotspot/cpu/riscv/gc/g1/g1_riscv.ad @@ -0,0 +1,564 @@ +// +// Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2024, Huawei Technologies Co., Ltd. All rights reserved. +// 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. +// + +source_hpp %{ + +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#include "gc/shared/gc_globals.hpp" + +%} + +source %{ + +#include "gc/g1/g1BarrierSetAssembler_riscv.hpp" +#include "gc/g1/g1BarrierSetRuntime.hpp" + +static void write_barrier_pre(MacroAssembler* masm, + const MachNode* node, + Register obj, + Register pre_val, + Register tmp1, + Register tmp2, + RegSet preserve = RegSet(), + RegSet no_preserve = RegSet()) { + if (!G1PreBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PreBarrierStubC2* const stub = G1PreBarrierStubC2::create(node); + for (RegSetIterator reg = preserve.begin(); *reg != noreg; ++reg) { + stub->preserve(*reg); + } + for (RegSetIterator reg = no_preserve.begin(); *reg != noreg; ++reg) { + stub->dont_preserve(*reg); + } + g1_asm->g1_write_barrier_pre_c2(masm, obj, pre_val, xthread, tmp1, tmp2, stub); +} + +static void write_barrier_post(MacroAssembler* masm, + const MachNode* node, + Register store_addr, + Register new_val, + Register tmp1, + Register tmp2) { + if (!G1PostBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PostBarrierStubC2* const stub = G1PostBarrierStubC2::create(node); + g1_asm->g1_write_barrier_post_c2(masm, store_addr, new_val, xthread, tmp1, tmp2, stub); +} + +%} + +instruct g1StoreP(indirect mem, iRegP src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3) +%{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreP mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(STORE_COST); + format %{ "sd $src, $mem\t# ptr" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + __ sd($src$$Register, Address($mem$$Register)); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(istore_reg_mem); +%} + +instruct g1StoreN(indirect mem, iRegN src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3) +%{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(STORE_COST); + format %{ "sw $src, $mem\t# compressed ptr" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + __ sw($src$$Register, Address($mem$$Register)); + if ((barrier_data() & G1C2BarrierPost) != 0) { + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ decode_heap_oop($tmp1$$Register, $src$$Register); + } else { + __ decode_heap_oop_not_null($tmp1$$Register, $src$$Register); + } + } + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(istore_reg_mem); +%} + +instruct g1EncodePAndStoreN(indirect mem, iRegP src, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3) +%{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem (EncodeP src))); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(STORE_COST); + format %{ "encode_heap_oop $tmp1, $src\n\t" + "sw $tmp1, $mem\t# compressed ptr" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ encode_heap_oop($tmp1$$Register, $src$$Register); + } else { + __ encode_heap_oop_not_null($tmp1$$Register, $src$$Register); + } + __ sw($tmp1$$Register, Address($mem$$Register)); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(istore_reg_mem); +%} + +instruct g1CompareAndExchangeP(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeP mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "cmpxchg $res = $mem, $oldval, $newval\t# ptr" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + // Pass $oldval to the pre-barrier (instead of loading from $mem), because + // $oldval is the only value that can be overwritten. + // The same holds for g1CompareAndSwapP and its Acq variant. + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + /*acquire*/ Assembler::relaxed, /*release*/ Assembler::rl, $res$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +instruct g1CompareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2) +%{ + predicate(UseG1GC && needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeP mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2); + ins_cost(VOLATILE_REF_COST); + format %{ "cmpxchg_acq $res = $mem, $oldval, $newval\t# ptr" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + // Pass $oldval to the pre-barrier (instead of loading from $mem), because + // $oldval is the only value that can be overwritten. + // The same holds for g1CompareAndSwapP and its Acq variant. + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + /*acquire*/ Assembler::aq, /*release*/ Assembler::rl, $res$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +instruct g1CompareAndExchangeN(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeN mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "cmpxchg $res = $mem, $oldval, $newval\t# narrow oop" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::uint32, + /*acquire*/ Assembler::relaxed, /*release*/ Assembler::rl, $res$$Register); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +instruct g1CompareAndExchangeNAcq(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3) +%{ + predicate(UseG1GC && needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeN mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(VOLATILE_REF_COST); + format %{ "cmpxchg_acq $res = $mem, $oldval, $newval\t# narrow oop" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::uint32, + /*acquire*/ Assembler::aq, /*release*/ Assembler::rl, $res$$Register); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +instruct g1CompareAndSwapP(iRegINoSp res, indirect mem, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegP oldval) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapP mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "cmpxchg $mem, $oldval, $newval\t# (ptr)\n\t" + "mv $res, $res == $oldval" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + /*acquire*/ Assembler::relaxed, /*release*/ Assembler::rl, $res$$Register, + /*result as bool*/ true); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +instruct g1CompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegP oldval) +%{ + predicate(UseG1GC && needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapP mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2); + ins_cost(VOLATILE_REF_COST); + format %{ "cmpxchg_acq $mem, $oldval, $newval\t# (ptr)\n\t" + "mv $res, $res == $oldval" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + /*acquire*/ Assembler::aq, /*release*/ Assembler::rl, $res$$Register, + /*result as bool*/ true); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +instruct g1CompareAndSwapN(iRegINoSp res, indirect mem, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, iRegN oldval) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapN mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "cmpxchg $mem, $oldval, $newval\t# (narrow oop)\n\t" + "mv $res, $res == $oldval" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::uint32, + /*acquire*/ Assembler::relaxed, /*release*/ Assembler::rl, $res$$Register, + /*result as bool*/ true); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +instruct g1CompareAndSwapNAcq(iRegINoSp res, indirect mem, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, iRegN oldval) +%{ + predicate(UseG1GC && needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapN mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(VOLATILE_REF_COST); + format %{ "cmpxchg_acq $mem, $oldval, $newval\t# (narrow oop)\n\t" + "mv $res, $res == $oldval" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($oldval$$Register, $mem$$Register); + assert_different_registers($newval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::uint32, + /*acquire*/ Assembler::aq, /*release*/ Assembler::rl, $res$$Register, + /*result as bool*/ true); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_slow); +%} + +instruct g1GetAndSetP(indirect mem, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp preval) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set preval (GetAndSetP mem newval)); + effect(TEMP preval, TEMP tmp1, TEMP tmp2); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "atomic_xchg $preval, $newval, [$mem]" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $preval$$Register /* pre_val (as a temporary register) */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $preval$$Register, $newval$$Register) /* preserve */); + __ atomic_xchg($preval$$Register, $newval$$Register, $mem$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_serial); +%} + +instruct g1GetAndSetPAcq(indirect mem, iRegP newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp preval) +%{ + predicate(UseG1GC && needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set preval (GetAndSetP mem newval)); + effect(TEMP preval, TEMP tmp1, TEMP tmp2); + ins_cost(VOLATILE_REF_COST); + format %{ "atomic_xchg_acq $preval, $newval, [$mem]" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $preval$$Register /* pre_val (as a temporary register) */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */, + RegSet::of($mem$$Register, $preval$$Register, $newval$$Register) /* preserve */); + __ atomic_xchgal($preval$$Register, $newval$$Register, $mem$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(pipe_serial); +%} + +instruct g1GetAndSetN(indirect mem, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, iRegNNoSp preval) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set preval (GetAndSetN mem newval)); + effect(TEMP preval, TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(2 * VOLATILE_REF_COST); + format %{ "atomic_xchgwu $preval, $newval, [$mem]" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $preval$$Register, $newval$$Register) /* preserve */); + __ atomic_xchgwu($preval$$Register, $newval$$Register, $mem$$Register); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_serial); +%} + +instruct g1GetAndSetNAcq(indirect mem, iRegN newval, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3, iRegNNoSp preval) +%{ + predicate(UseG1GC && needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() != 0); + match(Set preval (GetAndSetN mem newval)); + effect(TEMP preval, TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(VOLATILE_REF_COST); + format %{ "atomic_xchgwu_acq $preval, $newval, [$mem]" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */, + RegSet::of($mem$$Register, $preval$$Register, $newval$$Register) /* preserve */); + __ atomic_xchgalwu($preval$$Register, $newval$$Register, $mem$$Register); + __ decode_heap_oop($tmp1$$Register, $newval$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_serial); +%} + +instruct g1LoadP(iRegPNoSp dst, indirect mem, iRegPNoSp tmp1, iRegPNoSp tmp2) +%{ + predicate(UseG1GC && n->as_Load()->barrier_data() != 0); + match(Set dst (LoadP mem)); + effect(TEMP dst, TEMP tmp1, TEMP tmp2); + ins_cost(LOAD_COST + BRANCH_COST); + format %{ "ld $dst, $mem\t# ptr" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + __ ld($dst$$Register, Address($mem$$Register)); + write_barrier_pre(masm, this, + noreg /* obj */, + $dst$$Register /* pre_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(iload_reg_mem); +%} + +instruct g1LoadN(iRegNNoSp dst, indirect mem, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3) +%{ + predicate(UseG1GC && n->as_Load()->barrier_data() != 0); + match(Set dst (LoadN mem)); + effect(TEMP dst, TEMP tmp1, TEMP tmp2, TEMP tmp3); + ins_cost(LOAD_COST + BRANCH_COST); + format %{ "lwu $dst, $mem\t# compressed ptr" %} + ins_encode %{ + guarantee($mem$$disp == 0, "impossible encoding"); + __ lwu($dst$$Register, Address($mem$$Register)); + if ((barrier_data() & G1C2BarrierPre) != 0) { + __ decode_heap_oop($tmp1$$Register, $dst$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + } + %} + ins_pipe(iload_reg_mem); +%} diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad index 05f55fd0da7af..563dfd4cde972 100644 --- a/src/hotspot/cpu/riscv/riscv.ad +++ b/src/hotspot/cpu/riscv/riscv.ad @@ -2224,7 +2224,8 @@ bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) { assert_cond(m != nullptr); if (is_vshift_con_pattern(n, m) || // ShiftV src (ShiftCntV con) is_vector_bitwise_not_pattern(n, m) || - is_vector_scalar_bitwise_pattern(n, m)) { + is_vector_scalar_bitwise_pattern(n, m) || + is_encode_and_store_pattern(n, m)) { mstack.push(m, Visit); return true; } @@ -4785,6 +4786,7 @@ instruct loadP(iRegPNoSp dst, memory mem) // Load Compressed Pointer instruct loadN(iRegNNoSp dst, memory mem) %{ + predicate(n->as_Load()->barrier_data() == 0); match(Set dst (LoadN mem)); ins_cost(LOAD_COST); @@ -5220,6 +5222,7 @@ instruct storeimmP0(immP0 zero, memory mem) // Store Compressed Pointer instruct storeN(iRegN src, memory mem) %{ + predicate(n->as_Store()->barrier_data() == 0); match(Set mem (StoreN mem src)); ins_cost(STORE_COST); @@ -5234,6 +5237,7 @@ instruct storeN(iRegN src, memory mem) instruct storeImmN0(immN0 zero, memory mem) %{ + predicate(n->as_Store()->barrier_data() == 0); match(Set mem (StoreN mem zero)); ins_cost(STORE_COST); @@ -5424,6 +5428,7 @@ instruct compareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval instruct compareAndSwapN(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval) %{ + predicate(n->as_LoadStore()->barrier_data() == 0); match(Set res (CompareAndSwapN mem (Binary oldval newval))); ins_cost(LOAD_COST + STORE_COST + ALU_COST * 8 + BRANCH_COST * 4); @@ -5545,7 +5550,7 @@ instruct compareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP new instruct compareAndSwapNAcq(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval) %{ - predicate(needs_acquiring_load_reserved(n)); + predicate(needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == 0); match(Set res (CompareAndSwapN mem (Binary oldval newval))); @@ -5653,6 +5658,7 @@ instruct compareAndExchangeL(iRegLNoSp res, indirect mem, iRegL oldval, iRegL ne instruct compareAndExchangeN(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval) %{ + predicate(n->as_LoadStore()->barrier_data() == 0); match(Set res (CompareAndExchangeN mem (Binary oldval newval))); ins_cost(LOAD_COST + STORE_COST + BRANCH_COST * 3 + ALU_COST * 3); @@ -5786,7 +5792,7 @@ instruct compareAndExchangeLAcq(iRegLNoSp res, indirect mem, iRegL oldval, iRegL instruct compareAndExchangeNAcq(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval) %{ - predicate(needs_acquiring_load_reserved(n)); + predicate(needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == 0); match(Set res (CompareAndExchangeN mem (Binary oldval newval))); @@ -5914,6 +5920,7 @@ instruct weakCompareAndSwapL(iRegINoSp res, indirect mem, iRegL oldval, iRegL ne instruct weakCompareAndSwapN(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval) %{ + predicate(n->as_LoadStore()->barrier_data() == 0); match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); ins_cost(LOAD_COST + STORE_COST + BRANCH_COST * 2 + ALU_COST * 4); @@ -6045,7 +6052,7 @@ instruct weakCompareAndSwapLAcq(iRegINoSp res, indirect mem, iRegL oldval, iRegL instruct weakCompareAndSwapNAcq(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval) %{ - predicate(needs_acquiring_load_reserved(n)); + predicate(needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == 0); match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); @@ -6117,6 +6124,8 @@ instruct get_and_setL(indirect mem, iRegL newv, iRegLNoSp prev) instruct get_and_setN(indirect mem, iRegN newv, iRegINoSp prev) %{ + predicate(n->as_LoadStore()->barrier_data() == 0); + match(Set prev (GetAndSetN mem newv)); ins_cost(ALU_COST); @@ -6182,7 +6191,7 @@ instruct get_and_setLAcq(indirect mem, iRegL newv, iRegLNoSp prev) instruct get_and_setNAcq(indirect mem, iRegN newv, iRegINoSp prev) %{ - predicate(needs_acquiring_load_reserved(n)); + predicate(needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == 0); match(Set prev (GetAndSetN mem newv)); diff --git a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp index 37631298920ca..544c82d34a769 100644 --- a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2018, 2023 SAP SE. All rights reserved. + * Copyright (c) 2019, 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 @@ -42,11 +42,47 @@ #include "c1/c1_LIRAssembler.hpp" #include "c1/c1_MacroAssembler.hpp" #include "gc/g1/c1/g1BarrierSetC1.hpp" -#endif +#endif // COMPILER1 +#ifdef COMPILER2 +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#endif // COMPILER2 #define __ masm-> -#define BLOCK_COMMENT(str) if (PrintAssembly) __ block_comment(str) +#define BLOCK_COMMENT(str) __ block_comment(str) + +static void generate_pre_barrier_fast_path(MacroAssembler* masm, + const Register thread, + const Register tmp1) { + Address in_progress(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset())); + // Is marking active? + if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { + __ load_and_test_int(tmp1, in_progress); + } else { + assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); + __ load_and_test_byte(tmp1, in_progress); + } +} + +static void generate_queue_test_and_insertion(MacroAssembler* masm, ByteSize index_offset, ByteSize buffer_offset, Label& runtime, + const Register Z_thread, const Register value, const Register temp) { + BLOCK_COMMENT("generate_queue_test_and_insertion {"); + + assert_different_registers(temp, value); + // Can we store a value in the given thread's buffer? + // (The index field is typed as size_t.) + + __ load_and_test_long(temp, Address(Z_thread, in_bytes(index_offset))); // temp := *(index address) + __ branch_optimized(Assembler::bcondEqual, runtime); // jump to runtime if index == 0 (full buffer) + + // The buffer is not full, store value into it. + __ add2reg(temp, -wordSize); // temp := next index + __ z_stg(temp, in_bytes(index_offset), Z_thread); // *(index address) := next index + + __ z_ag(temp, Address(Z_thread, in_bytes(buffer_offset))); // temp := buffer address + next index + __ z_stg(value, 0, temp); // *(buffer address + next index) := value + BLOCK_COMMENT("} generate_queue_test_and_insertion"); +} void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators, Register addr, Register count) { @@ -59,13 +95,8 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm assert_different_registers(addr, Z_R0_scratch); // would be destroyed by push_frame() assert_different_registers(count, Z_R0_scratch); // would be destroyed by push_frame() Register Rtmp1 = Z_R0_scratch; - const int active_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()); - if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { - __ load_and_test_int(Rtmp1, Address(Z_thread, active_offset)); - } else { - guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); - __ load_and_test_byte(Rtmp1, Address(Z_thread, active_offset)); - } + + generate_pre_barrier_fast_path(masm, Z_thread, Rtmp1); __ z_bre(filtered); // Activity indicator is zero, so there is no marking going on currently. RegisterSaver::save_live_registers(masm, RegisterSaver::arg_registers); // Creates frame. @@ -100,6 +131,181 @@ void G1BarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* mas } } +#if defined(COMPILER2) + +#undef __ +#define __ masm-> + +static void generate_c2_barrier_runtime_call(MacroAssembler* masm, G1BarrierStubC2* stub, const Register pre_val, const address runtime_path) { + BLOCK_COMMENT("generate_c2_barrier_runtime_call {"); + SaveLiveRegisters save_registers(masm, stub); + __ call_VM_leaf(runtime_path, pre_val, Z_thread); + BLOCK_COMMENT("} generate_c2_barrier_runtime_call"); +} + +void G1BarrierSetAssembler::g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register thread, + Register tmp1, + G1PreBarrierStubC2* stub) { + + BLOCK_COMMENT("g1_write_barrier_pre_c2 {"); + + assert(thread == Z_thread, "must be"); + assert_different_registers(obj, pre_val, tmp1); + assert(pre_val != noreg && tmp1 != noreg, "expecting a register"); + + stub->initialize_registers(obj, pre_val, thread, tmp1, noreg); + + generate_pre_barrier_fast_path(masm, thread, tmp1); + __ branch_optimized(Assembler::bcondNotEqual, *stub->entry()); // Activity indicator is zero, so there is no marking going on currently. + + __ bind(*stub->continuation()); + + BLOCK_COMMENT("} g1_write_barrier_pre_c2"); +} + +void G1BarrierSetAssembler::generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const { + + BLOCK_COMMENT("generate_c2_pre_barrier_stub {"); + + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + + Label runtime; + Register obj = stub->obj(); + Register pre_val = stub->pre_val(); + Register thread = stub->thread(); + Register tmp1 = stub->tmp1(); + + __ bind(*stub->entry()); + + BLOCK_COMMENT("generate_pre_val_not_null_test {"); + if (obj != noreg) { + __ load_heap_oop(pre_val, Address(obj), noreg, noreg, AS_RAW); + } + __ z_ltgr(pre_val, pre_val); + __ branch_optimized(Assembler::bcondEqual, *stub->continuation()); + BLOCK_COMMENT("} generate_pre_val_not_null_test"); + + generate_queue_test_and_insertion(masm, + G1ThreadLocalData::satb_mark_queue_index_offset(), + G1ThreadLocalData::satb_mark_queue_buffer_offset(), + runtime, + Z_thread, pre_val, tmp1); + + __ branch_optimized(Assembler::bcondAlways, *stub->continuation()); + + __ bind(runtime); + + generate_c2_barrier_runtime_call(masm, stub, pre_val, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry)); + + __ branch_optimized(Assembler::bcondAlways, *stub->continuation()); + + BLOCK_COMMENT("} generate_c2_pre_barrier_stub"); +} + +void G1BarrierSetAssembler::g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register thread, + Register tmp1, + Register tmp2, + G1PostBarrierStubC2* stub) { + BLOCK_COMMENT("g1_write_barrier_post_c2 {"); + + assert(thread == Z_thread, "must be"); + assert_different_registers(store_addr, new_val, thread, tmp1, tmp2, Z_R1_scratch); + + assert(store_addr != noreg && new_val != noreg && tmp1 != noreg && tmp2 != noreg, "expecting a register"); + + stub->initialize_registers(thread, tmp1, tmp2); + + BLOCK_COMMENT("generate_region_crossing_test {"); + if (VM_Version::has_DistinctOpnds()) { + __ z_xgrk(tmp1, store_addr, new_val); + } else { + __ z_lgr(tmp1, store_addr); + __ z_xgr(tmp1, new_val); + } + __ z_srag(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); + __ branch_optimized(Assembler::bcondEqual, *stub->continuation()); + BLOCK_COMMENT("} generate_region_crossing_test"); + + // crosses regions, storing null? + if ((stub->barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ z_ltgr(new_val, new_val); + __ branch_optimized(Assembler::bcondEqual, *stub->continuation()); + } + + BLOCK_COMMENT("generate_card_young_test {"); + CardTableBarrierSet* ct = barrier_set_cast(BarrierSet::barrier_set()); + // calculate address of card + __ load_const_optimized(tmp2, (address)ct->card_table()->byte_map_base()); // Card table base. + __ z_srlg(tmp1, store_addr, CardTable::card_shift()); // Index into card table. + __ z_algr(tmp1, tmp2); // Explicit calculation needed for cli. + + // Filter young. + __ z_cli(0, tmp1, G1CardTable::g1_young_card_val()); + + BLOCK_COMMENT("} generate_card_young_test"); + + // From here on, tmp1 holds the card address. + __ branch_optimized(Assembler::bcondNotEqual, *stub->entry()); + + __ bind(*stub->continuation()); + + BLOCK_COMMENT("} g1_write_barrier_post_c2"); +} + +void G1BarrierSetAssembler::generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const { + + BLOCK_COMMENT("generate_c2_post_barrier_stub {"); + + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + Label runtime; + + Register thread = stub->thread(); + Register tmp1 = stub->tmp1(); // tmp1 holds the card address. + Register tmp2 = stub->tmp2(); + Register Rcard_addr = tmp1; + + __ bind(*stub->entry()); + + BLOCK_COMMENT("generate_card_clean_test {"); + __ z_sync(); // Required to support concurrent cleaning. + __ z_cli(0, Rcard_addr, 0); // Reload after membar. + __ branch_optimized(Assembler::bcondEqual, *stub->continuation()); + BLOCK_COMMENT("} generate_card_clean_test"); + + BLOCK_COMMENT("generate_dirty_card {"); + // Storing a region crossing, non-null oop, card is clean. + // Dirty card and log. + STATIC_ASSERT(CardTable::dirty_card_val() == 0); + __ z_mvi(0, Rcard_addr, CardTable::dirty_card_val()); + BLOCK_COMMENT("} generate_dirty_card"); + + generate_queue_test_and_insertion(masm, + G1ThreadLocalData::dirty_card_queue_index_offset(), + G1ThreadLocalData::dirty_card_queue_buffer_offset(), + runtime, + Z_thread, tmp1, tmp2); + + __ branch_optimized(Assembler::bcondAlways, *stub->continuation()); + + __ bind(runtime); + + generate_c2_barrier_runtime_call(masm, stub, tmp1, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry)); + + __ branch_optimized(Assembler::bcondAlways, *stub->continuation()); + + BLOCK_COMMENT("} generate_c2_post_barrier_stub"); +} + +#endif //COMPILER2 + void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, const Address& src, Register dst, Register tmp1, Register tmp2, Label *L_handle_null) { bool on_oop = is_reference_type(type); @@ -136,9 +342,6 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Decorator const Register Robj = obj ? obj->base() : noreg, Roff = obj ? obj->index() : noreg; - const int active_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()); - const int buffer_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset()); - const int index_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset()); assert_different_registers(Rtmp1, Rtmp2, Z_R0_scratch); // None of the Rtmp must be Z_R0!! assert_different_registers(Robj, Z_R0_scratch); // Used for addressing. Furthermore, push_frame destroys Z_R0!! assert_different_registers(Rval, Z_R0_scratch); // push_frame destroys Z_R0!! @@ -147,14 +350,7 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Decorator BLOCK_COMMENT("g1_write_barrier_pre {"); - // Is marking active? - // Note: value is loaded for test purposes only. No further use here. - if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { - __ load_and_test_int(Rtmp1, Address(Z_thread, active_offset)); - } else { - guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); - __ load_and_test_byte(Rtmp1, Address(Z_thread, active_offset)); - } + generate_pre_barrier_fast_path(masm, Z_thread, Rtmp1); __ z_bre(filtered); // Activity indicator is zero, so there is no marking going on currently. assert(Rpre_val != noreg, "must have a real register"); @@ -194,24 +390,14 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Decorator // We can store the original value in the thread's buffer // only if index > 0. Otherwise, we need runtime to handle. // (The index field is typed as size_t.) - Register Rbuffer = Rtmp1, Rindex = Rtmp2; - assert_different_registers(Rbuffer, Rindex, Rpre_val); - - __ z_lg(Rbuffer, buffer_offset, Z_thread); - __ load_and_test_long(Rindex, Address(Z_thread, index_offset)); - __ z_bre(callRuntime); // If index == 0, goto runtime. - - __ add2reg(Rindex, -wordSize); // Decrement index. - __ z_stg(Rindex, index_offset, Z_thread); - - // Record the previous value. - __ z_stg(Rpre_val, 0, Rbuffer, Rindex); + generate_queue_test_and_insertion(masm, + G1ThreadLocalData::satb_mark_queue_index_offset(), + G1ThreadLocalData::satb_mark_queue_buffer_offset(), + callRuntime, + Z_thread, Rpre_val, Rtmp2); __ z_bru(filtered); // We are done. - Rbuffer = noreg; // end of life - Rindex = noreg; // end of life - __ bind(callRuntime); // Save some registers (inputs and result) over runtime call @@ -326,23 +512,16 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato Register Rcard_addr_x = Rcard_addr; Register Rqueue_index = (Rtmp2 != Z_R0_scratch) ? Rtmp2 : Rtmp1; - Register Rqueue_buf = (Rtmp3 != Z_R0_scratch) ? Rtmp3 : Rtmp1; - const int qidx_off = in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset()); - const int qbuf_off = in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset()); - if ((Rcard_addr == Rqueue_buf) || (Rcard_addr == Rqueue_index)) { + if (Rcard_addr == Rqueue_index) { Rcard_addr_x = Z_R0_scratch; // Register shortage. We have to use Z_R0. } __ lgr_if_needed(Rcard_addr_x, Rcard_addr); - __ load_and_test_long(Rqueue_index, Address(Z_thread, qidx_off)); - __ z_bre(callRuntime); // Index == 0 then jump to runtime. - - __ z_lg(Rqueue_buf, qbuf_off, Z_thread); - - __ add2reg(Rqueue_index, -wordSize); // Decrement index. - __ z_stg(Rqueue_index, qidx_off, Z_thread); - - __ z_stg(Rcard_addr_x, 0, Rqueue_index, Rqueue_buf); // Store card. + generate_queue_test_and_insertion(masm, + G1ThreadLocalData::dirty_card_queue_index_offset(), + G1ThreadLocalData::dirty_card_queue_buffer_offset(), + callRuntime, + Z_thread, Rcard_addr_x, Rqueue_index); __ z_bru(filtered); __ bind(callRuntime); diff --git a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.hpp b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.hpp index cc1d51d2fa13e..0f0bdd8b83cfd 100644 --- a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2018, 2023, 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 @@ -34,6 +34,8 @@ class LIR_Assembler; class StubAssembler; class G1PreBarrierStub; class G1PostBarrierStub; +class G1PreBarrierStubC2; +class G1PostBarrierStubC2; class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { protected: @@ -62,7 +64,27 @@ class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { void generate_c1_pre_barrier_runtime_stub(StubAssembler* sasm); void generate_c1_post_barrier_runtime_stub(StubAssembler* sasm); -#endif +#endif // COMPILER1 + +#ifdef COMPILER2 + void g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register thread, + Register tmp1, + G1PreBarrierStubC2* c2_stub); + void generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const; + void g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register thread, + Register tmp1, + Register tmp2, + G1PostBarrierStubC2* c2_stub); + void generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const; +#endif // COMPILER2 virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, const Address& src, Register dst, Register tmp1, Register tmp2, Label *L_handle_null = nullptr); diff --git a/src/hotspot/cpu/s390/gc/g1/g1_s390.ad b/src/hotspot/cpu/s390/gc/g1/g1_s390.ad new file mode 100644 index 0000000000000..31f60c4aeff0b --- /dev/null +++ b/src/hotspot/cpu/s390/gc/g1/g1_s390.ad @@ -0,0 +1,457 @@ +// +// Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +// Copyright 2024 IBM Corporation. All rights reserved. +// 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. +// + +source_hpp %{ + +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#include "gc/shared/gc_globals.hpp" + +%} + +source %{ + +#include "gc/g1/g1BarrierSetAssembler_s390.hpp" +#include "gc/g1/g1BarrierSetRuntime.hpp" + +static void write_barrier_pre(MacroAssembler* masm, + const MachNode* node, + Register obj, + Register pre_val, + Register tmp1, + RegSet preserve = RegSet(), + RegSet no_preserve = RegSet()) { + if (!G1PreBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PreBarrierStubC2* const stub = G1PreBarrierStubC2::create(node); + for (RegSetIterator reg = preserve.begin(); *reg != noreg; ++reg) { + stub->preserve(*reg); + } + for (RegSetIterator reg = no_preserve.begin(); *reg != noreg; ++reg) { + stub->dont_preserve(*reg); + } + g1_asm->g1_write_barrier_pre_c2(masm, obj, pre_val, Z_thread, tmp1, stub); +} + +static void write_barrier_post(MacroAssembler* masm, + const MachNode* node, + Register store_addr, + Register new_val, + Register tmp1, + Register tmp2) { + if (!G1PostBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PostBarrierStubC2* const stub = G1PostBarrierStubC2::create(node); + g1_asm->g1_write_barrier_post_c2(masm, store_addr, new_val, Z_thread, tmp1, tmp2, stub); +} + +%} // source + +// store pointer +instruct g1StoreP(indirect dst, memoryRegP src, iRegL tmp1, iRegL tmp2, flagsReg cr) %{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set dst (StoreP dst src)); + effect(TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(MEMORY_REF_COST); + format %{ "STG $src,$dst\t # ptr" %} + ins_encode %{ + __ block_comment("g1StoreP {"); + write_barrier_pre(masm, this, + $dst$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + RegSet::of($dst$$Register, $src$$Register) /* preserve */); + + __ z_stg($src$$Register, Address($dst$$Register)); + + write_barrier_post(masm, this, + $dst$$Register, /* store_addr */ + $src$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + __ block_comment("} g1StoreP"); + %} + ins_pipe(pipe_class_dummy); +%} + +// Store Compressed Pointer +instruct g1StoreN(indirect mem, iRegN_P2N src, iRegL tmp1, iRegL tmp2, iRegL tmp3, flagsReg cr) %{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(MEMORY_REF_COST); + format %{ "STY $src,$mem\t # (cOop)" %} + ins_encode %{ + __ block_comment("g1StoreN {"); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + + __ z_sty($src$$Register, Address($mem$$Register)); + + if ((barrier_data() & G1C2BarrierPost) != 0) { + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ oop_decoder($tmp1$$Register, $src$$Register, true /* maybe_null */); + } else { + __ oop_decoder($tmp1$$Register, $src$$Register, false /* maybe_null */); + } + } + + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + __ block_comment("} g1StoreN"); + %} + + ins_pipe(pipe_class_dummy); +%} + +instruct g1CompareAndSwapN(indirect mem_ptr, rarg5RegN oldval, iRegN_P2N newval, iRegI res, iRegL tmp1, iRegL tmp2, iRegL tmp3, flagsReg cr) %{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval))); + match(Set res (WeakCompareAndSwapN mem_ptr (Binary oldval newval))); + effect(USE mem_ptr, TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3, USE_KILL oldval, KILL cr); + format %{ "$res = CompareAndSwapN $oldval,$newval,$mem_ptr" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem_ptr$$Register); + assert_different_registers($newval$$Register, $mem_ptr$$Register); + __ block_comment("g1compareAndSwapN {"); + + Register Rcomp = reg_to_register_object($oldval$$reg); + Register Rnew = reg_to_register_object($newval$$reg); + Register Raddr = reg_to_register_object($mem_ptr$$reg); + Register Rres = reg_to_register_object($res$$reg); + + write_barrier_pre(masm, this, + Raddr /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + RegSet::of(Raddr, Rcomp, Rnew) /* preserve */, + RegSet::of(Rres) /* no_preserve */); + + __ z_cs(Rcomp, Rnew, 0, Raddr); + + assert_different_registers(Rres, Raddr); + if (VM_Version::has_LoadStoreConditional()) { + __ load_const_optimized(Z_R0_scratch, 0L); // false (failed) + __ load_const_optimized(Rres, 1L); // true (succeed) + __ z_locgr(Rres, Z_R0_scratch, Assembler::bcondNotEqual); + } else { + Label done; + __ load_const_optimized(Rres, 0L); // false (failed) + __ z_brne(done); // Assume true to be the common case. + __ load_const_optimized(Rres, 1L); // true (succeed) + __ bind(done); + } + + __ oop_decoder($tmp3$$Register, Rnew, true /* maybe_null */); + + write_barrier_post(masm, this, + Raddr /* store_addr */, + $tmp3$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + __ block_comment("} g1compareAndSwapN"); + %} + ins_pipe(pipe_class_dummy); +%} + +instruct g1CompareAndExchangeN(iRegP mem_ptr, rarg5RegN oldval, iRegN_P2N newval, iRegN res, iRegL tmp1, iRegL tmp2, iRegL tmp3, flagsReg cr) %{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeN mem_ptr (Binary oldval newval))); + effect(USE mem_ptr, TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3, USE_KILL oldval, KILL cr); + format %{ "$res = CompareAndExchangeN $oldval,$newval,$mem_ptr" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem_ptr$$Register); + assert_different_registers($newval$$Register, $mem_ptr$$Register); + __ block_comment("g1CompareAndExchangeN {"); + write_barrier_pre(masm, this, + $mem_ptr$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + RegSet::of($mem_ptr$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + + Register Rcomp = reg_to_register_object($oldval$$reg); + Register Rnew = reg_to_register_object($newval$$reg); + Register Raddr = reg_to_register_object($mem_ptr$$reg); + + Register Rres = reg_to_register_object($res$$reg); + assert_different_registers(Rres, Raddr); + + __ z_lgr(Rres, Rcomp); // previous contents + __ z_csy(Rres, Rnew, 0, Raddr); // Try to store new value. + + __ oop_decoder($tmp1$$Register, Rnew, true /* maybe_null */); + + write_barrier_post(masm, this, + Raddr /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + __ block_comment("} g1CompareAndExchangeN"); + %} + ins_pipe(pipe_class_dummy); +%} + +// Load narrow oop +instruct g1LoadN(iRegN dst, indirect mem, iRegP tmp1, iRegP tmp2, flagsReg cr) %{ + predicate(UseG1GC && n->as_Load()->barrier_data() != 0); + match(Set dst (LoadN mem)); + effect(TEMP dst, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(MEMORY_REF_COST); + format %{ "LoadN $dst,$mem\t # (cOop)" %} + ins_encode %{ + __ block_comment("g1LoadN {"); + __ z_llgf($dst$$Register, Address($mem$$Register)); + if ((barrier_data() & G1C2BarrierPre) != 0) { + __ oop_decoder($tmp1$$Register, $dst$$Register, true); + write_barrier_pre(masm, this, + noreg /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register ); + } + __ block_comment("} g1LoadN"); + %} + ins_pipe(pipe_class_dummy); +%} + +instruct g1GetAndSetN(indirect mem, iRegN dst, iRegI tmp, iRegL tmp1, iRegL tmp2, iRegL tmp3, flagsReg cr) %{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set dst (GetAndSetN mem dst)); + effect(KILL cr, TEMP tmp, TEMP tmp1, TEMP tmp2, TEMP tmp3); // USE_DEF dst by match rule. + format %{ "XCHGN $dst,[$mem]\t # EXCHANGE (coop, atomic), temp $tmp" %} + ins_encode %{ + __ block_comment("g1GetAndSetN {"); + assert_different_registers($mem$$Register, $dst$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + RegSet::of($mem$$Register, $dst$$Register) /* preserve */); + + Register Rdst = reg_to_register_object($dst$$reg); + Register Rtmp = reg_to_register_object($tmp$$reg); + guarantee(Rdst != Rtmp, "Fix match rule to use TEMP_DEF"); + Label retry; + + // Iterate until swap succeeds. + __ z_llgf(Rtmp, Address($mem$$Register)); // current contents + __ bind(retry); + // Calculate incremented value. + __ z_csy(Rtmp, Rdst, Address($mem$$Register)); // Try to store new value. + __ z_brne(retry); // Yikes, concurrent update, need to retry. + + __ oop_decoder($tmp1$$Register, $dst$$Register, true /* maybe_null */); + + __ z_lgr(Rdst, Rtmp); // Exchanged value from memory is return value. + + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + + __ block_comment("} g1GetAndSetN"); + %} + ins_pipe(pipe_class_dummy); +%} + +instruct g1CompareAndSwapP(iRegP mem_ptr, rarg5RegP oldval, iRegP_N2P newval, iRegI res, iRegL tmp1, iRegL tmp2, flagsReg cr) %{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval))); + match(Set res (WeakCompareAndSwapP mem_ptr (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, USE mem_ptr, USE_KILL oldval, KILL cr); + format %{ "$res = CompareAndSwapP $oldval,$newval,$mem_ptr" %} + ins_encode %{ + __ block_comment("g1CompareAndSwapP {"); + assert_different_registers($oldval$$Register, $mem_ptr$$Register); + assert_different_registers($newval$$Register, $mem_ptr$$Register); + + Register Rcomp = reg_to_register_object($oldval$$reg); + Register Rnew = reg_to_register_object($newval$$reg); + Register Raddr = reg_to_register_object($mem_ptr$$reg); + Register Rres = reg_to_register_object($res$$reg); + + write_barrier_pre(masm, this, + noreg /* obj */, + Rcomp /* pre_val */, + $tmp1$$Register /* tmp1 */, + RegSet::of(Raddr, Rcomp, Rnew) /* preserve */, + RegSet::of(Rres) /* no_preserve */); + + __ z_csg(Rcomp, Rnew, 0, Raddr); + + if (VM_Version::has_LoadStoreConditional()) { + __ load_const_optimized(Z_R0_scratch, 0L); // false (failed) + __ load_const_optimized(Rres, 1L); // true (succeed) + __ z_locgr(Rres, Z_R0_scratch, Assembler::bcondNotEqual); + } else { + Label done; + __ load_const_optimized(Rres, 0L); // false (failed) + __ z_brne(done); // Assume true to be the common case. + __ load_const_optimized(Rres, 1L); // true (succeed) + __ bind(done); + } + + write_barrier_post(masm, this, + Raddr /* store_addr */, + Rnew /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + __ block_comment("} g1CompareAndSwapP"); + %} + ins_pipe(pipe_class_dummy); +%} + +instruct g1CompareAndExchangeP(iRegP mem_ptr, rarg5RegP oldval, iRegP_N2P newval, iRegP res, iRegL tmp1, iRegL tmp2, flagsReg cr) %{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndExchangeP mem_ptr (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, USE mem_ptr, USE_KILL oldval, KILL cr); + format %{ "$res = CompareAndExchangeP $oldval,$newval,$mem_ptr" %} + ins_encode %{ + __ block_comment("g1CompareAndExchangeP {"); + assert_different_registers($oldval$$Register, $mem_ptr$$Register); + assert_different_registers($newval$$Register, $mem_ptr$$Register); + + // Pass $oldval to the pre-barrier (instead of loading from $mem), because + // $oldval is the only value that can be overwritten. + // The same holds for g1CompareAndSwapP. + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + RegSet::of($mem_ptr$$Register, $oldval$$Register, $newval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + + __ z_lgr($res$$Register, $oldval$$Register); // previous content + + __ z_csg($oldval$$Register, $newval$$Register, 0, $mem_ptr$$reg); + + write_barrier_post(masm, this, + $mem_ptr$$Register /* store_addr */, + $newval$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + __ block_comment("} g1CompareAndExchangeP"); + %} + ins_pipe(pipe_class_dummy); +%} + +// Load Pointer +instruct g1LoadP(iRegP dst, memory mem, iRegL tmp1, flagsReg cr) %{ + predicate(UseG1GC && n->as_Load()->barrier_data() != 0); + match(Set dst (LoadP mem)); + effect(TEMP dst, TEMP tmp1, KILL cr); + ins_cost(MEMORY_REF_COST); + format %{ "LG $dst,$mem\t # ptr" %} + ins_encode %{ + __ block_comment("g1LoadP {"); + __ z_lg($dst$$Register, $mem$$Address); + write_barrier_pre(masm, this, + noreg /* obj */, + $dst$$Register /* pre_val */, + $tmp1$$Register ); + __ block_comment("} g1LoadP"); + %} + ins_pipe(pipe_class_dummy); +%} + +instruct g1GetAndSetP(indirect mem, iRegP dst, iRegL tmp, iRegL tmp1, iRegL tmp2, flagsReg cr) %{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set dst (GetAndSetP mem dst)); + effect(KILL cr, TEMP tmp, TEMP tmp1, TEMP tmp2); // USE_DEF dst by match rule. + format %{ "XCHGP $dst,[$mem]\t # EXCHANGE (oop, atomic), temp $tmp" %} + ins_encode %{ + __ block_comment("g1GetAndSetP {"); + + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp$$Register /* pre_val (as a temporary register) */, + $tmp1$$Register /* tmp1 */, + RegSet::of($mem$$Register, $dst$$Register) /* preserve */); + + __ z_lgr($tmp1$$Register, $dst$$Register); + Register Rdst = reg_to_register_object($dst$$reg); + Register Rtmp = reg_to_register_object($tmp$$reg); + guarantee(Rdst != Rtmp, "Fix match rule to use TEMP_DEF"); + Label retry; + + // Iterate until swap succeeds. + __ z_lg(Rtmp, Address($mem$$Register)); // current contents + __ bind(retry); + // Calculate incremented value. + __ z_csg(Rtmp, Rdst, Address($mem$$Register)); // Try to store new value. + __ z_brne(retry); // Yikes, concurrent update, need to retry. + __ z_lgr(Rdst, Rtmp); // Exchanged value from memory is return value. + + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp$$Register /* tmp2 */); + __ block_comment("} g1GetAndSetP"); + %} + ins_pipe(pipe_class_dummy); +%} + +instruct g1EncodePAndStoreN(indirect mem, iRegP src, iRegL tmp1, iRegL tmp2, flagsReg cr) +%{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem (EncodeP src))); + effect(TEMP tmp1, TEMP tmp2, KILL cr); + // ins_cost(INSN_COST); + format %{ "encode_heap_oop $tmp1, $src\n\t" + "st $tmp1, $mem\t# compressed ptr" %} + ins_encode %{ + __ block_comment("g1EncodePAndStoreN {"); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp1 */, + RegSet::of($mem$$Register, $src$$Register) /* preserve */); + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ oop_encoder($tmp1$$Register, $src$$Register, true /* maybe_null */); + } else { + __ oop_encoder($tmp1$$Register, $src$$Register, false /* maybe_null */); + } + __ z_st($tmp1$$Register, Address($mem$$Register)); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp1$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + __ block_comment("} g1EncodePAndStoreN"); + %} + ins_pipe(pipe_class_dummy); +%} diff --git a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp index 28892da6ca4c1..d826b4a06f336 100644 --- a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp @@ -33,6 +33,9 @@ #include "runtime/jniHandles.hpp" #include "runtime/stubRoutines.hpp" #include "utilities/macros.hpp" +#ifdef COMPILER2 +#include "gc/shared/c2/barrierSetC2.hpp" +#endif // COMPILER2 #define __ masm-> @@ -194,8 +197,93 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) { #ifdef COMPILER2 -OptoReg::Name BarrierSetAssembler::refine_register(const Node* node, OptoReg::Name opto_reg) { - Unimplemented(); // This must be implemented to support late barrier expansion. +OptoReg::Name BarrierSetAssembler::refine_register(const Node* node, OptoReg::Name opto_reg) const { + if (!OptoReg::is_reg(opto_reg)) { + return OptoReg::Bad; + } + + VMReg vm_reg = OptoReg::as_VMReg(opto_reg); + if ((vm_reg->is_Register() || vm_reg ->is_FloatRegister()) && (opto_reg & 1) != 0) { + return OptoReg::Bad; + } + + return opto_reg; +} + +#undef __ +#define __ _masm-> + +SaveLiveRegisters::SaveLiveRegisters(MacroAssembler *masm, BarrierStubC2 *stub) + : _masm(masm), _reg_mask(stub->preserve_set()) { + + const int register_save_size = iterate_over_register_mask(ACTION_COUNT_ONLY) * BytesPerWord; + + _frame_size = align_up(register_save_size, frame::alignment_in_bytes) + frame::z_abi_160_size; // FIXME: this could be restricted to argument only + + __ save_return_pc(); + __ push_frame(_frame_size, Z_R14); // FIXME: check if Z_R1_scaratch can do a job here; + + __ z_lg(Z_R14, _z_common_abi(return_pc) + _frame_size, Z_SP); + + iterate_over_register_mask(ACTION_SAVE, _frame_size); +} + +SaveLiveRegisters::~SaveLiveRegisters() { + iterate_over_register_mask(ACTION_RESTORE, _frame_size); + + __ pop_frame(); + + __ restore_return_pc(); +} + +int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int offset) { + int reg_save_index = 0; + RegMaskIterator live_regs_iterator(_reg_mask); + + while(live_regs_iterator.has_next()) { + const OptoReg::Name opto_reg = live_regs_iterator.next(); + + // Filter out stack slots (spilled registers, i.e., stack-allocated registers). + if (!OptoReg::is_reg(opto_reg)) { + continue; + } + + const VMReg vm_reg = OptoReg::as_VMReg(opto_reg); + if (vm_reg->is_Register()) { + Register std_reg = vm_reg->as_Register(); + + if (std_reg->encoding() >= Z_R2->encoding() && std_reg->encoding() <= Z_R15->encoding()) { + reg_save_index++; + + if (action == ACTION_SAVE) { + __ z_stg(std_reg, offset - reg_save_index * BytesPerWord, Z_SP); + } else if (action == ACTION_RESTORE) { + __ z_lg(std_reg, offset - reg_save_index * BytesPerWord, Z_SP); + } else { + assert(action == ACTION_COUNT_ONLY, "Sanity"); + } + } + } else if (vm_reg->is_FloatRegister()) { + FloatRegister fp_reg = vm_reg->as_FloatRegister(); + if (fp_reg->encoding() >= Z_F0->encoding() && fp_reg->encoding() <= Z_F15->encoding() + && fp_reg->encoding() != Z_F1->encoding()) { + reg_save_index++; + + if (action == ACTION_SAVE) { + __ z_std(fp_reg, offset - reg_save_index * BytesPerWord, Z_SP); + } else if (action == ACTION_RESTORE) { + __ z_ld(fp_reg, offset - reg_save_index * BytesPerWord, Z_SP); + } else { + assert(action == ACTION_COUNT_ONLY, "Sanity"); + } + } + } else if (false /* vm_reg->is_VectorRegister() */){ + fatal("Vector register support is not there yet!"); + } else { + fatal("Register type is not known"); + } + } + return reg_save_index; } #endif // COMPILER2 diff --git a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp index de1de8a51a7f1..fb61adc55b500 100644 --- a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp @@ -32,7 +32,9 @@ #ifdef COMPILER2 #include "code/vmreg.hpp" #include "opto/optoreg.hpp" +#include "opto/regmask.hpp" +class BarrierStubC2; class Node; #endif // COMPILER2 @@ -62,8 +64,42 @@ class BarrierSetAssembler: public CHeapObj { #ifdef COMPILER2 OptoReg::Name refine_register(const Node* node, - OptoReg::Name opto_reg); + OptoReg::Name opto_reg) const; #endif // COMPILER2 }; +#ifdef COMPILER2 + +// This class saves and restores the registers that need to be preserved across +// the runtime call represented by a given C2 barrier stub. Use as follows: +// { +// SaveLiveRegisters save(masm, stub); +// .. +// __ call_VM_leaf(...); +// .. +// } + +class SaveLiveRegisters { + MacroAssembler* _masm; + RegMask _reg_mask; + Register _result_reg; + int _frame_size; + + public: + SaveLiveRegisters(MacroAssembler *masm, BarrierStubC2 *stub); + + ~SaveLiveRegisters(); + + private: + enum IterationAction : int { + ACTION_SAVE, + ACTION_RESTORE, + ACTION_COUNT_ONLY + }; + + int iterate_over_register_mask(IterationAction action, int offset = 0); +}; + +#endif // COMPILER2 + #endif // CPU_S390_GC_SHARED_BARRIERSETASSEMBLER_S390_HPP diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.cpp b/src/hotspot/cpu/s390/macroAssembler_s390.cpp index af281345b1477..e192bbab0deb8 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp @@ -2127,8 +2127,9 @@ unsigned int MacroAssembler::push_frame_abi160(unsigned int bytes) { // Pop current C frame. void MacroAssembler::pop_frame() { - BLOCK_COMMENT("pop_frame:"); + BLOCK_COMMENT("pop_frame {"); Assembler::z_lg(Z_SP, _z_abi(callers_sp), Z_SP); + BLOCK_COMMENT("} pop_frame"); } // Pop current C frame and restore return PC register (Z_R14). diff --git a/src/hotspot/cpu/s390/register_s390.hpp b/src/hotspot/cpu/s390/register_s390.hpp index 931e899257e92..18af232e56970 100644 --- a/src/hotspot/cpu/s390/register_s390.hpp +++ b/src/hotspot/cpu/s390/register_s390.hpp @@ -448,4 +448,12 @@ constexpr Register Z_R0_scratch = Z_R0; constexpr Register Z_R1_scratch = Z_R1; constexpr FloatRegister Z_fscratch_1 = Z_F1; +typedef AbstractRegSet RegSet; + +template <> +inline Register AbstractRegSet::first() { + if (_bitset == 0) { return noreg; } + return as_Register(count_trailing_zeros(_bitset)); +} + #endif // CPU_S390_REGISTER_S390_HPP diff --git a/src/hotspot/cpu/s390/s390.ad b/src/hotspot/cpu/s390/s390.ad index 1bc9484215005..8181e96ecfc55 100644 --- a/src/hotspot/cpu/s390/s390.ad +++ b/src/hotspot/cpu/s390/s390.ad @@ -1644,6 +1644,10 @@ const RegMask Matcher::method_handle_invoke_SP_save_mask() { // Should the matcher clone input 'm' of node 'n'? bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) { + if (is_encode_and_store_pattern(n, m)) { + mstack.push(m, Visit); + return true; + } return false; } @@ -3913,6 +3917,7 @@ instruct loadL_unaligned(iRegL dst, memory mem) %{ // Load Pointer instruct loadP(iRegP dst, memory mem) %{ match(Set dst (LoadP mem)); + predicate(n->as_Load()->barrier_data() == 0); ins_cost(MEMORY_REF_COST); size(Z_DISP3_SIZE); format %{ "LG $dst,$mem\t # ptr" %} @@ -3924,6 +3929,7 @@ instruct loadP(iRegP dst, memory mem) %{ // LoadP + CastP2L instruct castP2X_loadP(iRegL dst, memory mem) %{ match(Set dst (CastP2X (LoadP mem))); + predicate(n->as_Load()->barrier_data() == 0); ins_cost(MEMORY_REF_COST); size(Z_DISP3_SIZE); format %{ "LG $dst,$mem\t # ptr + p2x" %} @@ -4286,6 +4292,7 @@ instruct storeL(memory mem, iRegL src) %{ // Store Pointer instruct storeP(memory dst, memoryRegP src) %{ match(Set dst (StoreP dst src)); + predicate(n->as_Store()->barrier_data() == 0); ins_cost(MEMORY_REF_COST); size(Z_DISP3_SIZE); format %{ "STG $src,$dst\t # ptr" %} @@ -4388,6 +4395,7 @@ instruct memInitL(memoryRS mem, immL16 src) %{ // Move Immediate to 8-byte memory. instruct memInitP(memoryRS mem, immP16 src) %{ match(Set mem (StoreP mem src)); + predicate(n->as_Store()->barrier_data() == 0); ins_cost(MEMORY_REF_COST); size(6); format %{ "MVGHI $mem,$src\t # direct mem init 8" %} @@ -4417,6 +4425,7 @@ instruct negL_reg_reg(iRegL dst, immL_0 zero, iRegL src, flagsReg cr) %{ // Load narrow oop instruct loadN(iRegN dst, memory mem) %{ match(Set dst (LoadN mem)); + predicate(n->as_Load()->barrier_data() == 0); ins_cost(MEMORY_REF_COST); size(Z_DISP3_SIZE); format %{ "LoadN $dst,$mem\t # (cOop)" %} @@ -4480,7 +4489,7 @@ instruct loadConNKlass(iRegN dst, immNKlass src) %{ instruct decodeLoadN(iRegP dst, memory mem) %{ match(Set dst (DecodeN (LoadN mem))); - predicate(false && (CompressedOops::base()==nullptr)&&(CompressedOops::shift()==0)); + predicate(false && (CompressedOops::base()==nullptr) && (CompressedOops::shift()==0)); ins_cost(MEMORY_REF_COST); size(Z_DISP3_SIZE); format %{ "DecodeLoadN $dst,$mem\t # (cOop Load+Decode)" %} @@ -4735,6 +4744,7 @@ instruct encodeP_NN_Ex(iRegN dst, iRegP src, flagsReg cr) %{ // Store Compressed Pointer instruct storeN(memory mem, iRegN_P2N src) %{ match(Set mem (StoreN mem src)); + predicate(n->as_Store()->barrier_data() == 0); ins_cost(MEMORY_REF_COST); size(Z_DISP_SIZE); format %{ "ST $src,$mem\t # (cOop)" %} @@ -5146,6 +5156,7 @@ instruct compareAndSwapL_bool(iRegP mem_ptr, rarg5RegL oldval, iRegL newval, iRe instruct compareAndSwapP_bool(iRegP mem_ptr, rarg5RegP oldval, iRegP_N2P newval, iRegI res, flagsReg cr) %{ match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval))); + predicate(n->as_LoadStore()->barrier_data() == 0); effect(USE mem_ptr, USE_KILL oldval, KILL cr); size(18); format %{ "$res = CompareAndSwapP $oldval,$newval,$mem_ptr" %} @@ -5156,6 +5167,7 @@ instruct compareAndSwapP_bool(iRegP mem_ptr, rarg5RegP oldval, iRegP_N2P newval, instruct compareAndSwapN_bool(iRegP mem_ptr, rarg5RegN oldval, iRegN_P2N newval, iRegI res, flagsReg cr) %{ match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval))); + predicate(n->as_LoadStore()->barrier_data() == 0); effect(USE mem_ptr, USE_KILL oldval, KILL cr); size(16); format %{ "$res = CompareAndSwapN $oldval,$newval,$mem_ptr" %} @@ -5443,6 +5455,7 @@ instruct xchgL_reg_mem(memoryRSY mem, iRegL dst, iRegL tmp, flagsReg cr) %{ %} instruct xchgN_reg_mem(memoryRSY mem, iRegN dst, iRegI tmp, flagsReg cr) %{ + predicate(n->as_LoadStore()->barrier_data() == 0); match(Set dst (GetAndSetN mem dst)); effect(KILL cr, TEMP tmp); // USE_DEF dst by match rule. format %{ "XCHGN $dst,[$mem]\t # EXCHANGE (coop, atomic), temp $tmp" %} @@ -5452,6 +5465,7 @@ instruct xchgN_reg_mem(memoryRSY mem, iRegN dst, iRegI tmp, flagsReg cr) %{ instruct xchgP_reg_mem(memoryRSY mem, iRegP dst, iRegL tmp, flagsReg cr) %{ match(Set dst (GetAndSetP mem dst)); + predicate(n->as_LoadStore()->barrier_data() == 0); effect(KILL cr, TEMP tmp); // USE_DEF dst by match rule. format %{ "XCHGP $dst,[$mem]\t # EXCHANGE (oop, atomic), temp $tmp" %} ins_encode(z_enc_SwapL(mem, dst, tmp)); @@ -5926,7 +5940,7 @@ instruct addP_regN_reg_imm20(iRegP dst, iRegP_N2P src1, iRegL src2, immL20 con) instruct addP_mem_imm(memoryRSY mem, immL8 src, flagsReg cr) %{ match(Set mem (StoreP mem (AddP (LoadP mem) src))); effect(KILL cr); - predicate(VM_Version::has_MemWithImmALUOps()); + predicate(VM_Version::has_MemWithImmALUOps() && n->as_LoadStore()->barrier_data() == 0); ins_cost(MEMORY_REF_COST); size(6); format %{ "AGSI $mem,$src\t # direct mem add 8 (ptr)" %} diff --git a/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp index b52be627776b8..b6be4012519a0 100644 --- a/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp @@ -38,7 +38,10 @@ #include "c1/c1_LIRAssembler.hpp" #include "c1/c1_MacroAssembler.hpp" #include "gc/g1/c1/g1BarrierSetC1.hpp" -#endif +#endif // COMPILER1 +#ifdef COMPILER2 +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#endif // COMPILER2 #define __ masm-> @@ -160,6 +163,56 @@ void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorator } } +static void generate_queue_insertion(MacroAssembler* masm, ByteSize index_offset, ByteSize buffer_offset, Label& runtime, + const Register thread, const Register value, const Register temp) { + // This code assumes that buffer index is pointer sized. + STATIC_ASSERT(in_bytes(SATBMarkQueue::byte_width_of_index()) == sizeof(intptr_t)); + // Can we store a value in the given thread's buffer? + // (The index field is typed as size_t.) + __ movptr(temp, Address(thread, in_bytes(index_offset))); // temp := *(index address) + __ testptr(temp, temp); // index == 0? + __ jcc(Assembler::zero, runtime); // jump to runtime if index == 0 (full buffer) + // The buffer is not full, store value into it. + __ subptr(temp, wordSize); // temp := next index + __ movptr(Address(thread, in_bytes(index_offset)), temp); // *(index address) := next index + __ addptr(temp, Address(thread, in_bytes(buffer_offset))); // temp := buffer address + next index + __ movptr(Address(temp, 0), value); // *(buffer address + next index) := value +} + +static void generate_pre_barrier_fast_path(MacroAssembler* masm, + const Register thread) { + Address in_progress(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset())); + // Is marking active? + if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { + __ cmpl(in_progress, 0); + } else { + assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); + __ cmpb(in_progress, 0); + } +} + +static void generate_pre_barrier_slow_path(MacroAssembler* masm, + const Register obj, + const Register pre_val, + const Register thread, + const Register tmp, + Label& done, + Label& runtime) { + // Do we need to load the previous value? + if (obj != noreg) { + __ load_heap_oop(pre_val, Address(obj, 0), noreg, noreg, AS_RAW); + } + // Is the previous value null? + __ cmpptr(pre_val, NULL_WORD); + __ jcc(Assembler::equal, done); + generate_queue_insertion(masm, + G1ThreadLocalData::satb_mark_queue_index_offset(), + G1ThreadLocalData::satb_mark_queue_buffer_offset(), + runtime, + thread, pre_val, tmp); + __ jmp(done); +} + void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Register obj, Register pre_val, @@ -185,43 +238,10 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, assert(pre_val != rax, "check this code"); } - Address in_progress(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset())); - Address index(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset())); - Address buffer(thread, in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset())); - - // Is marking active? - if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { - __ cmpl(in_progress, 0); - } else { - assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption"); - __ cmpb(in_progress, 0); - } - __ jcc(Assembler::equal, done); - - // Do we need to load the previous value? - if (obj != noreg) { - __ load_heap_oop(pre_val, Address(obj, 0), noreg, noreg, AS_RAW); - } - - // Is the previous value null? - __ cmpptr(pre_val, NULL_WORD); + generate_pre_barrier_fast_path(masm, thread); + // If marking is not active (*(mark queue active address) == 0), jump to done __ jcc(Assembler::equal, done); - - // Can we store original value in the thread's buffer? - // Is index == 0? - // (The index field is typed as size_t.) - - __ movptr(tmp, index); // tmp := *index_adr - __ cmpptr(tmp, 0); // tmp == 0? - __ jcc(Assembler::equal, runtime); // If yes, goto runtime - - __ subptr(tmp, wordSize); // tmp := tmp - wordSize - __ movptr(index, tmp); // *index_adr := tmp - __ addptr(tmp, buffer); // tmp := tmp + *buffer_adr - - // Record the previous value - __ movptr(Address(tmp, 0), pre_val); - __ jmp(done); + generate_pre_barrier_slow_path(masm, obj, pre_val, thread, tmp, done, runtime); __ bind(runtime); @@ -263,6 +283,54 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, __ bind(done); } +static void generate_post_barrier_fast_path(MacroAssembler* masm, + const Register store_addr, + const Register new_val, + const Register tmp, + const Register tmp2, + Label& done, + bool new_val_may_be_null) { + CardTableBarrierSet* ct = barrier_set_cast(BarrierSet::barrier_set()); + // Does store cross heap regions? + __ movptr(tmp, store_addr); // tmp := store address + __ xorptr(tmp, new_val); // tmp := store address ^ new value + __ shrptr(tmp, G1HeapRegion::LogOfHRGrainBytes); // ((store address ^ new value) >> LogOfHRGrainBytes) == 0? + __ jcc(Assembler::equal, done); + // Crosses regions, storing null? + if (new_val_may_be_null) { + __ cmpptr(new_val, NULL_WORD); // new value == null? + __ jcc(Assembler::equal, done); + } + // Storing region crossing non-null, is card young? + __ movptr(tmp, store_addr); // tmp := store address + __ shrptr(tmp, CardTable::card_shift()); // tmp := card address relative to card table base + // Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT + // a valid address and therefore is not properly handled by the relocation code. + __ movptr(tmp2, (intptr_t)ct->card_table()->byte_map_base()); // tmp2 := card table base address + __ addptr(tmp, tmp2); // tmp := card address + __ cmpb(Address(tmp, 0), G1CardTable::g1_young_card_val()); // *(card address) == young_card_val? +} + +static void generate_post_barrier_slow_path(MacroAssembler* masm, + const Register thread, + const Register tmp, + const Register tmp2, + Label& done, + Label& runtime) { + __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad)); // StoreLoad membar + __ cmpb(Address(tmp, 0), G1CardTable::dirty_card_val()); // *(card address) == dirty_card_val? + __ jcc(Assembler::equal, done); + // Storing a region crossing, non-null oop, card is clean. + // Dirty card and log. + __ movb(Address(tmp, 0), G1CardTable::dirty_card_val()); // *(card address) := dirty_card_val + generate_queue_insertion(masm, + G1ThreadLocalData::dirty_card_queue_index_offset(), + G1ThreadLocalData::dirty_card_queue_buffer_offset(), + runtime, + thread, tmp, tmp2); + __ jmp(done); +} + void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Register store_addr, Register new_val, @@ -273,74 +341,125 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, assert(thread == r15_thread, "must be"); #endif // _LP64 - Address queue_index(thread, in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset())); - Address buffer(thread, in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset())); - - CardTableBarrierSet* ct = - barrier_set_cast(BarrierSet::barrier_set()); - Label done; Label runtime; - // Does store cross heap regions? - - __ movptr(tmp, store_addr); - __ xorptr(tmp, new_val); - __ shrptr(tmp, G1HeapRegion::LogOfHRGrainBytes); + generate_post_barrier_fast_path(masm, store_addr, new_val, tmp, tmp2, done, true /* new_val_may_be_null */); + // If card is young, jump to done __ jcc(Assembler::equal, done); + generate_post_barrier_slow_path(masm, thread, tmp, tmp2, done, runtime); - // crosses regions, storing null? + __ bind(runtime); + // save the live input values + RegSet saved = RegSet::of(store_addr NOT_LP64(COMMA thread)); + __ push_set(saved); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), tmp, thread); + __ pop_set(saved); - __ cmpptr(new_val, NULL_WORD); - __ jcc(Assembler::equal, done); + __ bind(done); +} - // storing region crossing non-null, is card already dirty? +#if defined(COMPILER2) - const Register card_addr = tmp; - const Register cardtable = tmp2; +static void generate_c2_barrier_runtime_call(MacroAssembler* masm, G1BarrierStubC2* stub, const Register arg, const address runtime_path) { +#ifdef _LP64 + SaveLiveRegisters save_registers(masm, stub); + if (c_rarg0 != arg) { + __ mov(c_rarg0, arg); + } + __ mov(c_rarg1, r15_thread); + // rax is a caller-saved, non-argument-passing register, so it does not + // interfere with c_rarg0 or c_rarg1. If it contained any live value before + // entering this stub, it is saved at this point, and restored after the + // call. If it did not contain any live value, it is free to be used. In + // either case, it is safe to use it here as a call scratch register. + __ call(RuntimeAddress(runtime_path), rax); +#else + Unimplemented(); +#endif // _LP64 +} - __ movptr(card_addr, store_addr); - __ shrptr(card_addr, CardTable::card_shift()); - // Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT - // a valid address and therefore is not properly handled by the relocation code. - __ movptr(cardtable, (intptr_t)ct->card_table()->byte_map_base()); - __ addptr(card_addr, cardtable); +void G1BarrierSetAssembler::g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register thread, + Register tmp, + G1PreBarrierStubC2* stub) { +#ifdef _LP64 + assert(thread == r15_thread, "must be"); +#endif // _LP64 + assert(pre_val != noreg, "check this code"); + if (obj != noreg) { + assert_different_registers(obj, pre_val, tmp); + } - __ cmpb(Address(card_addr, 0), G1CardTable::g1_young_card_val()); - __ jcc(Assembler::equal, done); + stub->initialize_registers(obj, pre_val, thread, tmp); - __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad)); - __ cmpb(Address(card_addr, 0), G1CardTable::dirty_card_val()); - __ jcc(Assembler::equal, done); + generate_pre_barrier_fast_path(masm, thread); + // If marking is active (*(mark queue active address) != 0), jump to stub (slow path) + __ jcc(Assembler::notEqual, *stub->entry()); + __ bind(*stub->continuation()); +} - // storing a region crossing, non-null oop, card is clean. - // dirty card and log. +void G1BarrierSetAssembler::generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const { + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + Label runtime; + Register obj = stub->obj(); + Register pre_val = stub->pre_val(); + Register thread = stub->thread(); + Register tmp = stub->tmp1(); + assert(stub->tmp2() == noreg, "not needed in this platform"); - __ movb(Address(card_addr, 0), G1CardTable::dirty_card_val()); + __ bind(*stub->entry()); + generate_pre_barrier_slow_path(masm, obj, pre_val, thread, tmp, *stub->continuation(), runtime); - // The code below assumes that buffer index is pointer sized. - STATIC_ASSERT(in_bytes(G1DirtyCardQueue::byte_width_of_index()) == sizeof(intptr_t)); + __ bind(runtime); + generate_c2_barrier_runtime_call(masm, stub, pre_val, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry)); + __ jmp(*stub->continuation()); +} - __ movptr(tmp2, queue_index); - __ testptr(tmp2, tmp2); - __ jcc(Assembler::zero, runtime); - __ subptr(tmp2, wordSize); - __ movptr(queue_index, tmp2); - __ addptr(tmp2, buffer); - __ movptr(Address(tmp2, 0), card_addr); - __ jmp(done); +void G1BarrierSetAssembler::g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register thread, + Register tmp, + Register tmp2, + G1PostBarrierStubC2* stub) { +#ifdef _LP64 + assert(thread == r15_thread, "must be"); +#endif // _LP64 - __ bind(runtime); - // save the live input values - RegSet saved = RegSet::of(store_addr NOT_LP64(COMMA thread)); - __ push_set(saved); - __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), card_addr, thread); - __ pop_set(saved); + stub->initialize_registers(thread, tmp, tmp2); - __ bind(done); + bool new_val_may_be_null = (stub->barrier_data() & G1C2BarrierPostNotNull) == 0; + generate_post_barrier_fast_path(masm, store_addr, new_val, tmp, tmp2, *stub->continuation(), new_val_may_be_null); + // If card is not young, jump to stub (slow path) + __ jcc(Assembler::notEqual, *stub->entry()); + + __ bind(*stub->continuation()); +} + +void G1BarrierSetAssembler::generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const { + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + Label runtime; + Register thread = stub->thread(); + Register tmp = stub->tmp1(); // tmp holds the card address. + Register tmp2 = stub->tmp2(); + assert(stub->tmp3() == noreg, "not needed in this platform"); + + __ bind(*stub->entry()); + generate_post_barrier_slow_path(masm, thread, tmp, tmp2, *stub->continuation(), runtime); + + __ bind(runtime); + generate_c2_barrier_runtime_call(masm, stub, tmp, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry)); + __ jmp(*stub->continuation()); } +#endif // COMPILER2 + void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Address dst, Register val, Register tmp1, Register tmp2, Register tmp3) { bool in_heap = (decorators & IN_HEAP) != 0; diff --git a/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.hpp b/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.hpp index a5695f5657a4a..4dbb1efd885ea 100644 --- a/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.hpp @@ -32,6 +32,9 @@ class LIR_Assembler; class StubAssembler; class G1PreBarrierStub; class G1PostBarrierStub; +class G1BarrierStubC2; +class G1PreBarrierStubC2; +class G1PostBarrierStubC2; class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { protected: @@ -65,6 +68,26 @@ class G1BarrierSetAssembler: public ModRefBarrierSetAssembler { virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register dst, Address src, Register tmp1, Register tmp_thread); + +#ifdef COMPILER2 + void g1_write_barrier_pre_c2(MacroAssembler* masm, + Register obj, + Register pre_val, + Register thread, + Register tmp, + G1PreBarrierStubC2* c2_stub); + void generate_c2_pre_barrier_stub(MacroAssembler* masm, + G1PreBarrierStubC2* stub) const; + void g1_write_barrier_post_c2(MacroAssembler* masm, + Register store_addr, + Register new_val, + Register thread, + Register tmp, + Register tmp2, + G1PostBarrierStubC2* c2_stub); + void generate_c2_post_barrier_stub(MacroAssembler* masm, + G1PostBarrierStubC2* stub) const; +#endif // COMPILER2 }; #endif // CPU_X86_GC_G1_G1BARRIERSETASSEMBLER_X86_HPP diff --git a/src/hotspot/cpu/x86/gc/g1/g1_x86_64.ad b/src/hotspot/cpu/x86/gc/g1/g1_x86_64.ad new file mode 100644 index 0000000000000..8c1559f90f46d --- /dev/null +++ b/src/hotspot/cpu/x86/gc/g1/g1_x86_64.ad @@ -0,0 +1,371 @@ +// +// 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. +// + +source_hpp %{ + +#include "gc/g1/c2/g1BarrierSetC2.hpp" +#include "gc/shared/gc_globals.hpp" + +%} + +source %{ + +#include "gc/g1/g1BarrierSetAssembler_x86.hpp" +#include "gc/g1/g1BarrierSetRuntime.hpp" + +static void write_barrier_pre(MacroAssembler* masm, + const MachNode* node, + Register obj, + Register pre_val, + Register tmp, + RegSet preserve = RegSet(), + RegSet no_preserve = RegSet()) { + if (!G1PreBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PreBarrierStubC2* const stub = G1PreBarrierStubC2::create(node); + for (RegSetIterator reg = preserve.begin(); *reg != noreg; ++reg) { + stub->preserve(*reg); + } + for (RegSetIterator reg = no_preserve.begin(); *reg != noreg; ++reg) { + stub->dont_preserve(*reg); + } + g1_asm->g1_write_barrier_pre_c2(masm, obj, pre_val, r15_thread, tmp, stub); +} + +static void write_barrier_post(MacroAssembler* masm, + const MachNode* node, + Register store_addr, + Register new_val, + Register tmp1, + Register tmp2) { + if (!G1PostBarrierStubC2::needs_barrier(node)) { + return; + } + Assembler::InlineSkippedInstructionsCounter skip_counter(masm); + G1BarrierSetAssembler* g1_asm = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + G1PostBarrierStubC2* const stub = G1PostBarrierStubC2::create(node); + g1_asm->g1_write_barrier_post_c2(masm, store_addr, new_val, r15_thread, tmp1, tmp2, stub); +} + +%} + +instruct g1StoreP(memory mem, any_RegP src, rRegP tmp1, rRegP tmp2, rRegP tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreP mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(125); // XXX + format %{ "movq $mem, $src\t# ptr" %} + ins_encode %{ + // Materialize the store address internally (as opposed to defining 'mem' as + // an indirect memory operand) to reduce the overhead of LCM when processing + // large basic blocks with many stores. Such basic blocks arise, for + // instance, from static initializations of large String arrays. + // The same holds for g1StoreN and g1EncodePAndStoreN. + __ lea($tmp1$$Register, $mem$$Address); + write_barrier_pre(masm, this, + $tmp1$$Register /* obj */, + $tmp2$$Register /* pre_val */, + $tmp3$$Register /* tmp */, + RegSet::of($tmp1$$Register, $src$$Register) /* preserve */); + __ movq(Address($tmp1$$Register, 0), $src$$Register); + write_barrier_post(masm, this, + $tmp1$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp3$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(ialu_mem_reg); +%} + +instruct g1StoreN(memory mem, rRegN src, rRegP tmp1, rRegP tmp2, rRegP tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem src)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(125); // XXX + format %{ "movl $mem, $src\t# ptr" %} + ins_encode %{ + __ lea($tmp1$$Register, $mem$$Address); + write_barrier_pre(masm, this, + $tmp1$$Register /* obj */, + $tmp2$$Register /* pre_val */, + $tmp3$$Register /* tmp */, + RegSet::of($tmp1$$Register, $src$$Register) /* preserve */); + __ movl(Address($tmp1$$Register, 0), $src$$Register); + if ((barrier_data() & G1C2BarrierPost) != 0) { + __ movl($tmp2$$Register, $src$$Register); + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ decode_heap_oop($tmp2$$Register); + } else { + __ decode_heap_oop_not_null($tmp2$$Register); + } + } + write_barrier_post(masm, this, + $tmp1$$Register /* store_addr */, + $tmp2$$Register /* new_val */, + $tmp3$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(ialu_mem_reg); +%} + +instruct g1EncodePAndStoreN(memory mem, any_RegP src, rRegP tmp1, rRegP tmp2, rRegP tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && n->as_Store()->barrier_data() != 0); + match(Set mem (StoreN mem (EncodeP src))); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + ins_cost(125); // XXX + format %{ "encode_heap_oop $src\n\t" + "movl $mem, $src\t# ptr" %} + ins_encode %{ + __ lea($tmp1$$Register, $mem$$Address); + write_barrier_pre(masm, this, + $tmp1$$Register /* obj */, + $tmp2$$Register /* pre_val */, + $tmp3$$Register /* tmp */, + RegSet::of($tmp1$$Register, $src$$Register) /* preserve */); + __ movq($tmp2$$Register, $src$$Register); + if ((barrier_data() & G1C2BarrierPostNotNull) == 0) { + __ encode_heap_oop($tmp2$$Register); + } else { + __ encode_heap_oop_not_null($tmp2$$Register); + } + __ movl(Address($tmp1$$Register, 0), $tmp2$$Register); + write_barrier_post(masm, this, + $tmp1$$Register /* store_addr */, + $src$$Register /* new_val */, + $tmp3$$Register /* tmp1 */, + $tmp2$$Register /* tmp2 */); + %} + ins_pipe(ialu_mem_reg); +%} + +instruct g1CompareAndExchangeP(indirect mem, rRegP newval, rRegP tmp1, rRegP tmp2, rRegP tmp3, rax_RegP oldval, rFlagsReg cr) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set oldval (CompareAndExchangeP mem (Binary oldval newval))); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + format %{ "lock\n\t" + "cmpxchgq $newval, $mem" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + // Pass $oldval to the pre-barrier (instead of loading from $mem), because + // $oldval is the only value that can be overwritten. + // The same holds for g1CompareAndSwapP. + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp3$$Register /* tmp */, + RegSet::of($mem$$Register, $newval$$Register, $oldval$$Register) /* preserve */); + __ movq($tmp1$$Register, $newval$$Register); + __ lock(); + __ cmpxchgq($tmp1$$Register, Address($mem$$Register, 0)); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_cmpxchg); +%} + +instruct g1CompareAndExchangeN(indirect mem, rRegN newval, rRegP tmp1, rRegP tmp2, rRegP tmp3, rax_RegN oldval, rFlagsReg cr) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set oldval (CompareAndExchangeN mem (Binary oldval newval))); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + format %{ "lock\n\t" + "cmpxchgq $newval, $mem" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp2$$Register /* pre_val */, + $tmp3$$Register /* tmp */, + RegSet::of($mem$$Register, $newval$$Register, $oldval$$Register) /* preserve */); + __ movl($tmp1$$Register, $newval$$Register); + __ lock(); + __ cmpxchgl($tmp1$$Register, Address($mem$$Register, 0)); + __ decode_heap_oop($tmp1$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_cmpxchg); +%} + +instruct g1CompareAndSwapP(rRegI res, indirect mem, rRegP newval, rRegP tmp1, rRegP tmp2, rRegP tmp3, rax_RegP oldval, rFlagsReg cr) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapP mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL oldval, KILL cr); + format %{ "lock\n\t" + "cmpxchgq $newval, $mem\n\t" + "sete $res\n\t" + "movzbl $res, $res" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $oldval$$Register /* pre_val */, + $tmp3$$Register /* tmp */, + RegSet::of($mem$$Register, $newval$$Register, $oldval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ movq($tmp1$$Register, $newval$$Register); + __ lock(); + __ cmpxchgq($tmp1$$Register, Address($mem$$Register, 0)); + __ setb(Assembler::equal, $res$$Register); + __ movzbl($res$$Register, $res$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_cmpxchg); +%} + +instruct g1CompareAndSwapN(rRegI res, indirect mem, rRegN newval, rRegP tmp1, rRegP tmp2, rRegP tmp3, rax_RegN oldval, rFlagsReg cr) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set res (CompareAndSwapN mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapN mem (Binary oldval newval))); + effect(TEMP res, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL oldval, KILL cr); + format %{ "lock\n\t" + "cmpxchgq $newval, $mem\n\t" + "sete $res\n\t" + "movzbl $res, $res" %} + ins_encode %{ + assert_different_registers($oldval$$Register, $mem$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp2$$Register /* pre_val */, + $tmp3$$Register /* tmp */, + RegSet::of($mem$$Register, $newval$$Register, $oldval$$Register) /* preserve */, + RegSet::of($res$$Register) /* no_preserve */); + __ movl($tmp1$$Register, $newval$$Register); + __ lock(); + __ cmpxchgl($tmp1$$Register, Address($mem$$Register, 0)); + __ setb(Assembler::equal, $res$$Register); + __ movzbl($res$$Register, $res$$Register); + __ decode_heap_oop($tmp1$$Register); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_cmpxchg); +%} + +instruct g1GetAndSetP(indirect mem, rRegP newval, rRegP tmp1, rRegP tmp2, rRegP tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set newval (GetAndSetP mem newval)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + format %{ "xchgq $newval, $mem" %} + ins_encode %{ + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp2$$Register /* pre_val */, + $tmp3$$Register /* tmp */, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */); + __ movq($tmp1$$Register, $newval$$Register); + __ xchgq($newval$$Register, Address($mem$$Register, 0)); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_cmpxchg); +%} + +instruct g1GetAndSetN(indirect mem, rRegN newval, rRegP tmp1, rRegP tmp2, rRegP tmp3, rFlagsReg cr) +%{ + predicate(UseG1GC && n->as_LoadStore()->barrier_data() != 0); + match(Set newval (GetAndSetN mem newval)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); + format %{ "xchgq $newval, $mem" %} + ins_encode %{ + assert_different_registers($mem$$Register, $newval$$Register); + write_barrier_pre(masm, this, + $mem$$Register /* obj */, + $tmp2$$Register /* pre_val */, + $tmp3$$Register /* tmp */, + RegSet::of($mem$$Register, $newval$$Register) /* preserve */); + __ movl($tmp1$$Register, $newval$$Register); + __ decode_heap_oop($tmp1$$Register); + __ xchgl($newval$$Register, Address($mem$$Register, 0)); + write_barrier_post(masm, this, + $mem$$Register /* store_addr */, + $tmp1$$Register /* new_val */, + $tmp2$$Register /* tmp1 */, + $tmp3$$Register /* tmp2 */); + %} + ins_pipe(pipe_cmpxchg); +%} + +instruct g1LoadP(rRegP dst, memory mem, rRegP tmp, rFlagsReg cr) +%{ + predicate(UseG1GC && n->as_Load()->barrier_data() != 0); + match(Set dst (LoadP mem)); + effect(TEMP dst, TEMP tmp, KILL cr); + ins_cost(125); // XXX + format %{ "movq $dst, $mem\t# ptr" %} + ins_encode %{ + __ movq($dst$$Register, $mem$$Address); + write_barrier_pre(masm, this, + noreg /* obj */, + $dst$$Register /* pre_val */, + $tmp$$Register /* tmp */); + %} + ins_pipe(ialu_reg_mem); // XXX +%} + +instruct g1LoadN(rRegN dst, memory mem, rRegP tmp1, rRegP tmp2, rFlagsReg cr) +%{ + predicate(UseG1GC && n->as_Load()->barrier_data() != 0); + match(Set dst (LoadN mem)); + effect(TEMP dst, TEMP tmp1, TEMP tmp2, KILL cr); + ins_cost(125); // XXX + format %{ "movl $dst, $mem\t# compressed ptr" %} + ins_encode %{ + __ movl($dst$$Register, $mem$$Address); + __ movl($tmp1$$Register, $dst$$Register); + __ decode_heap_oop($tmp1$$Register); + write_barrier_pre(masm, this, + noreg /* obj */, + $tmp1$$Register /* pre_val */, + $tmp2$$Register /* tmp */); + %} + ins_pipe(ialu_reg_mem); // XXX +%} diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index 2b29dd14e4b27..b55a1208cf2df 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -2457,6 +2457,10 @@ bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) { mstack.push(m, Visit); // m = ShiftCntV return true; } + if (is_encode_and_store_pattern(n, m)) { + mstack.push(m, Visit); + return true; + } return false; } diff --git a/src/hotspot/cpu/x86/x86_64.ad b/src/hotspot/cpu/x86/x86_64.ad index 1b271683bd60d..fee265473befe 100644 --- a/src/hotspot/cpu/x86/x86_64.ad +++ b/src/hotspot/cpu/x86/x86_64.ad @@ -4341,6 +4341,7 @@ instruct loadP(rRegP dst, memory mem) // Load Compressed Pointer instruct loadN(rRegN dst, memory mem) %{ + predicate(n->as_Load()->barrier_data() == 0); match(Set dst (LoadN mem)); ins_cost(125); // XXX @@ -5126,6 +5127,7 @@ instruct storeImmP(memory mem, immP31 src) // Store Compressed Pointer instruct storeN(memory mem, rRegN src) %{ + predicate(n->as_Store()->barrier_data() == 0); match(Set mem (StoreN mem src)); ins_cost(125); // XXX @@ -5150,7 +5152,7 @@ instruct storeNKlass(memory mem, rRegN src) instruct storeImmN0(memory mem, immN0 zero) %{ - predicate(CompressedOops::base() == nullptr); + predicate(CompressedOops::base() == nullptr && n->as_Store()->barrier_data() == 0); match(Set mem (StoreN mem zero)); ins_cost(125); // XXX @@ -5163,6 +5165,7 @@ instruct storeImmN0(memory mem, immN0 zero) instruct storeImmN(memory mem, immN src) %{ + predicate(n->as_Store()->barrier_data() == 0); match(Set mem (StoreN mem src)); ins_cost(150); // XXX @@ -7162,6 +7165,7 @@ instruct compareAndSwapN(rRegI res, memory mem_ptr, rax_RegN oldval, rRegN newval, rFlagsReg cr) %{ + predicate(n->as_LoadStore()->barrier_data() == 0); match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval))); match(Set res (WeakCompareAndSwapN mem_ptr (Binary oldval newval))); effect(KILL cr, KILL oldval); @@ -7249,6 +7253,7 @@ instruct compareAndExchangeN( memory mem_ptr, rax_RegN oldval, rRegN newval, rFlagsReg cr) %{ + predicate(n->as_LoadStore()->barrier_data() == 0); match(Set oldval (CompareAndExchangeN mem_ptr (Binary oldval newval))); effect(KILL cr); @@ -7470,6 +7475,7 @@ instruct xchgP( memory mem, rRegP newval) %{ %} instruct xchgN( memory mem, rRegN newval) %{ + predicate(n->as_LoadStore()->barrier_data() == 0); match(Set newval (GetAndSetN mem newval)); format %{ "XCHGL $newval,$mem]" %} ins_encode %{ @@ -11659,6 +11665,7 @@ instruct compN_rReg(rFlagsRegU cr, rRegN op1, rRegN op2) instruct compN_rReg_mem(rFlagsRegU cr, rRegN src, memory mem) %{ + predicate(n->in(2)->as_Load()->barrier_data() == 0); match(Set cr (CmpN src (LoadN mem))); format %{ "cmpl $src, $mem\t# compressed ptr" %} @@ -11680,6 +11687,7 @@ instruct compN_rReg_imm(rFlagsRegU cr, rRegN op1, immN op2) %{ instruct compN_mem_imm(rFlagsRegU cr, memory mem, immN src) %{ + predicate(n->in(2)->as_Load()->barrier_data() == 0); match(Set cr (CmpN src (LoadN mem))); format %{ "cmpl $mem, $src\t# compressed ptr" %} @@ -11720,7 +11728,8 @@ instruct testN_reg(rFlagsReg cr, rRegN src, immN0 zero) %{ instruct testN_mem(rFlagsReg cr, memory mem, immN0 zero) %{ - predicate(CompressedOops::base() != nullptr); + predicate(CompressedOops::base() != nullptr && + n->in(1)->as_Load()->barrier_data() == 0); match(Set cr (CmpN (LoadN mem) zero)); ins_cost(500); // XXX @@ -11733,7 +11742,8 @@ instruct testN_mem(rFlagsReg cr, memory mem, immN0 zero) instruct testN_mem_reg0(rFlagsReg cr, memory mem, immN0 zero) %{ - predicate(CompressedOops::base() == nullptr); + predicate(CompressedOops::base() == nullptr && + n->in(1)->as_Load()->barrier_data() == 0); match(Set cr (CmpN (LoadN mem) zero)); format %{ "cmpl R12, $mem\t# compressed ptr (R12_heapbase==0)" %} diff --git a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp index 13b993546cde4..8e17d1d2a7a4e 100644 --- a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp +++ b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp @@ -24,49 +24,32 @@ #include "precompiled.hpp" #include "classfile/javaClasses.hpp" +#include "code/vmreg.inline.hpp" #include "gc/g1/c2/g1BarrierSetC2.hpp" #include "gc/g1/g1BarrierSet.hpp" +#include "gc/g1/g1BarrierSetAssembler.hpp" #include "gc/g1/g1BarrierSetRuntime.hpp" #include "gc/g1/g1CardTable.hpp" #include "gc/g1/g1ThreadLocalData.hpp" #include "gc/g1/g1HeapRegion.hpp" #include "opto/arraycopynode.hpp" +#include "opto/block.hpp" #include "opto/compile.hpp" #include "opto/escape.hpp" #include "opto/graphKit.hpp" #include "opto/idealKit.hpp" +#include "opto/machnode.hpp" #include "opto/macro.hpp" +#include "opto/memnode.hpp" +#include "opto/node.hpp" +#include "opto/output.hpp" +#include "opto/regalloc.hpp" #include "opto/rootnode.hpp" +#include "opto/runtime.hpp" #include "opto/type.hpp" +#include "utilities/growableArray.hpp" #include "utilities/macros.hpp" -const TypeFunc *G1BarrierSetC2::write_ref_field_pre_entry_Type() { - const Type **fields = TypeTuple::fields(2); - fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // original field value - fields[TypeFunc::Parms+1] = TypeRawPtr::NOTNULL; // thread - const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields); - - // create result type (range) - fields = TypeTuple::fields(0); - const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields); - - return TypeFunc::make(domain, range); -} - -const TypeFunc *G1BarrierSetC2::write_ref_field_post_entry_Type() { - const Type **fields = TypeTuple::fields(2); - fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // Card addr - fields[TypeFunc::Parms+1] = TypeRawPtr::NOTNULL; // thread - const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields); - - // create result type (range) - fields = TypeTuple::fields(0); - const TypeTuple *range = TypeTuple::make(TypeFunc::Parms, fields); - - return TypeFunc::make(domain, range); -} - -#define __ ideal. /* * Determine if the G1 pre-barrier can be removed. The pre-barrier is * required by SATB to make sure all objects live at the start of the @@ -84,8 +67,6 @@ const TypeFunc *G1BarrierSetC2::write_ref_field_post_entry_Type() { * The compiler needs to determine that the object in which a field is about * to be written is newly allocated, and that no prior store to the same field * has happened since the allocation. - * - * Returns true if the pre-barrier can be removed */ bool G1BarrierSetC2::g1_can_remove_pre_barrier(GraphKit* kit, PhaseValues* phase, @@ -97,34 +78,28 @@ bool G1BarrierSetC2::g1_can_remove_pre_barrier(GraphKit* kit, AllocateNode* alloc = AllocateNode::Ideal_allocation(base); if (offset == Type::OffsetBot) { - return false; // cannot unalias unless there are precise offsets + return false; // Cannot unalias unless there are precise offsets. } - if (alloc == nullptr) { - return false; // No allocation found + return false; // No allocation found. } intptr_t size_in_bytes = type2aelembytes(bt); - - Node* mem = kit->memory(adr_idx); // start searching here... + Node* mem = kit->memory(adr_idx); // Start searching here. for (int cnt = 0; cnt < 50; cnt++) { - if (mem->is_Store()) { - Node* st_adr = mem->in(MemNode::Address); intptr_t st_offset = 0; Node* st_base = AddPNode::Ideal_base_and_offset(st_adr, phase, st_offset); if (st_base == nullptr) { - break; // inscrutable pointer + break; // Inscrutable pointer. } - - // Break we have found a store with same base and offset as ours so break if (st_base == base && st_offset == offset) { + // We have found a store with same base and offset as ours. break; } - if (st_offset != offset && st_offset != Type::OffsetBot) { const int MAX_STORE = BytesPerLong; if (st_offset >= offset + size_in_bytes || @@ -136,20 +111,18 @@ bool G1BarrierSetC2::g1_can_remove_pre_barrier(GraphKit* kit, // in the same sequence of RawMem effects. We sometimes initialize // a whole 'tile' of array elements with a single jint or jlong.) mem = mem->in(MemNode::Memory); - continue; // advance through independent store memory + continue; // Advance through independent store memory. } } - if (st_base != base && MemNode::detect_ptr_independence(base, alloc, st_base, AllocateNode::Ideal_allocation(st_base), phase)) { - // Success: The bases are provably independent. + // Success: the bases are provably independent. mem = mem->in(MemNode::Memory); - continue; // advance through independent store memory + continue; // Advance through independent store memory. } } else if (mem->is_Proj() && mem->in(0)->is_Initialize()) { - InitializeNode* st_init = mem->in(0)->as_Initialize(); AllocateNode* st_alloc = st_init->allocation(); @@ -157,7 +130,7 @@ bool G1BarrierSetC2::g1_can_remove_pre_barrier(GraphKit* kit, // The alloc variable is guaranteed to not be null here from earlier check. if (alloc == st_alloc) { // Check that the initialization is storing null so that no previous store - // has been moved up and directly write a reference + // has been moved up and directly write a reference. Node* captured_store = st_init->find_captured_store(offset, type2aelembytes(T_OBJECT), phase); @@ -166,164 +139,55 @@ bool G1BarrierSetC2::g1_can_remove_pre_barrier(GraphKit* kit, } } } - // Unless there is an explicit 'continue', we must bail out here, // because 'mem' is an inscrutable memory state (e.g., a call). break; } - return false; } -// G1 pre/post barriers -void G1BarrierSetC2::pre_barrier(GraphKit* kit, - bool do_load, - Node* ctl, - Node* obj, - Node* adr, - uint alias_idx, - Node* val, - const TypeOopPtr* val_type, - Node* pre_val, - BasicType bt) const { - // Some sanity checks - // Note: val is unused in this routine. - - if (do_load) { - // We need to generate the load of the previous value - assert(obj != nullptr, "must have a base"); - assert(adr != nullptr, "where are loading from?"); - assert(pre_val == nullptr, "loaded already?"); - assert(val_type != nullptr, "need a type"); - - if (use_ReduceInitialCardMarks() - && g1_can_remove_pre_barrier(kit, &kit->gvn(), adr, bt, alias_idx)) { - return; - } - - } else { - // In this case both val_type and alias_idx are unused. - assert(pre_val != nullptr, "must be loaded already"); - // Nothing to be done if pre_val is null. - if (pre_val->bottom_type() == TypePtr::NULL_PTR) return; - assert(pre_val->bottom_type()->basic_type() == T_OBJECT, "or we shouldn't be here"); - } - assert(bt == T_OBJECT, "or we shouldn't be here"); - - IdealKit ideal(kit, true); - - Node* tls = __ thread(); // ThreadLocalStorage - - Node* no_base = __ top(); - Node* zero = __ ConI(0); - Node* zeroX = __ ConX(0); - - float likely = PROB_LIKELY(0.999); - float unlikely = PROB_UNLIKELY(0.999); - - BasicType active_type = in_bytes(SATBMarkQueue::byte_width_of_active()) == 4 ? T_INT : T_BYTE; - assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 4 || in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "flag width"); - - // Offsets into the thread - const int marking_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()); - const int index_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset()); - const int buffer_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset()); - - // Now the actual pointers into the thread - Node* marking_adr = __ AddP(no_base, tls, __ ConX(marking_offset)); - Node* buffer_adr = __ AddP(no_base, tls, __ ConX(buffer_offset)); - Node* index_adr = __ AddP(no_base, tls, __ ConX(index_offset)); - - // Now some of the values - Node* marking = __ load(__ ctrl(), marking_adr, TypeInt::INT, active_type, Compile::AliasIdxRaw); - - // if (!marking) - __ if_then(marking, BoolTest::ne, zero, unlikely); { - BasicType index_bt = TypeX_X->basic_type(); - assert(sizeof(size_t) == type2aelembytes(index_bt), "Loading G1 SATBMarkQueue::_index with wrong size."); - Node* index = __ load(__ ctrl(), index_adr, TypeX_X, index_bt, Compile::AliasIdxRaw); - - if (do_load) { - // load original value - pre_val = __ load(__ ctrl(), adr, val_type, bt, alias_idx, false, MemNode::unordered, LoadNode::Pinned); - } - - // if (pre_val != nullptr) - __ if_then(pre_val, BoolTest::ne, kit->null()); { - Node* buffer = __ load(__ ctrl(), buffer_adr, TypeRawPtr::NOTNULL, T_ADDRESS, Compile::AliasIdxRaw); - - // is the queue for this thread full? - __ if_then(index, BoolTest::ne, zeroX, likely); { - - // decrement the index - Node* next_index = kit->gvn().transform(new SubXNode(index, __ ConX(sizeof(intptr_t)))); - - // Now get the buffer location we will log the previous value into and store it - Node *log_addr = __ AddP(no_base, buffer, next_index); - __ store(__ ctrl(), log_addr, pre_val, T_OBJECT, Compile::AliasIdxRaw, MemNode::unordered); - // update the index - __ store(__ ctrl(), index_adr, next_index, index_bt, Compile::AliasIdxRaw, MemNode::unordered); - - } __ else_(); { - - // logging buffer is full, call the runtime - const TypeFunc *tf = write_ref_field_pre_entry_Type(); - __ make_leaf_call(tf, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), "write_ref_field_pre_entry", pre_val, tls); - } __ end_if(); // (!index) - } __ end_if(); // (pre_val != nullptr) - } __ end_if(); // (!marking) - - // Final sync IdealKit and GraphKit. - kit->final_sync(ideal); -} - /* - * G1 similar to any GC with a Young Generation requires a way to keep track of - * references from Old Generation to Young Generation to make sure all live + * G1, similar to any GC with a Young Generation, requires a way to keep track + * of references from Old Generation to Young Generation to make sure all live * objects are found. G1 also requires to keep track of object references * between different regions to enable evacuation of old regions, which is done - * as part of mixed collections. References are tracked in remembered sets and - * is continuously updated as reference are written to with the help of the - * post-barrier. + * as part of mixed collections. References are tracked in remembered sets, + * which are continuously updated as references are written to with the help of + * the post-barrier. * - * To reduce the number of updates to the remembered set the post-barrier - * filters updates to fields in objects located in the Young Generation, - * the same region as the reference, when the null is being written or - * if the card is already marked as dirty by an earlier write. + * To reduce the number of updates to the remembered set, the post-barrier + * filters out updates to fields in objects located in the Young Generation, the + * same region as the reference, when null is being written, or if the card is + * already marked as dirty by an earlier write. * * Under certain circumstances it is possible to avoid generating the - * post-barrier completely if it is possible during compile time to prove - * the object is newly allocated and that no safepoint exists between the - * allocation and the store. - * - * In the case of slow allocation the allocation code must handle the barrier - * as part of the allocation in the case the allocated object is not located - * in the nursery; this would happen for humongous objects. + * post-barrier completely, if it is possible during compile time to prove the + * object is newly allocated and that no safepoint exists between the allocation + * and the store. This can be seen as a compile-time version of the + * above-mentioned Young Generation filter. * - * Returns true if the post barrier can be removed + * In the case of a slow allocation, the allocation code must handle the barrier + * as part of the allocation if the allocated object is not located in the + * nursery; this would happen for humongous objects. */ bool G1BarrierSetC2::g1_can_remove_post_barrier(GraphKit* kit, - PhaseValues* phase, Node* store, + PhaseValues* phase, Node* store_ctrl, Node* adr) const { intptr_t offset = 0; Node* base = AddPNode::Ideal_base_and_offset(adr, phase, offset); AllocateNode* alloc = AllocateNode::Ideal_allocation(base); if (offset == Type::OffsetBot) { - return false; // cannot unalias unless there are precise offsets + return false; // Cannot unalias unless there are precise offsets. } - if (alloc == nullptr) { - return false; // No allocation found + return false; // No allocation found. } - // Start search from Store node - Node* mem = store->in(MemNode::Control); + Node* mem = store_ctrl; // Start search from Store node. if (mem->is_Proj() && mem->in(0)->is_Initialize()) { - InitializeNode* st_init = mem->in(0)->as_Initialize(); AllocateNode* st_alloc = st_init->allocation(); - // Make sure we are looking at the same allocation if (alloc == st_alloc) { return true; @@ -333,725 +197,361 @@ bool G1BarrierSetC2::g1_can_remove_post_barrier(GraphKit* kit, return false; } -// -// Update the card table and add card address to the queue -// -void G1BarrierSetC2::g1_mark_card(GraphKit* kit, - IdealKit& ideal, - Node* card_adr, - Node* oop_store, - uint oop_alias_idx, - Node* index, - Node* index_adr, - Node* buffer, - const TypeFunc* tf) const { - Node* zero = __ ConI(0); - Node* zeroX = __ ConX(0); - Node* no_base = __ top(); - BasicType card_bt = T_BYTE; - // Smash zero into card. MUST BE ORDERED WRT TO STORE - __ storeCM(__ ctrl(), card_adr, zero, oop_store, oop_alias_idx, card_bt, Compile::AliasIdxRaw); - - // Now do the queue work - __ if_then(index, BoolTest::ne, zeroX); { - - Node* next_index = kit->gvn().transform(new SubXNode(index, __ ConX(sizeof(intptr_t)))); - Node* log_addr = __ AddP(no_base, buffer, next_index); - - // Order, see storeCM. - __ store(__ ctrl(), log_addr, card_adr, T_ADDRESS, Compile::AliasIdxRaw, MemNode::unordered); - __ store(__ ctrl(), index_adr, next_index, TypeX_X->basic_type(), Compile::AliasIdxRaw, MemNode::unordered); - - } __ else_(); { - __ make_leaf_call(tf, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), "write_ref_field_post_entry", card_adr, __ thread()); - } __ end_if(); - +Node* G1BarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) const { + DecoratorSet decorators = access.decorators(); + bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0; + bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0; + bool no_keepalive = (decorators & AS_NO_KEEPALIVE) != 0; + // If we are reading the value of the referent field of a Reference object, we + // need to record the referent in an SATB log buffer using the pre-barrier + // mechanism. Also we need to add a memory barrier to prevent commoning reads + // from this field across safepoints, since GC can change its value. + bool need_read_barrier = ((on_weak || on_phantom) && !no_keepalive); + if (access.is_oop() && need_read_barrier) { + access.set_barrier_data(G1C2BarrierPre); + } + return CardTableBarrierSetC2::load_at_resolved(access, val_type); } -void G1BarrierSetC2::post_barrier(GraphKit* kit, - Node* ctl, - Node* oop_store, - Node* obj, - Node* adr, - uint alias_idx, - Node* val, - BasicType bt, - bool use_precise) const { - // If we are writing a null then we need no post barrier +void G1BarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { + eliminate_gc_barrier_data(node); +} - if (val != nullptr && val->is_Con() && val->bottom_type() == TypePtr::NULL_PTR) { - // Must be null - const Type* t = val->bottom_type(); - assert(t == Type::TOP || t == TypePtr::NULL_PTR, "must be null"); - // No post barrier if writing null - return; +void G1BarrierSetC2::eliminate_gc_barrier_data(Node* node) const { + if (node->is_LoadStore()) { + LoadStoreNode* loadstore = node->as_LoadStore(); + loadstore->set_barrier_data(0); + } else if (node->is_Mem()) { + MemNode* mem = node->as_Mem(); + mem->set_barrier_data(0); } +} - if (use_ReduceInitialCardMarks() && obj == kit->just_allocated_object(kit->control())) { - // We can skip marks on a freshly-allocated object in Eden. - // Keep this code in sync with CardTableBarrierSet::on_slowpath_allocation_exit. - // That routine informs GC to take appropriate compensating steps, - // upon a slow-path allocation, so as to make this card-mark - // elision safe. +static void refine_barrier_by_new_val_type(const Node* n) { + if (n->Opcode() != Op_StoreP && + n->Opcode() != Op_StoreN) { return; } - - if (use_ReduceInitialCardMarks() - && g1_can_remove_post_barrier(kit, &kit->gvn(), oop_store, adr)) { + MemNode* store = n->as_Mem(); + const Node* newval = n->in(MemNode::ValueIn); + assert(newval != nullptr, ""); + const Type* newval_bottom = newval->bottom_type(); + TypePtr::PTR newval_type = newval_bottom->make_ptr()->ptr(); + uint8_t barrier_data = store->barrier_data(); + if (!newval_bottom->isa_oopptr() && + !newval_bottom->isa_narrowoop() && + newval_type != TypePtr::Null) { + // newval is neither an OOP nor null, so there is no barrier to refine. + assert(barrier_data == 0, "non-OOP stores should have no barrier data"); return; } - - if (!use_precise) { - // All card marks for a (non-array) instance are in one place: - adr = obj; + if (barrier_data == 0) { + // No barrier to refine. + return; } - // (Else it's an array (or unknown), and we want more precise card marks.) - assert(adr != nullptr, ""); - - IdealKit ideal(kit, true); - - Node* tls = __ thread(); // ThreadLocalStorage - - Node* no_base = __ top(); - float likely = PROB_LIKELY_MAG(3); - float unlikely = PROB_UNLIKELY_MAG(3); - Node* young_card = __ ConI((jint)G1CardTable::g1_young_card_val()); - Node* dirty_card = __ ConI((jint)G1CardTable::dirty_card_val()); - Node* zeroX = __ ConX(0); - - const TypeFunc *tf = write_ref_field_post_entry_Type(); - - // Offsets into the thread - const int index_offset = in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset()); - const int buffer_offset = in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset()); - - // Pointers into the thread - - Node* buffer_adr = __ AddP(no_base, tls, __ ConX(buffer_offset)); - Node* index_adr = __ AddP(no_base, tls, __ ConX(index_offset)); - - // Now some values - // Use ctrl to avoid hoisting these values past a safepoint, which could - // potentially reset these fields in the JavaThread. - Node* index = __ load(__ ctrl(), index_adr, TypeX_X, TypeX_X->basic_type(), Compile::AliasIdxRaw); - Node* buffer = __ load(__ ctrl(), buffer_adr, TypeRawPtr::NOTNULL, T_ADDRESS, Compile::AliasIdxRaw); - - // Convert the store obj pointer to an int prior to doing math on it - // Must use ctrl to prevent "integerized oop" existing across safepoint - Node* cast = __ CastPX(__ ctrl(), adr); - - // Divide pointer by card size - Node* card_offset = __ URShiftX( cast, __ ConI(CardTable::card_shift()) ); - - // Combine card table base and card offset - Node* card_adr = __ AddP(no_base, byte_map_base_node(kit), card_offset ); - - // If we know the value being stored does it cross regions? - - if (val != nullptr) { - // Does the store cause us to cross regions? - - // Should be able to do an unsigned compare of region_size instead of - // and extra shift. Do we have an unsigned compare?? - // Node* region_size = __ ConI(1 << G1HeapRegion::LogOfHRGrainBytes); - Node* xor_res = __ URShiftX ( __ XorX( cast, __ CastPX(__ ctrl(), val)), __ ConI(checked_cast(G1HeapRegion::LogOfHRGrainBytes))); - - // if (xor_res == 0) same region so skip - __ if_then(xor_res, BoolTest::ne, zeroX, likely); { - - // No barrier if we are storing a null. - __ if_then(val, BoolTest::ne, kit->null(), likely); { - - // Ok must mark the card if not already dirty - - // load the original value of the card - Node* card_val = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); - - __ if_then(card_val, BoolTest::ne, young_card, unlikely); { - kit->sync_kit(ideal); - kit->insert_mem_bar(Op_MemBarVolatile, oop_store); - __ sync_kit(kit); - - Node* card_val_reload = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); - __ if_then(card_val_reload, BoolTest::ne, dirty_card); { - g1_mark_card(kit, ideal, card_adr, oop_store, alias_idx, index, index_adr, buffer, tf); - } __ end_if(); - } __ end_if(); - } __ end_if(); - } __ end_if(); - } else { - // The Object.clone() intrinsic uses this path if !ReduceInitialCardMarks. - // We don't need a barrier here if the destination is a newly allocated object - // in Eden. Otherwise, GC verification breaks because we assume that cards in Eden - // are set to 'g1_young_gen' (see G1CardTable::verify_g1_young_region()). - assert(!use_ReduceInitialCardMarks(), "can only happen with card marking"); - Node* card_val = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); - __ if_then(card_val, BoolTest::ne, young_card); { - g1_mark_card(kit, ideal, card_adr, oop_store, alias_idx, index, index_adr, buffer, tf); - } __ end_if(); + if (newval_type == TypePtr::Null) { + // Simply elide post-barrier if writing null. + barrier_data &= ~G1C2BarrierPost; + barrier_data &= ~G1C2BarrierPostNotNull; + } else if (((barrier_data & G1C2BarrierPost) != 0) && + newval_type == TypePtr::NotNull) { + // If the post-barrier has not been elided yet (e.g. due to newval being + // freshly allocated), mark it as not-null (simplifies barrier tests and + // compressed OOPs logic). + barrier_data |= G1C2BarrierPostNotNull; } - - // Final sync IdealKit and GraphKit. - kit->final_sync(ideal); + store->set_barrier_data(barrier_data); + return; } -// Helper that guards and inserts a pre-barrier. -void G1BarrierSetC2::insert_pre_barrier(GraphKit* kit, Node* base_oop, Node* offset, - Node* pre_val, bool need_mem_bar) const { - // We could be accessing the referent field of a reference object. If so, when G1 - // is enabled, we need to log the value in the referent field in an SATB buffer. - // This routine performs some compile time filters and generates suitable - // runtime filters that guard the pre-barrier code. - // Also add memory barrier for non volatile load from the referent field - // to prevent commoning of loads across safepoint. - - // Some compile time checks. - - // If offset is a constant, is it java_lang_ref_Reference::_reference_offset? - const TypeX* otype = offset->find_intptr_t_type(); - if (otype != nullptr && otype->is_con() && - otype->get_con() != java_lang_ref_Reference::referent_offset()) { - // Constant offset but not the reference_offset so just return - return; - } - - // We only need to generate the runtime guards for instances. - const TypeOopPtr* btype = base_oop->bottom_type()->isa_oopptr(); - if (btype != nullptr) { - if (btype->isa_aryptr()) { - // Array type so nothing to do - return; +// Refine (not really expand) G1 barriers by looking at the new value type +// (whether it is necessarily null or necessarily non-null). +bool G1BarrierSetC2::expand_barriers(Compile* C, PhaseIterGVN& igvn) const { + ResourceMark rm; + VectorSet visited; + Node_List worklist; + worklist.push(C->root()); + while (worklist.size() > 0) { + Node* n = worklist.pop(); + if (visited.test_set(n->_idx)) { + continue; } - - const TypeInstPtr* itype = btype->isa_instptr(); - if (itype != nullptr) { - // Can the klass of base_oop be statically determined to be - // _not_ a sub-class of Reference and _not_ Object? - ciKlass* klass = itype->instance_klass(); - if (klass->is_loaded() && - !klass->is_subtype_of(kit->env()->Reference_klass()) && - !kit->env()->Object_klass()->is_subtype_of(klass)) { - return; + refine_barrier_by_new_val_type(n); + for (uint j = 0; j < n->req(); j++) { + Node* in = n->in(j); + if (in != nullptr) { + worklist.push(in); } } } + return false; +} - // The compile time filters did not reject base_oop/offset so - // we need to generate the following runtime filters - // - // if (offset == java_lang_ref_Reference::_reference_offset) { - // if (instance_of(base, java.lang.ref.Reference)) { - // pre_barrier(_, pre_val, ...); +uint G1BarrierSetC2::estimated_barrier_size(const Node* node) const { + // These Ideal node counts are extracted from the pre-matching Ideal graph + // generated when compiling the following method with early barrier expansion: + // static void write(MyObject obj1, Object o) { + // obj1.o1 = o; // } - // } - - float likely = PROB_LIKELY( 0.999); - float unlikely = PROB_UNLIKELY(0.999); - - IdealKit ideal(kit); - - Node* referent_off = __ ConX(java_lang_ref_Reference::referent_offset()); - - __ if_then(offset, BoolTest::eq, referent_off, unlikely); { - // Update graphKit memory and control from IdealKit. - kit->sync_kit(ideal); - - Node* ref_klass_con = kit->makecon(TypeKlassPtr::make(kit->env()->Reference_klass())); - Node* is_instof = kit->gen_instanceof(base_oop, ref_klass_con); - - // Update IdealKit memory and control from graphKit. - __ sync_kit(kit); - - Node* one = __ ConI(1); - // is_instof == 0 if base_oop == nullptr - __ if_then(is_instof, BoolTest::eq, one, unlikely); { - - // Update graphKit from IdeakKit. - kit->sync_kit(ideal); - - // Use the pre-barrier to record the value in the referent field - pre_barrier(kit, false /* do_load */, - __ ctrl(), - nullptr /* obj */, nullptr /* adr */, max_juint /* alias_idx */, nullptr /* val */, nullptr /* val_type */, - pre_val /* pre_val */, - T_OBJECT); - if (need_mem_bar) { - // Add memory barrier to prevent commoning reads from this field - // across safepoint since GC can change its value. - kit->insert_mem_bar(Op_MemBarCPUOrder); - } - // Update IdealKit from graphKit. - __ sync_kit(kit); - - } __ end_if(); // _ref_type != ref_none - } __ end_if(); // offset == referent_offset + uint8_t barrier_data = MemNode::barrier_data(node); + uint nodes = 0; + if ((barrier_data & G1C2BarrierPre) != 0) { + nodes += 50; + } + if ((barrier_data & G1C2BarrierPost) != 0) { + nodes += 60; + } + return nodes; +} - // Final sync IdealKit and GraphKit. - kit->final_sync(ideal); +bool G1BarrierSetC2::can_initialize_object(const StoreNode* store) const { + assert(store->Opcode() == Op_StoreP || store->Opcode() == Op_StoreN, "OOP store expected"); + // It is OK to move the store across the object initialization boundary only + // if it does not have any barrier, or if it has barriers that can be safely + // elided (because of the compensation steps taken on the allocation slow path + // when ReduceInitialCardMarks is enabled). + return (MemNode::barrier_data(store) == 0) || use_ReduceInitialCardMarks(); } -#undef __ +void G1BarrierSetC2::clone_at_expansion(PhaseMacroExpand* phase, ArrayCopyNode* ac) const { + if (ac->is_clone_inst() && !use_ReduceInitialCardMarks()) { + clone_in_runtime(phase, ac, G1BarrierSetRuntime::clone_addr(), "G1BarrierSetRuntime::clone"); + return; + } + BarrierSetC2::clone_at_expansion(phase, ac); +} -Node* G1BarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) const { +Node* G1BarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue& val) const { DecoratorSet decorators = access.decorators(); - Node* adr = access.addr().node(); - Node* obj = access.base(); - - bool anonymous = (decorators & C2_UNSAFE_ACCESS) != 0; - bool mismatched = (decorators & C2_MISMATCHED) != 0; - bool unknown = (decorators & ON_UNKNOWN_OOP_REF) != 0; + bool anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; bool in_heap = (decorators & IN_HEAP) != 0; - bool in_native = (decorators & IN_NATIVE) != 0; - bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0; - bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0; - bool is_unordered = (decorators & MO_UNORDERED) != 0; - bool no_keepalive = (decorators & AS_NO_KEEPALIVE) != 0; - bool is_mixed = !in_heap && !in_native; - bool need_cpu_mem_bar = !is_unordered || mismatched || is_mixed; - - Node* top = Compile::current()->top(); - Node* offset = adr->is_AddP() ? adr->in(AddPNode::Offset) : top; - - // If we are reading the value of the referent field of a Reference - // object (either by using Unsafe directly or through reflection) - // then, if G1 is enabled, we need to record the referent in an - // SATB log buffer using the pre-barrier mechanism. - // Also we need to add memory barrier to prevent commoning reads - // from this field across safepoint since GC can change its value. - bool need_read_barrier = (((on_weak || on_phantom) && !no_keepalive) || - (in_heap && unknown && offset != top && obj != top)); + bool tightly_coupled_alloc = (decorators & C2_TIGHTLY_COUPLED_ALLOC) != 0; + bool need_store_barrier = !(tightly_coupled_alloc && use_ReduceInitialCardMarks()) && (in_heap || anonymous); + if (access.is_oop() && need_store_barrier) { + access.set_barrier_data(get_store_barrier(access)); + if (tightly_coupled_alloc) { + assert(!use_ReduceInitialCardMarks(), + "post-barriers are only needed for tightly-coupled initialization stores when ReduceInitialCardMarks is disabled"); + access.set_barrier_data(access.barrier_data() ^ G1C2BarrierPre); + } + } + return BarrierSetC2::store_at_resolved(access, val); +} - if (!access.is_oop() || !need_read_barrier) { - return CardTableBarrierSetC2::load_at_resolved(access, val_type); +Node* G1BarrierSetC2::atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access, Node* expected_val, + Node* new_val, const Type* value_type) const { + GraphKit* kit = access.kit(); + if (!access.is_oop()) { + return BarrierSetC2::atomic_cmpxchg_val_at_resolved(access, expected_val, new_val, value_type); } + access.set_barrier_data(G1C2BarrierPre | G1C2BarrierPost); + return BarrierSetC2::atomic_cmpxchg_val_at_resolved(access, expected_val, new_val, value_type); +} - assert(access.is_parse_access(), "entry not supported at optimization time"); +Node* G1BarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access, Node* expected_val, + Node* new_val, const Type* value_type) const { + GraphKit* kit = access.kit(); + if (!access.is_oop()) { + return BarrierSetC2::atomic_cmpxchg_bool_at_resolved(access, expected_val, new_val, value_type); + } + access.set_barrier_data(G1C2BarrierPre | G1C2BarrierPost); + return BarrierSetC2::atomic_cmpxchg_bool_at_resolved(access, expected_val, new_val, value_type); +} - C2ParseAccess& parse_access = static_cast(access); - GraphKit* kit = parse_access.kit(); - Node* load; +Node* G1BarrierSetC2::atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const { + GraphKit* kit = access.kit(); + if (!access.is_oop()) { + return BarrierSetC2::atomic_xchg_at_resolved(access, new_val, value_type); + } + access.set_barrier_data(G1C2BarrierPre | G1C2BarrierPost); + return BarrierSetC2::atomic_xchg_at_resolved(access, new_val, value_type); +} - Node* control = kit->control(); - const TypePtr* adr_type = access.addr().type(); - MemNode::MemOrd mo = access.mem_node_mo(); - bool requires_atomic_access = (decorators & MO_UNORDERED) == 0; - bool unaligned = (decorators & C2_UNALIGNED) != 0; - bool unsafe = (decorators & C2_UNSAFE_ACCESS) != 0; - // Pinned control dependency is the strictest. So it's ok to substitute it for any other. - load = kit->make_load(control, adr, val_type, access.type(), adr_type, mo, - LoadNode::Pinned, requires_atomic_access, unaligned, mismatched, unsafe, - access.barrier_data()); +class G1BarrierSetC2State : public BarrierSetC2State { +private: + GrowableArray* _stubs; +public: + G1BarrierSetC2State(Arena* arena) + : BarrierSetC2State(arena), + _stubs(new (arena) GrowableArray(arena, 8, 0, nullptr)) {} - if (on_weak || on_phantom) { - // Use the pre-barrier to record the value in the referent field - pre_barrier(kit, false /* do_load */, - kit->control(), - nullptr /* obj */, nullptr /* adr */, max_juint /* alias_idx */, nullptr /* val */, nullptr /* val_type */, - load /* pre_val */, T_OBJECT); - // Add memory barrier to prevent commoning reads from this field - // across safepoint since GC can change its value. - kit->insert_mem_bar(Op_MemBarCPUOrder); - } else if (unknown) { - // We do not require a mem bar inside pre_barrier if need_mem_bar - // is set: the barriers would be emitted by us. - insert_pre_barrier(kit, obj, offset, load, !need_cpu_mem_bar); + GrowableArray* stubs() { + return _stubs; } - return load; -} - -bool G1BarrierSetC2::is_gc_barrier_node(Node* node) const { - if (CardTableBarrierSetC2::is_gc_barrier_node(node)) { - return true; + bool needs_liveness_data(const MachNode* mach) const { + return G1PreBarrierStubC2::needs_barrier(mach) || + G1PostBarrierStubC2::needs_barrier(mach); } - if (node->Opcode() != Op_CallLeaf) { - return false; - } - CallLeafNode *call = node->as_CallLeaf(); - if (call->_name == nullptr) { + + bool needs_livein_data() const { return false; } +}; - return strcmp(call->_name, "write_ref_field_pre_entry") == 0 || strcmp(call->_name, "write_ref_field_post_entry") == 0; +static G1BarrierSetC2State* barrier_set_state() { + return reinterpret_cast(Compile::current()->barrier_set_state()); } -bool G1BarrierSetC2::is_g1_pre_val_load(Node* n) { - if (n->is_Load() && n->as_Load()->has_pinned_control_dependency()) { - // Make sure the only users of it are: CmpP, StoreP, and a call to write_ref_field_pre_entry +G1BarrierStubC2::G1BarrierStubC2(const MachNode* node) : BarrierStubC2(node) {} - // Skip possible decode - if (n->outcnt() == 1 && n->unique_out()->is_DecodeN()) { - n = n->unique_out(); - } +G1PreBarrierStubC2::G1PreBarrierStubC2(const MachNode* node) : G1BarrierStubC2(node) {} - if (n->outcnt() == 3) { - int found = 0; - for (SimpleDUIterator iter(n); iter.has_next(); iter.next()) { - Node* use = iter.get(); - if (use->is_Cmp() || use->is_Store()) { - ++found; - } else if (use->is_CallLeaf()) { - CallLeafNode* call = use->as_CallLeaf(); - if (strcmp(call->_name, "write_ref_field_pre_entry") == 0) { - ++found; - } - } - } - if (found == 3) { - return true; - } - } +bool G1PreBarrierStubC2::needs_barrier(const MachNode* node) { + return (node->barrier_data() & G1C2BarrierPre) != 0; +} + +G1PreBarrierStubC2* G1PreBarrierStubC2::create(const MachNode* node) { + G1PreBarrierStubC2* const stub = new (Compile::current()->comp_arena()) G1PreBarrierStubC2(node); + if (!Compile::current()->output()->in_scratch_emit_size()) { + barrier_set_state()->stubs()->append(stub); } - return false; + return stub; } -bool G1BarrierSetC2::is_gc_pre_barrier_node(Node *node) const { - return is_g1_pre_val_load(node); +void G1PreBarrierStubC2::initialize_registers(Register obj, Register pre_val, Register thread, Register tmp1, Register tmp2) { + _obj = obj; + _pre_val = pre_val; + _thread = thread; + _tmp1 = tmp1; + _tmp2 = tmp2; } -void G1BarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { - if (is_g1_pre_val_load(node)) { - macro->replace_node(node, macro->zerocon(node->as_Load()->bottom_type()->basic_type())); - } else { - assert(node->Opcode() == Op_CastP2X, "ConvP2XNode required"); - assert(node->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes"); - // It could be only one user, URShift node, in Object.clone() intrinsic - // but the new allocation is passed to arraycopy stub and it could not - // be scalar replaced. So we don't check the case. +Register G1PreBarrierStubC2::obj() const { + return _obj; +} - // An other case of only one user (Xor) is when the value check for null - // in G1 post barrier is folded after CCP so the code which used URShift - // is removed. +Register G1PreBarrierStubC2::pre_val() const { + return _pre_val; +} - // Take Region node before eliminating post barrier since it also - // eliminates CastP2X node when it has only one user. - Node* this_region = node->in(0); - assert(this_region != nullptr, ""); +Register G1PreBarrierStubC2::thread() const { + return _thread; +} - // Remove G1 post barrier. +Register G1PreBarrierStubC2::tmp1() const { + return _tmp1; +} + +Register G1PreBarrierStubC2::tmp2() const { + return _tmp2; +} - // Search for CastP2X->Xor->URShift->Cmp path which - // checks if the store done to a different from the value's region. - // And replace Cmp with #0 (false) to collapse G1 post barrier. - Node* xorx = node->find_out_with(Op_XorX); - if (xorx != nullptr) { - Node* shift = xorx->unique_out(); - Node* cmpx = shift->unique_out(); - assert(cmpx->is_Cmp() && cmpx->unique_out()->is_Bool() && - cmpx->unique_out()->as_Bool()->_test._test == BoolTest::ne, - "missing region check in G1 post barrier"); - macro->replace_node(cmpx, macro->makecon(TypeInt::CC_EQ)); +void G1PreBarrierStubC2::emit_code(MacroAssembler& masm) { + G1BarrierSetAssembler* bs = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + bs->generate_c2_pre_barrier_stub(&masm, this); +} - // Remove G1 pre barrier. +G1PostBarrierStubC2::G1PostBarrierStubC2(const MachNode* node) : G1BarrierStubC2(node) {} - // Search "if (marking != 0)" check and set it to "false". - // There is no G1 pre barrier if previous stored value is null - // (for example, after initialization). - if (this_region->is_Region() && this_region->req() == 3) { - int ind = 1; - if (!this_region->in(ind)->is_IfFalse()) { - ind = 2; - } - if (this_region->in(ind)->is_IfFalse() && - this_region->in(ind)->in(0)->Opcode() == Op_If) { - Node* bol = this_region->in(ind)->in(0)->in(1); - assert(bol->is_Bool(), ""); - cmpx = bol->in(1); - if (bol->as_Bool()->_test._test == BoolTest::ne && - cmpx->is_Cmp() && cmpx->in(2) == macro->intcon(0) && - cmpx->in(1)->is_Load()) { - Node* adr = cmpx->in(1)->as_Load()->in(MemNode::Address); - const int marking_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()); - if (adr->is_AddP() && adr->in(AddPNode::Base) == macro->top() && - adr->in(AddPNode::Address)->Opcode() == Op_ThreadLocal && - adr->in(AddPNode::Offset) == macro->MakeConX(marking_offset)) { - macro->replace_node(cmpx, macro->makecon(TypeInt::CC_EQ)); - } - } - } - } - } else { - assert(!use_ReduceInitialCardMarks(), "can only happen with card marking"); - // This is a G1 post barrier emitted by the Object.clone() intrinsic. - // Search for the CastP2X->URShiftX->AddP->LoadB->Cmp path which checks if the card - // is marked as young_gen and replace the Cmp with 0 (false) to collapse the barrier. - Node* shift = node->find_out_with(Op_URShiftX); - assert(shift != nullptr, "missing G1 post barrier"); - Node* addp = shift->unique_out(); - Node* load = addp->find_out_with(Op_LoadB); - assert(load != nullptr, "missing G1 post barrier"); - Node* cmpx = load->unique_out(); - assert(cmpx->is_Cmp() && cmpx->unique_out()->is_Bool() && - cmpx->unique_out()->as_Bool()->_test._test == BoolTest::ne, - "missing card value check in G1 post barrier"); - macro->replace_node(cmpx, macro->makecon(TypeInt::CC_EQ)); - // There is no G1 pre barrier in this case - } - // Now CastP2X can be removed since it is used only on dead path - // which currently still alive until igvn optimize it. - assert(node->outcnt() == 0 || node->unique_out()->Opcode() == Op_URShiftX, ""); - macro->replace_node(node, macro->top()); - } +bool G1PostBarrierStubC2::needs_barrier(const MachNode* node) { + return (node->barrier_data() & G1C2BarrierPost) != 0; } -Node* G1BarrierSetC2::step_over_gc_barrier(Node* c) const { - if (!use_ReduceInitialCardMarks() && - c != nullptr && c->is_Region() && c->req() == 3) { - for (uint i = 1; i < c->req(); i++) { - if (c->in(i) != nullptr && c->in(i)->is_Region() && - c->in(i)->req() == 3) { - Node* r = c->in(i); - for (uint j = 1; j < r->req(); j++) { - if (r->in(j) != nullptr && r->in(j)->is_Proj() && - r->in(j)->in(0) != nullptr && - r->in(j)->in(0)->Opcode() == Op_CallLeaf && - r->in(j)->in(0)->as_Call()->entry_point() == CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry)) { - Node* call = r->in(j)->in(0); - c = c->in(i == 1 ? 2 : 1); - if (c != nullptr && c->Opcode() != Op_Parm) { - c = c->in(0); - if (c != nullptr) { - c = c->in(0); - assert(call->in(0) == nullptr || - call->in(0)->in(0) == nullptr || - call->in(0)->in(0)->in(0) == nullptr || - call->in(0)->in(0)->in(0)->in(0) == nullptr || - call->in(0)->in(0)->in(0)->in(0)->in(0) == nullptr || - c == call->in(0)->in(0)->in(0)->in(0)->in(0), "bad barrier shape"); - return c; - } - } - } - } - } - } +G1PostBarrierStubC2* G1PostBarrierStubC2::create(const MachNode* node) { + G1PostBarrierStubC2* const stub = new (Compile::current()->comp_arena()) G1PostBarrierStubC2(node); + if (!Compile::current()->output()->in_scratch_emit_size()) { + barrier_set_state()->stubs()->append(stub); } - return c; + return stub; } -#ifdef ASSERT -bool G1BarrierSetC2::has_cas_in_use_chain(Node *n) const { - Unique_Node_List visited; - Node_List worklist; - worklist.push(n); - while (worklist.size() > 0) { - Node* x = worklist.pop(); - if (visited.member(x)) { - continue; - } else { - visited.push(x); - } +void G1PostBarrierStubC2::initialize_registers(Register thread, Register tmp1, Register tmp2, Register tmp3) { + _thread = thread; + _tmp1 = tmp1; + _tmp2 = tmp2; + _tmp3 = tmp3; +} - if (x->is_LoadStore()) { - int op = x->Opcode(); - if (op == Op_CompareAndExchangeP || op == Op_CompareAndExchangeN || - op == Op_CompareAndSwapP || op == Op_CompareAndSwapN || - op == Op_WeakCompareAndSwapP || op == Op_WeakCompareAndSwapN) { - return true; - } - } - if (!x->is_CFG()) { - for (SimpleDUIterator iter(x); iter.has_next(); iter.next()) { - Node* use = iter.get(); - worklist.push(use); - } - } - } - return false; +Register G1PostBarrierStubC2::thread() const { + return _thread; } -void G1BarrierSetC2::verify_pre_load(Node* marking_if, Unique_Node_List& loads /*output*/) const { - assert(loads.size() == 0, "Loads list should be empty"); - Node* pre_val_if = marking_if->find_out_with(Op_IfTrue)->find_out_with(Op_If); - if (pre_val_if != nullptr) { - Unique_Node_List visited; - Node_List worklist; - Node* pre_val = pre_val_if->in(1)->in(1)->in(1); +Register G1PostBarrierStubC2::tmp1() const { + return _tmp1; +} - worklist.push(pre_val); - while (worklist.size() > 0) { - Node* x = worklist.pop(); - if (visited.member(x)) { - continue; - } else { - visited.push(x); - } +Register G1PostBarrierStubC2::tmp2() const { + return _tmp2; +} - if (has_cas_in_use_chain(x)) { - loads.clear(); - return; - } +Register G1PostBarrierStubC2::tmp3() const { + return _tmp3; +} - if (x->is_Con()) { - continue; - } - if (x->is_EncodeP() || x->is_DecodeN()) { - worklist.push(x->in(1)); - continue; - } - if (x->is_Load() || x->is_LoadStore()) { - assert(x->in(0) != nullptr, "Pre-val load has to have a control"); - loads.push(x); - continue; - } - if (x->is_Phi()) { - for (uint i = 1; i < x->req(); i++) { - worklist.push(x->in(i)); - } - continue; - } - assert(false, "Pre-val anomaly"); - } - } +void G1PostBarrierStubC2::emit_code(MacroAssembler& masm) { + G1BarrierSetAssembler* bs = static_cast(BarrierSet::barrier_set()->barrier_set_assembler()); + bs->generate_c2_post_barrier_stub(&masm, this); } -void G1BarrierSetC2::verify_no_safepoints(Compile* compile, Node* marking_check_if, const Unique_Node_List& loads) const { - if (loads.size() == 0) { - return; - } +void* G1BarrierSetC2::create_barrier_state(Arena* comp_arena) const { + return new (comp_arena) G1BarrierSetC2State(comp_arena); +} - if (loads.size() == 1) { // Handle the typical situation when there a single pre-value load - // that is dominated by the marking_check_if, that's true when the - // barrier itself does the pre-val load. - Node *pre_val = loads.at(0); - if (pre_val->in(0)->in(0) == marking_check_if) { // IfTrue->If - return; - } +int G1BarrierSetC2::get_store_barrier(C2Access& access) const { + if (!access.is_parse_access()) { + // Only support for eliding barriers at parse time for now. + return G1C2BarrierPre | G1C2BarrierPost; } - - // All other cases are when pre-value loads dominate the marking check. - Unique_Node_List controls; - for (uint i = 0; i < loads.size(); i++) { - Node *c = loads.at(i)->in(0); - controls.push(c); + GraphKit* kit = (static_cast(access)).kit(); + Node* ctl = kit->control(); + Node* adr = access.addr().node(); + uint adr_idx = kit->C->get_alias_index(access.addr().type()); + assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory"); + + bool can_remove_pre_barrier = g1_can_remove_pre_barrier(kit, &kit->gvn(), adr, access.type(), adr_idx); + + // We can skip marks on a freshly-allocated object in Eden. Keep this code in + // sync with CardTableBarrierSet::on_slowpath_allocation_exit. That routine + // informs GC to take appropriate compensating steps, upon a slow-path + // allocation, so as to make this card-mark elision safe. + // The post-barrier can also be removed if null is written. This case is + // handled by G1BarrierSetC2::expand_barriers, which runs at the end of C2's + // platform-independent optimizations to exploit stronger type information. + bool can_remove_post_barrier = use_ReduceInitialCardMarks() && + ((access.base() == kit->just_allocated_object(ctl)) || + g1_can_remove_post_barrier(kit, &kit->gvn(), ctl, adr)); + + int barriers = 0; + if (!can_remove_pre_barrier) { + barriers |= G1C2BarrierPre; + } + if (!can_remove_post_barrier) { + barriers |= G1C2BarrierPost; } - Unique_Node_List visited; - Unique_Node_List safepoints; - Node_List worklist; - uint found = 0; + return barriers; +} - worklist.push(marking_check_if); - while (worklist.size() > 0 && found < controls.size()) { - Node* x = worklist.pop(); - if (x == nullptr || x == compile->top()) continue; - if (visited.member(x)) { - continue; - } else { - visited.push(x); - } +void G1BarrierSetC2::late_barrier_analysis() const { + compute_liveness_at_stubs(); +} - if (controls.member(x)) { - found++; - } - if (x->is_Region()) { - for (uint i = 1; i < x->req(); i++) { - worklist.push(x->in(i)); - } - } else { - if (!x->is_SafePoint()) { - worklist.push(x->in(0)); - } else { - safepoints.push(x); - } +void G1BarrierSetC2::emit_stubs(CodeBuffer& cb) const { + MacroAssembler masm(&cb); + GrowableArray* const stubs = barrier_set_state()->stubs(); + for (int i = 0; i < stubs->length(); i++) { + // Make sure there is enough space in the code buffer + if (cb.insts()->maybe_expand_to_ensure_remaining(PhaseOutput::MAX_inst_size) && cb.blob() == nullptr) { + ciEnv::current()->record_failure("CodeCache is full"); + return; } + stubs->at(i)->emit_code(masm); } - assert(found == controls.size(), "Pre-barrier structure anomaly or possible safepoint"); + masm.flush(); } -void G1BarrierSetC2::verify_gc_barriers(Compile* compile, CompilePhase phase) const { - if (phase != BarrierSetC2::BeforeCodeGen) { - return; +#ifndef PRODUCT +void G1BarrierSetC2::dump_barrier_data(const MachNode* mach, outputStream* st) const { + if ((mach->barrier_data() & G1C2BarrierPre) != 0) { + st->print("pre "); } - // Verify G1 pre-barriers - const int marking_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()); - - Unique_Node_List visited; - Node_List worklist; - // We're going to walk control flow backwards starting from the Root - worklist.push(compile->root()); - while (worklist.size() > 0) { - Node* x = worklist.pop(); - if (x == nullptr || x == compile->top()) continue; - if (visited.member(x)) { - continue; - } else { - visited.push(x); - } - - if (x->is_Region()) { - for (uint i = 1; i < x->req(); i++) { - worklist.push(x->in(i)); - } - } else { - worklist.push(x->in(0)); - // We are looking for the pattern: - // /->ThreadLocal - // If->Bool->CmpI->LoadB->AddP->ConL(marking_offset) - // \->ConI(0) - // We want to verify that the If and the LoadB have the same control - // See GraphKit::g1_write_barrier_pre() - if (x->is_If()) { - IfNode *iff = x->as_If(); - if (iff->in(1)->is_Bool() && iff->in(1)->in(1)->is_Cmp()) { - CmpNode *cmp = iff->in(1)->in(1)->as_Cmp(); - if (cmp->Opcode() == Op_CmpI && cmp->in(2)->is_Con() && cmp->in(2)->bottom_type()->is_int()->get_con() == 0 - && cmp->in(1)->is_Load()) { - LoadNode* load = cmp->in(1)->as_Load(); - if (load->Opcode() == Op_LoadB && load->in(2)->is_AddP() && load->in(2)->in(2)->Opcode() == Op_ThreadLocal - && load->in(2)->in(3)->is_Con() - && load->in(2)->in(3)->bottom_type()->is_intptr_t()->get_con() == marking_offset) { - - Node* if_ctrl = iff->in(0); - Node* load_ctrl = load->in(0); - - if (if_ctrl != load_ctrl) { - // Skip possible CProj->NeverBranch in infinite loops - if ((if_ctrl->is_Proj() && if_ctrl->Opcode() == Op_CProj) - && if_ctrl->in(0)->is_NeverBranch()) { - if_ctrl = if_ctrl->in(0)->in(0); - } - } - assert(load_ctrl != nullptr && if_ctrl == load_ctrl, "controls must match"); - - Unique_Node_List loads; - verify_pre_load(iff, loads); - verify_no_safepoints(compile, iff, loads); - } - } - } - } - } + if ((mach->barrier_data() & G1C2BarrierPost) != 0) { + st->print("post "); } -} -#endif - -bool G1BarrierSetC2::escape_add_to_con_graph(ConnectionGraph* conn_graph, PhaseGVN* gvn, Unique_Node_List* delayed_worklist, Node* n, uint opcode) const { - if (opcode == Op_StoreP) { - Node* adr = n->in(MemNode::Address); - const Type* adr_type = gvn->type(adr); - // Pointer stores in G1 barriers looks like unsafe access. - // Ignore such stores to be able scalar replace non-escaping - // allocations. - if (adr_type->isa_rawptr() && adr->is_AddP()) { - Node* base = conn_graph->get_addp_base(adr); - if (base->Opcode() == Op_LoadP && - base->in(MemNode::Address)->is_AddP()) { - adr = base->in(MemNode::Address); - Node* tls = conn_graph->get_addp_base(adr); - if (tls->Opcode() == Op_ThreadLocal) { - int offs = (int) gvn->find_intptr_t_con(adr->in(AddPNode::Offset), Type::OffsetBot); - const int buf_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset()); - if (offs == buf_offset) { - return true; // G1 pre barrier previous oop value store. - } - if (offs == in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset())) { - return true; // G1 post barrier card address store. - } - } - } - } + if ((mach->barrier_data() & G1C2BarrierPostNotNull) != 0) { + st->print("notnull "); } - return false; } +#endif // !PRODUCT diff --git a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.hpp b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.hpp index c445a87d2e46d..dc333d8c33174 100644 --- a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.hpp +++ b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.hpp @@ -31,29 +31,62 @@ class PhaseTransform; class Type; class TypeFunc; -class G1BarrierSetC2: public CardTableBarrierSetC2 { +const int G1C2BarrierPre = 1; +const int G1C2BarrierPost = 2; +const int G1C2BarrierPostNotNull = 4; + +class G1BarrierStubC2 : public BarrierStubC2 { +public: + G1BarrierStubC2(const MachNode* node); + virtual void emit_code(MacroAssembler& masm) = 0; +}; + +class G1PreBarrierStubC2 : public G1BarrierStubC2 { +private: + Register _obj; + Register _pre_val; + Register _thread; + Register _tmp1; + Register _tmp2; + +protected: + G1PreBarrierStubC2(const MachNode* node); + +public: + static bool needs_barrier(const MachNode* node); + static G1PreBarrierStubC2* create(const MachNode* node); + void initialize_registers(Register obj, Register pre_val, Register thread, Register tmp1 = noreg, Register tmp2 = noreg); + Register obj() const; + Register pre_val() const; + Register thread() const; + Register tmp1() const; + Register tmp2() const; + virtual void emit_code(MacroAssembler& masm); +}; + +class G1PostBarrierStubC2 : public G1BarrierStubC2 { +private: + Register _thread; + Register _tmp1; + Register _tmp2; + Register _tmp3; + protected: - virtual void pre_barrier(GraphKit* kit, - bool do_load, - Node* ctl, - Node* obj, - Node* adr, - uint adr_idx, - Node* val, - const TypeOopPtr* val_type, - Node* pre_val, - BasicType bt) const; - - virtual void post_barrier(GraphKit* kit, - Node* ctl, - Node* store, - Node* obj, - Node* adr, - uint adr_idx, - Node* val, - BasicType bt, - bool use_precise) const; + G1PostBarrierStubC2(const MachNode* node); +public: + static bool needs_barrier(const MachNode* node); + static G1PostBarrierStubC2* create(const MachNode* node); + void initialize_registers(Register thread, Register tmp1 = noreg, Register tmp2 = noreg, Register tmp3 = noreg); + Register thread() const; + Register tmp1() const; + Register tmp2() const; + Register tmp3() const; + virtual void emit_code(MacroAssembler& masm); +}; + +class G1BarrierSetC2: public CardTableBarrierSetC2 { +protected: bool g1_can_remove_pre_barrier(GraphKit* kit, PhaseValues* phase, Node* adr, @@ -64,44 +97,31 @@ class G1BarrierSetC2: public CardTableBarrierSetC2 { PhaseValues* phase, Node* store, Node* adr) const; - void g1_mark_card(GraphKit* kit, - IdealKit& ideal, - Node* card_adr, - Node* oop_store, - uint oop_alias_idx, - Node* index, - Node* index_adr, - Node* buffer, - const TypeFunc* tf) const; - - // Helper for unsafe accesses, that may or may not be on the referent field. - // Generates the guards that check whether the result of - // Unsafe.getReference should be recorded in an SATB log buffer. - void insert_pre_barrier(GraphKit* kit, Node* base_oop, Node* offset, Node* pre_val, bool need_mem_bar) const; - - static const TypeFunc* write_ref_field_pre_entry_Type(); - static const TypeFunc* write_ref_field_post_entry_Type(); + int get_store_barrier(C2Access& access) const; virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const; + virtual Node* store_at_resolved(C2Access& access, C2AccessValue& val) const; + virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access, Node* expected_val, + Node* new_val, const Type* value_type) const; + virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access, Node* expected_val, + Node* new_val, const Type* value_type) const; + virtual Node* atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const; -#ifdef ASSERT - bool has_cas_in_use_chain(Node* x) const; - void verify_pre_load(Node* marking_check_if, Unique_Node_List& loads /*output*/) const; - void verify_no_safepoints(Compile* compile, Node* marking_load, const Unique_Node_List& loads) const; -#endif - - static bool is_g1_pre_val_load(Node* n); public: - virtual bool is_gc_pre_barrier_node(Node* node) const; - virtual bool is_gc_barrier_node(Node* node) const; virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const; - virtual Node* step_over_gc_barrier(Node* c) const; - -#ifdef ASSERT - virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const; + virtual void eliminate_gc_barrier_data(Node* node) const; + virtual bool expand_barriers(Compile* C, PhaseIterGVN& igvn) const; + virtual uint estimated_barrier_size(const Node* node) const; + virtual bool can_initialize_object(const StoreNode* store) const; + virtual void clone_at_expansion(PhaseMacroExpand* phase, + ArrayCopyNode* ac) const; + virtual void* create_barrier_state(Arena* comp_arena) const; + virtual void emit_stubs(CodeBuffer& cb) const; + virtual void late_barrier_analysis() const; + +#ifndef PRODUCT + virtual void dump_barrier_data(const MachNode* mach, outputStream* st) const; #endif - - virtual bool escape_add_to_con_graph(ConnectionGraph* conn_graph, PhaseGVN* gvn, Unique_Node_List* delayed_worklist, Node* n, uint opcode) const; }; #endif // SHARE_GC_G1_C2_G1BARRIERSETC2_HPP diff --git a/src/hotspot/share/gc/g1/g1BarrierSetRuntime.cpp b/src/hotspot/share/gc/g1/g1BarrierSetRuntime.cpp index a0fce437807f4..2e247f46c93d8 100644 --- a/src/hotspot/share/gc/g1/g1BarrierSetRuntime.cpp +++ b/src/hotspot/share/gc/g1/g1BarrierSetRuntime.cpp @@ -61,3 +61,11 @@ JRT_LEAF(void, G1BarrierSetRuntime::write_ref_field_post_entry(volatile G1CardTa G1DirtyCardQueue& queue = G1ThreadLocalData::dirty_card_queue(thread); G1BarrierSet::dirty_card_queue_set().enqueue(queue, card_addr); JRT_END + +JRT_LEAF(void, G1BarrierSetRuntime::clone(oopDesc* src, oopDesc* dst, size_t size)) + HeapAccess<>::clone(src, dst, size); +JRT_END + +address G1BarrierSetRuntime::clone_addr() { + return reinterpret_cast

          (clone); +} diff --git a/src/hotspot/share/gc/g1/g1BarrierSetRuntime.hpp b/src/hotspot/share/gc/g1/g1BarrierSetRuntime.hpp index 366679f032ba9..f98e94096e72d 100644 --- a/src/hotspot/share/gc/g1/g1BarrierSetRuntime.hpp +++ b/src/hotspot/share/gc/g1/g1BarrierSetRuntime.hpp @@ -35,6 +35,8 @@ class oopDesc; class JavaThread; class G1BarrierSetRuntime: public AllStatic { +private: + static void clone(oopDesc* src, oopDesc* dst, size_t size); public: using CardValue = G1CardTable::CardValue; @@ -46,6 +48,8 @@ class G1BarrierSetRuntime: public AllStatic { // C2 slow-path runtime calls. static void write_ref_field_pre_entry(oopDesc* orig, JavaThread *thread); static void write_ref_field_post_entry(volatile CardValue* card_addr, JavaThread* thread); + + static address clone_addr(); }; #endif // SHARE_GC_G1_G1BARRIERSETRUNTIME_HPP diff --git a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp index 59e0245204441..643a7936b9b17 100644 --- a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp +++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp @@ -109,6 +109,10 @@ Label* BarrierStubC2::continuation() { return &_continuation; } +uint8_t BarrierStubC2::barrier_data() const { + return _node->barrier_data(); +} + void BarrierStubC2::preserve(Register r) { const VMReg vm_reg = r->as_VMReg(); assert(vm_reg->is_Register(), "r must be a general-purpose register"); diff --git a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp b/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp index c1485c069c83c..00fbf1f2c9f8b 100644 --- a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp +++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp @@ -254,6 +254,8 @@ class BarrierStubC2 : public ArenaObj { Label* entry(); // Return point from the stub (typically end of barrier). Label* continuation(); + // High-level, GC-specific barrier flags. + uint8_t barrier_data() const; // Preserve the value in reg across runtime calls in this barrier. void preserve(Register reg); @@ -340,6 +342,8 @@ class BarrierSetC2: public CHeapObj { // Estimated size of the node barrier in number of C2 Ideal nodes. // This is used to guide heuristics in C2, e.g. whether to unroll a loop. virtual uint estimated_barrier_size(const Node* node) const { return 0; } + // Whether the given store can be used to initialize a newly allocated object. + virtual bool can_initialize_object(const StoreNode* store) const { return true; } enum CompilePhase { BeforeOptimize, diff --git a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp index 87bb9f3cd5170..11b742156a831 100644 --- a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp @@ -125,39 +125,10 @@ void CardTableBarrierSetC2::post_barrier(GraphKit* kit, kit->final_sync(ideal); } -void CardTableBarrierSetC2::clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const { - BarrierSetC2::clone(kit, src, dst, size, is_array); - const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM; - - // If necessary, emit some card marks afterwards. (Non-arrays only.) - bool card_mark = !is_array && !use_ReduceInitialCardMarks(); - if (card_mark) { - assert(!is_array, ""); - // Put in store barrier for any and all oops we are sticking - // into this object. (We could avoid this if we could prove - // that the object type contains no oop fields at all.) - Node* no_particular_value = nullptr; - Node* no_particular_field = nullptr; - int raw_adr_idx = Compile::AliasIdxRaw; - post_barrier(kit, kit->control(), - kit->memory(raw_adr_type), - dst, - no_particular_field, - raw_adr_idx, - no_particular_value, - T_OBJECT, - false); - } -} - bool CardTableBarrierSetC2::use_ReduceInitialCardMarks() const { return ReduceInitialCardMarks; } -bool CardTableBarrierSetC2::is_gc_barrier_node(Node* node) const { - return ModRefBarrierSetC2::is_gc_barrier_node(node) || node->Opcode() == Op_StoreCM; -} - void CardTableBarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { assert(node->Opcode() == Op_CastP2X, "ConvP2XNode required"); Node *shift = node->unique_out(); diff --git a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp index 9512f09ff8a6d..3bbf14892d3ef 100644 --- a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp +++ b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp @@ -42,8 +42,6 @@ class CardTableBarrierSetC2: public ModRefBarrierSetC2 { Node* byte_map_base_node(GraphKit* kit) const; public: - virtual void clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const; - virtual bool is_gc_barrier_node(Node* node) const; virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const; virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, bool is_clone_instance, ArrayCopyPhase phase) const; diff --git a/src/hotspot/share/opto/buildOopMap.cpp b/src/hotspot/share/opto/buildOopMap.cpp index 4591e87da2d14..b553cc6ea6949 100644 --- a/src/hotspot/share/opto/buildOopMap.cpp +++ b/src/hotspot/share/opto/buildOopMap.cpp @@ -235,6 +235,13 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i Node *def = _defs[reg]; // Get reaching def assert( def, "since live better have reaching def" ); + if (def->is_MachTemp()) { + assert(!def->bottom_type()->isa_oop_ptr(), + "ADLC only assigns OOP types to MachTemp defs corresponding to xRegN operands"); + // Exclude MachTemp definitions even if they are typed as oops. + continue; + } + // Classify the reaching def as oop, derived, callee-save, dead, or other const Type *t = def->bottom_type(); if( t->isa_oop_ptr() ) { // Oop or derived? diff --git a/src/hotspot/share/opto/lcm.cpp b/src/hotspot/share/opto/lcm.cpp index 9db94748ca27c..3c6de96074a15 100644 --- a/src/hotspot/share/opto/lcm.cpp +++ b/src/hotspot/share/opto/lcm.cpp @@ -161,6 +161,14 @@ void PhaseCFG::implicit_null_check(Block* block, Node *proj, Node *val, int allo Node *m = val->out(i); if( !m->is_Mach() ) continue; MachNode *mach = m->as_Mach(); + if (mach->barrier_data() != 0) { + // Using memory accesses with barriers to perform implicit null checks is + // not supported. These operations might expand into multiple assembly + // instructions during code emission, including new memory accesses (e.g. + // in G1's pre-barrier), which would invalidate the implicit null + // exception table. + continue; + } was_store = false; int iop = mach->ideal_Opcode(); switch( iop ) { diff --git a/src/hotspot/share/opto/matcher.cpp b/src/hotspot/share/opto/matcher.cpp index bf773d43d3d39..6d96bff1c1c44 100644 --- a/src/hotspot/share/opto/matcher.cpp +++ b/src/hotspot/share/opto/matcher.cpp @@ -1594,6 +1594,14 @@ static bool match_into_reg( const Node *n, Node *m, Node *control, int i, bool s // the same register. See find_shared_node. return false; } else { // Not a constant + if (!shared && Matcher::is_encode_and_store_pattern(n, m)) { + // Make it possible to match "encode and store" patterns with non-shared + // encode operations that are pinned to a control node (e.g. by CastPP + // node removal in final graph reshaping). The matched instruction cannot + // float above the encode's control node because it is pinned to the + // store's control node. + return false; + } // Stop recursion if they have different Controls. Node* m_control = m->in(0); // Control of load's memory can post-dominates load's control. @@ -2833,6 +2841,18 @@ bool Matcher::is_non_long_integral_vector(const Node* n) { return is_subword_type(bt) || bt == T_INT; } +bool Matcher::is_encode_and_store_pattern(const Node* n, const Node* m) { + if (n == nullptr || + m == nullptr || + n->Opcode() != Op_StoreN || + !m->is_EncodeP() || + n->as_Store()->barrier_data() == 0) { + return false; + } + assert(m == n->in(MemNode::ValueIn), "m should be input to n"); + return true; +} + #ifdef ASSERT bool Matcher::verify_after_postselect_cleanup() { assert(!C->failing(), "sanity"); diff --git a/src/hotspot/share/opto/matcher.hpp b/src/hotspot/share/opto/matcher.hpp index 84e48086f92d3..257628350881a 100644 --- a/src/hotspot/share/opto/matcher.hpp +++ b/src/hotspot/share/opto/matcher.hpp @@ -385,6 +385,8 @@ class Matcher : public PhaseTransform { return ((bt & BoolTest::unsigned_compare) == BoolTest::unsigned_compare); } + static bool is_encode_and_store_pattern(const Node* n, const Node* m); + // These calls are all generated by the ADLC // Java-Java calling convention diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp index eee14e5ba03f1..6613918826057 100644 --- a/src/hotspot/share/opto/memnode.cpp +++ b/src/hotspot/share/opto/memnode.cpp @@ -4644,6 +4644,11 @@ intptr_t InitializeNode::can_capture_store(StoreNode* st, PhaseGVN* phase, bool Node* mem = st->in(MemNode::Memory); if (!(mem->is_Proj() && mem->in(0) == this)) return FAIL; // must not be preceded by other stores + BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); + if ((st->Opcode() == Op_StoreP || st->Opcode() == Op_StoreN) && + !bs->can_initialize_object(st)) { + return FAIL; + } Node* adr = st->in(MemNode::Address); intptr_t offset; AllocateNode* alloc = AllocateNode::Ideal_allocation(adr, phase, offset); diff --git a/src/hotspot/share/opto/output.cpp b/src/hotspot/share/opto/output.cpp index b3f251bb361ba..260f887347f18 100644 --- a/src/hotspot/share/opto/output.cpp +++ b/src/hotspot/share/opto/output.cpp @@ -2022,6 +2022,8 @@ void PhaseOutput::FillExceptionTables(uint cnt, uint *call_returns, uint *inct_s // Handle implicit null exception table updates if (n->is_MachNullCheck()) { + assert(n->in(1)->as_Mach()->barrier_data() == 0, + "Implicit null checks on memory accesses with barriers are not yet supported"); uint block_num = block->non_connector_successor(0)->_pre_order; _inc_table.append(inct_starts[inct_cnt++], blk_labels[block_num].loc_pos()); continue; diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java index 23b9321fc35c1..3f82c3e00b3ac 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java @@ -261,20 +261,11 @@ private void checkstore(OutputAnalyzer output, String testType, boolean useCompr }; break; case "G1": - // a card mark volatile barrier should be generated - // before the card mark strb - // - // following the fix for 8225776 the G1 barrier is now - // scheduled out of line after the membar volatile and - // and subsequent return matches = new String[] { "membar_release \\(elided\\)", useCompressedOops ? "stlrw?" : "stlr", "membar_volatile \\(elided\\)", - "ret", - "membar_volatile", - "dmb ish", - "strb" + "ret" }; break; case "Shenandoah": @@ -332,20 +323,11 @@ private void checkcas(OutputAnalyzer output, String testType, boolean useCompres }; break; case "G1": - // a card mark volatile barrier should be generated - // before the card mark strb - // - // following the fix for 8225776 the G1 barrier is now - // scheduled out of line after the membar acquire and - // and subsequent return matches = new String[] { "membar_release \\(elided\\)", useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq", "membar_acquire \\(elided\\)", - "ret", - "membar_volatile", - "dmb ish", - "strb" + "ret" }; break; case "Shenandoah": @@ -418,20 +400,11 @@ private void checkcae(OutputAnalyzer output, String testType, boolean useCompres return; case "G1": - // a card mark volatile barrier should be generated - // before the card mark strb - // - // following the fix for 8225776 the G1 barrier is now - // scheduled out of line after the membar acquire and - // and subsequent return matches = new String[] { "membar_release \\(elided\\)", useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq", "membar_acquire \\(elided\\)", - "ret", - "membar_volatile", - "dmb ish", - "strb" + "ret" }; break; case "Shenandoah": @@ -484,20 +457,11 @@ private void checkgas(OutputAnalyzer output, String testType, boolean useCompres }; break; case "G1": - // a card mark volatile barrier should be generated - // before the card mark strb - // - // following the fix for 8225776 the G1 barrier is now - // scheduled out of line after the membar acquire and - // and subsequent return matches = new String[] { "membar_release \\(elided\\)", useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq", "membar_acquire \\(elided\\)", - "ret", - "membar_volatile", - "dmb ish", - "strb" + "ret" }; break; case "Shenandoah": diff --git a/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java b/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java index cd3d5329771ef..69b3cb5274b57 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java @@ -1355,9 +1355,12 @@ int testReReduce(boolean cond, int x, int y) { } @Test - @IR(counts = { IRNode.ALLOC, "1" }) - // The last allocation won't be reduced because it would cause the creation - // of a nested SafePointScalarMergeNode. + // Using G1, all allocations are reduced. + @IR(applyIf = {"UseG1GC", "true"}, failOn = { IRNode.ALLOC }) + // Otherwise, the last allocation won't be reduced because it would cause + // the creation of a nested SafePointScalarMergeNode. This is caused by the + // store barrier corresponding to 'C.other = B'. + @IR(applyIf = {"UseG1GC", "false"}, counts = { IRNode.ALLOC, "1" }) int testReReduce_C2(boolean cond1, int x, int y) { return testReReduce(cond1, x, y); } @DontCompile diff --git a/test/hotspot/jtreg/compiler/gcbarriers/TestG1BarrierGeneration.java b/test/hotspot/jtreg/compiler/gcbarriers/TestG1BarrierGeneration.java new file mode 100644 index 0000000000000..36ad0bf84a40b --- /dev/null +++ b/test/hotspot/jtreg/compiler/gcbarriers/TestG1BarrierGeneration.java @@ -0,0 +1,639 @@ +/* + * 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 compiler.gcbarriers; + +import compiler.lib.ir_framework.*; +import java.lang.invoke.VarHandle; +import java.lang.invoke.MethodHandles; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.SoftReference; +import java.lang.ref.WeakReference; +import java.util.concurrent.ThreadLocalRandom; +import jdk.test.lib.Asserts; + +/** + * @test + * @summary Test that G1 barriers are generated and optimized as expected. + * @library /test/lib / + * @requires vm.gc.G1 + * @run driver compiler.gcbarriers.TestG1BarrierGeneration + */ + +public class TestG1BarrierGeneration { + static final String PRE_ONLY = "pre"; + static final String POST_ONLY = "post"; + static final String POST_ONLY_NOT_NULL = "post notnull"; + static final String PRE_AND_POST = "pre post"; + static final String PRE_AND_POST_NOT_NULL = "pre post notnull"; + + static class Outer { + Object f; + } + + static class OuterWithVolatileField { + volatile Object f; + } + + static class OuterWithFewFields implements Cloneable { + Object f1; + Object f2; + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + } + + static class OuterWithManyFields implements Cloneable { + Object f1; + Object f2; + Object f3; + Object f4; + Object f5; + Object f6; + Object f7; + Object f8; + Object f9; + Object f10; + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + } + + static final VarHandle fVarHandle; + static { + MethodHandles.Lookup l = MethodHandles.lookup(); + try { + fVarHandle = l.findVarHandle(Outer.class, "f", Object.class); + } catch (Exception e) { + throw new Error(e); + } + } + + public static void main(String[] args) { + TestFramework framework = new TestFramework(); + Scenario[] scenarios = new Scenario[2*2]; + int scenarioIndex = 0; + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 2; j++) { + scenarios[scenarioIndex] = + new Scenario(scenarioIndex, + "-XX:CompileCommand=inline,java.lang.ref.*::*", + "-XX:" + (i == 0 ? "-" : "+") + "UseCompressedOops", + "-XX:" + (j == 0 ? "-" : "+") + "ReduceInitialCardMarks"); + scenarioIndex++; + } + } + framework.addScenarios(scenarios); + framework.start(); + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + public static void testStore(Outer o, Object o1) { + o.f = o1; + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, PRE_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_STORE_N_WITH_BARRIER_FLAG, PRE_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + public static void testStoreNull(Outer o) { + o.f = null; + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, PRE_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_STORE_N_WITH_BARRIER_FLAG, PRE_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + public static void testStoreObfuscatedNull(Outer o, Object o1) { + Object o2 = o1; + for (int i = 0; i < 4; i++) { + if ((i % 2) == 0) { + o2 = null; + } + } + // o2 is null here, but this is only known to C2 after applying some + // optimizations (loop unrolling, IGVN). + o.f = o2; + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, PRE_AND_POST_NOT_NULL, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, PRE_AND_POST_NOT_NULL, "1"}, + phase = CompilePhase.FINAL_CODE) + public static void testStoreNotNull(Outer o, Object o1) { + if (o1.hashCode() == 42) { + return; + } + o.f = o1; + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, PRE_AND_POST, "2"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, PRE_AND_POST, "2"}, + phase = CompilePhase.FINAL_CODE) + public static void testStoreTwice(Outer o, Outer p, Object o1) { + o.f = o1; + p.f = o1; + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + public static void testStoreVolatile(OuterWithVolatileField o, Object o1) { + o.f = o1; + } + + @Test + @IR(applyIfAnd = {"UseCompressedOops", "false", "ReduceInitialCardMarks", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, POST_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"UseCompressedOops", "true", "ReduceInitialCardMarks", "false"}, + counts = {IRNode.G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, POST_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"UseCompressedOops", "false", "ReduceInitialCardMarks", "true"}, + failOn = {IRNode.G1_STORE_P}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"UseCompressedOops", "true", "ReduceInitialCardMarks", "true"}, + failOn = {IRNode.G1_STORE_N, IRNode.G1_ENCODE_P_AND_STORE_N}, + phase = CompilePhase.FINAL_CODE) + public static Outer testStoreOnNewObject(Object o1) { + Outer o = new Outer(); + o.f = o1; + return o; + } + + @Test + @IR(failOn = {IRNode.STORE_P, IRNode.STORE_N}, + phase = CompilePhase.BEFORE_MACRO_EXPANSION) + public static Outer testStoreNullOnNewObject() { + Outer o = new Outer(); + o.f = null; + return o; + } + + @Test + @IR(applyIfAnd = {"UseCompressedOops", "false", "ReduceInitialCardMarks", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, POST_ONLY_NOT_NULL, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"UseCompressedOops", "true", "ReduceInitialCardMarks", "false"}, + counts = {IRNode.G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, POST_ONLY_NOT_NULL, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"UseCompressedOops", "false", "ReduceInitialCardMarks", "true"}, + failOn = {IRNode.G1_STORE_P}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"UseCompressedOops", "true", "ReduceInitialCardMarks", "true"}, + failOn = {IRNode.G1_STORE_N, IRNode.G1_ENCODE_P_AND_STORE_N}, + phase = CompilePhase.FINAL_CODE) + public static Outer testStoreNotNullOnNewObject(Object o1) { + if (o1.hashCode() == 42) { + return null; + } + Outer o = new Outer(); + o.f = o1; + return o; + } + + @Test + @IR(applyIfAnd = {"UseCompressedOops", "false", "ReduceInitialCardMarks", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, POST_ONLY, "2"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"UseCompressedOops", "true", "ReduceInitialCardMarks", "false"}, + counts = {IRNode.G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, POST_ONLY, "2"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"UseCompressedOops", "false", "ReduceInitialCardMarks", "true"}, + failOn = {IRNode.G1_STORE_P}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"UseCompressedOops", "true", "ReduceInitialCardMarks", "true"}, + failOn = {IRNode.G1_STORE_N, IRNode.G1_ENCODE_P_AND_STORE_N}, + phase = CompilePhase.FINAL_CODE) + public static Outer testStoreOnNewObjectInTwoPaths(Object o1, boolean c) { + Outer o; + if (c) { + o = new Outer(); + o.f = o1; + } else { + o = new Outer(); + o.f = o1; + } + return o; + } + + @Run(test = {"testStore", + "testStoreNull", + "testStoreObfuscatedNull", + "testStoreNotNull", + "testStoreTwice", + "testStoreVolatile", + "testStoreOnNewObject", + "testStoreNullOnNewObject", + "testStoreNotNullOnNewObject", + "testStoreOnNewObjectInTwoPaths"}) + public void runStoreTests() { + { + Outer o = new Outer(); + Object o1 = new Object(); + testStore(o, o1); + Asserts.assertEquals(o1, o.f); + } + { + Outer o = new Outer(); + testStoreNull(o); + Asserts.assertNull(o.f); + } + { + Outer o = new Outer(); + Object o1 = new Object(); + testStoreObfuscatedNull(o, o1); + Asserts.assertNull(o.f); + } + { + Outer o = new Outer(); + Object o1 = new Object(); + testStoreNotNull(o, o1); + Asserts.assertEquals(o1, o.f); + } + { + Outer o = new Outer(); + Outer p = new Outer(); + Object o1 = new Object(); + testStoreTwice(o, p, o1); + Asserts.assertEquals(o1, o.f); + Asserts.assertEquals(o1, p.f); + } + { + OuterWithVolatileField o = new OuterWithVolatileField(); + Object o1 = new Object(); + testStoreVolatile(o, o1); + Asserts.assertEquals(o1, o.f); + } + { + Object o1 = new Object(); + Outer o = testStoreOnNewObject(o1); + Asserts.assertEquals(o1, o.f); + } + { + Outer o = testStoreNullOnNewObject(); + Asserts.assertNull(o.f); + } + { + Object o1 = new Object(); + Outer o = testStoreNotNullOnNewObject(o1); + Asserts.assertEquals(o1, o.f); + } + { + Object o1 = new Object(); + Outer o = testStoreOnNewObjectInTwoPaths(o1, ThreadLocalRandom.current().nextBoolean()); + Asserts.assertEquals(o1, o.f); + } + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + public static void testArrayStore(Object[] a, int index, Object o1) { + a[index] = o1; + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, PRE_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_STORE_N_WITH_BARRIER_FLAG, PRE_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + public static void testArrayStoreNull(Object[] a, int index) { + a[index] = null; + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, PRE_AND_POST_NOT_NULL, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, PRE_AND_POST_NOT_NULL, "1"}, + phase = CompilePhase.FINAL_CODE) + public static void testArrayStoreNotNull(Object[] a, int index, Object o1) { + if (o1.hashCode() == 42) { + return; + } + a[index] = o1; + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, PRE_AND_POST, "2"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, PRE_AND_POST, "2"}, + phase = CompilePhase.FINAL_CODE) + public static void testArrayStoreTwice(Object[] a, Object[] b, int index, Object o1) { + a[index] = o1; + b[index] = o1; + } + + @Test + @IR(applyIfAnd = {"UseCompressedOops", "false", "ReduceInitialCardMarks", "true"}, + failOn = {IRNode.G1_STORE_P}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"UseCompressedOops", "true", "ReduceInitialCardMarks", "true"}, + failOn = {IRNode.G1_STORE_N, IRNode.G1_ENCODE_P_AND_STORE_N}, + phase = CompilePhase.FINAL_CODE) + public static Object[] testStoreOnNewArray(Object o1) { + Object[] a = new Object[10]; + // The index needs to be concrete for C2 to detect that it is safe to + // remove the pre-barrier. + a[4] = o1; + return a; + } + + @Run(test = {"testArrayStore", + "testArrayStoreNull", + "testArrayStoreNotNull", + "testArrayStoreTwice", + "testStoreOnNewArray"}) + public void runArrayStoreTests() { + { + Object[] a = new Object[10]; + Object o1 = new Object(); + testArrayStore(a, 4, o1); + Asserts.assertEquals(o1, a[4]); + } + { + Object[] a = new Object[10]; + testArrayStoreNull(a, 4); + Asserts.assertNull(a[4]); + } + { + Object[] a = new Object[10]; + Object o1 = new Object(); + testArrayStoreNotNull(a, 4, o1); + Asserts.assertEquals(o1, a[4]); + } + { + Object[] a = new Object[10]; + Object[] b = new Object[10]; + Object o1 = new Object(); + testArrayStoreTwice(a, b, 4, o1); + Asserts.assertEquals(o1, a[4]); + Asserts.assertEquals(o1, b[4]); + } + { + Object o1 = new Object(); + Object[] a = testStoreOnNewArray(o1); + Asserts.assertEquals(o1, a[4]); + } + } + + @Test + public static Object[] testCloneArrayOfObjects(Object[] a) { + Object[] a1 = null; + try { + a1 = a.clone(); + } catch (Exception e) {} + return a1; + } + + @Test + @IR(applyIf = {"ReduceInitialCardMarks", "true"}, + failOn = {IRNode.G1_STORE_P, IRNode.G1_STORE_N, IRNode.G1_ENCODE_P_AND_STORE_N}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"ReduceInitialCardMarks", "false", "UseCompressedOops", "false"}, + counts = {IRNode.G1_STORE_P_WITH_BARRIER_FLAG, POST_ONLY, "2"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIfAnd = {"ReduceInitialCardMarks", "false", "UseCompressedOops", "true"}, + counts = {IRNode.G1_STORE_N_WITH_BARRIER_FLAG, POST_ONLY, "2"}, + phase = CompilePhase.FINAL_CODE) + public static OuterWithFewFields testCloneObjectWithFewFields(OuterWithFewFields o) { + Object o1 = null; + try { + o1 = o.clone(); + } catch (Exception e) {} + return (OuterWithFewFields)o1; + } + + @Test + @IR(applyIf = {"ReduceInitialCardMarks", "true"}, + counts = {IRNode.CALL_OF, "jlong_disjoint_arraycopy", "1"}) + @IR(applyIf = {"ReduceInitialCardMarks", "false"}, + counts = {IRNode.CALL_OF, "G1BarrierSetRuntime::clone", "1"}) + public static OuterWithManyFields testCloneObjectWithManyFields(OuterWithManyFields o) { + Object o1 = null; + try { + o1 = o.clone(); + } catch (Exception e) {} + return (OuterWithManyFields)o1; + } + + @Run(test = {"testCloneArrayOfObjects", + "testCloneObjectWithFewFields", + "testCloneObjectWithManyFields"}) + public void runCloneTests() { + { + Object o1 = new Object(); + Object[] a = new Object[4]; + for (int i = 0; i < 4; i++) { + a[i] = o1; + } + Object[] a1 = testCloneArrayOfObjects(a); + for (int i = 0; i < 4; i++) { + Asserts.assertEquals(o1, a1[i]); + } + } + { + Object a = new Object(); + Object b = new Object(); + OuterWithFewFields o = new OuterWithFewFields(); + o.f1 = a; + o.f2 = b; + OuterWithFewFields o1 = testCloneObjectWithFewFields(o); + Asserts.assertEquals(a, o1.f1); + Asserts.assertEquals(b, o1.f2); + } + { + Object a = new Object(); + Object b = new Object(); + Object c = new Object(); + Object d = new Object(); + Object e = new Object(); + Object f = new Object(); + Object g = new Object(); + Object h = new Object(); + Object i = new Object(); + Object j = new Object(); + OuterWithManyFields o = new OuterWithManyFields(); + o.f1 = a; + o.f2 = b; + o.f3 = c; + o.f4 = d; + o.f5 = e; + o.f6 = f; + o.f7 = g; + o.f8 = h; + o.f9 = i; + o.f10 = j; + OuterWithManyFields o1 = testCloneObjectWithManyFields(o); + Asserts.assertEquals(a, o1.f1); + Asserts.assertEquals(b, o1.f2); + Asserts.assertEquals(c, o1.f3); + Asserts.assertEquals(d, o1.f4); + Asserts.assertEquals(e, o1.f5); + Asserts.assertEquals(f, o1.f6); + Asserts.assertEquals(g, o1.f7); + Asserts.assertEquals(h, o1.f8); + Asserts.assertEquals(i, o1.f9); + Asserts.assertEquals(j, o1.f10); + } + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + static Object testCompareAndExchange(Outer o, Object oldVal, Object newVal) { + return fVarHandle.compareAndExchange(o, oldVal, newVal); + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + static boolean testCompareAndSwap(Outer o, Object oldVal, Object newVal) { + return fVarHandle.compareAndSet(o, oldVal, newVal); + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_GET_AND_SET_P_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_GET_AND_SET_N_WITH_BARRIER_FLAG, PRE_AND_POST, "1"}, + phase = CompilePhase.FINAL_CODE) + static Object testGetAndSet(Outer o, Object newVal) { + return fVarHandle.getAndSet(o, newVal); + } + + @Run(test = {"testCompareAndExchange", + "testCompareAndSwap", + "testGetAndSet"}) + public void runAtomicTests() { + { + Outer o = new Outer(); + Object oldVal = new Object(); + o.f = oldVal; + Object newVal = new Object(); + Object oldVal2 = testCompareAndExchange(o, oldVal, newVal); + Asserts.assertEquals(oldVal, oldVal2); + Asserts.assertEquals(o.f, newVal); + } + { + Outer o = new Outer(); + Object oldVal = new Object(); + o.f = oldVal; + Object newVal = new Object(); + boolean b = testCompareAndSwap(o, oldVal, newVal); + Asserts.assertTrue(b); + Asserts.assertEquals(o.f, newVal); + } + { + Outer o = new Outer(); + Object oldVal = new Object(); + o.f = oldVal; + Object newVal = new Object(); + Object oldVal2 = testGetAndSet(o, newVal); + Asserts.assertEquals(oldVal, oldVal2); + Asserts.assertEquals(o.f, newVal); + } + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_LOAD_P_WITH_BARRIER_FLAG, PRE_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_LOAD_N_WITH_BARRIER_FLAG, PRE_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + static Object testLoadSoftReference(SoftReference ref) { + return ref.get(); + } + + @Test + @IR(applyIf = {"UseCompressedOops", "false"}, + counts = {IRNode.G1_LOAD_P_WITH_BARRIER_FLAG, PRE_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + @IR(applyIf = {"UseCompressedOops", "true"}, + counts = {IRNode.G1_LOAD_N_WITH_BARRIER_FLAG, PRE_ONLY, "1"}, + phase = CompilePhase.FINAL_CODE) + static Object testLoadWeakReference(WeakReference ref) { + return ref.get(); + } + + @Run(test = {"testLoadSoftReference", + "testLoadWeakReference"}) + public void runReferenceTests() { + { + Object o1 = new Object(); + SoftReference sref = new SoftReference(o1); + Object o2 = testLoadSoftReference(sref); + Asserts.assertTrue(o2 == o1 || o2 == null); + } + { + Object o1 = new Object(); + WeakReference wref = new WeakReference(o1); + Object o2 = testLoadWeakReference(wref); + Asserts.assertTrue(o2 == o1 || o2 == null); + } + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java index 16f56012d3dd9..a7c61f710505a 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java @@ -358,6 +358,11 @@ public class IRNode { beforeMatchingNameRegex(CALL, "Call.*Java"); } + public static final String CALL_OF = COMPOSITE_PREFIX + "CALL_OF" + POSTFIX; + static { + callOfNodes(CALL_OF, "Call.*"); + } + public static final String CALL_OF_METHOD = COMPOSITE_PREFIX + "CALL_OF_METHOD" + POSTFIX; static { callOfNodes(CALL_OF_METHOD, "Call.*Java"); @@ -581,6 +586,92 @@ public class IRNode { vectorNode(FMA_VD, "FmaVD", TYPE_DOUBLE); } + public static final String G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG" + POSTFIX; + static { + String regex = START + "g1CompareAndExchangeN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END; + machOnly(G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG, regex); + } + + public static final String G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG" + POSTFIX; + static { + String regex = START + "g1CompareAndExchangeP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END; + machOnly(G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG, regex); + } + + public static final String G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG" + POSTFIX; + static { + String regex = START + "g1CompareAndSwapN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END; + machOnly(G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG, regex); + } + + public static final String G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG" + POSTFIX; + static { + String regex = START + "g1CompareAndSwapP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END; + machOnly(G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG, regex); + } + + public static final String G1_ENCODE_P_AND_STORE_N = PREFIX + "G1_ENCODE_P_AND_STORE_N" + POSTFIX; + static { + machOnlyNameRegex(G1_ENCODE_P_AND_STORE_N, "g1EncodePAndStoreN"); + } + + public static final String G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG" + POSTFIX; + static { + String regex = START + "g1EncodePAndStoreN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END; + machOnly(G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, regex); + } + + public static final String G1_GET_AND_SET_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_GET_AND_SET_N_WITH_BARRIER_FLAG" + POSTFIX; + static { + String regex = START + "g1GetAndSetN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END; + machOnly(G1_GET_AND_SET_N_WITH_BARRIER_FLAG, regex); + } + + public static final String G1_GET_AND_SET_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_GET_AND_SET_P_WITH_BARRIER_FLAG" + POSTFIX; + static { + String regex = START + "g1GetAndSetP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END; + machOnly(G1_GET_AND_SET_P_WITH_BARRIER_FLAG, regex); + } + + public static final String G1_LOAD_N = PREFIX + "G1_LOAD_N" + POSTFIX; + static { + machOnlyNameRegex(G1_LOAD_N, "g1LoadN"); + } + + public static final String G1_LOAD_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_LOAD_N_WITH_BARRIER_FLAG" + POSTFIX; + static { + String regex = START + "g1LoadN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END; + machOnly(G1_LOAD_N_WITH_BARRIER_FLAG, regex); + } + + public static final String G1_LOAD_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_LOAD_P_WITH_BARRIER_FLAG" + POSTFIX; + static { + String regex = START + "g1LoadP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END; + machOnly(G1_LOAD_P_WITH_BARRIER_FLAG, regex); + } + + public static final String G1_STORE_N = PREFIX + "G1_STORE_N" + POSTFIX; + static { + machOnlyNameRegex(G1_STORE_N, "g1StoreN"); + } + + public static final String G1_STORE_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_STORE_N_WITH_BARRIER_FLAG" + POSTFIX; + static { + String regex = START + "g1StoreN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END; + machOnly(G1_STORE_N_WITH_BARRIER_FLAG, regex); + } + + public static final String G1_STORE_P = PREFIX + "G1_STORE_P" + POSTFIX; + static { + machOnlyNameRegex(G1_STORE_P, "g1StoreP"); + } + + public static final String G1_STORE_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_STORE_P_WITH_BARRIER_FLAG" + POSTFIX; + static { + String regex = START + "g1StoreP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END; + machOnly(G1_STORE_P_WITH_BARRIER_FLAG, regex); + } + public static final String IF = PREFIX + "IF" + POSTFIX; static { beforeMatchingNameRegex(IF, "If\\b"); @@ -852,6 +943,11 @@ public class IRNode { vectorNode(LSHIFT_VL, "LShiftVL", TYPE_LONG); } + public static final String MACH_TEMP = PREFIX + "MACH_TEMP" + POSTFIX; + static { + machOnlyNameRegex(MACH_TEMP, "MachTemp"); + } + public static final String MACRO_LOGIC_V = PREFIX + "MACRO_LOGIC_V" + POSTFIX; static { afterBarrierExpansionToBeforeMatching(MACRO_LOGIC_V, "MacroLogicV"); @@ -1148,6 +1244,12 @@ public class IRNode { trapNodes(NULL_CHECK_TRAP, "null_check"); } + public static final String OOPMAP_WITH = COMPOSITE_PREFIX + "OOPMAP_WITH" + POSTFIX; + static { + String regex = "(#\\s*OopMap\\s*\\{.*" + IS_REPLACED + ".*\\})"; + optoOnly(OOPMAP_WITH, regex); + } + public static final String OR_VB = VECTOR_PREFIX + "OR_VB" + POSTFIX; static { vectorNode(OR_VB, "OrV", TYPE_BYTE); diff --git a/test/hotspot/jtreg/compiler/runtime/safepoints/TestMachTempsAcrossSafepoints.java b/test/hotspot/jtreg/compiler/runtime/safepoints/TestMachTempsAcrossSafepoints.java new file mode 100644 index 0000000000000..ecd8f58c5ed82 --- /dev/null +++ b/test/hotspot/jtreg/compiler/runtime/safepoints/TestMachTempsAcrossSafepoints.java @@ -0,0 +1,98 @@ +/* + * 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 compiler.runtime.safepoints; + +import compiler.lib.ir_framework.*; +import java.lang.ref.SoftReference; + +/** + * @test + * @summary Test that undefined values generated by MachTemp nodes (in this + * case, derived from G1 barriers) are not included in OopMaps. + * Extracted from java.lang.invoke.LambdaFormEditor::getInCache. + * @key randomness + * @library /test/lib / + * @requires vm.gc.G1 & vm.bits == 64 & vm.opt.final.UseCompressedOops == true + * @run driver compiler.runtime.safepoints.TestMachTempsAcrossSafepoints + */ + +public class TestMachTempsAcrossSafepoints { + + static class RefWithKey extends SoftReference { + final int key; + + public RefWithKey(int key) { + super(new Object()); + this.key = key; + } + + @DontInline + @Override + public boolean equals(Object obj) { + return obj instanceof RefWithKey that && this.key == that.key; + } + } + + public static void main(String[] args) throws Exception { + String inlineCmd = "-XX:CompileCommand=inline,java.lang.ref.SoftReference::get"; + TestFramework.runWithFlags(inlineCmd, "-XX:+StressGCM", "-XX:+StressLCM", "-XX:StressSeed=1"); + TestFramework.runWithFlags(inlineCmd, "-XX:+StressGCM", "-XX:+StressLCM"); + } + + @Test + @IR(counts = {IRNode.G1_LOAD_N, "1"}, phase = CompilePhase.FINAL_CODE) + @IR(counts = {IRNode.MACH_TEMP, ">= 1"}, phase = CompilePhase.FINAL_CODE) + @IR(counts = {IRNode.STATIC_CALL_OF_METHOD, "equals", "2"}) + @IR(failOn = {IRNode.OOPMAP_WITH, "NarrowOop"}) + static private Object test(RefWithKey key, RefWithKey[] refs) { + RefWithKey k = null; + // This loop causes the register allocator to not "rematerialize" all + // MachTemp nodes generated for the reference g1LoadN instruction below. + for (int i = 0; i < refs.length; i++) { + RefWithKey k0 = refs[0]; + if (k0.equals(key)) { + k = k0; + } + } + if (k != null && !key.equals(k)) { + return null; + } + // The MachTemp node implementing the dst TEMP operand in the g1LoadN + // instruction corresponding to k.get() can be scheduled across the + // above call to RefWithKey::equals(), due to an unfortunate interaction + // of inaccurate basic block frequency estimation (emulated in this test + // by randomizing the GCM and LCM heuristics) and call-catch cleanup. + // Since narrow pointer MachTemp nodes are typed as narrow OOPs, this + // causes the oopmap builder to include the MachTemp node definition in + // the RefWithKey::equals() return oopmap. + return (k != null) ? k.get() : null; + } + + @Run(test = "test") + @Warmup(0) + public void run() { + RefWithKey ref = new RefWithKey(42); + test(ref, new RefWithKey[]{ref}); + } +} diff --git a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java index df4f9063586f4..d62e286c68d58 100644 --- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java +++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java @@ -304,7 +304,10 @@ private String[] cmd(long classStart, long classStop) { "-XX:+StressMacroExpansion", "-XX:+StressIncrementalInlining", // StressSeed is uint - "-XX:StressSeed=" + rng.nextInt(Integer.MAX_VALUE))); + "-XX:StressSeed=" + rng.nextInt(Integer.MAX_VALUE), + // Do not fail on huge methods where StressGCM makes register + // allocation allocate lots of memory + "-XX:CompileCommand=memlimit,*.*,0")); for (String arg : CTW_EXTRA_ARGS.split(",")) { Args.add(arg); diff --git a/test/jdk/java/lang/invoke/BigArityTest.java b/test/jdk/java/lang/invoke/BigArityTest.java index 338903f31630d..2dba056a183ab 100644 --- a/test/jdk/java/lang/invoke/BigArityTest.java +++ b/test/jdk/java/lang/invoke/BigArityTest.java @@ -24,7 +24,7 @@ /* @test * @summary High arity invocations * @compile BigArityTest.java - * @run junit/othervm/timeout=2500 -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies -esa -DBigArityTest.ITERATION_COUNT=1 test.java.lang.invoke.BigArityTest + * @run junit/othervm/timeout=2500 -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies -XX:CompileCommand=memlimit,*.*,0 -esa -DBigArityTest.ITERATION_COUNT=1 test.java.lang.invoke.BigArityTest */ package test.java.lang.invoke; From 19642bd3833fa96eb4bc7a8a11e902782e0b7844 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Thu, 3 Oct 2024 09:23:46 +0000 Subject: [PATCH 295/307] 8341148: Open source several Choice related tests Reviewed-by: abhiscxk --- .../Choice/ChoiceInLWTest/ChoiceInLWTest.java | 96 +++++++++++++++++++ .../MultiItemSelected_DragOut.java | 74 ++++++++++++++ .../MultiItemSelected_KeySelect.java | 75 +++++++++++++++ .../MultiItemSelected_UpDown.java | 76 +++++++++++++++ .../RepaintAfterRemoveLastItemTest.java | 77 +++++++++++++++ 5 files changed, 398 insertions(+) create mode 100644 test/jdk/java/awt/Choice/ChoiceInLWTest/ChoiceInLWTest.java create mode 100644 test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_DragOut.java create mode 100644 test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_KeySelect.java create mode 100644 test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_UpDown.java create mode 100644 test/jdk/java/awt/Choice/RepaintAfterRemoveLastItemTest/RepaintAfterRemoveLastItemTest.java diff --git a/test/jdk/java/awt/Choice/ChoiceInLWTest/ChoiceInLWTest.java b/test/jdk/java/awt/Choice/ChoiceInLWTest/ChoiceInLWTest.java new file mode 100644 index 0000000000000..9d1ad19549189 --- /dev/null +++ b/test/jdk/java/awt/Choice/ChoiceInLWTest/ChoiceInLWTest.java @@ -0,0 +1,96 @@ +/* + * 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 4130788 + * @summary Choice components move unexpectedly when in lightweight containers + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ChoiceInLWTest + */ + +import java.awt.BorderLayout; +import java.awt.Choice; +import java.awt.Container; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Label; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.lang.reflect.InvocationTargetException; + +public class ChoiceInLWTest extends Frame implements Runnable { + private final Choice choices; + static final String INSTRUCTIONS = """ + After test starts wait for two seconds and open a choice. + If choice's popup obscures the label above it press Fail. + Otherwise press Pass. + """; + + public ChoiceInLWTest() { + setLayout(new BorderLayout()); + Container lwCont = new Container(); + lwCont.setLayout(new FlowLayout()); + choices = new Choice(); + choices.add("This is just a token item to get a nice width."); + lwCont.add(choices); + add("Center", lwCont); + Label label = new Label("You should see an unobscured Choice below."); + label.setAlignment(Label.CENTER); + add("North", label); + addChoiceItem(); + addWindowListener(new WindowAdapter() { + @Override + public void windowOpened(WindowEvent e) { + super.windowOpened(e); + new Thread(ChoiceInLWTest.this).start(); + } + }); + pack(); + } + + private void addChoiceItem() { + choices.add("Adding an item used to move the Choice!"); + } + + public void run() { + try { + Thread.sleep(1000); + } catch (InterruptedException ignore) { + } + addChoiceItem(); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Choice in LW Container Test") + .testUI(ChoiceInLWTest::new) + .instructions(INSTRUCTIONS) + .columns(40) + .build() + .awaitAndCheck(); + + } +} diff --git a/test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_DragOut.java b/test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_DragOut.java new file mode 100644 index 0000000000000..aed1543774575 --- /dev/null +++ b/test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_DragOut.java @@ -0,0 +1,74 @@ +/* + * 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. + */ + +/* + * @test + * @bug 6367251 + * @summary 2 items are highlighted when pressing, dragging the mouse inside the choice, XToolkit + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MultiItemSelected_DragOut + */ + +import java.awt.Choice; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.lang.reflect.InvocationTargetException; + +public class MultiItemSelected_DragOut extends Frame { + static final String INSTRUCTIONS = """ + 1) Open Choice. + 2) Start drag from first item to second or third one. + 3) Without releasing left mouse button + press and release right mouse button. + 4) Release left mouse button. + 5) Open choice again. + 6) If there is only one selection cursor + in the dropdown list press Pass otherwise press Fail. + """; + + public MultiItemSelected_DragOut() { + Choice choice = new Choice(); + + for (int i = 1; i < 10; i++) { + choice.add("item " + i); + } + add(choice); + choice.addItemListener(ie -> System.out.println(ie)); + + setLayout(new FlowLayout()); + setSize(200, 200); + validate(); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("MultiItemSelected Drag Out Test") + .testUI(MultiItemSelected_DragOut::new) + .instructions(INSTRUCTIONS) + .columns(40) + .build() + .awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_KeySelect.java b/test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_KeySelect.java new file mode 100644 index 0000000000000..9e930f9923b81 --- /dev/null +++ b/test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_KeySelect.java @@ -0,0 +1,75 @@ +/* + * 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. + */ + +/* + * @test + * @bug 6367251 + * @summary 2 items are highlighted when dragging inside and press ESC or ENTER + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MultiItemSelected_KeySelect + */ + +import java.awt.Choice; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.lang.reflect.InvocationTargetException; + +public class MultiItemSelected_KeySelect extends Frame { + static final String INSTRUCTIONS = """ + 1) Open Choice. + 2) Start drag from first item to another one. + 3) Without releasing the mouse button press ESC key. + 4) Open choice again. + 5) Verify that there is only one + selection cursor in the dropdown list. + 6) Repeat steps 2-5 once again but this time + press ENTER key instead of ESC. + 7) If in both scenarios there is only one selection cursor + press Pass otherwise press Fail. + """; + + public MultiItemSelected_KeySelect() { + Choice choice = new Choice(); + + for (int i = 1; i < 10; i++) { + choice.add("item " + i); + } + add(choice); + choice.addItemListener(ie -> System.out.println(ie)); + setLayout(new FlowLayout()); + setSize(200, 200); + validate(); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("MultiItemSelected Key Select Test") + .testUI(MultiItemSelected_KeySelect::new) + .instructions(INSTRUCTIONS) + .columns(40) + .build() + .awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_UpDown.java b/test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_UpDown.java new file mode 100644 index 0000000000000..5904d98a9081f --- /dev/null +++ b/test/jdk/java/awt/Choice/MultiItemSelected/MultiItemSelected_UpDown.java @@ -0,0 +1,76 @@ +/* + * 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. + */ + +/* + * @test + * @bug 6367251 + * @summary 2 items are highlighted when dragging outside and press UP or DOWN + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MultiItemSelected_UpDown + */ + +import java.awt.Choice; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.lang.reflect.InvocationTargetException; + +public class MultiItemSelected_UpDown extends Frame { + static final String INSTRUCTIONS = """ + 1) Open Choice. + 2) Start drag from first item to another one. + 3) Without interrupting drag + move mouse cursor outside the choice popup. + 4) Press UP, DOWN key several times to position + selection cursor to a different item. + 5) Release mouse button. + 6) If popup is closed upon mouse button release open Choice again. + 7) Verify that there is only one + selection cursor in the dropdown list. + 8) If true then press Pass, otherwise press Fail. + """; + + public MultiItemSelected_UpDown() { + Choice choice = new Choice(); + + for (int i = 1; i < 20; i++) { + choice.add(" item " + i); + } + add(choice); + choice.addItemListener(ie -> System.out.println(ie)); + setLayout(new FlowLayout()); + setSize(200, 200); + validate(); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("MultiItemSelected Up/Down Test") + .testUI(MultiItemSelected_UpDown::new) + .instructions(INSTRUCTIONS) + .columns(40) + .build() + .awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/Choice/RepaintAfterRemoveLastItemTest/RepaintAfterRemoveLastItemTest.java b/test/jdk/java/awt/Choice/RepaintAfterRemoveLastItemTest/RepaintAfterRemoveLastItemTest.java new file mode 100644 index 0000000000000..20acc66b6bda1 --- /dev/null +++ b/test/jdk/java/awt/Choice/RepaintAfterRemoveLastItemTest/RepaintAfterRemoveLastItemTest.java @@ -0,0 +1,77 @@ +/* + * 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. + */ + +/* + * @test + * @bug 6292186 + * @summary Choice is not refreshed properly when the last item gets removed + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual RepaintAfterRemoveLastItemTest + */ + +import java.awt.Button; +import java.awt.Choice; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.lang.reflect.InvocationTargetException; + +public class RepaintAfterRemoveLastItemTest extends Frame implements ActionListener { + Choice ch = new Choice(); + + static final String INSTRUCTIONS = """ + Press on the 'remove' button after that if the choice does not display + 'only item' press Pass. If 'only item' is still displayed press Fail. + """; + + public RepaintAfterRemoveLastItemTest() { + ch.add("only item"); + add(ch); + + Button b = new Button("remove"); + add(b); + b.addActionListener(this); + setLayout(new FlowLayout()); + setSize(200, 200); + validate(); + } + + public void actionPerformed(ActionEvent ae) { + if (ch.getItemCount() != 0) { + ch.remove(0); + } + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Repaint After Remove Test") + .testUI(RepaintAfterRemoveLastItemTest::new) + .instructions(INSTRUCTIONS) + .columns(40) + .build() + .awaitAndCheck(); + } +} From 6af13580c2086afefde489275bc2353c2320ff3f Mon Sep 17 00:00:00 2001 From: Jorn Vernee Date: Thu, 3 Oct 2024 12:02:24 +0000 Subject: [PATCH 296/307] 8337753: Target class of upcall stub may be unloaded Reviewed-by: amitkumar, vlivanov, mdoerr --- .../cpu/aarch64/stubGenerator_aarch64.cpp | 23 +++++ .../cpu/aarch64/upcallLinker_aarch64.cpp | 16 ++- src/hotspot/cpu/arm/upcallLinker_arm.cpp | 2 +- src/hotspot/cpu/ppc/stubGenerator_ppc.cpp | 25 +++++ src/hotspot/cpu/ppc/upcallLinker_ppc.cpp | 18 ++-- src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 24 +++++ src/hotspot/cpu/riscv/upcallLinker_riscv.cpp | 16 ++- src/hotspot/cpu/s390/stubGenerator_s390.cpp | 24 +++++ src/hotspot/cpu/s390/upcallLinker_s390.cpp | 17 ++-- src/hotspot/cpu/x86/stubGenerator_x86_64.cpp | 24 +++++ src/hotspot/cpu/x86/stubGenerator_x86_64.hpp | 1 + src/hotspot/cpu/x86/upcallLinker_x86_32.cpp | 2 +- src/hotspot/cpu/x86/upcallLinker_x86_64.cpp | 19 ++-- src/hotspot/cpu/zero/upcallLinker_zero.cpp | 2 +- src/hotspot/share/code/codeBlob.cpp | 8 +- src/hotspot/share/prims/upcallLinker.cpp | 35 +++---- src/hotspot/share/prims/upcallLinker.hpp | 4 +- src/hotspot/share/runtime/frame.cpp | 17 +++- src/hotspot/share/runtime/frame.hpp | 1 + src/hotspot/share/runtime/stubRoutines.cpp | 1 + src/hotspot/share/runtime/stubRoutines.hpp | 6 ++ test/jdk/TEST.groups | 3 +- test/jdk/java/foreign/TestUpcallStress.java | 97 +++++++++++++++++++ 23 files changed, 307 insertions(+), 78 deletions(-) create mode 100644 test/jdk/java/foreign/TestUpcallStress.java diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index eb235f8472c1d..31116e006f025 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -7320,6 +7320,28 @@ class StubGenerator: public StubCodeGenerator { return start; } + // load Method* target of MethodHandle + // j_rarg0 = jobject receiver + // rmethod = result + address generate_upcall_stub_load_target() { + StubCodeMark mark(this, "StubRoutines", "upcall_stub_load_target"); + address start = __ pc(); + + __ resolve_global_jobject(j_rarg0, rscratch1, rscratch2); + // Load target method from receiver + __ load_heap_oop(rmethod, Address(j_rarg0, java_lang_invoke_MethodHandle::form_offset()), rscratch1, rscratch2); + __ load_heap_oop(rmethod, Address(rmethod, java_lang_invoke_LambdaForm::vmentry_offset()), rscratch1, rscratch2); + __ load_heap_oop(rmethod, Address(rmethod, java_lang_invoke_MemberName::method_offset()), rscratch1, rscratch2); + __ access_load_at(T_ADDRESS, IN_HEAP, rmethod, + Address(rmethod, java_lang_invoke_ResolvedMethodName::vmtarget_offset()), + noreg, noreg); + __ str(rmethod, Address(rthread, JavaThread::callee_target_offset())); // just in case callee is deoptimized + + __ ret(lr); + + return start; + } + #undef __ #define __ masm-> @@ -8241,6 +8263,7 @@ class StubGenerator: public StubCodeGenerator { #endif StubRoutines::_upcall_stub_exception_handler = generate_upcall_stub_exception_handler(); + StubRoutines::_upcall_stub_load_target = generate_upcall_stub_load_target(); StubRoutines::aarch64::set_completed(); // Inidicate that arraycopy and zero_blocks stubs are generated } diff --git a/src/hotspot/cpu/aarch64/upcallLinker_aarch64.cpp b/src/hotspot/cpu/aarch64/upcallLinker_aarch64.cpp index 28ec07815be5c..517fccb2d1aa5 100644 --- a/src/hotspot/cpu/aarch64/upcallLinker_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/upcallLinker_aarch64.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "classfile/javaClasses.hpp" #include "logging/logStream.hpp" #include "memory/resourceArea.hpp" #include "prims/upcallLinker.hpp" @@ -117,7 +118,7 @@ static void restore_callee_saved_registers(MacroAssembler* _masm, const ABIDescr static const int upcall_stub_code_base_size = 1024; static const int upcall_stub_size_per_arg = 16; -address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, +address UpcallLinker::make_upcall_stub(jobject receiver, Symbol* signature, BasicType* out_sig_bt, int total_out_args, BasicType ret_type, jobject jabi, jobject jconv, @@ -222,7 +223,6 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, __ block_comment("{ on_entry"); __ lea(c_rarg0, Address(sp, frame_data_offset)); - __ movptr(c_rarg1, (intptr_t)receiver); __ movptr(rscratch1, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::on_entry)); __ blr(rscratch1); __ mov(rthread, r0); @@ -238,12 +238,10 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, arg_shuffle.generate(_masm, as_VMStorage(shuffle_reg), abi._shadow_space_bytes, 0); __ block_comment("} argument shuffle"); - __ block_comment("{ receiver "); - __ get_vm_result(j_rarg0, rthread); - __ block_comment("} receiver "); - - __ mov_metadata(rmethod, entry); - __ str(rmethod, Address(rthread, JavaThread::callee_target_offset())); // just in case callee is deoptimized + __ block_comment("{ load target "); + __ movptr(j_rarg0, (intptr_t)receiver); + __ far_call(RuntimeAddress(StubRoutines::upcall_stub_load_target()), rscratch1); // puts target Method* in rmethod + __ block_comment("} load target "); __ push_cont_fastpath(rthread); @@ -318,7 +316,7 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, #ifndef PRODUCT stringStream ss; - ss.print("upcall_stub_%s", entry->signature()->as_C_string()); + ss.print("upcall_stub_%s", signature->as_C_string()); const char* name = _masm->code_string(ss.as_string()); #else // PRODUCT const char* name = "upcall_stub"; diff --git a/src/hotspot/cpu/arm/upcallLinker_arm.cpp b/src/hotspot/cpu/arm/upcallLinker_arm.cpp index c7645f4a03351..696b2001e6b7b 100644 --- a/src/hotspot/cpu/arm/upcallLinker_arm.cpp +++ b/src/hotspot/cpu/arm/upcallLinker_arm.cpp @@ -25,7 +25,7 @@ #include "prims/upcallLinker.hpp" #include "utilities/debug.hpp" -address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, +address UpcallLinker::make_upcall_stub(jobject receiver, Symbol* signature, BasicType* out_sig_bt, int total_out_args, BasicType ret_type, jobject jabi, jobject jconv, diff --git a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp index ee3f1911e2082..206c161287fa2 100644 --- a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp @@ -4587,6 +4587,30 @@ address generate_lookup_secondary_supers_table_stub(u1 super_klass_index) { return start; } + // load Method* target of MethodHandle + // R3_ARG1 = jobject receiver + // R19_method = result Method* + address generate_upcall_stub_load_target() { + + StubCodeMark mark(this, "StubRoutines", "upcall_stub_load_target"); + address start = __ pc(); + + __ resolve_global_jobject(R3_ARG1, R22_tmp2, R23_tmp3, MacroAssembler::PRESERVATION_FRAME_LR_GP_FP_REGS); + // Load target method from receiver + __ load_heap_oop(R19_method, java_lang_invoke_MethodHandle::form_offset(), R3_ARG1, + R22_tmp2, R23_tmp3, MacroAssembler::PRESERVATION_FRAME_LR_GP_FP_REGS, IS_NOT_NULL); + __ load_heap_oop(R19_method, java_lang_invoke_LambdaForm::vmentry_offset(), R19_method, + R22_tmp2, R23_tmp3, MacroAssembler::PRESERVATION_FRAME_LR_GP_FP_REGS, IS_NOT_NULL); + __ load_heap_oop(R19_method, java_lang_invoke_MemberName::method_offset(), R19_method, + R22_tmp2, R23_tmp3, MacroAssembler::PRESERVATION_FRAME_LR_GP_FP_REGS, IS_NOT_NULL); + __ ld(R19_method, java_lang_invoke_ResolvedMethodName::vmtarget_offset(), R19_method); + __ std(R19_method, in_bytes(JavaThread::callee_target_offset()), R16_thread); // just in case callee is deoptimized + + __ blr(); + + return start; + } + // Initialization void generate_initial_stubs() { // Generates all stubs and initializes the entry points @@ -4651,6 +4675,7 @@ address generate_lookup_secondary_supers_table_stub(u1 super_klass_index) { } StubRoutines::_upcall_stub_exception_handler = generate_upcall_stub_exception_handler(); + StubRoutines::_upcall_stub_load_target = generate_upcall_stub_load_target(); } void generate_compiler_stubs() { diff --git a/src/hotspot/cpu/ppc/upcallLinker_ppc.cpp b/src/hotspot/cpu/ppc/upcallLinker_ppc.cpp index b60fd4f16d163..635bab900d157 100644 --- a/src/hotspot/cpu/ppc/upcallLinker_ppc.cpp +++ b/src/hotspot/cpu/ppc/upcallLinker_ppc.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" +#include "classfile/javaClasses.hpp" #include "logging/logStream.hpp" #include "memory/resourceArea.hpp" #include "prims/upcallLinker.hpp" @@ -118,7 +119,7 @@ static void restore_callee_saved_registers(MacroAssembler* _masm, const ABIDescr static const int upcall_stub_code_base_size = 1024; static const int upcall_stub_size_per_arg = 16; // arg save & restore + move -address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, +address UpcallLinker::make_upcall_stub(jobject receiver, Symbol* signature, BasicType* out_sig_bt, int total_out_args, BasicType ret_type, jobject jabi, jobject jconv, @@ -221,7 +222,6 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, __ block_comment("{ on_entry"); __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::on_entry), R0); __ addi(R3_ARG1, R1_SP, frame_data_offset); - __ load_const_optimized(R4_ARG2, (intptr_t)receiver, R0); __ call_c(call_target_address); __ mr(R16_thread, R3_RET); __ block_comment("} on_entry"); @@ -236,12 +236,12 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, arg_shuffle.generate(_masm, as_VMStorage(callerSP), frame::native_abi_minframe_size, frame::jit_out_preserve_size); __ block_comment("} argument shuffle"); - __ block_comment("{ receiver "); - __ get_vm_result(R3_ARG1); - __ block_comment("} receiver "); - - __ load_const_optimized(R19_method, (intptr_t)entry); - __ std(R19_method, in_bytes(JavaThread::callee_target_offset()), R16_thread); + __ block_comment("{ load target "); + __ load_const_optimized(call_target_address, StubRoutines::upcall_stub_load_target(), R0); + __ load_const_optimized(R3_ARG1, (intptr_t)receiver, R0); + __ mtctr(call_target_address); + __ bctrl(); // loads target Method* into R19_method + __ block_comment("} load target "); __ push_cont_fastpath(); @@ -326,7 +326,7 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, #ifndef PRODUCT stringStream ss; - ss.print("upcall_stub_%s", entry->signature()->as_C_string()); + ss.print("upcall_stub_%s", signature->as_C_string()); const char* name = _masm->code_string(ss.as_string()); #else // PRODUCT const char* name = "upcall_stub"; diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index 5970111088fd1..8bf3ac5c90163 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp @@ -6124,6 +6124,29 @@ static const int64_t right_3_bits = right_n_bits(3); return start; } + // load Method* target of MethodHandle + // j_rarg0 = jobject receiver + // xmethod = Method* result + address generate_upcall_stub_load_target() { + + StubCodeMark mark(this, "StubRoutines", "upcall_stub_load_target"); + address start = __ pc(); + + __ resolve_global_jobject(j_rarg0, t0, t1); + // Load target method from receiver + __ load_heap_oop(xmethod, Address(j_rarg0, java_lang_invoke_MethodHandle::form_offset()), t0, t1); + __ load_heap_oop(xmethod, Address(xmethod, java_lang_invoke_LambdaForm::vmentry_offset()), t0, t1); + __ load_heap_oop(xmethod, Address(xmethod, java_lang_invoke_MemberName::method_offset()), t0, t1); + __ access_load_at(T_ADDRESS, IN_HEAP, xmethod, + Address(xmethod, java_lang_invoke_ResolvedMethodName::vmtarget_offset()), + noreg, noreg); + __ sd(xmethod, Address(xthread, JavaThread::callee_target_offset())); // just in case callee is deoptimized + + __ ret(); + + return start; + } + #undef __ // Initialization @@ -6189,6 +6212,7 @@ static const int64_t right_3_bits = right_n_bits(3); #endif // COMPILER2 StubRoutines::_upcall_stub_exception_handler = generate_upcall_stub_exception_handler(); + StubRoutines::_upcall_stub_load_target = generate_upcall_stub_load_target(); StubRoutines::riscv::set_completed(); } diff --git a/src/hotspot/cpu/riscv/upcallLinker_riscv.cpp b/src/hotspot/cpu/riscv/upcallLinker_riscv.cpp index 383f332f8fd94..55160be99d0d8 100644 --- a/src/hotspot/cpu/riscv/upcallLinker_riscv.cpp +++ b/src/hotspot/cpu/riscv/upcallLinker_riscv.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "classfile/javaClasses.hpp" #include "logging/logStream.hpp" #include "memory/resourceArea.hpp" #include "prims/upcallLinker.hpp" @@ -117,7 +118,7 @@ static void restore_callee_saved_registers(MacroAssembler* _masm, const ABIDescr static const int upcall_stub_code_base_size = 1024; static const int upcall_stub_size_per_arg = 16; -address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, +address UpcallLinker::make_upcall_stub(jobject receiver, Symbol* signature, BasicType* out_sig_bt, int total_out_args, BasicType ret_type, jobject jabi, jobject jconv, @@ -223,7 +224,6 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, __ block_comment("{ on_entry"); __ la(c_rarg0, Address(sp, frame_data_offset)); - __ movptr(c_rarg1, (address) receiver); __ rt_call(CAST_FROM_FN_PTR(address, UpcallLinker::on_entry)); __ mv(xthread, x10); __ reinit_heapbase(); @@ -260,12 +260,10 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, arg_shuffle.generate(_masm, as_VMStorage(shuffle_reg), abi._shadow_space_bytes, 0); __ block_comment("} argument shuffle"); - __ block_comment("{ receiver "); - __ get_vm_result(j_rarg0, xthread); - __ block_comment("} receiver "); - - __ mov_metadata(xmethod, entry); - __ sd(xmethod, Address(xthread, JavaThread::callee_target_offset())); // just in case callee is deoptimized + __ block_comment("{ load target "); + __ movptr(j_rarg0, (address) receiver); + __ far_call(RuntimeAddress(StubRoutines::upcall_stub_load_target())); // loads Method* into xmethod + __ block_comment("} load target "); __ push_cont_fastpath(xthread); @@ -338,7 +336,7 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, #ifndef PRODUCT stringStream ss; - ss.print("upcall_stub_%s", entry->signature()->as_C_string()); + ss.print("upcall_stub_%s", signature->as_C_string()); const char *name = _masm->code_string(ss.as_string()); #else // PRODUCT const char* name = "upcall_stub"; diff --git a/src/hotspot/cpu/s390/stubGenerator_s390.cpp b/src/hotspot/cpu/s390/stubGenerator_s390.cpp index d878731cca51f..dd9ed4c95462b 100644 --- a/src/hotspot/cpu/s390/stubGenerator_s390.cpp +++ b/src/hotspot/cpu/s390/stubGenerator_s390.cpp @@ -3053,6 +3053,29 @@ class StubGenerator: public StubCodeGenerator { return start; } + // load Method* target of MethodHandle + // Z_ARG1 = jobject receiver + // Z_method = Method* result + address generate_upcall_stub_load_target() { + StubCodeMark mark(this, "StubRoutines", "upcall_stub_load_target"); + address start = __ pc(); + + __ resolve_global_jobject(Z_ARG1, Z_tmp_1, Z_tmp_2); + // Load target method from receiver + __ load_heap_oop(Z_method, Address(Z_ARG1, java_lang_invoke_MethodHandle::form_offset()), + noreg, noreg, IS_NOT_NULL); + __ load_heap_oop(Z_method, Address(Z_method, java_lang_invoke_LambdaForm::vmentry_offset()), + noreg, noreg, IS_NOT_NULL); + __ load_heap_oop(Z_method, Address(Z_method, java_lang_invoke_MemberName::method_offset()), + noreg, noreg, IS_NOT_NULL); + __ z_lg(Z_method, Address(Z_method, java_lang_invoke_ResolvedMethodName::vmtarget_offset())); + __ z_stg(Z_method, Address(Z_thread, JavaThread::callee_target_offset())); // just in case callee is deoptimized + + __ z_br(Z_R14); + + return start; + } + void generate_initial_stubs() { // Generates all stubs and initializes the entry points. @@ -3110,6 +3133,7 @@ class StubGenerator: public StubCodeGenerator { } StubRoutines::_upcall_stub_exception_handler = generate_upcall_stub_exception_handler(); + StubRoutines::_upcall_stub_load_target = generate_upcall_stub_load_target(); } void generate_compiler_stubs() { diff --git a/src/hotspot/cpu/s390/upcallLinker_s390.cpp b/src/hotspot/cpu/s390/upcallLinker_s390.cpp index 734b4e89c7cb2..8baad40a519a4 100644 --- a/src/hotspot/cpu/s390/upcallLinker_s390.cpp +++ b/src/hotspot/cpu/s390/upcallLinker_s390.cpp @@ -23,6 +23,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" +#include "classfile/javaClasses.hpp" #include "logging/logStream.hpp" #include "memory/resourceArea.hpp" #include "prims/upcallLinker.hpp" @@ -116,7 +117,7 @@ static void restore_callee_saved_registers(MacroAssembler* _masm, const ABIDescr static const int upcall_stub_code_base_size = 1024; static const int upcall_stub_size_per_arg = 16; // arg save & restore + move -address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, +address UpcallLinker::make_upcall_stub(jobject receiver, Symbol* signature, BasicType* out_sig_bt, int total_out_args, BasicType ret_type, jobject jabi, jobject jconv, @@ -206,7 +207,6 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, __ block_comment("on_entry {"); __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::on_entry)); __ z_aghik(Z_ARG1, Z_SP, frame_data_offset); - __ load_const_optimized(Z_ARG2, (intptr_t)receiver); __ call(call_target_address); __ z_lgr(Z_thread, Z_RET); __ block_comment("} on_entry"); @@ -216,12 +216,11 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, arg_shuffle.generate(_masm, shuffle_reg, abi._shadow_space_bytes, frame::z_jit_out_preserve_size); __ block_comment("} argument_shuffle"); - __ block_comment("receiver {"); - __ get_vm_result(Z_ARG1); - __ block_comment("} receiver"); - - __ load_const_optimized(Z_method, (intptr_t)entry); - __ z_stg(Z_method, Address(Z_thread, in_bytes(JavaThread::callee_target_offset()))); + __ block_comment("load_target {"); + __ load_const_optimized(Z_ARG1, (intptr_t)receiver); + __ load_const_optimized(call_target_address, StubRoutines::upcall_stub_load_target()); + __ call(call_target_address); // load taget Method* into Z_method + __ block_comment("} load_target"); __ z_lg(call_target_address, Address(Z_method, in_bytes(Method::from_compiled_offset()))); __ call(call_target_address); @@ -274,7 +273,7 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, #ifndef PRODUCT stringStream ss; - ss.print("upcall_stub_%s", entry->signature()->as_C_string()); + ss.print("upcall_stub_%s", signature->as_C_string()); const char* name = _masm->code_string(ss.as_string()); #else // PRODUCT const char* name = "upcall_stub"; diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index 4f37dc31d0305..835bfc770fe90 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "classfile/javaClasses.hpp" #include "classfile/vmIntrinsics.hpp" #include "compiler/oopMap.hpp" #include "gc/shared/barrierSet.hpp" @@ -3796,6 +3797,28 @@ address StubGenerator::generate_upcall_stub_exception_handler() { return start; } +// load Method* target of MethodHandle +// j_rarg0 = jobject receiver +// rbx = result +address StubGenerator::generate_upcall_stub_load_target() { + StubCodeMark mark(this, "StubRoutines", "upcall_stub_load_target"); + address start = __ pc(); + + __ resolve_global_jobject(j_rarg0, r15_thread, rscratch1); + // Load target method from receiver + __ load_heap_oop(rbx, Address(j_rarg0, java_lang_invoke_MethodHandle::form_offset()), rscratch1); + __ load_heap_oop(rbx, Address(rbx, java_lang_invoke_LambdaForm::vmentry_offset()), rscratch1); + __ load_heap_oop(rbx, Address(rbx, java_lang_invoke_MemberName::method_offset()), rscratch1); + __ access_load_at(T_ADDRESS, IN_HEAP, rbx, + Address(rbx, java_lang_invoke_ResolvedMethodName::vmtarget_offset()), + noreg, noreg); + __ movptr(Address(r15_thread, JavaThread::callee_target_offset()), rbx); // just in case callee is deoptimized + + __ ret(0); + + return start; +} + address StubGenerator::generate_lookup_secondary_supers_table_stub(u1 super_klass_index) { StubCodeMark mark(this, "StubRoutines", "lookup_secondary_supers_table"); @@ -3955,6 +3978,7 @@ void StubGenerator::generate_final_stubs() { } StubRoutines::_upcall_stub_exception_handler = generate_upcall_stub_exception_handler(); + StubRoutines::_upcall_stub_load_target = generate_upcall_stub_load_target(); } void StubGenerator::generate_compiler_stubs() { diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp index 71777fbfffea2..7280e9fbe957e 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp @@ -620,6 +620,7 @@ class StubGenerator: public StubCodeGenerator { // shared exception handler for FFM upcall stubs address generate_upcall_stub_exception_handler(); + address generate_upcall_stub_load_target(); // Specialized stub implementations for UseSecondarySupersTable. address generate_lookup_secondary_supers_table_stub(u1 super_klass_index); diff --git a/src/hotspot/cpu/x86/upcallLinker_x86_32.cpp b/src/hotspot/cpu/x86/upcallLinker_x86_32.cpp index e5075e180d9d6..d795c751d02b5 100644 --- a/src/hotspot/cpu/x86/upcallLinker_x86_32.cpp +++ b/src/hotspot/cpu/x86/upcallLinker_x86_32.cpp @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "prims/upcallLinker.hpp" -address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, +address UpcallLinker::make_upcall_stub(jobject receiver, Symbol* signature, BasicType* out_sig_bt, int total_out_args, BasicType ret_type, jobject jabi, jobject jconv, diff --git a/src/hotspot/cpu/x86/upcallLinker_x86_64.cpp b/src/hotspot/cpu/x86/upcallLinker_x86_64.cpp index 82179f9022e92..bc261bfd93f44 100644 --- a/src/hotspot/cpu/x86/upcallLinker_x86_64.cpp +++ b/src/hotspot/cpu/x86/upcallLinker_x86_64.cpp @@ -23,7 +23,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" -#include "code/codeBlob.hpp" +#include "classfile/javaClasses.hpp" #include "code/codeBlob.hpp" #include "code/vmreg.inline.hpp" #include "compiler/disassembler.hpp" @@ -169,10 +169,10 @@ static void restore_callee_saved_registers(MacroAssembler* _masm, const ABIDescr __ block_comment("} restore_callee_saved_regs "); } -static const int upcall_stub_code_base_size = 1024; +static const int upcall_stub_code_base_size = 1200; static const int upcall_stub_size_per_arg = 16; -address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, +address UpcallLinker::make_upcall_stub(jobject receiver, Symbol* signature, BasicType* out_sig_bt, int total_out_args, BasicType ret_type, jobject jabi, jobject jconv, @@ -281,7 +281,6 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, __ block_comment("{ on_entry"); __ vzeroupper(); __ lea(c_rarg0, Address(rsp, frame_data_offset)); - __ movptr(c_rarg1, (intptr_t)receiver); // stack already aligned __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, UpcallLinker::on_entry))); __ movptr(r15_thread, rax); @@ -297,12 +296,10 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, arg_shuffle.generate(_masm, shuffle_reg, abi._shadow_space_bytes, 0); __ block_comment("} argument shuffle"); - __ block_comment("{ receiver "); - __ get_vm_result(j_rarg0, r15_thread); - __ block_comment("} receiver "); - - __ mov_metadata(rbx, entry); - __ movptr(Address(r15_thread, JavaThread::callee_target_offset()), rbx); // just in case callee is deoptimized + __ block_comment("{ load target "); + __ movptr(j_rarg0, (intptr_t)receiver); + __ call(RuntimeAddress(StubRoutines::upcall_stub_load_target())); // puts target Method* in rbx + __ block_comment("} load target "); __ push_cont_fastpath(); @@ -377,7 +374,7 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, #ifndef PRODUCT stringStream ss; - ss.print("upcall_stub_%s", entry->signature()->as_C_string()); + ss.print("upcall_stub_%s", signature->as_C_string()); const char* name = _masm->code_string(ss.freeze()); #else // PRODUCT const char* name = "upcall_stub"; diff --git a/src/hotspot/cpu/zero/upcallLinker_zero.cpp b/src/hotspot/cpu/zero/upcallLinker_zero.cpp index 6447dac86c915..408ebc328205d 100644 --- a/src/hotspot/cpu/zero/upcallLinker_zero.cpp +++ b/src/hotspot/cpu/zero/upcallLinker_zero.cpp @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "prims/upcallLinker.hpp" -address UpcallLinker::make_upcall_stub(jobject mh, Method* entry, +address UpcallLinker::make_upcall_stub(jobject mh, Symbol* signature, BasicType* out_sig_bt, int total_out_args, BasicType ret_type, jobject jabi, jobject jconv, diff --git a/src/hotspot/share/code/codeBlob.cpp b/src/hotspot/share/code/codeBlob.cpp index 81c4d001078cb..23f621ffec832 100644 --- a/src/hotspot/share/code/codeBlob.cpp +++ b/src/hotspot/share/code/codeBlob.cpp @@ -41,7 +41,7 @@ #include "runtime/handles.inline.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/javaFrameAnchor.hpp" -#include "runtime/jniHandles.hpp" +#include "runtime/jniHandles.inline.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/safepoint.hpp" #include "runtime/sharedRuntime.hpp" @@ -623,7 +623,7 @@ UpcallStub* UpcallStub::create(const char* name, CodeBuffer* cb, jobject receive // Track memory usage statistic after releasing CodeCache_lock MemoryService::track_code_cache_memory_usage(); - trace_new_stub(blob, "UpcallStub"); + trace_new_stub(blob, "UpcallStub - ", name); return blob; } @@ -772,6 +772,10 @@ void UpcallStub::verify() { void UpcallStub::print_on(outputStream* st) const { RuntimeBlob::print_on(st); print_value_on(st); + st->print_cr("Frame data offset: %d", (int) _frame_data_offset); + oop recv = JNIHandles::resolve(_receiver); + st->print("Receiver MH="); + recv->print_on(st); Disassembler::decode((RuntimeBlob*)this, st); } diff --git a/src/hotspot/share/prims/upcallLinker.cpp b/src/hotspot/share/prims/upcallLinker.cpp index b02746911a808..1abce57652a9f 100644 --- a/src/hotspot/share/prims/upcallLinker.cpp +++ b/src/hotspot/share/prims/upcallLinker.cpp @@ -22,7 +22,7 @@ */ #include "precompiled.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "compiler/compilationPolicy.hpp" @@ -73,7 +73,7 @@ JavaThread* UpcallLinker::maybe_attach_and_get_thread() { } // modelled after JavaCallWrapper::JavaCallWrapper -JavaThread* UpcallLinker::on_entry(UpcallStub::FrameData* context, jobject receiver) { +JavaThread* UpcallLinker::on_entry(UpcallStub::FrameData* context) { JavaThread* thread = maybe_attach_and_get_thread(); guarantee(thread->thread_state() == _thread_in_native, "wrong thread state for upcall"); context->thread = thread; @@ -108,8 +108,6 @@ JavaThread* UpcallLinker::on_entry(UpcallStub::FrameData* context, jobject recei debug_only(thread->inc_java_call_counter()); thread->set_active_handles(context->new_handles); // install new handle block and reset Java frame linkage - thread->set_vm_result(JNIHandles::resolve(receiver)); - return thread; } @@ -138,11 +136,10 @@ void UpcallLinker::on_exit(UpcallStub::FrameData* context) { } void UpcallLinker::handle_uncaught_exception(oop exception) { - ResourceMark rm; - // Based on CATCH macro tty->print_cr("Uncaught exception:"); - exception->print(); - ShouldNotReachHere(); + Handle exception_h(Thread::current(), exception); + java_lang_Throwable::print_stack_trace(exception_h, tty); + fatal("Unrecoverable uncaught exception encountered"); } JVM_ENTRY(jlong, UL_MakeUpcallStub(JNIEnv *env, jclass unused, jobject mh, jobject abi, jobject conv, @@ -150,36 +147,30 @@ JVM_ENTRY(jlong, UL_MakeUpcallStub(JNIEnv *env, jclass unused, jobject mh, jobje ResourceMark rm(THREAD); Handle mh_h(THREAD, JNIHandles::resolve(mh)); jobject mh_j = JNIHandles::make_global(mh_h); + oop type = java_lang_invoke_MethodHandle::type(mh_h()); - oop lform = java_lang_invoke_MethodHandle::form(mh_h()); - oop vmentry = java_lang_invoke_LambdaForm::vmentry(lform); - Method* entry = java_lang_invoke_MemberName::vmtarget(vmentry); - const methodHandle mh_entry(THREAD, entry); - - assert(entry->method_holder()->is_initialized(), "no clinit barrier"); - CompilationPolicy::compile_if_required(mh_entry, CHECK_0); - - assert(entry->is_static(), "static only"); // Fill in the signature array, for the calling-convention call. - const int total_out_args = entry->size_of_parameters(); - assert(total_out_args > 0, "receiver arg"); + const int total_out_args = java_lang_invoke_MethodType::ptype_slot_count(type) + 1; // +1 for receiver + bool create_new = true; + TempNewSymbol signature = java_lang_invoke_MethodType::as_signature(type, create_new); BasicType* out_sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_out_args); BasicType ret_type; { int i = 0; - SignatureStream ss(entry->signature()); + out_sig_bt[i++] = T_OBJECT; // receiver MH + SignatureStream ss(signature); for (; !ss.at_return_type(); ss.next()) { out_sig_bt[i++] = ss.type(); // Collect remaining bits of signature if (ss.type() == T_LONG || ss.type() == T_DOUBLE) out_sig_bt[i++] = T_VOID; // Longs & doubles take 2 Java slots } - assert(i == total_out_args, ""); + assert(i == total_out_args, "%d != %d", i, total_out_args); ret_type = ss.type(); } return (jlong) UpcallLinker::make_upcall_stub( - mh_j, entry, out_sig_bt, total_out_args, ret_type, + mh_j, signature, out_sig_bt, total_out_args, ret_type, abi, conv, needs_return_buffer, checked_cast(ret_buf_size)); JVM_END diff --git a/src/hotspot/share/prims/upcallLinker.hpp b/src/hotspot/share/prims/upcallLinker.hpp index d80516b256678..765ed63fc5a56 100644 --- a/src/hotspot/share/prims/upcallLinker.hpp +++ b/src/hotspot/share/prims/upcallLinker.hpp @@ -34,10 +34,10 @@ class UpcallLinker { private: static JavaThread* maybe_attach_and_get_thread(); - static JavaThread* on_entry(UpcallStub::FrameData* context, jobject receiver); + static JavaThread* on_entry(UpcallStub::FrameData* context); static void on_exit(UpcallStub::FrameData* context); public: - static address make_upcall_stub(jobject mh, Method* entry, + static address make_upcall_stub(jobject mh, Symbol* signature, BasicType* out_sig_bt, int total_out_args, BasicType ret_type, jobject jabi, jobject jconv, diff --git a/src/hotspot/share/runtime/frame.cpp b/src/hotspot/share/runtime/frame.cpp index e193271eff658..17078a69ab991 100644 --- a/src/hotspot/share/runtime/frame.cpp +++ b/src/hotspot/share/runtime/frame.cpp @@ -719,6 +719,8 @@ void frame::print_on_error(outputStream* st, char* buf, int buflen, bool verbose st->print("v ~MethodHandlesAdapterBlob " PTR_FORMAT, p2i(pc())); } else if (_cb->is_uncommon_trap_stub()) { st->print("v ~UncommonTrapBlob " PTR_FORMAT, p2i(pc())); + } else if (_cb->is_upcall_stub()) { + st->print("v ~UpcallStub::%s " PTR_FORMAT, _cb->name(), p2i(pc())); } else { st->print("v blob " PTR_FORMAT, p2i(pc())); } @@ -1116,6 +1118,19 @@ void frame::oops_entry_do(OopClosure* f, const RegisterMap* map) const { entry_frame_call_wrapper()->oops_do(f); } +void frame::oops_upcall_do(OopClosure* f, const RegisterMap* map) const { + assert(map != nullptr, "map must be set"); + if (map->include_argument_oops()) { + // Upcall stubs call a MethodHandle impl method of which only the receiver + // is ever an oop. + // Currently we should not be able to get here, since there are no + // safepoints in the one resolve stub we can get into (handle_wrong_method) + // Leave this here as a trap in case we ever do: + ShouldNotReachHere(); // not implemented + } + _cb->as_upcall_stub()->oops_do(f, *this); +} + bool frame::is_deoptimized_frame() const { assert(_deopt_state != unknown, "not answerable"); if (_deopt_state == is_deoptimized) { @@ -1147,7 +1162,7 @@ void frame::oops_do_internal(OopClosure* f, NMethodClosure* cf, } else if (is_entry_frame()) { oops_entry_do(f, map); } else if (is_upcall_stub_frame()) { - _cb->as_upcall_stub()->oops_do(f, *this); + oops_upcall_do(f, map); } else if (CodeCache::contains(pc())) { oops_nmethod_do(f, cf, df, derived_mode, map); } else { diff --git a/src/hotspot/share/runtime/frame.hpp b/src/hotspot/share/runtime/frame.hpp index 1c57e3de4daa6..50aafce3837ac 100644 --- a/src/hotspot/share/runtime/frame.hpp +++ b/src/hotspot/share/runtime/frame.hpp @@ -464,6 +464,7 @@ class frame { const RegisterMap* map, bool use_interpreter_oop_map_cache) const; void oops_entry_do(OopClosure* f, const RegisterMap* map) const; + void oops_upcall_do(OopClosure* f, const RegisterMap* map) const; void oops_nmethod_do(OopClosure* f, NMethodClosure* cf, DerivedOopClosure* df, DerivedPointerIterationMode derived_mode, const RegisterMap* map) const; diff --git a/src/hotspot/share/runtime/stubRoutines.cpp b/src/hotspot/share/runtime/stubRoutines.cpp index a2b8c1da64490..331aa3c73641f 100644 --- a/src/hotspot/share/runtime/stubRoutines.cpp +++ b/src/hotspot/share/runtime/stubRoutines.cpp @@ -188,6 +188,7 @@ address StubRoutines::_cont_returnBarrier = nullptr; address StubRoutines::_cont_returnBarrierExc = nullptr; address StubRoutines::_upcall_stub_exception_handler = nullptr; +address StubRoutines::_upcall_stub_load_target = nullptr; address StubRoutines::_lookup_secondary_supers_table_slow_path_stub = nullptr; address StubRoutines::_lookup_secondary_supers_table_stubs[Klass::SECONDARY_SUPERS_TABLE_SIZE] = { nullptr }; diff --git a/src/hotspot/share/runtime/stubRoutines.hpp b/src/hotspot/share/runtime/stubRoutines.hpp index b58c591bbf75c..be9577d542f67 100644 --- a/src/hotspot/share/runtime/stubRoutines.hpp +++ b/src/hotspot/share/runtime/stubRoutines.hpp @@ -298,6 +298,7 @@ class StubRoutines: AllStatic { static address _vector_d_math[VectorSupport::NUM_VEC_SIZES][VectorSupport::NUM_SVML_OP]; static address _upcall_stub_exception_handler; + static address _upcall_stub_load_target; static address _lookup_secondary_supers_table_stubs[]; static address _lookup_secondary_supers_table_slow_path_stub; @@ -506,6 +507,11 @@ class StubRoutines: AllStatic { return _upcall_stub_exception_handler; } + static address upcall_stub_load_target() { + assert(_upcall_stub_load_target != nullptr, "not implemented"); + return _upcall_stub_load_target; + } + static address lookup_secondary_supers_table_stub(u1 slot) { assert(slot < Klass::SECONDARY_SUPERS_TABLE_SIZE, "out of bounds"); assert(_lookup_secondary_supers_table_stubs[slot] != nullptr, "not implemented"); diff --git a/test/jdk/TEST.groups b/test/jdk/TEST.groups index 0c6b13fdca057..d51fcec733b3c 100644 --- a/test/jdk/TEST.groups +++ b/test/jdk/TEST.groups @@ -381,7 +381,8 @@ jdk_svc = \ jdk_foreign = \ java/foreign \ jdk/internal/reflect/CallerSensitive/CheckCSMs.java \ - -java/foreign/TestMatrix.java + -java/foreign/TestMatrix.java \ + -java/foreign/TestUpcallStress.java jdk_vector = \ jdk/incubator/vector diff --git a/test/jdk/java/foreign/TestUpcallStress.java b/test/jdk/java/foreign/TestUpcallStress.java new file mode 100644 index 0000000000000..4060774685641 --- /dev/null +++ b/test/jdk/java/foreign/TestUpcallStress.java @@ -0,0 +1,97 @@ +/* + * 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 + * @requires jdk.foreign.linker != "FALLBACK" + * @requires (os.arch == "aarch64" | os.arch=="riscv64") & os.name == "Linux" + * @requires os.maxMemory > 4G + * @modules java.base/jdk.internal.foreign + * @build NativeTestHelper CallGeneratorHelper TestUpcallBase + * @bug 8337753 + * + * @run testng/othervm/timeout=3200 + * -Xcheck:jni + * -XX:+IgnoreUnrecognizedVMOptions + * -XX:-VerifyDependencies + * --enable-native-access=ALL-UNNAMED + * -Dgenerator.sample.factor=17 + * TestUpcallStress + */ + +import java.lang.foreign.Arena; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.MemorySegment; + +import org.testng.annotations.Test; + +import java.lang.invoke.MethodHandle; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.*; +import java.util.function.Consumer; + +public class TestUpcallStress extends TestUpcallBase { + + static { + System.loadLibrary("TestUpcall"); + } + + @Test(dataProvider="functions", dataProviderClass=CallGeneratorHelper.class) + public void testUpcallsStress(int count, String fName, Ret ret, List paramTypes, + List fields) throws Throwable { + ExecutorService executor = Executors.newFixedThreadPool(16); + for (int threadIdx = 0; threadIdx < 16; threadIdx++) { + executor.submit(() -> { + for (int iter = 0; iter < 10000; iter++) { + List> returnChecks = new ArrayList<>(); + List> argChecks = new ArrayList<>(); + MemorySegment addr = findNativeOrThrow(fName); + try (Arena arena = Arena.ofConfined()) { + FunctionDescriptor descriptor = function(ret, paramTypes, fields); + MethodHandle mh = downcallHandle(LINKER, addr, arena, descriptor); + AtomicReference capturedArgs = new AtomicReference<>(); + Object[] args = makeArgs(capturedArgs, arena, descriptor, returnChecks, argChecks, 0); + + Object res = mh.invokeWithArguments(args); + + if (ret == Ret.NON_VOID) { + returnChecks.forEach(c -> c.accept(res)); + } + + Object[] capturedArgsArr = capturedArgs.get(); + for (int i = 0; i < capturedArgsArr.length; i++) { + argChecks.get(i).accept(capturedArgsArr[i]); + } + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + }); + } + // This shutdownNow is 'wrong', since it doesn't wait for tasks to terminate, + // but it seems to be the only way to reproduce the race of JDK-8337753 + executor.shutdownNow(); + } +} From d7f32d891cde2278fe7158fb28d29235db5c818c Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Thu, 3 Oct 2024 12:08:23 +0000 Subject: [PATCH 297/307] 8341415: Optimize RawBytecodeHelper::next Reviewed-by: liach --- .../classfile/impl/RawBytecodeHelper.java | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java b/src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java index 2403ae150e9dd..659f41f9699ae 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java @@ -299,7 +299,6 @@ public static int align(int n) { private int nextBci; private int bci; private int opcode; - private boolean isWide; public static CodeRange of(byte[] array) { return new CodeRange(array, array.length); @@ -341,14 +340,14 @@ public void reset(int nextBci) { * be valid and can be accessed unchecked. */ public int opcode() { - return opcode; + return opcode & 0xFF; } /** * Returns whether the current functional opcode is in wide. */ public boolean isWide() { - return isWide; + return (opcode & (WIDE << 8)) != 0; } /** @@ -411,7 +410,7 @@ public int destW() { // *load, *store, iinc public int getIndex() { - return isWide ? getU2Unchecked(bci + 2) : getIndexU1(); + return isWide() ? getU2Unchecked(bci + 2) : getIndexU1(); } // ldc @@ -443,12 +442,11 @@ public boolean next() { int len = LENGTHS[code & 0xFF]; // & 0xFF eliminates bound check this.bci = bci; opcode = code; - isWide = false; if (len <= 0) { len = checkSpecialInstruction(bci, end, code); // sets opcode } - if (len <= 0 || (nextBci += len) > end) { + if ((nextBci += len) > end) { opcode = ILLEGAL; } @@ -457,37 +455,34 @@ public boolean next() { // Put rarely used code in another method to reduce code size private int checkSpecialInstruction(int bci, int end, int code) { + int len = -1; if (code == WIDE) { - if (bci + 1 >= end) { - return -1; + if (bci + 1 < end) { + opcode = (WIDE << 8) | (code = getIndexU1()); + // Validated in UtilTest.testOpcodeLengthTable + len = LENGTHS[code] * 2; } - opcode = code = getIndexU1(); - isWide = true; - // Validated in UtilTest.testOpcodeLengthTable - return LENGTHS[code] * 2; - } - if (code == TABLESWITCH) { + } else if (code == TABLESWITCH) { int alignedBci = align(bci + 1); - if (alignedBci + 3 * 4 >= end) { - return -1; + if (alignedBci + 3 * 4 < end) { + int lo = getIntUnchecked(alignedBci + 1 * 4); + int hi = getIntUnchecked(alignedBci + 2 * 4); + long l = alignedBci - bci + (3L + (long) hi - lo + 1L) * 4L; + len = l > 0 && ((int) l == l) ? (int) l : -1; } - int lo = getIntUnchecked(alignedBci + 1 * 4); - int hi = getIntUnchecked(alignedBci + 2 * 4); - long l = alignedBci - bci + (3L + (long) hi - lo + 1L) * 4L; - return l > 0 && ((int) l == l) ? (int) l : -1; - } - if (code == LOOKUPSWITCH) { + } else if (code == LOOKUPSWITCH) { int alignedBci = align(bci + 1); - if (alignedBci + 2 * 4 >= end) { - return -1; - } - int npairs = getIntUnchecked(alignedBci + 4); - if (npairs < 0) { - return -1; + if (alignedBci + 2 * 4 < end) { + int npairs = getIntUnchecked(alignedBci + 4); + if (npairs >= 0) { + long l = alignedBci - bci + (2L + 2L * npairs) * 4L; + len = l > 0 && ((int) l == l) ? (int) l : -1; + } } - long l = alignedBci - bci + (2L + 2L * npairs) * 4L; - return l > 0 && ((int) l == l) ? (int) l : -1; } - return -1; + if (len <= 0) { + opcode = ILLEGAL; + } + return len; } } From 7d524d7e378430afb3a262e8fe544bd1be22748c Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 3 Oct 2024 12:20:01 +0000 Subject: [PATCH 298/307] 8341004: Open source AWT FileDialog related tests Reviewed-by: kizune --- .../awt/FileDialog/DoubleActionCloseX.java | 75 +++++++++++ .../java/awt/FileDialog/DoubleActionESC.java | 122 ++++++++++++++++++ .../FileDialog/TestFileDialogDupJNIRef.java | 82 ++++++++++++ 3 files changed, 279 insertions(+) create mode 100644 test/jdk/java/awt/FileDialog/DoubleActionCloseX.java create mode 100644 test/jdk/java/awt/FileDialog/DoubleActionESC.java create mode 100644 test/jdk/java/awt/FileDialog/TestFileDialogDupJNIRef.java diff --git a/test/jdk/java/awt/FileDialog/DoubleActionCloseX.java b/test/jdk/java/awt/FileDialog/DoubleActionCloseX.java new file mode 100644 index 0000000000000..5d3feaa42ed4b --- /dev/null +++ b/test/jdk/java/awt/FileDialog/DoubleActionCloseX.java @@ -0,0 +1,75 @@ +/* + * 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.FileDialog; +import java.awt.Frame; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/* + * @test + * @bug 6227750 + * @summary Tests that FileDialog can be closed by clicking the 'close' (X) button + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual DoubleActionCloseX + */ + +public class DoubleActionCloseX { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + NOTE: On Linux and Mac, there is no 'close'(X) button + when file dialog is visible, press Pass. + + Click the 'Open File Dialog' button to open FileDialog. + A file dialog will appear on the screen. + Click on the 'close'(X) button. + The dialog should be closed. + If not, the test failed, press Fail otherwise press Pass. + """; + + PassFailJFrame.builder() + .title("DoubleActionCloseX Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(DoubleActionCloseX::createUI) + .build() + .awaitAndCheck(); + } + public static Frame createUI() { + Frame f = new Frame("DoubleActionCloseX Test"); + Button b = new Button("Open File Dialog"); + FileDialog fd = new FileDialog(f); + b.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + fd.setVisible(true); + } + }); + f.add(b); + f.setSize(300, 200); + return f; + } +} diff --git a/test/jdk/java/awt/FileDialog/DoubleActionESC.java b/test/jdk/java/awt/FileDialog/DoubleActionESC.java new file mode 100644 index 0000000000000..748c3aeb5e446 --- /dev/null +++ b/test/jdk/java/awt/FileDialog/DoubleActionESC.java @@ -0,0 +1,122 @@ +/* + * 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.Dimension; +import java.awt.EventQueue; +import java.awt.FileDialog; +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.InputEvent; +import java.awt.event.KeyEvent; +import java.util.concurrent.CountDownLatch; + +/* + * @test + * @bug 5097243 + * @summary Tests that FileDialog can be closed by ESC any time + * @key headful + * @run main DoubleActionESC + */ + +public class DoubleActionESC { + private static Frame f; + private static Button showBtn; + private static FileDialog fd; + private static Robot robot; + private static volatile Point p; + private static volatile Dimension d; + private static volatile CountDownLatch latch; + private static final int REPEAT_COUNT = 2; + + public static void main(String[] args) throws Exception { + latch = new CountDownLatch(1); + + robot = new Robot(); + robot.setAutoDelay(100); + try { + EventQueue.invokeAndWait(() -> { + createAndShowUI(); + }); + + robot.delay(1000); + EventQueue.invokeAndWait(() -> { + p = showBtn.getLocationOnScreen(); + d = showBtn.getSize(); + }); + + for (int i = 0; i < REPEAT_COUNT; ++i) { + Thread thread = new Thread(() -> { + robot.mouseMove(p.x + d.width / 2, p.y + d.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + }); + thread.start(); + robot.delay(3000); + + Thread thread1 = new Thread(() -> { + robot.keyPress(KeyEvent.VK_ESCAPE); + robot.keyRelease(KeyEvent.VK_ESCAPE); + robot.waitForIdle(); + }); + thread1.start(); + robot.delay(3000); + } + + latch.await(); + if (fd.isVisible()) { + throw new RuntimeException("File Dialog is not closed"); + } + } finally { + EventQueue.invokeAndWait(() -> { + if (f != null) { + f.dispose(); + } + }); + } + } + + public static void createAndShowUI() { + f = new Frame("DoubleActionESC Test"); + showBtn = new Button("Show File Dialog"); + fd = new FileDialog(f); + showBtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (e.getSource() == showBtn) { + fd.setSize(200, 200); + fd.setLocation(200, 200); + fd.setVisible(true); + latch.countDown(); + } + } + }); + f.add(showBtn); + f.setSize(300, 200); + f.setLocationRelativeTo(null); + f.setVisible(true); + } +} diff --git a/test/jdk/java/awt/FileDialog/TestFileDialogDupJNIRef.java b/test/jdk/java/awt/FileDialog/TestFileDialogDupJNIRef.java new file mode 100644 index 0000000000000..56b6c49214488 --- /dev/null +++ b/test/jdk/java/awt/FileDialog/TestFileDialogDupJNIRef.java @@ -0,0 +1,82 @@ +/* + * 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.Dialog; +import java.awt.FileDialog; +import java.awt.FlowLayout; +import java.awt.Frame; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/* + * @test + * @bug 4906972 + * @summary Tests using of JNI reference to peer object. + * @requires (os.family == "windows") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual TestFileDialogDupJNIRef + */ + +public class TestFileDialogDupJNIRef { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + This is a crash test. + After test started you will see 'Test Frame' with one button. + 1. Click the button to open FileDialog. + 2. Go to the dialog and choose any directory with some files in it.. + 3. Click on any file to highlight it. + 4. Click on the file again to rename. + 5. Leave the file in edit mode and click Open button + + If there was no crash the test passed, Press Pass. + """; + + PassFailJFrame.builder() + .title("TestFileDialogDupJNIRef Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(TestFileDialogDupJNIRef::createUI) + .build() + .awaitAndCheck(); + } + + public static Frame createUI() { + Frame frame = new Frame("TestFileDialogDupJNIRef Test Frame"); + Button open = new Button("Open File Dialog"); + + open.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + FileDialog fd = new FileDialog(frame); + fd.setVisible(true); + } + }); + + frame.setLayout(new FlowLayout()); + frame.add(open); + frame.setSize(250, 70); + return frame; + } +} From 21f8ccf4a97313593f210f9a07e56d5ff92b7aa5 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Thu, 3 Oct 2024 12:55:54 +0000 Subject: [PATCH 299/307] 8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PROC_ROOT (after JDK-8327114) Reviewed-by: kevinw --- .../jtreg/containers/docker/TestJcmdWithSideCar.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java b/test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java index 2088398834702..5dea864f42750 100644 --- a/test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java +++ b/test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java @@ -42,8 +42,8 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.file.Paths; -import java.util.Arrays; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.EnumSet; import java.util.List; @@ -52,7 +52,9 @@ import java.util.function.Consumer; import java.util.regex.Pattern; import java.util.stream.Collectors; + import jdk.test.lib.Container; +import jdk.test.lib.Platform; import jdk.test.lib.Utils; import jdk.test.lib.containers.docker.Common; import jdk.test.lib.containers.docker.DockerRunOptions; @@ -108,6 +110,11 @@ public static void main(String[] args) throws Exception { mainContainer.waitForMainMethodStart(TIME_TO_WAIT_FOR_MAIN_METHOD_START); for (AttachStrategy attachStrategy : EnumSet.allOf(AttachStrategy.class)) { + if (attachStrategy == AttachStrategy.ACCESS_TMP_VIA_PROC_ROOT && + elevated && !Platform.isRoot()) { + // Elevated attach via proc/root not yet supported. + continue; + } long mainProcPid = testCase01(attachStrategy, elevated); // Excluding the test case below until JDK-8228850 is fixed From eb93e6952b5d2dbe78cd9680855ac99c69b3dcb2 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Thu, 3 Oct 2024 14:02:40 +0000 Subject: [PATCH 300/307] 8339979: VirtualThreadSchedulerMXBeanTest.testReduceParallelism fails intermittently Reviewed-by: kevinw --- .../VirtualThreadSchedulerMXBeanTest.java | 95 ++++++++++++++----- 1 file changed, 72 insertions(+), 23 deletions(-) diff --git a/test/jdk/jdk/management/VirtualThreadSchedulerMXBean/VirtualThreadSchedulerMXBeanTest.java b/test/jdk/jdk/management/VirtualThreadSchedulerMXBean/VirtualThreadSchedulerMXBeanTest.java index 891f6e62e6fc7..b256d2b89ab0b 100644 --- a/test/jdk/jdk/management/VirtualThreadSchedulerMXBean/VirtualThreadSchedulerMXBeanTest.java +++ b/test/jdk/jdk/management/VirtualThreadSchedulerMXBean/VirtualThreadSchedulerMXBeanTest.java @@ -34,6 +34,8 @@ import java.lang.management.ManagementFactory; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.IntPredicate; +import java.util.function.LongPredicate; import java.util.stream.Stream; import java.util.stream.IntStream; import javax.management.MBeanServer; @@ -140,23 +142,37 @@ void testReduceParallelism(VirtualThreadSchedulerMXBean bean) throws Exception { try { // increase parallelism + saturate - int newParallelism = parallelism + 4; - bean.setParallelism(newParallelism); - IntStream.range(0, newParallelism).forEach(_ -> executor.submit(busyTask)); - awaitMountedVirtualThreadCountGte(bean, newParallelism); + int highParallelism = parallelism + 4; + bean.setParallelism(highParallelism); + IntStream.range(0, highParallelism).forEach(_ -> executor.submit(busyTask)); + + // mounted virtual thread count should increase to highParallelism. + // Sample the count at highParallelism a few times. + for (int i = 0; i < 5; i++) { + Thread.sleep(100); + awaitMountedVirtualThreadCountEq(bean, highParallelism); + } // reduce parallelism and workload - newParallelism = Math.clamp(parallelism / 2, 1, parallelism); - bean.setParallelism(newParallelism); + int lowParallelism = Math.clamp(parallelism / 2, 1, parallelism); + bean.setParallelism(lowParallelism); sleep.set(true); - // mounted virtual thread count should reduce - awaitMountedVirtualThreadCountLte(bean, newParallelism); - // increase workload, the mounted virtual thread count should not increase + // mounted virtual thread count should reduce to lowParallelism or less. + // Sample the count at lowParallelism or less a few times. + for (int i = 0; i < 5; i++) { + Thread.sleep(100); + awaitMountedVirtualThreadCountLte(bean, lowParallelism); + } + + // increase workload sleep.set(false); + + // mounted virtual thread count should not exceed lowParallelism. + // Sample the count at lowParallelism a few times. for (int i = 0; i < 5; i++) { Thread.sleep(100); - assertTrue(bean.getMountedVirtualThreadCount() <= newParallelism); + awaitMountedVirtualThreadCountEq(bean, lowParallelism); } } finally { @@ -230,31 +246,64 @@ void testQueuedVirtualThreadCount(VirtualThreadSchedulerMXBean bean) throws Exce * Waits for pool size >= target to be true. */ void awaitPoolSizeGte(VirtualThreadSchedulerMXBean bean, int target) throws InterruptedException { - System.err.format("await pool size >= %d ...%n", target); - while (bean.getPoolSize() < target) { - Thread.sleep(10); - } + awaitPoolSize(bean, ps -> ps >= target, ">= " + target); } /** * Waits for the mounted virtual thread count >= target to be true. */ void awaitMountedVirtualThreadCountGte(VirtualThreadSchedulerMXBean bean, - int target) throws InterruptedException { - System.err.format("await mounted virtual thread count >= %d ...%n", target); - while (bean.getMountedVirtualThreadCount() < target) { - Thread.sleep(10); - } + long target) throws InterruptedException { + awaitMountedVirtualThreadCount(bean, c -> c >= target, ">= " + target); } /** * Waits for the mounted virtual thread count <= target to be true. */ void awaitMountedVirtualThreadCountLte(VirtualThreadSchedulerMXBean bean, - int target) throws InterruptedException { - System.err.format("await mounted virtual thread count <= %d ...%n", target); - while (bean.getMountedVirtualThreadCount() > target) { - Thread.sleep(10); + long target) throws InterruptedException { + awaitMountedVirtualThreadCount(bean, c -> c <= target, "<= " + target); + } + + /** + * Waits for the mounted virtual thread count == target to be true. + */ + void awaitMountedVirtualThreadCountEq(VirtualThreadSchedulerMXBean bean, + long target) throws InterruptedException { + awaitMountedVirtualThreadCount(bean, c -> c == target, "== " + target); + } + + /** + * Waits until evaluating the given predicte on the pool size is true. + */ + void awaitPoolSize(VirtualThreadSchedulerMXBean bean, + IntPredicate predicate, + String reason) throws InterruptedException { + int poolSize = bean.getPoolSize(); + if (!predicate.test(poolSize)) { + System.err.format("poolSize = %d, await %s ...%n", poolSize, reason); + while (!predicate.test(poolSize)) { + Thread.sleep(10); + poolSize = bean.getPoolSize(); + } + System.err.format("poolSize = %d%n", poolSize); + } + } + + /** + * Waits until evaluating the given predicte on the mounted thread count is true. + */ + void awaitMountedVirtualThreadCount(VirtualThreadSchedulerMXBean bean, + LongPredicate predicate, + String reason) throws InterruptedException { + long count = bean.getMountedVirtualThreadCount(); + if (!predicate.test(count)) { + System.err.format("mountedVirtualThreadCount = %d, await %s ...%n", count, reason); + while (!predicate.test(count)) { + Thread.sleep(10); + count = bean.getMountedVirtualThreadCount(); + } + System.err.format("mountedVirtualThreadCount = %d%n", count); } } } \ No newline at end of file From 12028000db2ef3b1c784af119c495aa3ef9590cf Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Thu, 3 Oct 2024 14:34:05 +0000 Subject: [PATCH 301/307] 8341006: Optimize StackMapGenerator detect frames Reviewed-by: liach --- .../classfile/impl/StackMapGenerator.java | 159 ++++++++++-------- 1 file changed, 91 insertions(+), 68 deletions(-) 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 ae9835206831e..0eae3c357196a 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 @@ -1,5 +1,6 @@ /* * Copyright (c) 2022, 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 @@ -39,7 +40,6 @@ import java.lang.constant.MethodTypeDesc; import java.util.ArrayList; import java.util.Arrays; -import java.util.BitSet; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -58,8 +58,8 @@ *

          * The {@linkplain #generate() frames computation} consists of following steps: *

            - *
          1. {@linkplain #detectFrameOffsets() Detection} of mandatory stack map frames offsets:
              - *
            • Mandatory stack map frame offsets include all jump and switch instructions targets, + *
            • {@linkplain #detectFrames() Detection} of mandatory stack map frames:
                + *
              • Mandatory stack map frame include all jump and switch instructions targets, * offsets immediately following {@linkplain #noControlFlow(int) "no control flow"} * and all exception table handlers. *
              • Detection is performed in a single fast pass through the bytecode, @@ -163,6 +163,7 @@ static StackMapGenerator of(DirectCodeBuilder dcb, BufWriterImpl buf) { private static final int FLAG_THIS_UNINIT = 0x01; private static final int FRAME_DEFAULT_CAPACITY = 10; private static final int T_BOOLEAN = 4, T_LONG = 11; + private static final Frame[] EMPTY_FRAME_ARRAY = new Frame[0]; private static final int ITEM_TOP = 0, ITEM_INTEGER = 1, @@ -198,7 +199,8 @@ static record RawExceptionCatch(int start, int end, int handler, Type catchType) private final ClassHierarchyImpl classHierarchy; private final boolean patchDeadCode; private final boolean filterDeadLabels; - private List frames; + private Frame[] frames = EMPTY_FRAME_ARRAY; + private int framesCount = 0; private final Frame currentFrame; private int maxStack, maxLocals; @@ -262,10 +264,10 @@ public int maxStack() { private Frame getFrame(int offset) { //binary search over frames ordered by offset int low = 0; - int high = frames.size() - 1; + int high = framesCount - 1; while (low <= high) { int mid = (low + high) >>> 1; - var f = frames.get(mid); + var f = frames[mid]; if (f.offset < offset) low = mid + 1; else if (f.offset > offset) @@ -283,8 +285,8 @@ private void checkJumpTarget(Frame frame, int target) { private int exMin, exMax; private boolean isAnyFrameDirty() { - for (var f : frames) { - if (f.dirty) return true; + for (int i = 0; i < framesCount; i++) { + if (frames[i].dirty) return true; } return false; } @@ -292,27 +294,10 @@ private boolean isAnyFrameDirty() { private void generate() { exMin = bytecode.length(); exMax = -1; - for (var exhandler : handlers) { - int start_pc = labelContext.labelToBci(exhandler.tryStart()); - int end_pc = labelContext.labelToBci(exhandler.tryEnd()); - int handler_pc = labelContext.labelToBci(exhandler.handler()); - if (start_pc >= 0 && end_pc >= 0 && end_pc > start_pc && handler_pc >= 0) { - if (start_pc < exMin) exMin = start_pc; - if (end_pc > exMax) exMax = end_pc; - var catchType = exhandler.catchType(); - rawHandlers.add(new RawExceptionCatch(start_pc, end_pc, handler_pc, - catchType.isPresent() ? cpIndexToType(catchType.get().index(), cp) - : Type.THROWABLE_TYPE)); - } - } - BitSet frameOffsets = detectFrameOffsets(); - int framesCount = frameOffsets.cardinality(); - frames = new ArrayList<>(framesCount); - int offset = -1; - for (int i = 0; i < framesCount; i++) { - offset = frameOffsets.nextSetBit(offset + 1); - frames.add(new Frame(offset, classHierarchy)); + if (!handlers.isEmpty()) { + generateHandlers(); } + detectFrames(); do { processMethod(); } while (isAnyFrameDirty()); @@ -321,23 +306,45 @@ private void generate() { //dead code patching for (int i = 0; i < framesCount; i++) { - var frame = frames.get(i); + var frame = frames[i]; if (frame.flags == -1) { - if (!patchDeadCode) throw generatorError("Unable to generate stack map frame for dead code", frame.offset); - //patch frame - frame.pushStack(Type.THROWABLE_TYPE); - if (maxStack < 1) maxStack = 1; - int end = (i < framesCount - 1 ? frames.get(i + 1).offset : bytecode.length()) - 1; - //patch bytecode - var arr = bytecode.array(); - Arrays.fill(arr, frame.offset, end, (byte) NOP); - arr[end] = (byte) ATHROW; - //patch handlers - removeRangeFromExcTable(frame.offset, end + 1); + deadCodePatching(frame, i); + } + } + } + + private void generateHandlers() { + var labelContext = this.labelContext; + for (int i = 0; i < handlers.size(); i++) { + var exhandler = handlers.get(i); + int start_pc = labelContext.labelToBci(exhandler.tryStart()); + int end_pc = labelContext.labelToBci(exhandler.tryEnd()); + int handler_pc = labelContext.labelToBci(exhandler.handler()); + if (start_pc >= 0 && end_pc >= 0 && end_pc > start_pc && handler_pc >= 0) { + if (start_pc < exMin) exMin = start_pc; + if (end_pc > exMax) exMax = end_pc; + var catchType = exhandler.catchType(); + rawHandlers.add(new RawExceptionCatch(start_pc, end_pc, handler_pc, + catchType.isPresent() ? cpIndexToType(catchType.get().index(), cp) + : Type.THROWABLE_TYPE)); } } } + private void deadCodePatching(Frame frame, int i) { + if (!patchDeadCode) throw generatorError("Unable to generate stack map frame for dead code", frame.offset); + //patch frame + frame.pushStack(Type.THROWABLE_TYPE); + if (maxStack < 1) maxStack = 1; + int end = (i < framesCount - 1 ? frames[i + 1].offset : bytecode.length()) - 1; + //patch bytecode + var arr = bytecode.array(); + Arrays.fill(arr, frame.offset, end, (byte) NOP); + arr[end] = (byte) ATHROW; + //patch handlers + removeRangeFromExcTable(frame.offset, end + 1); + } + private void removeRangeFromExcTable(int rangeStart, int rangeEnd) { var it = handlers.listIterator(); while (it.hasNext()) { @@ -380,14 +387,15 @@ private void removeRangeFromExcTable(int rangeStart, int rangeEnd) { * @return StackMapTableAttribute or null if stack map is empty */ public Attribute stackMapTableAttribute() { - return frames.isEmpty() ? null : new UnboundAttribute.AdHocAttribute<>(Attributes.stackMapTable()) { + return framesCount == 0 ? null : new UnboundAttribute.AdHocAttribute<>(Attributes.stackMapTable()) { @Override public void writeBody(BufWriterImpl b) { - b.writeU2(frames.size()); + b.writeU2(framesCount); Frame prevFrame = new Frame(classHierarchy); prevFrame.setLocalsFromArg(methodName, methodDesc, isStatic, thisType); prevFrame.trimAndCompress(); - for (var fr : frames) { + for (int i = 0; i < framesCount; i++) { + var fr = frames[i]; fr.trimAndCompress(); fr.writeTo(b, prevFrame, cp); prevFrame = fr; @@ -412,19 +420,19 @@ private void processMethod() { boolean ncf = false; while (bcs.next()) { currentFrame.offset = bcs.bci(); - if (stackmapIndex < frames.size()) { - int thisOffset = frames.get(stackmapIndex).offset; + if (stackmapIndex < framesCount) { + int thisOffset = frames[stackmapIndex].offset; if (ncf && thisOffset > bcs.bci()) { throw generatorError("Expecting a stack map frame"); } if (thisOffset == bcs.bci()) { - Frame nextFrame = frames.get(stackmapIndex++); + Frame nextFrame = frames[stackmapIndex++]; if (!ncf) { currentFrame.checkAssignableTo(nextFrame); } while (!nextFrame.dirty) { //skip unmatched frames - if (stackmapIndex == frames.size()) return; //skip the rest of this round - nextFrame = frames.get(stackmapIndex++); + if (stackmapIndex == framesCount) return; //skip the rest of this round + nextFrame = frames[stackmapIndex++]; } bcs.reset(nextFrame.offset); //skip code up-to the next frame bcs.next(); @@ -841,18 +849,10 @@ private IllegalArgumentException generatorError(String msg, int offset) { } /** - * Performs detection of mandatory stack map frames offsets - * in a single bytecode traversing pass - * @return java.lang.BitSet of detected frames offsets + * Performs detection of mandatory stack map frames in a single bytecode traversing pass + * @return detected frames */ - private BitSet detectFrameOffsets() { - var offsets = new BitSet() { - @Override - public void set(int i) { - Preconditions.checkIndex(i, bytecode.length(), RawBytecodeHelper.IAE_FORMATTER); - super.set(i); - } - }; + private void detectFrames() { var bcs = bytecode.start(); boolean no_control_flow = false; int opcode, bci = 0; @@ -860,22 +860,22 @@ public void set(int i) { opcode = bcs.opcode(); bci = bcs.bci(); if (no_control_flow) { - offsets.set(bci); + addFrame(bci); } no_control_flow = switch (opcode) { case GOTO -> { - offsets.set(bcs.dest()); + addFrame(bcs.dest()); yield true; } case GOTO_W -> { - offsets.set(bcs.destW()); + addFrame(bcs.destW()); yield true; } case IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ACMPEQ, IF_ACMPNE , IFNULL , IFNONNULL -> { - offsets.set(bcs.dest()); + addFrame(bcs.dest()); yield false; } case TABLESWITCH, LOOKUPSWITCH -> { @@ -891,9 +891,9 @@ public void set(int i) { keys = bcs.getIntUnchecked(aligned_bci + 4); delta = 2; } - offsets.set(bci + default_ofset); + addFrame(bci + default_ofset); for (int i = 0; i < keys; i++) { - offsets.set(bci + bcs.getIntUnchecked(aligned_bci + (3 + i * delta) * 4)); + addFrame(bci + bcs.getIntUnchecked(aligned_bci + (3 + i * delta) * 4)); } yield true; } @@ -904,13 +904,36 @@ public void set(int i) { } catch (IllegalArgumentException iae) { throw generatorError("Detected branch target out of bytecode range", bci); } - for (var exhandler : rawHandlers) try { - offsets.set(exhandler.handler()); + for (int i = 0; i < rawHandlers.size(); i++) try { + addFrame(rawHandlers.get(i).handler()); } catch (IllegalArgumentException iae) { if (!filterDeadLabels) throw generatorError("Detected exception handler out of bytecode range"); } - return offsets; + } + + private void addFrame(int offset) { + Preconditions.checkIndex(offset, bytecode.length(), RawBytecodeHelper.IAE_FORMATTER); + var frames = this.frames; + int i = 0, framesCount = this.framesCount; + for (; i < framesCount; i++) { + var frameOffset = frames[i].offset; + if (frameOffset == offset) { + return; + } + if (frameOffset > offset) { + break; + } + } + if (framesCount >= frames.length) { + int newCapacity = framesCount + 8; + this.frames = frames = framesCount == 0 ? new Frame[newCapacity] : Arrays.copyOf(frames, newCapacity); + } + if (i != framesCount) { + System.arraycopy(frames, i, frames, i + 1, framesCount - i); + } + frames[i] = new Frame(offset, classHierarchy); + this.framesCount = framesCount + 1; } private final class Frame { From f1ea57f06a044ebd39d31a7c4765d0220327b0a0 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Thu, 3 Oct 2024 15:13:42 +0000 Subject: [PATCH 302/307] 8340229: Improve opening sentence of FileInputStream constructor specification Reviewed-by: alanb, jpai --- .../share/classes/java/io/FileInputStream.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/java.base/share/classes/java/io/FileInputStream.java b/src/java.base/share/classes/java/io/FileInputStream.java index 60b289637fdfc..180b2e416a914 100644 --- a/src/java.base/share/classes/java/io/FileInputStream.java +++ b/src/java.base/share/classes/java/io/FileInputStream.java @@ -82,10 +82,9 @@ public class FileInputStream extends InputStream private volatile boolean closed; /** - * 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. {@linkplain java.nio.file##links Symbolic links} + * Creates a {@code FileInputStream} to read from an existing file + * named by the path name {@code name}. + * {@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 @@ -115,10 +114,8 @@ public FileInputStream(String name) throws FileNotFoundException { } /** - * Creates a {@code FileInputStream} by - * opening a connection to an actual file, - * the file named by the {@code File} - * object {@code file} in the file system. + * Creates a {@code FileInputStream} to read from an existing file + * represented by the {@code File} object {@code file}. * {@linkplain java.nio.file##links Symbolic links} * are automatically redirected to the target of the link. * A new {@code FileDescriptor} object From 3ee94e040a7395d11a294a6b660d707c97f188f8 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Thu, 3 Oct 2024 15:13:58 +0000 Subject: [PATCH 303/307] 8341282: (fs) Move creation time fallback logic to Java layer (Linux) Reviewed-by: sgehwolf, alanb --- .../sun/nio/fs/UnixFileAttributes.java | 7 +++--- .../native/libnio/fs/UnixNativeDispatcher.c | 25 +++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java b/src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java index 3b09bd259ceec..2a036d22aed9d 100644 --- a/src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java +++ b/src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java @@ -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 @@ -58,6 +58,7 @@ class UnixFileAttributes private long st_ctime_nsec; private long st_birthtime_sec; private long st_birthtime_nsec; + private boolean birthtime_available; // created lazily private volatile UserPrincipal owner; @@ -163,10 +164,10 @@ public FileTime lastAccessTime() { @Override public FileTime creationTime() { - if (UnixNativeDispatcher.birthtimeSupported()) { + if (UnixNativeDispatcher.birthtimeSupported() && birthtime_available) { return toFileTime(st_birthtime_sec, st_birthtime_nsec); } else { - // return last modified when birth time not supported + // return last modified when birth time unsupported or unavailable return lastModifiedTime(); } } diff --git a/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c b/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c index b91ab6f0cab92..61e9215471a32 100644 --- a/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c +++ b/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c @@ -184,6 +184,7 @@ static jfieldID attrs_st_birthtime_sec; #if defined(__linux__) // Linux has nsec granularity if supported static jfieldID attrs_st_birthtime_nsec; #endif +static jfieldID attrs_birthtime_available; static jfieldID attrs_f_frsize; static jfieldID attrs_f_blocks; @@ -332,6 +333,8 @@ Java_sun_nio_fs_UnixNativeDispatcher_init(JNIEnv* env, jclass this) attrs_st_birthtime_nsec = (*env)->GetFieldID(env, clazz, "st_birthtime_nsec", "J"); CHECK_NULL_RETURN(attrs_st_birthtime_nsec, 0); #endif + attrs_birthtime_available = (*env)->GetFieldID(env, clazz, "birthtime_available", "Z"); + CHECK_NULL_RETURN(attrs_birthtime_available, 0); clazz = (*env)->FindClass(env, "sun/nio/fs/UnixFileStoreAttributes"); CHECK_NULL_RETURN(clazz, 0); @@ -620,19 +623,19 @@ static void copy_statx_attributes(JNIEnv* env, struct my_statx* buf, jobject att (*env)->SetLongField(env, attrs, attrs_st_atime_sec, (jlong)buf->stx_atime.tv_sec); (*env)->SetLongField(env, attrs, attrs_st_mtime_sec, (jlong)buf->stx_mtime.tv_sec); (*env)->SetLongField(env, attrs, attrs_st_ctime_sec, (jlong)buf->stx_ctime.tv_sec); + + // Check mask for birth time and set flag accordingly. The birth time is + // filled in if and only if the STATX_BTIME bit is set in the mask. + // Although the statx system call might be supported by the operating + // system, the birth time is not necessarily supported by the file system. if ((buf->stx_mask & STATX_BTIME) != 0) { - // Birth time was filled in so use it - (*env)->SetLongField(env, attrs, attrs_st_birthtime_sec, - (jlong)buf->stx_btime.tv_sec); - (*env)->SetLongField(env, attrs, attrs_st_birthtime_nsec, - (jlong)buf->stx_btime.tv_nsec); + (*env)->SetBooleanField(env, attrs, attrs_birthtime_available, (jboolean)JNI_TRUE); + (*env)->SetLongField(env, attrs, attrs_st_birthtime_sec, (jlong)buf->stx_btime.tv_sec); + (*env)->SetLongField(env, attrs, attrs_st_birthtime_nsec, (jlong)buf->stx_btime.tv_nsec); } else { - // Birth time was not filled in: fall back to last modification time - (*env)->SetLongField(env, attrs, attrs_st_birthtime_sec, - (jlong)buf->stx_mtime.tv_sec); - (*env)->SetLongField(env, attrs, attrs_st_birthtime_nsec, - (jlong)buf->stx_mtime.tv_nsec); + (*env)->SetBooleanField(env, attrs, attrs_birthtime_available, (jboolean)JNI_FALSE); } + (*env)->SetLongField(env, attrs, attrs_st_atime_nsec, (jlong)buf->stx_atime.tv_nsec); (*env)->SetLongField(env, attrs, attrs_st_mtime_nsec, (jlong)buf->stx_mtime.tv_nsec); (*env)->SetLongField(env, attrs, attrs_st_ctime_nsec, (jlong)buf->stx_ctime.tv_nsec); @@ -661,7 +664,9 @@ static void copy_stat_attributes(JNIEnv* env, struct stat* buf, jobject attrs) { (*env)->SetLongField(env, attrs, attrs_st_ctime_sec, (jlong)buf->st_ctime); #ifdef _DARWIN_FEATURE_64_BIT_INODE + // birthtime_available defaults to 'false'; on Darwin, it is always true (*env)->SetLongField(env, attrs, attrs_st_birthtime_sec, (jlong)buf->st_birthtime); + (*env)->SetBooleanField(env, attrs, attrs_birthtime_available, (jboolean)JNI_TRUE); // rely on default value of 0 for st_birthtime_nsec field on Darwin #endif From ebb4759c3d2776f5e6e83f743a7891a145f8aee4 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Thu, 3 Oct 2024 16:19:09 +0000 Subject: [PATCH 304/307] 8340625: Open source additional Component tests (part 3) Reviewed-by: psadhukhan --- .../PaintGlitchTest/PaintGlitchTest.java | 225 +++++++++ .../Component/ProcessEvent/ProcessEvent.java | 455 ++++++++++++++++++ .../SetFontOrBackground/SetBgrFnt.java | 123 +++++ 3 files changed, 803 insertions(+) create mode 100644 test/jdk/java/awt/Component/PaintGlitchTest/PaintGlitchTest.java create mode 100644 test/jdk/java/awt/Component/ProcessEvent/ProcessEvent.java create mode 100644 test/jdk/java/awt/Component/SetFontOrBackground/SetBgrFnt.java diff --git a/test/jdk/java/awt/Component/PaintGlitchTest/PaintGlitchTest.java b/test/jdk/java/awt/Component/PaintGlitchTest/PaintGlitchTest.java new file mode 100644 index 0000000000000..867d82d326297 --- /dev/null +++ b/test/jdk/java/awt/Component/PaintGlitchTest/PaintGlitchTest.java @@ -0,0 +1,225 @@ +/* + * 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. + */ + +/* + * @test + * @bug 4045781 + * @summary Exposed/damaged canvases don't always update correctly + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual PaintGlitchTest + */ + +import java.awt.Button; +import java.awt.Canvas; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Label; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.Panel; +import java.awt.Scrollbar; +import java.awt.TextArea; +import java.awt.TextField; +import java.lang.reflect.InvocationTargetException; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JScrollBar; +import javax.swing.JTextArea; +import javax.swing.JTextField; + +public class PaintGlitchTest extends Frame { + static final String INSTRUCTIONS = """ + 1. Click on the 'Painting Glitch Test' window and select from + its menu a content type (text, gradient, fill, + AWT components, Swing components etc.). + 2. Select 'Modal Dialog...' to create a dialog. + 3. Drag the dialog over the content very fast + for 10 seconds or so - make sure you + keep dragging while the content is painting. + 4. Verify that the area exposed by the drag (the damaged regions) + always update properly no white areas or bits of the dialog + should be left after the drag operation is + completed (i.e. after you let go of the mouse). + 5. Repeat for all other content types. + 6. If for any content type the damaged dialog is not properly + repainted press Fail. Otherwise press Pass. + """; + + public PaintGlitchTest() { + super("Painting Glitch Test"); + + TextPanel textPanel = new TextPanel(); + GradientPanel gradientPanel = new GradientPanel(); + ComponentPanel componentPanel = new ComponentPanel(); + SwingPanel swingPanel = new SwingPanel(); + + add(textPanel); + + MenuBar menubar = new MenuBar(); + Menu testMenu = new Menu("Test"); + testMenu.add(makeContentItem("Text Lines", textPanel) ); + testMenu.add(makeContentItem("Gradient Fill", gradientPanel) ); + testMenu.add(makeContentItem("AWT Components", componentPanel) ); + testMenu.add(makeContentItem("Swing Components", swingPanel) ); + testMenu.addSeparator(); + MenuItem dialogItem = new MenuItem("Modal Dialog..."); + dialogItem.addActionListener(ev -> new ObscuringDialog(PaintGlitchTest.this).show()); + testMenu.add(dialogItem); + testMenu.addSeparator(); + menubar.add(testMenu); + + setMenuBar(menubar); + setSize(400,300); + } + + public static void main(String args[]) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Repaint Glitch") + .testUI(PaintGlitchTest::new) + .instructions(INSTRUCTIONS) + .columns(40) + .logArea() + .build() + .awaitAndCheck(); + } + + public MenuItem makeContentItem(String title, final Component content) { + MenuItem menuItem = new MenuItem(title); + menuItem.addActionListener( + ev -> { + remove(0); + add(content); + validate(); + } + ); + + return menuItem; + } +} + +class GradientPanel extends Canvas { + public void paint(Graphics g) { + long ms = System.currentTimeMillis(); + // just paint something that'll take a while + int x, y; + int width = getSize().width; + int height = getSize().height; + int step = 8; + + for (x = 0; x < width; x += step) { + for (y = 0; y < height; y += step) { + int red = (255 * y) / height; + int green = (255 * x * y) / (width * height); + int blue = (255 * x) / width; + + Color color = new Color(red, green, blue); + g.setColor(color); + g.fillRect(x, y, step, step); + } + } + long time = System.currentTimeMillis() - ms; + PassFailJFrame.log("GradientPanel paint took " + time + " ms"); + } + + public Dimension getPreferredSize() { + return new Dimension(200,1000); + } +} + +class TextPanel extends Canvas { + public void paint(Graphics g) { + long ms = System.currentTimeMillis(); + Font font = new Font("SanSerif", Font.ITALIC, 12); + + g.setFont(font); + // just paint something that'll take a while + int x, y; + int height = getHeight(); + int step = 16; + + for (x = y = 0; y < height; y += step) { + g.drawString(y + " : The quick brown fox jumps over the lazy dog. " + + "The rain in Spain falls mainly on the plain.", x, y); + } + long time = System.currentTimeMillis() - ms; + PassFailJFrame.log("TextPanel paint took " + time + " ms"); + } + + public Dimension getPreferredSize() { + return new Dimension(640,1000); + } +} + +class ComponentPanel extends Panel { + ComponentPanel() { + add(new Label("Label")); + add(new Button("Button")); + add(new Checkbox("Checkbox")); + Choice c = new Choice(); + c.add("choice"); + java.awt.List l = new java.awt.List(); + l.add("list"); + add(new Scrollbar()); + add(new TextField("TextField")); + add(new TextArea("TextArea")); + add(new Panel()); + add(new Canvas()); + } +} + +class SwingPanel extends JPanel { + SwingPanel() { + add(new JLabel("JLabel")); + add(new JButton("JButton")); + add(new JCheckBox("JCheckBox")); + JComboBox c = new JComboBox(); + JList l = new JList(); + add(new JScrollBar()); + add(new JTextField("This is a JTextField with some text in it to make it longer.")); + add(new JTextArea("This is a JTextArea with some text in it to make it longer.")); + } +} + +class ObscuringDialog extends Dialog { + ObscuringDialog(Frame f) { + super(f, "Obscuring Dialog"); + Button ok = new Button("OK, go away"); + ok.addActionListener(ev -> dispose()); + add(ok); + pack(); + } +} diff --git a/test/jdk/java/awt/Component/ProcessEvent/ProcessEvent.java b/test/jdk/java/awt/Component/ProcessEvent/ProcessEvent.java new file mode 100644 index 0000000000000..3dfd5a0403804 --- /dev/null +++ b/test/jdk/java/awt/Component/ProcessEvent/ProcessEvent.java @@ -0,0 +1,455 @@ +/* + * 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 4292099 + * @summary AWT Event delivery to processEvent + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ProcessEvent + */ + +import java.awt.AWTEvent; +import java.awt.AWTEventMulticaster; +import java.awt.Adjustable; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.ItemSelectable; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.TextEvent; +import java.awt.event.TextListener; +import java.lang.reflect.InvocationTargetException; + +public class ProcessEvent extends Frame { + + static final String INSTRUCTIONS = """ + Press each of the four buttons for ActionEvent, AdjustmentEvent, + ItemEvent and TextEvent. If a message for each corresponding event + appears in the log area and says the event listener was + called, then press Pass otherwise press Fail. + """; + ActionBtn af; + AdjustmentBtn adjf; + ItemBtn itf; + TextBtn txtf; + + public ProcessEvent() { + setLayout(new FlowLayout()); + add(af = new ActionBtn()); + af.setBackground(Color.green); + + add(adjf = new AdjustmentBtn()); + adjf.setBackground(Color.green); + + add(itf = new ItemBtn()); + itf.setBackground(Color.green); + + add(txtf = new TextBtn()); + txtf.setBackground(Color.green); + + // These action listeners simply provide feedback of when + // the event is delivered properly. + af.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + PassFailJFrame.log(af.getText() + + ": action listener called: " + + ae.toString()); + } + }); + + adjf.addAdjustmentListener(new AdjustmentListener() { + public void adjustmentValueChanged(AdjustmentEvent ae) { + PassFailJFrame.log(adjf.getText() + + ": adjustment listener called: " + + ae.toString()); + } + }); + + itf.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + PassFailJFrame.log(itf.getText() + + ": item listener called: " + + e.toString()); + } + }); + + txtf.addTextListener(new TextListener() { + public void textValueChanged(TextEvent e) { + PassFailJFrame.log(txtf.getText() + + ": text listener called: " + + e.toString()); + } + }); + + pack(); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Process Events Test") + .testUI(ProcessEvent::new) + .instructions(INSTRUCTIONS) + .columns(40) + .logArea() + .build() + .awaitAndCheck(); + } +} + +class ButtonComponent extends Component implements ItemSelectable, Adjustable { + + transient protected TextListener textListener; + transient ActionListener actionListener; + transient AdjustmentListener adjustmentListener; + transient ItemListener itemListener; + String actionCommand = null; + + String text = null; + + public ButtonComponent(String label) { + super(); + text = label; + } + + public String getText() { + return text; + } + + public Dimension getPreferredSize() { + return new Dimension(200, 30); + } + + public Dimension getMinimumSize() { + return getPreferredSize(); + } + + public String getActionCommand() { + if (actionCommand == null) + return getText(); + else + return actionCommand; + } + + public void setActionCommand(String ac) { + actionCommand = ac; + } + + // ActionEvent listener support + + public synchronized void addActionListener(ActionListener l) { + if (l == null) { + return; + } + enableEvents(AWTEvent.ACTION_EVENT_MASK); + actionListener = AWTEventMulticaster.add(actionListener, l); + } + + public synchronized void removeActionListener(ActionListener l) { + if (l == null) { + return; + } + actionListener = AWTEventMulticaster.remove(actionListener, l); + } + + // AdjustmentEvent listener support + + public synchronized void addAdjustmentListener(AdjustmentListener l) { + if (l == null) { + return; + } + enableEvents(AWTEvent.ADJUSTMENT_EVENT_MASK); + adjustmentListener = AWTEventMulticaster.add(adjustmentListener, l); + } + + public synchronized void removeAdjustmentListener(AdjustmentListener l) { + if (l == null) { + return; + } + adjustmentListener = AWTEventMulticaster.remove(adjustmentListener, l); + } + + // ItemEvent listener support + + public synchronized void addItemListener(ItemListener l) { + if (l == null) { + return; + } + enableEvents(AWTEvent.ITEM_EVENT_MASK); + itemListener = AWTEventMulticaster.add(itemListener, l); + } + + public synchronized void removeItemListener(ItemListener l) { + if (l == null) { + return; + } + itemListener = AWTEventMulticaster.remove(itemListener, l); + } + + // TextEvent listener support + + public synchronized void addTextListener(TextListener l) { + if (l == null) { + return; + } + enableEvents(AWTEvent.TEXT_EVENT_MASK); + textListener = AWTEventMulticaster.add(textListener, l); + } + + public synchronized void removeTextListener(TextListener l) { + if (l == null) { + return; + } + textListener = AWTEventMulticaster.remove(textListener, l); + } + + // Implement the processEvent and processXXXEvent methods to + // handle reception and processing of the event types. + + protected void processEvent(AWTEvent e) { + if (e instanceof ActionEvent) { + processActionEvent((ActionEvent) e); + return; + } + if (e instanceof AdjustmentEvent) { + processAdjustmentEvent((AdjustmentEvent) e); + return; + } + if (e instanceof ItemEvent) { + processItemEvent((ItemEvent) e); + return; + } + if (e instanceof TextEvent) { + processTextEvent((TextEvent) e); + return; + } + super.processEvent(e); + } + + protected void processActionEvent(ActionEvent e) { + if (actionListener != null) { + actionListener.actionPerformed(e); + } + } + + protected void processAdjustmentEvent(AdjustmentEvent e) { + if (adjustmentListener != null) { + adjustmentListener.adjustmentValueChanged(e); + } + } + + protected void processItemEvent(ItemEvent e) { + if (itemListener != null) { + itemListener.itemStateChanged(e); + } + } + + protected void processTextEvent(TextEvent e) { + if (textListener != null) { + textListener.textValueChanged(e); + } + } + + public void paint(Graphics g) { + Dimension dim = getSize(); + g.clearRect(0, 0, dim.width, dim.height); + g.setColor(getForeground()); + g.drawString(text, 2, dim.height - 2); + } + + /** + * Returns the selected items or null if no items are selected. + */ + public Object[] getSelectedObjects() { + return null; + } + + /** + * Gets the orientation of the adjustable object. + */ + public int getOrientation() { + return 0; + } + + /** + * Gets the minimum value of the adjustable object. + */ + public int getMinimum() { + return 0; + } + + /** + * Sets the minimum value of the adjustable object. + * + * @param min the minimum value + */ + public void setMinimum(int min) { + } + + /** + * Gets the maximum value of the adjustable object. + */ + public int getMaximum() { + return 0; + } + + /** + * Sets the maximum value of the adjustable object. + * + * @param max the maximum value + */ + public void setMaximum(int max) { + } + + /** + * Gets the unit value increment for the adjustable object. + */ + public int getUnitIncrement() { + return 0; + } + + /** + * Sets the unit value increment for the adjustable object. + * + * @param u the unit increment + */ + public void setUnitIncrement(int u) { + } + + /** + * Gets the block value increment for the adjustable object. + */ + public int getBlockIncrement() { + return 0; + } + + /** + * Sets the block value increment for the adjustable object. + * + * @param b the block increment + */ + public void setBlockIncrement(int b) { + } + + /** + * Gets the length of the propertional indicator. + */ + public int getVisibleAmount() { + return 0; + } + + /** + * Sets the length of the proportionl indicator of the + * adjustable object. + * + * @param v the length of the indicator + */ + public void setVisibleAmount(int v) { + } + + /** + * Gets the current value of the adjustable object. + */ + public int getValue() { + return 0; + } + + /** + * Sets the current value of the adjustable object. This + * value must be within the range defined by the minimum and + * maximum values for this object. + * + * @param v the current value + */ + public void setValue(int v) { + } + +} + +class ActionBtn extends ButtonComponent { + public ActionBtn() { + super("ActionEvent"); + addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + ActionEvent ae = new ActionEvent(e.getSource(), + ActionEvent.ACTION_PERFORMED, + getActionCommand()); + Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(ae); + } + }); + } +} + +class AdjustmentBtn extends ButtonComponent { + public AdjustmentBtn() { + super("AdjustmentEvent"); + addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + AdjustmentEvent ae = new AdjustmentEvent((Adjustable) e.getSource(), + AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED, + 1, 1); + Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(ae); + } + }); + } +} + +class ItemBtn extends ButtonComponent { + public ItemBtn() { + super("ItemEvent"); + addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + ItemEvent ae = new ItemEvent((ItemSelectable) e.getSource(), + ItemEvent.ITEM_STATE_CHANGED, + e.getSource(), 1); + Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(ae); + } + }); + } +} + +class TextBtn extends ButtonComponent { + public TextBtn() { + super("TextEvent"); + addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + TextEvent ae = new TextEvent(e.getSource(), + TextEvent.TEXT_VALUE_CHANGED); + Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(ae); + } + }); + } +} diff --git a/test/jdk/java/awt/Component/SetFontOrBackground/SetBgrFnt.java b/test/jdk/java/awt/Component/SetFontOrBackground/SetBgrFnt.java new file mode 100644 index 0000000000000..02707ad578475 --- /dev/null +++ b/test/jdk/java/awt/Component/SetFontOrBackground/SetBgrFnt.java @@ -0,0 +1,123 @@ +/* + * 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 4906548 4921849 + * @summary Checks that setFont and setBackground have immediate effect + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual SetBgrFnt + */ + +import java.awt.Button; +import java.awt.Canvas; +import java.awt.Checkbox; +import java.awt.Color; +import java.awt.Font; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.Label; +import java.lang.reflect.InvocationTargetException; + +public class SetBgrFnt extends Frame { + static final String INSTRUCTIONS = """ + 1. Press a button marked 'Switch fonts' + fonts in three components below (a Button, a Checkbox + and a Label) must change immediately. + + 2. Press a button marked 'Switch background' + background of three components and canvas must change. + MacOS is an exception - AWT buttons on macOS so not + change color so on macOS only canvas, checkbox + and a label should change background. + + If this is the behavior that you observe press Pass, + otherwise press Fail. + """; + Label la; + Button bu, bu1, bu2; + Checkbox cb; + Font font1, font2; + Canvas ca; + boolean bToggleFont = true; + boolean bToggleBg = true; + + public SetBgrFnt() { + bu = new Button("Switch fonts"); + bu1 = new Button("Switch background"); + bu2 = new Button("I'm a button"); + cb = new Checkbox("Checkbox I am"); + la = new Label("I am a label"); + ca = new Canvas(); + font1 = new Font("Serif", Font.ITALIC, 22); + font2 = new Font("SansSerif", Font.PLAIN, 10); + la.setFont(font1); + cb.setFont(font1); + bu2.setFont(font1); + bu.addActionListener(ae -> { + if (bToggleFont) { + la.setFont(font2); + cb.setFont(font2); + bu2.setFont(font2); + } else { + la.setFont(font1); + cb.setFont(font1); + bu2.setFont(font1); + } + bToggleFont = !bToggleFont; + }); + + bu1.addActionListener(ae -> { + if (bToggleBg) { + ca.setBackground(Color.YELLOW); + setBackground(Color.YELLOW); + } else { + ca.setBackground(Color.GREEN); + setBackground(Color.GREEN); + } + bToggleBg = !bToggleBg; + }); + + setLayout(new GridLayout(8, 1)); + add(bu); + add(bu1); + add(new Label()); + add("South", la); + add("South", bu2); + add("South", cb); + add("South", ca); + pack(); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Set Font and Background Test") + .testUI(SetBgrFnt::new) + .instructions(INSTRUCTIONS) + .columns(40) + .build() + .awaitAndCheck(); + } +} From de12fc7a3601ad7d5e10ccd38967b26eadf96aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Thu, 3 Oct 2024 16:44:22 +0000 Subject: [PATCH 305/307] 8339684: ResizeObserver callback interrupts smooth scrolling on Chrome Reviewed-by: prappo --- .../doclets/formats/html/resources/script.js.template | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/script.js.template b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/script.js.template index 633f453bc43b1..2185b1c951f8e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/script.js.template +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/script.js.template @@ -300,6 +300,7 @@ document.addEventListener("DOMContentLoaded", function(e) { }); var expanded = false; var windowWidth; + var bodyHeight; function collapse(e) { if (expanded) { mainnav.removeAttribute("style"); @@ -365,6 +366,7 @@ document.addEventListener("DOMContentLoaded", function(e) { var scrollTimeoutNeeded; var prevHash; function initSectionData() { + bodyHeight = document.body.offsetHeight; sections = [{ id: "", top: 0 }].concat(Array.from(main.querySelectorAll("section[id], h2[id], h2 a[id], div[id]")) .filter((e) => { return sidebar.querySelector("a[href=\"#" + encodeURI(e.getAttribute("id")) + "\"]") !== null @@ -469,7 +471,7 @@ document.addEventListener("DOMContentLoaded", function(e) { expand(); } } - if (sections) { + if (sections && document.body.offsetHeight !== bodyHeight) { initSectionData(); prevHash = null; handleScroll(); From 013250e4a7bc2fa83c6e57bb8fad6002dbe3176c Mon Sep 17 00:00:00 2001 From: Damon Nguyen Date: Thu, 3 Oct 2024 16:46:46 +0000 Subject: [PATCH 306/307] 8340432: Open source some MenuBar tests - Set2 Reviewed-by: prr, psadhukhan --- .../MenuBarAddRemoveTest.java | 72 +++++++++++++++ .../MenuBarOnDisabledFrame.java | 77 ++++++++++++++++ .../MenuBarVisuals/MenuBarVisuals.java | 88 +++++++++++++++++++ .../SetHelpMenuTest/SetHelpMenuTest.java | 88 +++++++++++++++++++ 4 files changed, 325 insertions(+) create mode 100644 test/jdk/java/awt/MenuBar/MenuBarAddRemoveTest/MenuBarAddRemoveTest.java create mode 100644 test/jdk/java/awt/MenuBar/MenuBarOnDisabledFrame/MenuBarOnDisabledFrame.java create mode 100644 test/jdk/java/awt/MenuBar/MenuBarVisuals/MenuBarVisuals.java create mode 100644 test/jdk/java/awt/MenuBar/SetHelpMenuTest/SetHelpMenuTest.java diff --git a/test/jdk/java/awt/MenuBar/MenuBarAddRemoveTest/MenuBarAddRemoveTest.java b/test/jdk/java/awt/MenuBar/MenuBarAddRemoveTest/MenuBarAddRemoveTest.java new file mode 100644 index 0000000000000..fdb9f06e98c76 --- /dev/null +++ b/test/jdk/java/awt/MenuBar/MenuBarAddRemoveTest/MenuBarAddRemoveTest.java @@ -0,0 +1,72 @@ +/* + * 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 4028130 4112308 + * @summary Test for location of Frame/MenuBar when MenuBar is re-added + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MenuBarAddRemoveTest + */ + +import java.awt.Button; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; + +public class MenuBarAddRemoveTest { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + 1. Click the left mouse button on the "Re-Add MenuBar" + button several times. + 3. The Frame/MenuBar may repaint or flash, but the location + of its upper left corner should never change. + """; + + PassFailJFrame.builder() + .title("Test Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(MenuBarAddRemoveTest::createUI) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame f = new Frame("Re-Add MenuBar Test Frame"); + Button b = new Button("Re-Add MenuBar"); + b.addActionListener(e -> f.setMenuBar(createMenuBar())); + f.setMenuBar(createMenuBar()); + f.add(b); + f.pack(); + return f; + } + + private static MenuBar createMenuBar() { + MenuBar bar = new MenuBar(); + bar.add(new Menu("foo")); + return bar; + } +} diff --git a/test/jdk/java/awt/MenuBar/MenuBarOnDisabledFrame/MenuBarOnDisabledFrame.java b/test/jdk/java/awt/MenuBar/MenuBarOnDisabledFrame/MenuBarOnDisabledFrame.java new file mode 100644 index 0000000000000..06f5d96c19e32 --- /dev/null +++ b/test/jdk/java/awt/MenuBar/MenuBarOnDisabledFrame/MenuBarOnDisabledFrame.java @@ -0,0 +1,77 @@ +/* + * 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. + */ + +/* + * @test + * @bug 6185057 + * @summary Disabling a frame does not disable the menus on the frame, on + * solaris/linux + * @requires os.family != "mac" + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MenuBarOnDisabledFrame + */ + +import java.awt.Button; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; + +public class MenuBarOnDisabledFrame { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + Check if MenuBar is disabled on 'Disabled frame' + Press pass if menu bar is disabled, fail otherwise + """; + + PassFailJFrame.builder() + .title("Test Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(MenuBarOnDisabledFrame::createUI) + .build() + .awaitAndCheck(); + } + + public static Frame createUI() { + Frame f = new Frame("Disabled frame"); + MenuBar mb = new MenuBar(); + Menu m1 = new Menu("Disabled Menu 1"); + Menu m2 = new Menu("Disabled Menu 2"); + MenuItem m11 = new MenuItem("MenuItem 1.1"); + MenuItem m21 = new MenuItem("MenuItem 2.1"); + Button b = new Button("Disabled button"); + + m1.add(m11); + m2.add(m21); + mb.add(m1); + mb.add(m2); + f.setMenuBar(mb); + f.add(b); + f.setEnabled(false); + f.setSize(300, 300); + return f; + } +} diff --git a/test/jdk/java/awt/MenuBar/MenuBarVisuals/MenuBarVisuals.java b/test/jdk/java/awt/MenuBar/MenuBarVisuals/MenuBarVisuals.java new file mode 100644 index 0000000000000..7663dd0d99be1 --- /dev/null +++ b/test/jdk/java/awt/MenuBar/MenuBarVisuals/MenuBarVisuals.java @@ -0,0 +1,88 @@ +/* + * 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. + */ + +/* + * @test + * @bug 6180416 + * @summary Tests MenuBar and drop down menu visuals + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MenuBarVisuals + */ + +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.MenuShortcut; +import java.awt.event.KeyEvent; + +public class MenuBarVisuals { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + Look at the MenuBar and traverse the menus using mouse and + keyboard. Then check if following is showing correctly: + 1. Mnemonic label Ctrl+A is NOT drawn for Menu 1/Submenu 1.1 + 2. Mnemonic label Ctrl+B is drawn for + Menu 1/Submenu 1.1/Item 1.1.1 + 3. Mnemonic label Ctrl+C is drawn for Menu1/Item 1.2 + Press PASS if Menu is drawing correctly, FAIL otherwise. + """; + + PassFailJFrame.builder() + .title("Test Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(MenuBarVisuals::createUI) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame f = new Frame("MenuBar Visuals Test"); + MenuBar mb = new MenuBar(); + Menu menu1 = new Menu("Menu 1"); + Menu submenu11 = new Menu("Submenu 1.1"); + MenuItem item111 = new MenuItem("Item 1.1.1"); + MenuItem item112 = new MenuItem("Item 1.1.2"); + MenuItem item12 = new MenuItem("Item 1.2"); + Menu menu2 = new Menu("Menu 2"); + MenuItem item21 = new MenuItem("Item 2.1"); + MenuItem item22 = new MenuItem("Item 2.2"); + item111.setShortcut(new MenuShortcut(KeyEvent.VK_B, false)); + submenu11.add(item111); + submenu11.add(item112); + submenu11.setShortcut(new MenuShortcut(KeyEvent.VK_A, false)); + menu1.add(submenu11); + item12.setShortcut(new MenuShortcut(KeyEvent.VK_C, false)); + menu1.add(item12); + mb.add(menu1); + menu2.add(item21); + menu2.add(item22); + mb.add(menu2); + f.setMenuBar(mb); + f.setSize(300, 300); + return f; + } +} diff --git a/test/jdk/java/awt/MenuBar/SetHelpMenuTest/SetHelpMenuTest.java b/test/jdk/java/awt/MenuBar/SetHelpMenuTest/SetHelpMenuTest.java new file mode 100644 index 0000000000000..fcfc3e80ed34c --- /dev/null +++ b/test/jdk/java/awt/MenuBar/SetHelpMenuTest/SetHelpMenuTest.java @@ -0,0 +1,88 @@ +/* + * 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 4275843 + * @summary MenuBar doesn't display all of its Menus correctly on Windows + * @requires os.family == "windows" + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual SetHelpMenuTest + */ + +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; + +public class SetHelpMenuTest { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + An empty frame should be visible. When focused, the MenuBar + should have 5 menus ("one", "two", "three", "Help 2", + "four"). If so, then the test passed. Otherwise, the test + failed. + """; + + PassFailJFrame.builder() + .title("Test Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(SetHelpMenuTest::createUI) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame f = new Frame("Help MenuBar Test"); + f.setSize(100, 100); + + MenuBar mb = new MenuBar(); + Menu h1, h2; + + f.setMenuBar(mb); + mb.add(createMenu("one", false)); + mb.add(createMenu("two", false)); + mb.add(createMenu("three", true)); + + mb.add(h1 = createMenu("Help 1", false)); // h1 is HelpMenu + mb.setHelpMenu(h1); + + mb.add(h2 = createMenu("Help 2", false)); // h2 replaced h1 + mb.setHelpMenu(h2); + + mb.add(createMenu("four", false)); + + return f; + } + + private static Menu createMenu(String name, boolean tearOff) { + Menu m = new Menu(name, tearOff); + m.add(new MenuItem(name + " item 1")); + m.add(new MenuItem(name + " item 2")); + m.add(new MenuItem(name + " item 3")); + return m; + } +} From b6e72ff971455f7768c2e1c0fe53d922e5deed38 Mon Sep 17 00:00:00 2001 From: Jamil Nimeh Date: Thu, 3 Oct 2024 17:16:31 +0000 Subject: [PATCH 307/307] 8339403: sun.security.ssl.StatusResponseManager.get swallows interrupt status Reviewed-by: valeriep --- .../security/ssl/StatusResponseManager.java | 28 +++++++++++---- .../ssl/Stapling/StatusResponseManager.java | 4 +-- .../ssl/StatusResponseManagerTests.java | 35 ++++++++++++++++++- 3 files changed, 57 insertions(+), 10 deletions(-) diff --git a/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java b/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java index 0632f846cbf71..1baf3264122e4 100644 --- a/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java +++ b/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.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 @@ -257,7 +257,20 @@ Map get(CertStatusRequestType type, } if (!task.isCancelled()) { - StatusInfo info = task.get(); + StatusInfo info; + try { + info = task.get(); + } catch (ExecutionException exc) { + // Check for an underlying cause available and log + // that, otherwise just log the ExecutionException + Throwable cause = Optional.ofNullable( + exc.getCause()).orElse(exc); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine("Exception during OCSP fetch: " + + cause); + } + continue; + } if (info != null && info.responseData != null) { responseMap.put(info.cert, info.responseData.ocspBytes); @@ -272,10 +285,12 @@ Map get(CertStatusRequestType type, } } } - } catch (InterruptedException | ExecutionException exc) { - // Not sure what else to do here + } catch (InterruptedException intex) { + // Log and reset the interrupt state + Thread.currentThread().interrupt(); if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { - SSLLogger.fine("Exception when getting data: ", exc); + SSLLogger.fine("Interrupt occurred while fetching: " + + intex); } } } @@ -582,8 +597,7 @@ private void addToCache(CertId certId, ResponseCacheEntry entry) { } - static final StaplingParameters processStapling( - ServerHandshakeContext shc) { + static StaplingParameters processStapling(ServerHandshakeContext shc) { StaplingParameters params = null; SSLExtension ext = null; CertStatusRequestType type = null; diff --git a/test/jdk/sun/security/ssl/Stapling/StatusResponseManager.java b/test/jdk/sun/security/ssl/Stapling/StatusResponseManager.java index 58ebb5b876af8..5555363374ca9 100644 --- a/test/jdk/sun/security/ssl/Stapling/StatusResponseManager.java +++ b/test/jdk/sun/security/ssl/Stapling/StatusResponseManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, 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,7 +23,7 @@ /* * @test - * @bug 8046321 + * @bug 8046321 8339403 * @library ../../../../java/security/testlibrary * @build CertificateBuilder SimpleOCSPServer * @run main/othervm -Djavax.net.debug=ssl:respmgr java.base/sun.security.ssl.StatusResponseManagerTests diff --git a/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java b/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java index f6b0d1f10e20f..b210cfb26eaed 100644 --- a/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java +++ b/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.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 @@ -82,6 +82,7 @@ public static void main(String[] args) throws Exception { put("Clear StatusResponseManager cache", testClearSRM); put("Basic OCSP_MULTI fetch test", testOcspMultiFetch); put("Test Cache Expiration", testCacheExpiry); + put("Test Interrupt while fetching", forceInterruptMainThread); }}; // Create the CAs and OCSP responders @@ -262,6 +263,38 @@ public Map.Entry runTest() { } }; + public static final TestCase forceInterruptMainThread = new TestCase() { + @Override + public Map.Entry runTest() { + StatusResponseManager srm = new StatusResponseManager(); + Boolean pass = Boolean.FALSE; + String message = null; + CertStatusRequest oReq = OCSPStatusRequest.EMPTY_OCSP; + + try { + // Force the interrupt flag to be set on the thread that + // performs the invokeAll in the SRM. + Thread.currentThread().interrupt(); + + // Get OCSP responses for non-root certs in the chain + Map responseMap = srm.get( + CertStatusRequestType.OCSP, oReq, chain, 5000, + TimeUnit.MILLISECONDS); + if (Thread.currentThread().isInterrupted()) { + pass = Boolean.TRUE; + message = "Thread is in expected interrupted state."; + } else { + message = "Missing expectedInterruptedException."; + } + message += " Number of SRM entries: " + responseMap.size(); + } catch (Exception exc) { + message = "Unexpected exception: " + exc; + } + + return new AbstractMap.SimpleEntry<>(pass, message); + } + }; + /** * Creates the PKI components necessary for this test, including * Root CA, Intermediate CA and SSL server certificates, the keystores