8271368: [BACKOUT] JDK-8266054 VectorAPI rotate operation optimization
Reviewed-by: dholmes, iklam
This commit is contained in:
parent
ecd445562f
commit
d7b5cb6889
@ -138,11 +138,6 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
// Does the CPU supports vector constant rotate instructions?
|
||||
static constexpr bool supports_vector_constant_rotates(int shift) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Does the CPU supports vector unsigned comparison instructions?
|
||||
static const bool supports_vector_comparison_unsigned(int vlen, BasicType bt) {
|
||||
// Not supported on SVE yet.
|
||||
|
@ -131,11 +131,6 @@
|
||||
return false; // not supported
|
||||
}
|
||||
|
||||
// Does the CPU supports vector constant rotate instructions?
|
||||
static constexpr bool supports_vector_constant_rotates(int shift) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Does the CPU supports vector unsigned comparison instructions?
|
||||
static constexpr bool supports_vector_comparison_unsigned(int vlen, BasicType bt) {
|
||||
return false;
|
||||
|
@ -138,11 +138,6 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
// Does the CPU supports vector constant rotate instructions?
|
||||
static constexpr bool supports_vector_constant_rotates(int shift) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Does the CPU supports vector unsigned comparison instructions?
|
||||
static constexpr bool supports_vector_comparison_unsigned(int vlen, BasicType bt) {
|
||||
return false;
|
||||
|
@ -128,11 +128,6 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
// Does the CPU supports vector constant rotate instructions?
|
||||
static constexpr bool supports_vector_constant_rotates(int shift) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Does the CPU supports vector unsigned comparison instructions?
|
||||
static constexpr bool supports_vector_comparison_unsigned(int vlen, BasicType bt) {
|
||||
return false;
|
||||
|
@ -158,11 +158,6 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
// Does the CPU supports vector constant rotate instructions?
|
||||
static constexpr bool supports_vector_constant_rotates(int shift) {
|
||||
return -0x80 <= shift && shift < 0x80;
|
||||
}
|
||||
|
||||
// Does the CPU supports vector unsigned comparison instructions?
|
||||
static const bool supports_vector_comparison_unsigned(int vlen, BasicType bt) {
|
||||
int vlen_in_bytes = vlen * type2aelembytes(bt);
|
||||
|
@ -1638,9 +1638,6 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType
|
||||
break;
|
||||
case Op_RotateRightV:
|
||||
case Op_RotateLeftV:
|
||||
if (bt != T_INT && bt != T_LONG) {
|
||||
return false;
|
||||
} // fallthrough
|
||||
case Op_MacroLogicV:
|
||||
if (!VM_Version::supports_evex() ||
|
||||
((size_in_bits != 512) && !VM_Version::supports_avx512vl())) {
|
||||
|
@ -336,7 +336,6 @@ class LibraryCallKit : public GraphKit {
|
||||
};
|
||||
|
||||
bool arch_supports_vector(int op, int num_elem, BasicType type, VectorMaskUseType mask_use_type, bool has_scalar_args = false);
|
||||
bool arch_supports_vector_rotate(int opc, int num_elem, BasicType elem_bt, bool has_scalar_args = false);
|
||||
|
||||
void clear_upper_avx() {
|
||||
#ifdef X86
|
||||
|
@ -2488,8 +2488,9 @@ void SuperWord::output() {
|
||||
} else if (VectorNode::is_scalar_rotate(n)) {
|
||||
Node* in1 = low_adr->in(1);
|
||||
Node* in2 = p->at(0)->in(2);
|
||||
assert(in2->bottom_type()->isa_int(), "Shift must always be an int value");
|
||||
// If rotation count is non-constant or greater than 8bit value create a vector.
|
||||
if (!in2->is_Con() || !Matcher::supports_vector_constant_rotates(in2->get_int())) {
|
||||
if (!in2->is_Con() || -0x80 > in2->get_int() || in2->get_int() >= 0x80) {
|
||||
in2 = vector_opd(p, 2);
|
||||
}
|
||||
vn = VectorNode::make(opc, in1, in2, vlen, velt_basic_type(n));
|
||||
|
@ -59,48 +59,6 @@ static bool check_vbox(const TypeInstPtr* vbox_type) {
|
||||
}
|
||||
#endif
|
||||
|
||||
bool LibraryCallKit::arch_supports_vector_rotate(int opc, int num_elem, BasicType elem_bt, bool has_scalar_args) {
|
||||
bool is_supported = true;
|
||||
// has_scalar_args flag is true only for non-constant scalar shift count,
|
||||
// since in this case shift needs to be broadcasted.
|
||||
if (!Matcher::match_rule_supported_vector(opc, num_elem, elem_bt) ||
|
||||
(has_scalar_args &&
|
||||
!arch_supports_vector(VectorNode::replicate_opcode(elem_bt), num_elem, elem_bt, VecMaskNotUsed))) {
|
||||
is_supported = false;
|
||||
}
|
||||
|
||||
int lshiftopc, rshiftopc;
|
||||
switch(elem_bt) {
|
||||
case T_BYTE:
|
||||
lshiftopc = Op_LShiftI;
|
||||
rshiftopc = Op_URShiftB;
|
||||
break;
|
||||
case T_SHORT:
|
||||
lshiftopc = Op_LShiftI;
|
||||
rshiftopc = Op_URShiftS;
|
||||
break;
|
||||
case T_INT:
|
||||
lshiftopc = Op_LShiftI;
|
||||
rshiftopc = Op_URShiftI;
|
||||
break;
|
||||
case T_LONG:
|
||||
lshiftopc = Op_LShiftL;
|
||||
rshiftopc = Op_URShiftL;
|
||||
break;
|
||||
default:
|
||||
assert(false, "Unexpected type");
|
||||
}
|
||||
int lshiftvopc = VectorNode::opcode(lshiftopc, elem_bt);
|
||||
int rshiftvopc = VectorNode::opcode(rshiftopc, elem_bt);
|
||||
if (!is_supported &&
|
||||
arch_supports_vector(lshiftvopc, num_elem, elem_bt, VecMaskNotUsed) &&
|
||||
arch_supports_vector(rshiftvopc, num_elem, elem_bt, VecMaskNotUsed) &&
|
||||
arch_supports_vector(Op_OrV, num_elem, elem_bt, VecMaskNotUsed)) {
|
||||
is_supported = true;
|
||||
}
|
||||
return is_supported;
|
||||
}
|
||||
|
||||
Node* GraphKit::box_vector(Node* vector, const TypeInstPtr* vbox_type, BasicType elem_bt, int num_elem, bool deoptimize_on_exception) {
|
||||
assert(EnableVectorSupport, "");
|
||||
|
||||
@ -154,29 +112,17 @@ bool LibraryCallKit::arch_supports_vector(int sopc, int num_elem, BasicType type
|
||||
return false;
|
||||
}
|
||||
|
||||
if (VectorNode::is_vector_rotate(sopc)) {
|
||||
if(!arch_supports_vector_rotate(sopc, num_elem, type, has_scalar_args)) {
|
||||
// Check that architecture supports this op-size-type combination.
|
||||
if (!Matcher::match_rule_supported_vector(sopc, num_elem, type)) {
|
||||
#ifndef PRODUCT
|
||||
if (C->print_intrinsics()) {
|
||||
tty->print_cr(" ** Rejected vector op (%s,%s,%d) because architecture does not support variable vector shifts",
|
||||
NodeClassNames[sopc], type2name(type), num_elem);
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
if (C->print_intrinsics()) {
|
||||
tty->print_cr(" ** Rejected vector op (%s,%s,%d) because architecture does not support it",
|
||||
NodeClassNames[sopc], type2name(type), num_elem);
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
} else {
|
||||
// Check that architecture supports this op-size-type combination.
|
||||
if (!Matcher::match_rule_supported_vector(sopc, num_elem, type)) {
|
||||
#ifndef PRODUCT
|
||||
if (C->print_intrinsics()) {
|
||||
tty->print_cr(" ** Rejected vector op (%s,%s,%d) because architecture does not support it",
|
||||
NodeClassNames[sopc], type2name(type), num_elem);
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
} else {
|
||||
assert(Matcher::match_rule_supported(sopc), "must be supported");
|
||||
}
|
||||
assert(Matcher::match_rule_supported(sopc), "must be supported");
|
||||
}
|
||||
|
||||
if (num_elem == 1) {
|
||||
@ -1554,9 +1500,7 @@ bool LibraryCallKit::inline_vector_broadcast_int() {
|
||||
BasicType elem_bt = elem_type->basic_type();
|
||||
int num_elem = vlen->get_con();
|
||||
int opc = VectorSupport::vop2ideal(opr->get_con(), elem_bt);
|
||||
bool is_shift = VectorNode::is_shift_opcode(opc);
|
||||
bool is_rotate = VectorNode::is_rotate_opcode(opc);
|
||||
if (opc == 0 || (!is_shift && !is_rotate)) {
|
||||
if (opc == 0 || !VectorNode::is_shift_opcode(opc)) {
|
||||
if (C->print_intrinsics()) {
|
||||
tty->print_cr(" ** operation not supported: op=%d bt=%s", opr->get_con(), type2name(elem_bt));
|
||||
}
|
||||
@ -1569,16 +1513,10 @@ bool LibraryCallKit::inline_vector_broadcast_int() {
|
||||
}
|
||||
return false; // operation not supported
|
||||
}
|
||||
Node* cnt = argument(5);
|
||||
ciKlass* vbox_klass = vector_klass->const_oop()->as_instance()->java_lang_Class_klass();
|
||||
const TypeInstPtr* vbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, vbox_klass);
|
||||
const TypeInt* cnt_type = cnt->bottom_type()->isa_int();
|
||||
|
||||
// If CPU supports vector constant rotate instructions pass it directly
|
||||
bool is_const_rotate = is_rotate && cnt_type && cnt_type->is_con() &&
|
||||
Matcher::supports_vector_constant_rotates(cnt_type->get_con());
|
||||
bool has_scalar_args = is_rotate ? !is_const_rotate : true;
|
||||
if (!arch_supports_vector(sopc, num_elem, elem_bt, VecMaskNotUsed, has_scalar_args)) {
|
||||
if (!arch_supports_vector(sopc, num_elem, elem_bt, VecMaskNotUsed, true /*has_scalar_args*/)) {
|
||||
if (C->print_intrinsics()) {
|
||||
tty->print_cr(" ** not supported: arity=0 op=int/%d vlen=%d etype=%s ismask=no",
|
||||
sopc, num_elem, type2name(elem_bt));
|
||||
@ -1586,20 +1524,7 @@ bool LibraryCallKit::inline_vector_broadcast_int() {
|
||||
return false; // not supported
|
||||
}
|
||||
Node* opd1 = unbox_vector(argument(4), vbox_type, elem_bt, num_elem);
|
||||
Node* opd2 = NULL;
|
||||
if (is_shift) {
|
||||
opd2 = vector_shift_count(cnt, opc, elem_bt, num_elem);
|
||||
} else {
|
||||
assert(is_rotate, "unexpected operation");
|
||||
if (!is_const_rotate) {
|
||||
const Type * type_bt = Type::get_const_basic_type(elem_bt);
|
||||
cnt = elem_bt == T_LONG ? gvn().transform(new ConvI2LNode(cnt)) : cnt;
|
||||
opd2 = gvn().transform(VectorNode::scalar2vector(cnt, num_elem, type_bt));
|
||||
} else {
|
||||
// Constant shift value.
|
||||
opd2 = cnt;
|
||||
}
|
||||
}
|
||||
Node* opd2 = vector_shift_count(argument(5), opc, elem_bt, num_elem);
|
||||
if (opd1 == NULL || opd2 == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
@ -142,9 +142,9 @@ int VectorNode::opcode(int sopc, BasicType bt) {
|
||||
case Op_RoundDoubleMode:
|
||||
return (bt == T_DOUBLE ? Op_RoundDoubleModeV : 0);
|
||||
case Op_RotateLeft:
|
||||
return (is_integral_type(bt) ? Op_RotateLeftV : 0);
|
||||
return (bt == T_LONG || bt == T_INT ? Op_RotateLeftV : 0);
|
||||
case Op_RotateRight:
|
||||
return (is_integral_type(bt) ? Op_RotateRightV : 0);
|
||||
return (bt == T_LONG || bt == T_INT ? Op_RotateRightV : 0);
|
||||
case Op_SqrtF:
|
||||
return (bt == T_FLOAT ? Op_SqrtVF : 0);
|
||||
case Op_SqrtD:
|
||||
@ -261,7 +261,7 @@ bool VectorNode::implemented(int opc, uint vlen, BasicType bt) {
|
||||
// For rotate operation we will do a lazy de-generation into
|
||||
// OrV/LShiftV/URShiftV pattern if the target does not support
|
||||
// vector rotation instruction.
|
||||
if (VectorNode::is_vector_rotate(vopc)) {
|
||||
if (vopc == Op_RotateLeftV || vopc == Op_RotateRightV) {
|
||||
return is_vector_rotate_supported(vopc, vlen, bt);
|
||||
}
|
||||
return vopc > 0 && Matcher::match_rule_supported_vector(vopc, vlen, bt);
|
||||
@ -295,8 +295,15 @@ bool VectorNode::is_roundopD(Node* n) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VectorNode::is_scalar_rotate(Node* n) {
|
||||
if (n->Opcode() == Op_RotateLeft || n->Opcode() == Op_RotateRight) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VectorNode::is_vector_rotate_supported(int vopc, uint vlen, BasicType bt) {
|
||||
assert(VectorNode::is_vector_rotate(vopc), "wrong opcode");
|
||||
assert(vopc == Op_RotateLeftV || vopc == Op_RotateRightV, "wrong opcode");
|
||||
|
||||
// If target defines vector rotation patterns then no
|
||||
// need for degeneration.
|
||||
@ -340,23 +347,6 @@ bool VectorNode::is_shift(Node* n) {
|
||||
return is_shift_opcode(n->Opcode());
|
||||
}
|
||||
|
||||
bool VectorNode::is_rotate_opcode(int opc) {
|
||||
switch (opc) {
|
||||
case Op_RotateRight:
|
||||
case Op_RotateLeft:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool VectorNode::is_scalar_rotate(Node* n) {
|
||||
if (is_rotate_opcode(n->Opcode())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VectorNode::is_vshift_cnt(Node* n) {
|
||||
switch (n->Opcode()) {
|
||||
case Op_LShiftCntV:
|
||||
@ -588,16 +578,6 @@ VectorNode* VectorNode::shift_count(int opc, Node* cnt, uint vlen, BasicType bt)
|
||||
}
|
||||
}
|
||||
|
||||
bool VectorNode::is_vector_rotate(int opc) {
|
||||
switch (opc) {
|
||||
case Op_RotateLeftV:
|
||||
case Op_RotateRightV:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool VectorNode::is_vector_shift(int opc) {
|
||||
assert(opc > _last_machine_leaf && opc < _last_opcode, "invalid opcode");
|
||||
switch (opc) {
|
||||
@ -1151,35 +1131,24 @@ MacroLogicVNode* MacroLogicVNode::make(PhaseGVN& gvn, Node* in1, Node* in2, Node
|
||||
|
||||
Node* VectorNode::degenerate_vector_rotate(Node* src, Node* cnt, bool is_rotate_left,
|
||||
int vlen, BasicType bt, PhaseGVN* phase) {
|
||||
assert(is_integral_type(bt), "sanity");
|
||||
assert(bt == T_INT || bt == T_LONG, "sanity");
|
||||
const TypeVect* vt = TypeVect::make(bt, vlen);
|
||||
|
||||
int shift_mask = (type2aelembytes(bt) * 8) - 1;
|
||||
int shiftLOpc = (bt == T_LONG) ? Op_LShiftL : Op_LShiftI;
|
||||
auto urshiftopc = [=]() {
|
||||
switch(bt) {
|
||||
case T_INT: return Op_URShiftI;
|
||||
case T_LONG: return Op_URShiftL;
|
||||
case T_BYTE: return Op_URShiftB;
|
||||
case T_SHORT: return Op_URShiftS;
|
||||
default: return (Opcodes)0;
|
||||
}
|
||||
};
|
||||
int shiftROpc = urshiftopc();
|
||||
int shift_mask = (bt == T_INT) ? 0x1F : 0x3F;
|
||||
int shiftLOpc = (bt == T_INT) ? Op_LShiftI : Op_LShiftL;
|
||||
int shiftROpc = (bt == T_INT) ? Op_URShiftI: Op_URShiftL;
|
||||
|
||||
// Compute shift values for right rotation and
|
||||
// later swap them in case of left rotation.
|
||||
Node* shiftRCnt = NULL;
|
||||
Node* shiftLCnt = NULL;
|
||||
const TypeInt* cnt_type = cnt->bottom_type()->isa_int();
|
||||
bool is_binary_vector_op = false;
|
||||
if (cnt_type && cnt_type->is_con()) {
|
||||
// Constant shift.
|
||||
int shift = cnt_type->get_con() & shift_mask;
|
||||
if (cnt->is_Con() && cnt->bottom_type()->isa_int()) {
|
||||
// Constant shift case.
|
||||
int shift = cnt->get_int() & shift_mask;
|
||||
shiftRCnt = phase->intcon(shift);
|
||||
shiftLCnt = phase->intcon(shift_mask + 1 - shift);
|
||||
} else if (VectorNode::is_invariant_vector(cnt)) {
|
||||
// Scalar variable shift, handle replicates generated by auto vectorizer.
|
||||
} else {
|
||||
// Variable shift case.
|
||||
assert(VectorNode::is_invariant_vector(cnt), "Broadcast expected");
|
||||
cnt = cnt->in(1);
|
||||
if (bt == T_LONG) {
|
||||
@ -1187,19 +1156,8 @@ Node* VectorNode::degenerate_vector_rotate(Node* src, Node* cnt, bool is_rotate_
|
||||
assert(cnt->Opcode() == Op_ConvI2L, "ConvI2L expected");
|
||||
cnt = cnt->in(1);
|
||||
}
|
||||
shiftRCnt = cnt;
|
||||
shiftRCnt = phase->transform(new AndINode(cnt, phase->intcon(shift_mask)));
|
||||
shiftLCnt = phase->transform(new SubINode(phase->intcon(shift_mask + 1), shiftRCnt));
|
||||
} else {
|
||||
// Vector variable shift.
|
||||
assert(cnt->bottom_type()->isa_vect(), "Unexpected shift");
|
||||
const Type* elem_ty = Type::get_const_basic_type(bt);
|
||||
Node* shift_mask_node = (bt == T_LONG) ? (Node*)(phase->longcon(shift_mask + 1L)) :
|
||||
(Node*)(phase->intcon(shift_mask + 1));
|
||||
Node* vector_mask = phase->transform(VectorNode::scalar2vector(shift_mask_node,vlen, elem_ty));
|
||||
int subVopc = VectorNode::opcode((bt == T_LONG) ? Op_SubL : Op_SubI, bt);
|
||||
shiftRCnt = cnt;
|
||||
shiftLCnt = phase->transform(VectorNode::make(subVopc, vector_mask, shiftRCnt, vt));
|
||||
is_binary_vector_op = true;
|
||||
}
|
||||
|
||||
// Swap the computed left and right shift counts.
|
||||
@ -1207,10 +1165,8 @@ Node* VectorNode::degenerate_vector_rotate(Node* src, Node* cnt, bool is_rotate_
|
||||
swap(shiftRCnt,shiftLCnt);
|
||||
}
|
||||
|
||||
if (!is_binary_vector_op) {
|
||||
shiftLCnt = phase->transform(new LShiftCntVNode(shiftLCnt, vt));
|
||||
shiftRCnt = phase->transform(new RShiftCntVNode(shiftRCnt, vt));
|
||||
}
|
||||
shiftLCnt = phase->transform(new LShiftCntVNode(shiftLCnt, vt));
|
||||
shiftRCnt = phase->transform(new RShiftCntVNode(shiftRCnt, vt));
|
||||
|
||||
return new OrVNode(phase->transform(VectorNode::make(shiftLOpc, src, shiftLCnt, vlen, bt)),
|
||||
phase->transform(VectorNode::make(shiftROpc, src, shiftRCnt, vlen, bt)),
|
||||
|
@ -76,7 +76,6 @@ class VectorNode : public TypeNode {
|
||||
static VectorNode* make(int vopc, Node* n1, Node* n2, Node* n3, const TypeVect* vt);
|
||||
|
||||
static bool is_shift_opcode(int opc);
|
||||
static bool is_rotate_opcode(int opc);
|
||||
|
||||
static int opcode(int opc, BasicType bt);
|
||||
static int replicate_opcode(BasicType bt);
|
||||
@ -100,7 +99,6 @@ class VectorNode : public TypeNode {
|
||||
|
||||
static bool is_vector_shift(int opc);
|
||||
static bool is_vector_shift_count(int opc);
|
||||
static bool is_vector_rotate(int opc);
|
||||
|
||||
static bool is_vector_shift(Node* n) {
|
||||
return is_vector_shift(n->Opcode());
|
||||
|
@ -374,26 +374,6 @@ int VectorSupport::vop2ideal(jint id, BasicType bt) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VECTOR_OP_LROTATE: {
|
||||
switch (bt) {
|
||||
case T_BYTE: // fall-through
|
||||
case T_SHORT: // fall-through
|
||||
case T_INT: // fall-through
|
||||
case T_LONG: return Op_RotateLeft;
|
||||
default: fatal("LROTATE: %s", type2name(bt));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VECTOR_OP_RROTATE: {
|
||||
switch (bt) {
|
||||
case T_BYTE: // fall-through
|
||||
case T_SHORT: // fall-through
|
||||
case T_INT: // fall-through
|
||||
case T_LONG: return Op_RotateRight;
|
||||
default: fatal("RROTATE: %s", type2name(bt));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VECTOR_OP_MASK_LASTTRUE: {
|
||||
switch (bt) {
|
||||
case T_BYTE: // fall-through
|
||||
|
@ -83,10 +83,6 @@ class VectorSupport : AllStatic {
|
||||
VECTOR_OP_MASK_FIRSTTRUE = 20,
|
||||
VECTOR_OP_MASK_LASTTRUE = 21,
|
||||
|
||||
// Rotate operations
|
||||
VECTOR_OP_LROTATE = 22,
|
||||
VECTOR_OP_RROTATE = 23,
|
||||
|
||||
// Vector Math Library
|
||||
VECTOR_OP_TAN = 101,
|
||||
VECTOR_OP_TANH = 102,
|
||||
|
@ -70,10 +70,6 @@ public class VectorSupport {
|
||||
public static final int VECTOR_OP_MASK_FIRSTTRUE = 20;
|
||||
public static final int VECTOR_OP_MASK_LASTTRUE = 21;
|
||||
|
||||
// Rotate operations
|
||||
public static final int VECTOR_OP_LROTATE = 22;
|
||||
public static final int VECTOR_OP_RROTATE = 23;
|
||||
|
||||
// Math routines
|
||||
public static final int VECTOR_OP_TAN = 101;
|
||||
public static final int VECTOR_OP_TANH = 102;
|
||||
|
@ -380,18 +380,6 @@ public abstract class ByteVector extends AbstractVector<Byte> {
|
||||
return maskFactory(bits);
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static byte rotateLeft(byte a, int n) {
|
||||
return (byte)(((((byte)a) & Byte.toUnsignedInt((byte)-1)) << (n & Byte.SIZE-1)) | ((((byte)a) & Byte.toUnsignedInt((byte)-1)) >>> (Byte.SIZE - (n & Byte.SIZE-1))));
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static byte rotateRight(byte a, int n) {
|
||||
return (byte)(((((byte)a) & Byte.toUnsignedInt((byte)-1)) >>> (n & Byte.SIZE-1)) | ((((byte)a) & Byte.toUnsignedInt((byte)-1)) << (Byte.SIZE - (n & Byte.SIZE-1))));
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@Override
|
||||
abstract ByteSpecies vspecies();
|
||||
@ -612,7 +600,12 @@ public abstract class ByteVector extends AbstractVector<Byte> {
|
||||
// This allows the JIT to ignore some ISA details.
|
||||
that = that.lanewise(AND, SHIFT_MASK);
|
||||
}
|
||||
if (op == AND_NOT) {
|
||||
if (op == ROR || op == ROL) { // FIXME: JIT should do this
|
||||
ByteVector neg = that.lanewise(NEG);
|
||||
ByteVector hi = this.lanewise(LSHL, (op == ROR) ? neg : that);
|
||||
ByteVector lo = this.lanewise(LSHR, (op == ROR) ? that : neg);
|
||||
return hi.lanewise(OR, lo);
|
||||
} else if (op == AND_NOT) {
|
||||
// FIXME: Support this in the JIT.
|
||||
that = that.lanewise(NOT);
|
||||
op = AND;
|
||||
@ -653,10 +646,6 @@ public abstract class ByteVector extends AbstractVector<Byte> {
|
||||
v0.bOp(v1, (i, a, n) -> (byte)(a >> n));
|
||||
case VECTOR_OP_URSHIFT: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> (byte)((a & LSHR_SETUP_MASK) >>> n));
|
||||
case VECTOR_OP_LROTATE: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> rotateLeft(a, (int)n));
|
||||
case VECTOR_OP_RROTATE: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> rotateRight(a, (int)n));
|
||||
default: return null;
|
||||
}}));
|
||||
}
|
||||
@ -803,6 +792,11 @@ public abstract class ByteVector extends AbstractVector<Byte> {
|
||||
assert(opKind(op, VO_SHIFT));
|
||||
// As per shift specification for Java, mask the shift count.
|
||||
e &= SHIFT_MASK;
|
||||
if (op == ROR || op == ROL) { // FIXME: JIT should do this
|
||||
ByteVector hi = this.lanewise(LSHL, (op == ROR) ? -e : e);
|
||||
ByteVector lo = this.lanewise(LSHR, (op == ROR) ? e : -e);
|
||||
return hi.lanewise(OR, lo);
|
||||
}
|
||||
int opc = opCode(op);
|
||||
return VectorSupport.broadcastInt(
|
||||
opc, getClass(), byte.class, length(),
|
||||
@ -815,10 +809,6 @@ public abstract class ByteVector extends AbstractVector<Byte> {
|
||||
v.uOp((i, a) -> (byte)(a >> n));
|
||||
case VECTOR_OP_URSHIFT: return (v, n) ->
|
||||
v.uOp((i, a) -> (byte)((a & LSHR_SETUP_MASK) >>> n));
|
||||
case VECTOR_OP_LROTATE: return (v, n) ->
|
||||
v.uOp((i, a) -> rotateLeft(a, (int)n));
|
||||
case VECTOR_OP_RROTATE: return (v, n) ->
|
||||
v.uOp((i, a) -> rotateRight(a, (int)n));
|
||||
default: return null;
|
||||
}}));
|
||||
}
|
||||
|
@ -380,7 +380,6 @@ public abstract class DoubleVector extends AbstractVector<Double> {
|
||||
return maskFactory(bits);
|
||||
}
|
||||
|
||||
|
||||
/*package-private*/
|
||||
@Override
|
||||
abstract DoubleSpecies vspecies();
|
||||
|
@ -380,7 +380,6 @@ public abstract class FloatVector extends AbstractVector<Float> {
|
||||
return maskFactory(bits);
|
||||
}
|
||||
|
||||
|
||||
/*package-private*/
|
||||
@Override
|
||||
abstract FloatSpecies vspecies();
|
||||
|
@ -380,18 +380,6 @@ public abstract class IntVector extends AbstractVector<Integer> {
|
||||
return maskFactory(bits);
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static int rotateLeft(int a, int n) {
|
||||
return Integer.rotateLeft(a, n);
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static int rotateRight(int a, int n) {
|
||||
return Integer.rotateRight(a, n);
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@Override
|
||||
abstract IntSpecies vspecies();
|
||||
@ -612,7 +600,12 @@ public abstract class IntVector extends AbstractVector<Integer> {
|
||||
// This allows the JIT to ignore some ISA details.
|
||||
that = that.lanewise(AND, SHIFT_MASK);
|
||||
}
|
||||
if (op == AND_NOT) {
|
||||
if (op == ROR || op == ROL) { // FIXME: JIT should do this
|
||||
IntVector neg = that.lanewise(NEG);
|
||||
IntVector hi = this.lanewise(LSHL, (op == ROR) ? neg : that);
|
||||
IntVector lo = this.lanewise(LSHR, (op == ROR) ? that : neg);
|
||||
return hi.lanewise(OR, lo);
|
||||
} else if (op == AND_NOT) {
|
||||
// FIXME: Support this in the JIT.
|
||||
that = that.lanewise(NOT);
|
||||
op = AND;
|
||||
@ -653,10 +646,6 @@ public abstract class IntVector extends AbstractVector<Integer> {
|
||||
v0.bOp(v1, (i, a, n) -> (int)(a >> n));
|
||||
case VECTOR_OP_URSHIFT: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> (int)((a & LSHR_SETUP_MASK) >>> n));
|
||||
case VECTOR_OP_LROTATE: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> rotateLeft(a, (int)n));
|
||||
case VECTOR_OP_RROTATE: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> rotateRight(a, (int)n));
|
||||
default: return null;
|
||||
}}));
|
||||
}
|
||||
@ -803,6 +792,11 @@ public abstract class IntVector extends AbstractVector<Integer> {
|
||||
assert(opKind(op, VO_SHIFT));
|
||||
// As per shift specification for Java, mask the shift count.
|
||||
e &= SHIFT_MASK;
|
||||
if (op == ROR || op == ROL) { // FIXME: JIT should do this
|
||||
IntVector hi = this.lanewise(LSHL, (op == ROR) ? -e : e);
|
||||
IntVector lo = this.lanewise(LSHR, (op == ROR) ? e : -e);
|
||||
return hi.lanewise(OR, lo);
|
||||
}
|
||||
int opc = opCode(op);
|
||||
return VectorSupport.broadcastInt(
|
||||
opc, getClass(), int.class, length(),
|
||||
@ -815,10 +809,6 @@ public abstract class IntVector extends AbstractVector<Integer> {
|
||||
v.uOp((i, a) -> (int)(a >> n));
|
||||
case VECTOR_OP_URSHIFT: return (v, n) ->
|
||||
v.uOp((i, a) -> (int)((a & LSHR_SETUP_MASK) >>> n));
|
||||
case VECTOR_OP_LROTATE: return (v, n) ->
|
||||
v.uOp((i, a) -> rotateLeft(a, (int)n));
|
||||
case VECTOR_OP_RROTATE: return (v, n) ->
|
||||
v.uOp((i, a) -> rotateRight(a, (int)n));
|
||||
default: return null;
|
||||
}}));
|
||||
}
|
||||
|
@ -380,18 +380,6 @@ public abstract class LongVector extends AbstractVector<Long> {
|
||||
return maskFactory(bits);
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static long rotateLeft(long a, int n) {
|
||||
return Long.rotateLeft(a, n);
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static long rotateRight(long a, int n) {
|
||||
return Long.rotateRight(a, n);
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@Override
|
||||
abstract LongSpecies vspecies();
|
||||
@ -570,7 +558,12 @@ public abstract class LongVector extends AbstractVector<Long> {
|
||||
// This allows the JIT to ignore some ISA details.
|
||||
that = that.lanewise(AND, SHIFT_MASK);
|
||||
}
|
||||
if (op == AND_NOT) {
|
||||
if (op == ROR || op == ROL) { // FIXME: JIT should do this
|
||||
LongVector neg = that.lanewise(NEG);
|
||||
LongVector hi = this.lanewise(LSHL, (op == ROR) ? neg : that);
|
||||
LongVector lo = this.lanewise(LSHR, (op == ROR) ? that : neg);
|
||||
return hi.lanewise(OR, lo);
|
||||
} else if (op == AND_NOT) {
|
||||
// FIXME: Support this in the JIT.
|
||||
that = that.lanewise(NOT);
|
||||
op = AND;
|
||||
@ -611,10 +604,6 @@ public abstract class LongVector extends AbstractVector<Long> {
|
||||
v0.bOp(v1, (i, a, n) -> (long)(a >> n));
|
||||
case VECTOR_OP_URSHIFT: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> (long)((a & LSHR_SETUP_MASK) >>> n));
|
||||
case VECTOR_OP_LROTATE: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> rotateLeft(a, (int)n));
|
||||
case VECTOR_OP_RROTATE: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> rotateRight(a, (int)n));
|
||||
default: return null;
|
||||
}}));
|
||||
}
|
||||
@ -721,6 +710,11 @@ public abstract class LongVector extends AbstractVector<Long> {
|
||||
assert(opKind(op, VO_SHIFT));
|
||||
// As per shift specification for Java, mask the shift count.
|
||||
e &= SHIFT_MASK;
|
||||
if (op == ROR || op == ROL) { // FIXME: JIT should do this
|
||||
LongVector hi = this.lanewise(LSHL, (op == ROR) ? -e : e);
|
||||
LongVector lo = this.lanewise(LSHR, (op == ROR) ? e : -e);
|
||||
return hi.lanewise(OR, lo);
|
||||
}
|
||||
int opc = opCode(op);
|
||||
return VectorSupport.broadcastInt(
|
||||
opc, getClass(), long.class, length(),
|
||||
@ -733,10 +727,6 @@ public abstract class LongVector extends AbstractVector<Long> {
|
||||
v.uOp((i, a) -> (long)(a >> n));
|
||||
case VECTOR_OP_URSHIFT: return (v, n) ->
|
||||
v.uOp((i, a) -> (long)((a & LSHR_SETUP_MASK) >>> n));
|
||||
case VECTOR_OP_LROTATE: return (v, n) ->
|
||||
v.uOp((i, a) -> rotateLeft(a, (int)n));
|
||||
case VECTOR_OP_RROTATE: return (v, n) ->
|
||||
v.uOp((i, a) -> rotateRight(a, (int)n));
|
||||
default: return null;
|
||||
}}));
|
||||
}
|
||||
|
@ -380,18 +380,6 @@ public abstract class ShortVector extends AbstractVector<Short> {
|
||||
return maskFactory(bits);
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static short rotateLeft(short a, int n) {
|
||||
return (short)(((((short)a) & Short.toUnsignedInt((short)-1)) << (n & Short.SIZE-1)) | ((((short)a) & Short.toUnsignedInt((short)-1)) >>> (Short.SIZE - (n & Short.SIZE-1))));
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static short rotateRight(short a, int n) {
|
||||
return (short)(((((short)a) & Short.toUnsignedInt((short)-1)) >>> (n & Short.SIZE-1)) | ((((short)a) & Short.toUnsignedInt((short)-1)) << (Short.SIZE - (n & Short.SIZE-1))));
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@Override
|
||||
abstract ShortSpecies vspecies();
|
||||
@ -612,7 +600,12 @@ public abstract class ShortVector extends AbstractVector<Short> {
|
||||
// This allows the JIT to ignore some ISA details.
|
||||
that = that.lanewise(AND, SHIFT_MASK);
|
||||
}
|
||||
if (op == AND_NOT) {
|
||||
if (op == ROR || op == ROL) { // FIXME: JIT should do this
|
||||
ShortVector neg = that.lanewise(NEG);
|
||||
ShortVector hi = this.lanewise(LSHL, (op == ROR) ? neg : that);
|
||||
ShortVector lo = this.lanewise(LSHR, (op == ROR) ? that : neg);
|
||||
return hi.lanewise(OR, lo);
|
||||
} else if (op == AND_NOT) {
|
||||
// FIXME: Support this in the JIT.
|
||||
that = that.lanewise(NOT);
|
||||
op = AND;
|
||||
@ -653,10 +646,6 @@ public abstract class ShortVector extends AbstractVector<Short> {
|
||||
v0.bOp(v1, (i, a, n) -> (short)(a >> n));
|
||||
case VECTOR_OP_URSHIFT: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> (short)((a & LSHR_SETUP_MASK) >>> n));
|
||||
case VECTOR_OP_LROTATE: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> rotateLeft(a, (int)n));
|
||||
case VECTOR_OP_RROTATE: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> rotateRight(a, (int)n));
|
||||
default: return null;
|
||||
}}));
|
||||
}
|
||||
@ -803,6 +792,11 @@ public abstract class ShortVector extends AbstractVector<Short> {
|
||||
assert(opKind(op, VO_SHIFT));
|
||||
// As per shift specification for Java, mask the shift count.
|
||||
e &= SHIFT_MASK;
|
||||
if (op == ROR || op == ROL) { // FIXME: JIT should do this
|
||||
ShortVector hi = this.lanewise(LSHL, (op == ROR) ? -e : e);
|
||||
ShortVector lo = this.lanewise(LSHR, (op == ROR) ? e : -e);
|
||||
return hi.lanewise(OR, lo);
|
||||
}
|
||||
int opc = opCode(op);
|
||||
return VectorSupport.broadcastInt(
|
||||
opc, getClass(), short.class, length(),
|
||||
@ -815,10 +809,6 @@ public abstract class ShortVector extends AbstractVector<Short> {
|
||||
v.uOp((i, a) -> (short)(a >> n));
|
||||
case VECTOR_OP_URSHIFT: return (v, n) ->
|
||||
v.uOp((i, a) -> (short)((a & LSHR_SETUP_MASK) >>> n));
|
||||
case VECTOR_OP_LROTATE: return (v, n) ->
|
||||
v.uOp((i, a) -> rotateLeft(a, (int)n));
|
||||
case VECTOR_OP_RROTATE: return (v, n) ->
|
||||
v.uOp((i, a) -> rotateRight(a, (int)n));
|
||||
default: return null;
|
||||
}}));
|
||||
}
|
||||
|
@ -551,9 +551,9 @@ public abstract class VectorOperators {
|
||||
/** Produce {@code a>>>(n&(ESIZE*8-1))}. Integral only. */
|
||||
public static final /*bitwise*/ Binary LSHR = binary("LSHR", ">>>", VectorSupport.VECTOR_OP_URSHIFT, VO_SHIFT);
|
||||
/** Produce {@code rotateLeft(a,n)}. Integral only. */
|
||||
public static final /*bitwise*/ Binary ROL = binary("ROL", "rotateLeft", VectorSupport.VECTOR_OP_LROTATE, VO_SHIFT);
|
||||
public static final /*bitwise*/ Binary ROL = binary("ROL", "rotateLeft", -1 /*VectorSupport.VECTOR_OP_LROTATE*/, VO_SHIFT | VO_SPECIAL);
|
||||
/** Produce {@code rotateRight(a,n)}. Integral only. */
|
||||
public static final /*bitwise*/ Binary ROR = binary("ROR", "rotateRight", VectorSupport.VECTOR_OP_RROTATE, VO_SHIFT);
|
||||
public static final /*bitwise*/ Binary ROR = binary("ROR", "rotateRight", -1 /*VectorSupport.VECTOR_OP_RROTATE*/, VO_SHIFT | VO_SPECIAL);
|
||||
|
||||
/** Produce {@code atan2(a,b)}. See Floating only.
|
||||
* Not guaranteed to be semi-monotonic. See section "Operations on floating point vectors" above
|
||||
|
@ -384,28 +384,6 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
return maskFactory(bits);
|
||||
}
|
||||
|
||||
#if[BITWISE]
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static $type$ rotateLeft($type$ a, int n) {
|
||||
#if[intOrLong]
|
||||
return $Boxtype$.rotateLeft(a, n);
|
||||
#else[intOrLong]
|
||||
return ($type$)((((($type$)a) & $Boxtype$.toUnsignedInt(($type$)-1)) << (n & $Boxtype$.SIZE-1)) | (((($type$)a) & $Boxtype$.toUnsignedInt(($type$)-1)) >>> ($Boxtype$.SIZE - (n & $Boxtype$.SIZE-1))));
|
||||
#end[intOrLong]
|
||||
}
|
||||
|
||||
/*package-private*/
|
||||
@ForceInline
|
||||
static $type$ rotateRight($type$ a, int n) {
|
||||
#if[intOrLong]
|
||||
return $Boxtype$.rotateRight(a, n);
|
||||
#else[intOrLong]
|
||||
return ($type$)((((($type$)a) & $Boxtype$.toUnsignedInt(($type$)-1)) >>> (n & $Boxtype$.SIZE-1)) | (((($type$)a) & $Boxtype$.toUnsignedInt(($type$)-1)) << ($Boxtype$.SIZE - (n & $Boxtype$.SIZE-1))));
|
||||
#end[intOrLong]
|
||||
}
|
||||
#end[BITWISE]
|
||||
|
||||
/*package-private*/
|
||||
@Override
|
||||
abstract $Type$Species vspecies();
|
||||
@ -679,7 +657,12 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
that = that.lanewise(AND, SHIFT_MASK);
|
||||
}
|
||||
#end[!FP]
|
||||
if (op == AND_NOT) {
|
||||
if (op == ROR || op == ROL) { // FIXME: JIT should do this
|
||||
$abstractvectortype$ neg = that.lanewise(NEG);
|
||||
$abstractvectortype$ hi = this.lanewise(LSHL, (op == ROR) ? neg : that);
|
||||
$abstractvectortype$ lo = this.lanewise(LSHR, (op == ROR) ? that : neg);
|
||||
return hi.lanewise(OR, lo);
|
||||
} else if (op == AND_NOT) {
|
||||
// FIXME: Support this in the JIT.
|
||||
that = that.lanewise(NOT);
|
||||
op = AND;
|
||||
@ -722,10 +705,6 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
v0.bOp(v1, (i, a, n) -> ($type$)(a >> n));
|
||||
case VECTOR_OP_URSHIFT: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> ($type$)((a & LSHR_SETUP_MASK) >>> n));
|
||||
case VECTOR_OP_LROTATE: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> rotateLeft(a, (int)n));
|
||||
case VECTOR_OP_RROTATE: return (v0, v1) ->
|
||||
v0.bOp(v1, (i, a, n) -> rotateRight(a, (int)n));
|
||||
#end[BITWISE]
|
||||
#if[FP]
|
||||
case VECTOR_OP_ATAN2: return (v0, v1) ->
|
||||
@ -890,6 +869,11 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
assert(opKind(op, VO_SHIFT));
|
||||
// As per shift specification for Java, mask the shift count.
|
||||
e &= SHIFT_MASK;
|
||||
if (op == ROR || op == ROL) { // FIXME: JIT should do this
|
||||
$abstractvectortype$ hi = this.lanewise(LSHL, (op == ROR) ? -e : e);
|
||||
$abstractvectortype$ lo = this.lanewise(LSHR, (op == ROR) ? e : -e);
|
||||
return hi.lanewise(OR, lo);
|
||||
}
|
||||
int opc = opCode(op);
|
||||
return VectorSupport.broadcastInt(
|
||||
opc, getClass(), $type$.class, length(),
|
||||
@ -902,10 +886,6 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
v.uOp((i, a) -> ($type$)(a >> n));
|
||||
case VECTOR_OP_URSHIFT: return (v, n) ->
|
||||
v.uOp((i, a) -> ($type$)((a & LSHR_SETUP_MASK) >>> n));
|
||||
case VECTOR_OP_LROTATE: return (v, n) ->
|
||||
v.uOp((i, a) -> rotateLeft(a, (int)n));
|
||||
case VECTOR_OP_RROTATE: return (v, n) ->
|
||||
v.uOp((i, a) -> rotateRight(a, (int)n));
|
||||
default: return null;
|
||||
}}));
|
||||
}
|
||||
|
@ -1153,14 +1153,6 @@ public class Byte128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static byte ROL_scalar(byte a, byte b) {
|
||||
return (byte)(((((byte)a) & 0xFF) << (b & 7)) | ((((byte)a) & 0xFF) >>> (8 - (b & 7))));
|
||||
}
|
||||
|
||||
static byte ROR_scalar(byte a, byte b) {
|
||||
return (byte)(((((byte)a) & 0xFF) >>> (b & 7)) | ((((byte)a) & 0xFF) << (8 - (b & 7))));
|
||||
}
|
||||
|
||||
static boolean eq(byte a, byte b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2330,7 +2322,7 @@ public class Byte128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void LSHLByte128VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void LSHLByte128VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2348,7 +2340,7 @@ public class Byte128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void LSHLByte128VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void LSHLByte128VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2376,7 +2368,7 @@ public class Byte128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void LSHRByte128VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void LSHRByte128VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2394,7 +2386,7 @@ public class Byte128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void LSHRByte128VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void LSHRByte128VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2422,7 +2414,7 @@ public class Byte128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ASHRByte128VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void ASHRByte128VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2440,7 +2432,7 @@ public class Byte128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ASHRByte128VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void ASHRByte128VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2460,178 +2452,6 @@ public class Byte128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static byte ROR(byte a, byte b) {
|
||||
return (byte)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void RORByte128VectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Byte128VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void RORByte128VectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Byte128VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static byte ROL(byte a, byte b) {
|
||||
return (byte)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ROLByte128VectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Byte128VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ROLByte128VectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Byte128VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static byte ROR_unary(byte a, byte b) {
|
||||
return (byte)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void RORByte128VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Byte128VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void RORByte128VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Byte128VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static byte ROL_unary(byte a, byte b) {
|
||||
return (byte)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ROLByte128VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Byte128VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ROLByte128VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Byte128VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static byte MIN(byte a, byte b) {
|
||||
return (byte)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1153,14 +1153,6 @@ public class Byte256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static byte ROL_scalar(byte a, byte b) {
|
||||
return (byte)(((((byte)a) & 0xFF) << (b & 7)) | ((((byte)a) & 0xFF) >>> (8 - (b & 7))));
|
||||
}
|
||||
|
||||
static byte ROR_scalar(byte a, byte b) {
|
||||
return (byte)(((((byte)a) & 0xFF) >>> (b & 7)) | ((((byte)a) & 0xFF) << (8 - (b & 7))));
|
||||
}
|
||||
|
||||
static boolean eq(byte a, byte b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2330,7 +2322,7 @@ public class Byte256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void LSHLByte256VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void LSHLByte256VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2348,7 +2340,7 @@ public class Byte256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void LSHLByte256VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void LSHLByte256VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2376,7 +2368,7 @@ public class Byte256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void LSHRByte256VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void LSHRByte256VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2394,7 +2386,7 @@ public class Byte256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void LSHRByte256VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void LSHRByte256VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2422,7 +2414,7 @@ public class Byte256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ASHRByte256VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void ASHRByte256VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2440,7 +2432,7 @@ public class Byte256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ASHRByte256VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void ASHRByte256VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2460,178 +2452,6 @@ public class Byte256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static byte ROR(byte a, byte b) {
|
||||
return (byte)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void RORByte256VectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Byte256VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void RORByte256VectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Byte256VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static byte ROL(byte a, byte b) {
|
||||
return (byte)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ROLByte256VectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Byte256VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ROLByte256VectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Byte256VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static byte ROR_unary(byte a, byte b) {
|
||||
return (byte)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void RORByte256VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Byte256VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void RORByte256VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Byte256VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static byte ROL_unary(byte a, byte b) {
|
||||
return (byte)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ROLByte256VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Byte256VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ROLByte256VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Byte256VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static byte MIN(byte a, byte b) {
|
||||
return (byte)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1153,14 +1153,6 @@ public class Byte512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static byte ROL_scalar(byte a, byte b) {
|
||||
return (byte)(((((byte)a) & 0xFF) << (b & 7)) | ((((byte)a) & 0xFF) >>> (8 - (b & 7))));
|
||||
}
|
||||
|
||||
static byte ROR_scalar(byte a, byte b) {
|
||||
return (byte)(((((byte)a) & 0xFF) >>> (b & 7)) | ((((byte)a) & 0xFF) << (8 - (b & 7))));
|
||||
}
|
||||
|
||||
static boolean eq(byte a, byte b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2330,7 +2322,7 @@ public class Byte512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void LSHLByte512VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void LSHLByte512VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2348,7 +2340,7 @@ public class Byte512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void LSHLByte512VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void LSHLByte512VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2376,7 +2368,7 @@ public class Byte512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void LSHRByte512VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void LSHRByte512VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2394,7 +2386,7 @@ public class Byte512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void LSHRByte512VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void LSHRByte512VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2422,7 +2414,7 @@ public class Byte512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ASHRByte512VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void ASHRByte512VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2440,7 +2432,7 @@ public class Byte512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ASHRByte512VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void ASHRByte512VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2460,178 +2452,6 @@ public class Byte512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static byte ROR(byte a, byte b) {
|
||||
return (byte)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void RORByte512VectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Byte512VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void RORByte512VectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Byte512VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static byte ROL(byte a, byte b) {
|
||||
return (byte)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ROLByte512VectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Byte512VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ROLByte512VectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Byte512VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static byte ROR_unary(byte a, byte b) {
|
||||
return (byte)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void RORByte512VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Byte512VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void RORByte512VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Byte512VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static byte ROL_unary(byte a, byte b) {
|
||||
return (byte)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ROLByte512VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Byte512VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ROLByte512VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Byte512VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static byte MIN(byte a, byte b) {
|
||||
return (byte)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1153,14 +1153,6 @@ public class Byte64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static byte ROL_scalar(byte a, byte b) {
|
||||
return (byte)(((((byte)a) & 0xFF) << (b & 7)) | ((((byte)a) & 0xFF) >>> (8 - (b & 7))));
|
||||
}
|
||||
|
||||
static byte ROR_scalar(byte a, byte b) {
|
||||
return (byte)(((((byte)a) & 0xFF) >>> (b & 7)) | ((((byte)a) & 0xFF) << (8 - (b & 7))));
|
||||
}
|
||||
|
||||
static boolean eq(byte a, byte b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2330,7 +2322,7 @@ public class Byte64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void LSHLByte64VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void LSHLByte64VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2348,7 +2340,7 @@ public class Byte64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void LSHLByte64VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void LSHLByte64VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2376,7 +2368,7 @@ public class Byte64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void LSHRByte64VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void LSHRByte64VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2394,7 +2386,7 @@ public class Byte64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void LSHRByte64VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void LSHRByte64VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2422,7 +2414,7 @@ public class Byte64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ASHRByte64VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void ASHRByte64VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2440,7 +2432,7 @@ public class Byte64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ASHRByte64VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void ASHRByte64VectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2460,178 +2452,6 @@ public class Byte64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static byte ROR(byte a, byte b) {
|
||||
return (byte)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void RORByte64VectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Byte64VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void RORByte64VectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Byte64VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static byte ROL(byte a, byte b) {
|
||||
return (byte)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ROLByte64VectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Byte64VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ROLByte64VectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Byte64VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static byte ROR_unary(byte a, byte b) {
|
||||
return (byte)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void RORByte64VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Byte64VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void RORByte64VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Byte64VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static byte ROL_unary(byte a, byte b) {
|
||||
return (byte)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ROLByte64VectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Byte64VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ROLByte64VectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Byte64VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static byte MIN(byte a, byte b) {
|
||||
return (byte)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1158,14 +1158,6 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static byte ROL_scalar(byte a, byte b) {
|
||||
return (byte)(((((byte)a) & 0xFF) << (b & 7)) | ((((byte)a) & 0xFF) >>> (8 - (b & 7))));
|
||||
}
|
||||
|
||||
static byte ROR_scalar(byte a, byte b) {
|
||||
return (byte)(((((byte)a) & 0xFF) >>> (b & 7)) | ((((byte)a) & 0xFF) << (8 - (b & 7))));
|
||||
}
|
||||
|
||||
static boolean eq(byte a, byte b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2335,7 +2327,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void LSHLByteMaxVectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void LSHLByteMaxVectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2353,7 +2345,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void LSHLByteMaxVectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void LSHLByteMaxVectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2381,7 +2373,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void LSHRByteMaxVectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void LSHRByteMaxVectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2399,7 +2391,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void LSHRByteMaxVectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void LSHRByteMaxVectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2427,7 +2419,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ASHRByteMaxVectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
static void ASHRByteMaxVectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
@ -2445,7 +2437,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ASHRByteMaxVectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
static void ASHRByteMaxVectorTestsShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
@ -2465,178 +2457,6 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static byte ROR(byte a, byte b) {
|
||||
return (byte)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void RORByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, ByteMaxVectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void RORByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static byte ROL(byte a, byte b) {
|
||||
return (byte)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ROLByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, ByteMaxVectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ROLByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
ByteVector bv = ByteVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static byte ROR_unary(byte a, byte b) {
|
||||
return (byte)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void RORByteMaxVectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void RORByteMaxVectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static byte ROL_unary(byte a, byte b) {
|
||||
return (byte)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpProvider")
|
||||
static void ROLByteMaxVectorTestsScalarShift(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "byteBinaryOpMaskProvider")
|
||||
static void ROLByteMaxVectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
byte[] a = fa.apply(SPECIES.length());
|
||||
byte[] b = fb.apply(SPECIES.length());
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static byte MIN(byte a, byte b) {
|
||||
return (byte)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1943,14 +1943,6 @@ public class Double128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1943,14 +1943,6 @@ public class Double256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1943,14 +1943,6 @@ public class Double512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1943,14 +1943,6 @@ public class Double64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1948,14 +1948,6 @@ public class DoubleMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1953,14 +1953,6 @@ public class Float128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1953,14 +1953,6 @@ public class Float256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1953,14 +1953,6 @@ public class Float512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1953,14 +1953,6 @@ public class Float64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1958,14 +1958,6 @@ public class FloatMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1113,14 +1113,6 @@ public class Int128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static int ROL_scalar(int a, int b) {
|
||||
return Integer.rotateLeft(a, ((int)b));
|
||||
}
|
||||
|
||||
static int ROR_scalar(int a, int b) {
|
||||
return Integer.rotateRight(a, ((int)b));
|
||||
}
|
||||
|
||||
static boolean eq(int a, int b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2293,7 +2285,7 @@ public class Int128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void LSHLInt128VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void LSHLInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2311,7 +2303,7 @@ public class Int128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void LSHLInt128VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void LSHLInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2339,7 +2331,7 @@ public class Int128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void LSHRInt128VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void LSHRInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2357,7 +2349,7 @@ public class Int128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void LSHRInt128VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void LSHRInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2385,7 +2377,7 @@ public class Int128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ASHRInt128VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void ASHRInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2403,7 +2395,7 @@ public class Int128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ASHRInt128VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void ASHRInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2425,178 +2417,6 @@ public class Int128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static int ROR(int a, int b) {
|
||||
return (int)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void RORInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Int128VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void RORInt128VectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Int128VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static int ROL(int a, int b) {
|
||||
return (int)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ROLInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Int128VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ROLInt128VectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Int128VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static int ROR_unary(int a, int b) {
|
||||
return (int)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void RORInt128VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Int128VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void RORInt128VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Int128VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static int ROL_unary(int a, int b) {
|
||||
return (int)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ROLInt128VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Int128VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ROLInt128VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Int128VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static int MIN(int a, int b) {
|
||||
return (int)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1113,14 +1113,6 @@ public class Int256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static int ROL_scalar(int a, int b) {
|
||||
return Integer.rotateLeft(a, ((int)b));
|
||||
}
|
||||
|
||||
static int ROR_scalar(int a, int b) {
|
||||
return Integer.rotateRight(a, ((int)b));
|
||||
}
|
||||
|
||||
static boolean eq(int a, int b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2293,7 +2285,7 @@ public class Int256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void LSHLInt256VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void LSHLInt256VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2311,7 +2303,7 @@ public class Int256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void LSHLInt256VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void LSHLInt256VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2339,7 +2331,7 @@ public class Int256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void LSHRInt256VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void LSHRInt256VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2357,7 +2349,7 @@ public class Int256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void LSHRInt256VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void LSHRInt256VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2385,7 +2377,7 @@ public class Int256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ASHRInt256VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void ASHRInt256VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2403,7 +2395,7 @@ public class Int256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ASHRInt256VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void ASHRInt256VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2425,178 +2417,6 @@ public class Int256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static int ROR(int a, int b) {
|
||||
return (int)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void RORInt256VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Int256VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void RORInt256VectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Int256VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static int ROL(int a, int b) {
|
||||
return (int)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ROLInt256VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Int256VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ROLInt256VectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Int256VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static int ROR_unary(int a, int b) {
|
||||
return (int)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void RORInt256VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Int256VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void RORInt256VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Int256VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static int ROL_unary(int a, int b) {
|
||||
return (int)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ROLInt256VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Int256VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ROLInt256VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Int256VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static int MIN(int a, int b) {
|
||||
return (int)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1113,14 +1113,6 @@ public class Int512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static int ROL_scalar(int a, int b) {
|
||||
return Integer.rotateLeft(a, ((int)b));
|
||||
}
|
||||
|
||||
static int ROR_scalar(int a, int b) {
|
||||
return Integer.rotateRight(a, ((int)b));
|
||||
}
|
||||
|
||||
static boolean eq(int a, int b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2293,7 +2285,7 @@ public class Int512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void LSHLInt512VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void LSHLInt512VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2311,7 +2303,7 @@ public class Int512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void LSHLInt512VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void LSHLInt512VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2339,7 +2331,7 @@ public class Int512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void LSHRInt512VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void LSHRInt512VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2357,7 +2349,7 @@ public class Int512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void LSHRInt512VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void LSHRInt512VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2385,7 +2377,7 @@ public class Int512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ASHRInt512VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void ASHRInt512VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2403,7 +2395,7 @@ public class Int512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ASHRInt512VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void ASHRInt512VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2425,178 +2417,6 @@ public class Int512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static int ROR(int a, int b) {
|
||||
return (int)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void RORInt512VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Int512VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void RORInt512VectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Int512VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static int ROL(int a, int b) {
|
||||
return (int)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ROLInt512VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Int512VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ROLInt512VectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Int512VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static int ROR_unary(int a, int b) {
|
||||
return (int)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void RORInt512VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Int512VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void RORInt512VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Int512VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static int ROL_unary(int a, int b) {
|
||||
return (int)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ROLInt512VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Int512VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ROLInt512VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Int512VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static int MIN(int a, int b) {
|
||||
return (int)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1113,14 +1113,6 @@ public class Int64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static int ROL_scalar(int a, int b) {
|
||||
return Integer.rotateLeft(a, ((int)b));
|
||||
}
|
||||
|
||||
static int ROR_scalar(int a, int b) {
|
||||
return Integer.rotateRight(a, ((int)b));
|
||||
}
|
||||
|
||||
static boolean eq(int a, int b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2293,7 +2285,7 @@ public class Int64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void LSHLInt64VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void LSHLInt64VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2311,7 +2303,7 @@ public class Int64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void LSHLInt64VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void LSHLInt64VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2339,7 +2331,7 @@ public class Int64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void LSHRInt64VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void LSHRInt64VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2357,7 +2349,7 @@ public class Int64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void LSHRInt64VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void LSHRInt64VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2385,7 +2377,7 @@ public class Int64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ASHRInt64VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void ASHRInt64VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2403,7 +2395,7 @@ public class Int64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ASHRInt64VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void ASHRInt64VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2425,178 +2417,6 @@ public class Int64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static int ROR(int a, int b) {
|
||||
return (int)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void RORInt64VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Int64VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void RORInt64VectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Int64VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static int ROL(int a, int b) {
|
||||
return (int)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ROLInt64VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Int64VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ROLInt64VectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Int64VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static int ROR_unary(int a, int b) {
|
||||
return (int)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void RORInt64VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Int64VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void RORInt64VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Int64VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static int ROL_unary(int a, int b) {
|
||||
return (int)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ROLInt64VectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Int64VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ROLInt64VectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Int64VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static int MIN(int a, int b) {
|
||||
return (int)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1118,14 +1118,6 @@ public class IntMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static int ROL_scalar(int a, int b) {
|
||||
return Integer.rotateLeft(a, ((int)b));
|
||||
}
|
||||
|
||||
static int ROR_scalar(int a, int b) {
|
||||
return Integer.rotateRight(a, ((int)b));
|
||||
}
|
||||
|
||||
static boolean eq(int a, int b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2298,7 +2290,7 @@ public class IntMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void LSHLIntMaxVectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void LSHLIntMaxVectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2316,7 +2308,7 @@ public class IntMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void LSHLIntMaxVectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void LSHLIntMaxVectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2344,7 +2336,7 @@ public class IntMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void LSHRIntMaxVectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void LSHRIntMaxVectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2362,7 +2354,7 @@ public class IntMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void LSHRIntMaxVectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void LSHRIntMaxVectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2390,7 +2382,7 @@ public class IntMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ASHRIntMaxVectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
static void ASHRIntMaxVectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
@ -2408,7 +2400,7 @@ public class IntMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ASHRIntMaxVectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
static void ASHRIntMaxVectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
@ -2430,178 +2422,6 @@ public class IntMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static int ROR(int a, int b) {
|
||||
return (int)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void RORIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, IntMaxVectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void RORIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, IntMaxVectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static int ROL(int a, int b) {
|
||||
return (int)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ROLIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, IntMaxVectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ROLIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
IntVector bv = IntVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, IntMaxVectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static int ROR_unary(int a, int b) {
|
||||
return (int)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void RORIntMaxVectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, IntMaxVectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void RORIntMaxVectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static int ROL_unary(int a, int b) {
|
||||
return (int)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "intBinaryOpProvider")
|
||||
static void ROLIntMaxVectorTestsScalarShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, IntMaxVectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "intBinaryOpMaskProvider")
|
||||
static void ROLIntMaxVectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
int[] a = fa.apply(SPECIES.length());
|
||||
int[] b = fb.apply(SPECIES.length());
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static int MIN(int a, int b) {
|
||||
return (int)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1135,14 +1135,6 @@ public class Long128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static long ROL_scalar(long a, long b) {
|
||||
return Long.rotateLeft(a, ((int)b));
|
||||
}
|
||||
|
||||
static long ROR_scalar(long a, long b) {
|
||||
return Long.rotateRight(a, ((int)b));
|
||||
}
|
||||
|
||||
static boolean eq(long a, long b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2315,7 +2307,7 @@ public class Long128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void LSHLLong128VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void LSHLLong128VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2333,7 +2325,7 @@ public class Long128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void LSHLLong128VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void LSHLLong128VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2361,7 +2353,7 @@ public class Long128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void LSHRLong128VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void LSHRLong128VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2379,7 +2371,7 @@ public class Long128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void LSHRLong128VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void LSHRLong128VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2407,7 +2399,7 @@ public class Long128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ASHRLong128VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void ASHRLong128VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2425,7 +2417,7 @@ public class Long128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ASHRLong128VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void ASHRLong128VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2447,178 +2439,6 @@ public class Long128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static long ROR(long a, long b) {
|
||||
return (long)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void RORLong128VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Long128VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void RORLong128VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Long128VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static long ROL(long a, long b) {
|
||||
return (long)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ROLLong128VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Long128VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ROLLong128VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Long128VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static long ROR_unary(long a, long b) {
|
||||
return (long)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void RORLong128VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Long128VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void RORLong128VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Long128VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static long ROL_unary(long a, long b) {
|
||||
return (long)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ROLLong128VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Long128VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ROLLong128VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Long128VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static long MIN(long a, long b) {
|
||||
return (long)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1135,14 +1135,6 @@ public class Long256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static long ROL_scalar(long a, long b) {
|
||||
return Long.rotateLeft(a, ((int)b));
|
||||
}
|
||||
|
||||
static long ROR_scalar(long a, long b) {
|
||||
return Long.rotateRight(a, ((int)b));
|
||||
}
|
||||
|
||||
static boolean eq(long a, long b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2315,7 +2307,7 @@ public class Long256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void LSHLLong256VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void LSHLLong256VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2333,7 +2325,7 @@ public class Long256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void LSHLLong256VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void LSHLLong256VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2361,7 +2353,7 @@ public class Long256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void LSHRLong256VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void LSHRLong256VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2379,7 +2371,7 @@ public class Long256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void LSHRLong256VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void LSHRLong256VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2407,7 +2399,7 @@ public class Long256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ASHRLong256VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void ASHRLong256VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2425,7 +2417,7 @@ public class Long256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ASHRLong256VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void ASHRLong256VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2447,178 +2439,6 @@ public class Long256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static long ROR(long a, long b) {
|
||||
return (long)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void RORLong256VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Long256VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void RORLong256VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Long256VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static long ROL(long a, long b) {
|
||||
return (long)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ROLLong256VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Long256VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ROLLong256VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Long256VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static long ROR_unary(long a, long b) {
|
||||
return (long)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void RORLong256VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Long256VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void RORLong256VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Long256VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static long ROL_unary(long a, long b) {
|
||||
return (long)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ROLLong256VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Long256VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ROLLong256VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Long256VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static long MIN(long a, long b) {
|
||||
return (long)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1135,14 +1135,6 @@ public class Long512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static long ROL_scalar(long a, long b) {
|
||||
return Long.rotateLeft(a, ((int)b));
|
||||
}
|
||||
|
||||
static long ROR_scalar(long a, long b) {
|
||||
return Long.rotateRight(a, ((int)b));
|
||||
}
|
||||
|
||||
static boolean eq(long a, long b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2315,7 +2307,7 @@ public class Long512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void LSHLLong512VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void LSHLLong512VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2333,7 +2325,7 @@ public class Long512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void LSHLLong512VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void LSHLLong512VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2361,7 +2353,7 @@ public class Long512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void LSHRLong512VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void LSHRLong512VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2379,7 +2371,7 @@ public class Long512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void LSHRLong512VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void LSHRLong512VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2407,7 +2399,7 @@ public class Long512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ASHRLong512VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void ASHRLong512VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2425,7 +2417,7 @@ public class Long512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ASHRLong512VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void ASHRLong512VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2447,178 +2439,6 @@ public class Long512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static long ROR(long a, long b) {
|
||||
return (long)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void RORLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Long512VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void RORLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Long512VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static long ROL(long a, long b) {
|
||||
return (long)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ROLLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Long512VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ROLLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Long512VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static long ROR_unary(long a, long b) {
|
||||
return (long)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void RORLong512VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Long512VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void RORLong512VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static long ROL_unary(long a, long b) {
|
||||
return (long)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ROLLong512VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Long512VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ROLLong512VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static long MIN(long a, long b) {
|
||||
return (long)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1135,14 +1135,6 @@ public class Long64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static long ROL_scalar(long a, long b) {
|
||||
return Long.rotateLeft(a, ((int)b));
|
||||
}
|
||||
|
||||
static long ROR_scalar(long a, long b) {
|
||||
return Long.rotateRight(a, ((int)b));
|
||||
}
|
||||
|
||||
static boolean eq(long a, long b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2315,7 +2307,7 @@ public class Long64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void LSHLLong64VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void LSHLLong64VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2333,7 +2325,7 @@ public class Long64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void LSHLLong64VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void LSHLLong64VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2361,7 +2353,7 @@ public class Long64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void LSHRLong64VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void LSHRLong64VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2379,7 +2371,7 @@ public class Long64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void LSHRLong64VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void LSHRLong64VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2407,7 +2399,7 @@ public class Long64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ASHRLong64VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void ASHRLong64VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2425,7 +2417,7 @@ public class Long64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ASHRLong64VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void ASHRLong64VectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2447,178 +2439,6 @@ public class Long64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static long ROR(long a, long b) {
|
||||
return (long)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void RORLong64VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Long64VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void RORLong64VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Long64VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static long ROL(long a, long b) {
|
||||
return (long)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ROLLong64VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Long64VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ROLLong64VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Long64VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static long ROR_unary(long a, long b) {
|
||||
return (long)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void RORLong64VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Long64VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void RORLong64VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Long64VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static long ROL_unary(long a, long b) {
|
||||
return (long)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ROLLong64VectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Long64VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ROLLong64VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Long64VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static long MIN(long a, long b) {
|
||||
return (long)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1140,14 +1140,6 @@ public class LongMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static long ROL_scalar(long a, long b) {
|
||||
return Long.rotateLeft(a, ((int)b));
|
||||
}
|
||||
|
||||
static long ROR_scalar(long a, long b) {
|
||||
return Long.rotateRight(a, ((int)b));
|
||||
}
|
||||
|
||||
static boolean eq(long a, long b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2320,7 +2312,7 @@ public class LongMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void LSHLLongMaxVectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void LSHLLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2338,7 +2330,7 @@ public class LongMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void LSHLLongMaxVectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void LSHLLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2366,7 +2358,7 @@ public class LongMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void LSHRLongMaxVectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void LSHRLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2384,7 +2376,7 @@ public class LongMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void LSHRLongMaxVectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void LSHRLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2412,7 +2404,7 @@ public class LongMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ASHRLongMaxVectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
static void ASHRLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
@ -2430,7 +2422,7 @@ public class LongMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ASHRLongMaxVectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
static void ASHRLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
@ -2452,178 +2444,6 @@ public class LongMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
|
||||
|
||||
static long ROR(long a, long b) {
|
||||
return (long)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void RORLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, LongMaxVectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void RORLongMaxVectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, LongMaxVectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static long ROL(long a, long b) {
|
||||
return (long)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ROLLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, LongMaxVectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ROLLongMaxVectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
LongVector bv = LongVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, LongMaxVectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static long ROR_unary(long a, long b) {
|
||||
return (long)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void RORLongMaxVectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, LongMaxVectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void RORLongMaxVectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, LongMaxVectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static long ROL_unary(long a, long b) {
|
||||
return (long)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "longBinaryOpProvider")
|
||||
static void ROLLongMaxVectorTestsScalarShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, LongMaxVectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "longBinaryOpMaskProvider")
|
||||
static void ROLLongMaxVectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
long[] a = fa.apply(SPECIES.length());
|
||||
long[] b = fb.apply(SPECIES.length());
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, LongMaxVectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static long MIN(long a, long b) {
|
||||
return (long)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1143,14 +1143,6 @@ public class Short128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static short ROL_scalar(short a, short b) {
|
||||
return (short)(((((short)a) & 0xFFFF) << (b & 15)) | ((((short)a) & 0xFFFF) >>> (16 - (b & 15))));
|
||||
}
|
||||
|
||||
static short ROR_scalar(short a, short b) {
|
||||
return (short)(((((short)a) & 0xFFFF) >>> (b & 15)) | ((((short)a) & 0xFFFF) << (16 - (b & 15))));
|
||||
}
|
||||
|
||||
static boolean eq(short a, short b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2322,7 +2314,7 @@ public class Short128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void LSHLShort128VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void LSHLShort128VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2340,7 +2332,7 @@ public class Short128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void LSHLShort128VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void LSHLShort128VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2368,7 +2360,7 @@ public class Short128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void LSHRShort128VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void LSHRShort128VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2386,7 +2378,7 @@ public class Short128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void LSHRShort128VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void LSHRShort128VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2414,7 +2406,7 @@ public class Short128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ASHRShort128VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void ASHRShort128VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2432,7 +2424,7 @@ public class Short128VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ASHRShort128VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void ASHRShort128VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2450,178 +2442,6 @@ public class Short128VectorTests extends AbstractVectorTest {
|
||||
assertShiftArraysEquals(r, a, b, mask, Short128VectorTests::ASHR_unary);
|
||||
}
|
||||
|
||||
|
||||
static short ROR(short a, short b) {
|
||||
return (short)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void RORShort128VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Short128VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void RORShort128VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Short128VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static short ROL(short a, short b) {
|
||||
return (short)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ROLShort128VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Short128VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ROLShort128VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Short128VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static short ROR_unary(short a, short b) {
|
||||
return (short)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void RORShort128VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Short128VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void RORShort128VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Short128VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static short ROL_unary(short a, short b) {
|
||||
return (short)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ROLShort128VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Short128VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ROLShort128VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Short128VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static short MIN(short a, short b) {
|
||||
return (short)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1143,14 +1143,6 @@ public class Short256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static short ROL_scalar(short a, short b) {
|
||||
return (short)(((((short)a) & 0xFFFF) << (b & 15)) | ((((short)a) & 0xFFFF) >>> (16 - (b & 15))));
|
||||
}
|
||||
|
||||
static short ROR_scalar(short a, short b) {
|
||||
return (short)(((((short)a) & 0xFFFF) >>> (b & 15)) | ((((short)a) & 0xFFFF) << (16 - (b & 15))));
|
||||
}
|
||||
|
||||
static boolean eq(short a, short b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2322,7 +2314,7 @@ public class Short256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void LSHLShort256VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void LSHLShort256VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2340,7 +2332,7 @@ public class Short256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void LSHLShort256VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void LSHLShort256VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2368,7 +2360,7 @@ public class Short256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void LSHRShort256VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void LSHRShort256VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2386,7 +2378,7 @@ public class Short256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void LSHRShort256VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void LSHRShort256VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2414,7 +2406,7 @@ public class Short256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ASHRShort256VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void ASHRShort256VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2432,7 +2424,7 @@ public class Short256VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ASHRShort256VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void ASHRShort256VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2450,178 +2442,6 @@ public class Short256VectorTests extends AbstractVectorTest {
|
||||
assertShiftArraysEquals(r, a, b, mask, Short256VectorTests::ASHR_unary);
|
||||
}
|
||||
|
||||
|
||||
static short ROR(short a, short b) {
|
||||
return (short)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void RORShort256VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Short256VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void RORShort256VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Short256VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static short ROL(short a, short b) {
|
||||
return (short)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ROLShort256VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Short256VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ROLShort256VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Short256VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static short ROR_unary(short a, short b) {
|
||||
return (short)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void RORShort256VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Short256VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void RORShort256VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Short256VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static short ROL_unary(short a, short b) {
|
||||
return (short)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ROLShort256VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Short256VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ROLShort256VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Short256VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static short MIN(short a, short b) {
|
||||
return (short)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1143,14 +1143,6 @@ public class Short512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static short ROL_scalar(short a, short b) {
|
||||
return (short)(((((short)a) & 0xFFFF) << (b & 15)) | ((((short)a) & 0xFFFF) >>> (16 - (b & 15))));
|
||||
}
|
||||
|
||||
static short ROR_scalar(short a, short b) {
|
||||
return (short)(((((short)a) & 0xFFFF) >>> (b & 15)) | ((((short)a) & 0xFFFF) << (16 - (b & 15))));
|
||||
}
|
||||
|
||||
static boolean eq(short a, short b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2322,7 +2314,7 @@ public class Short512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void LSHLShort512VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void LSHLShort512VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2340,7 +2332,7 @@ public class Short512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void LSHLShort512VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void LSHLShort512VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2368,7 +2360,7 @@ public class Short512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void LSHRShort512VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void LSHRShort512VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2386,7 +2378,7 @@ public class Short512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void LSHRShort512VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void LSHRShort512VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2414,7 +2406,7 @@ public class Short512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ASHRShort512VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void ASHRShort512VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2432,7 +2424,7 @@ public class Short512VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ASHRShort512VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void ASHRShort512VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2450,178 +2442,6 @@ public class Short512VectorTests extends AbstractVectorTest {
|
||||
assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::ASHR_unary);
|
||||
}
|
||||
|
||||
|
||||
static short ROR(short a, short b) {
|
||||
return (short)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void RORShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Short512VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void RORShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Short512VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static short ROL(short a, short b) {
|
||||
return (short)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ROLShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Short512VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ROLShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Short512VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static short ROR_unary(short a, short b) {
|
||||
return (short)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void RORShort512VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Short512VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void RORShort512VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static short ROL_unary(short a, short b) {
|
||||
return (short)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ROLShort512VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Short512VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ROLShort512VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static short MIN(short a, short b) {
|
||||
return (short)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1143,14 +1143,6 @@ public class Short64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static short ROL_scalar(short a, short b) {
|
||||
return (short)(((((short)a) & 0xFFFF) << (b & 15)) | ((((short)a) & 0xFFFF) >>> (16 - (b & 15))));
|
||||
}
|
||||
|
||||
static short ROR_scalar(short a, short b) {
|
||||
return (short)(((((short)a) & 0xFFFF) >>> (b & 15)) | ((((short)a) & 0xFFFF) << (16 - (b & 15))));
|
||||
}
|
||||
|
||||
static boolean eq(short a, short b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2322,7 +2314,7 @@ public class Short64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void LSHLShort64VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void LSHLShort64VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2340,7 +2332,7 @@ public class Short64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void LSHLShort64VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void LSHLShort64VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2368,7 +2360,7 @@ public class Short64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void LSHRShort64VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void LSHRShort64VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2386,7 +2378,7 @@ public class Short64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void LSHRShort64VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void LSHRShort64VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2414,7 +2406,7 @@ public class Short64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ASHRShort64VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void ASHRShort64VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2432,7 +2424,7 @@ public class Short64VectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ASHRShort64VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void ASHRShort64VectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2450,178 +2442,6 @@ public class Short64VectorTests extends AbstractVectorTest {
|
||||
assertShiftArraysEquals(r, a, b, mask, Short64VectorTests::ASHR_unary);
|
||||
}
|
||||
|
||||
|
||||
static short ROR(short a, short b) {
|
||||
return (short)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void RORShort64VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Short64VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void RORShort64VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Short64VectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static short ROL(short a, short b) {
|
||||
return (short)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ROLShort64VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, Short64VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ROLShort64VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, Short64VectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static short ROR_unary(short a, short b) {
|
||||
return (short)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void RORShort64VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Short64VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void RORShort64VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Short64VectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static short ROL_unary(short a, short b) {
|
||||
return (short)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ROLShort64VectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, Short64VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ROLShort64VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, Short64VectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static short MIN(short a, short b) {
|
||||
return (short)(Math.min(a, b));
|
||||
}
|
||||
|
@ -1148,14 +1148,6 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static short ROL_scalar(short a, short b) {
|
||||
return (short)(((((short)a) & 0xFFFF) << (b & 15)) | ((((short)a) & 0xFFFF) >>> (16 - (b & 15))));
|
||||
}
|
||||
|
||||
static short ROR_scalar(short a, short b) {
|
||||
return (short)(((((short)a) & 0xFFFF) >>> (b & 15)) | ((((short)a) & 0xFFFF) << (16 - (b & 15))));
|
||||
}
|
||||
|
||||
static boolean eq(short a, short b) {
|
||||
return a == b;
|
||||
}
|
||||
@ -2327,7 +2319,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void LSHLShortMaxVectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void LSHLShortMaxVectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2345,7 +2337,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void LSHLShortMaxVectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void LSHLShortMaxVectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2373,7 +2365,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void LSHRShortMaxVectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void LSHRShortMaxVectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2391,7 +2383,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void LSHRShortMaxVectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void LSHRShortMaxVectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2419,7 +2411,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ASHRShortMaxVectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
static void ASHRShortMaxVectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
@ -2437,7 +2429,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ASHRShortMaxVectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
static void ASHRShortMaxVectorTestsShift(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
@ -2455,178 +2447,6 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
|
||||
assertShiftArraysEquals(r, a, b, mask, ShortMaxVectorTests::ASHR_unary);
|
||||
}
|
||||
|
||||
|
||||
static short ROR(short a, short b) {
|
||||
return (short)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void RORShortMaxVectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, ShortMaxVectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void RORShortMaxVectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROR, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::ROR);
|
||||
}
|
||||
|
||||
|
||||
static short ROL(short a, short b) {
|
||||
return (short)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ROLShortMaxVectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, ShortMaxVectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ROLShortMaxVectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
|
||||
av.lanewise(VectorOperators.ROL, bv, vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::ROL);
|
||||
}
|
||||
|
||||
|
||||
static short ROR_unary(short a, short b) {
|
||||
return (short)(ROR_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void RORShortMaxVectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, ShortMaxVectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void RORShortMaxVectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROR, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, ShortMaxVectorTests::ROR_unary);
|
||||
}
|
||||
|
||||
|
||||
static short ROL_unary(short a, short b) {
|
||||
return (short)(ROL_scalar(a,b));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpProvider")
|
||||
static void ROLShortMaxVectorTestsScalarShift(IntFunction<short[]> fa, IntFunction<short[]> fb) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i]).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, ShortMaxVectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test(dataProvider = "shortBinaryOpMaskProvider")
|
||||
static void ROLShortMaxVectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
short[] a = fa.apply(SPECIES.length());
|
||||
short[] b = fb.apply(SPECIES.length());
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
boolean[] mask = fm.apply(SPECIES.length());
|
||||
VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.lanewise(VectorOperators.ROL, (int)b[i], vmask).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertShiftArraysEquals(r, a, b, mask, ShortMaxVectorTests::ROL_unary);
|
||||
}
|
||||
|
||||
static short MIN(short a, short b) {
|
||||
return (short)(Math.min(a, b));
|
||||
}
|
||||
|
@ -99,9 +99,9 @@ function replace_variables {
|
||||
local kernel_smoke=${10}
|
||||
|
||||
if [ "x${kernel}" != "x" ]; then
|
||||
local kernel_escaped=$(echo -e "$kernel" | tr '\n' '`')
|
||||
local kernel_escaped=$(echo -e "$kernel" | tr '\n' '|')
|
||||
sed "s/\[\[KERNEL\]\]/${kernel_escaped}/g" $filename > ${filename}.current1
|
||||
cat ${filename}.current1 | tr '`' "\n" > ${filename}.current
|
||||
cat ${filename}.current1 | tr '|' "\n" > ${filename}.current
|
||||
rm -f "${filename}.current1"
|
||||
else
|
||||
cp $filename ${filename}.current
|
||||
@ -156,9 +156,9 @@ function replace_variables {
|
||||
if [[ "$filename" == *"Unit"* ]] && [ "$test_func" != "" ]; then
|
||||
if [ "$masked" == "" ] || [ "$withMask" != "" ]; then
|
||||
if [ ! -z "$kernel_smoke" ]; then
|
||||
local kernel_smoke_escaped=$(echo -e "$kernel_smoke" | tr '\n' '`')
|
||||
local kernel_smoke_escaped=$(echo -e "$kernel_smoke" | tr '\n' '|')
|
||||
sed "s/\[\[KERNEL\]\]/${kernel_smoke_escaped}/g" $filename > ${filename}.scurrent1
|
||||
cat ${filename}.scurrent1 | tr '`' "\n" > ${filename}.scurrent
|
||||
cat ${filename}.scurrent1 | tr '|' "\n" > ${filename}.scurrent
|
||||
rm -f "${filename}.scurrent1"
|
||||
else
|
||||
cp $filename.current ${filename}.scurrent
|
||||
@ -445,10 +445,6 @@ gen_shift_cst_op "LSHR" "((a \& 0xFFFF) >>> (b \& 15))" "short"
|
||||
gen_shift_cst_op "ASHR" "(a >> b)" "intOrLong"
|
||||
gen_shift_cst_op "ASHR" "(a >> (b \& 7))" "byte"
|
||||
gen_shift_cst_op "ASHR" "(a >> (b \& 15))" "short"
|
||||
gen_binary_alu_op "ROR" "ROR_scalar(a,b)" "BITWISE"
|
||||
gen_binary_alu_op "ROL" "ROL_scalar(a,b)" "BITWISE"
|
||||
gen_shift_cst_op "ROR" "ROR_scalar(a,b)" "BITWISE"
|
||||
gen_shift_cst_op "ROL" "ROL_scalar(a,b)" "BITWISE"
|
||||
|
||||
# Masked reductions.
|
||||
gen_binary_op_no_masked "MIN+min" "Math.min(a, b)"
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
@Test(dataProvider = "$type$BinaryOpMaskProvider")
|
||||
static void [[TEST]]$vectorteststype$ScalarShiftMasked(IntFunction<$type$[]> fa, IntFunction<$type$[]> fb,
|
||||
static void [[TEST]]$vectorteststype$Shift(IntFunction<$type$[]> fa, IntFunction<$type$[]> fb,
|
||||
IntFunction<boolean[]> fm) {
|
||||
[[KERNEL]]
|
||||
assertShiftArraysEquals(r, a, b, mask, $vectorteststype$::[[TEST]]_unary);
|
||||
|
@ -3,7 +3,7 @@
|
||||
}
|
||||
|
||||
@Test(dataProvider = "$type$BinaryOpProvider")
|
||||
static void [[TEST]]$vectorteststype$ScalarShift(IntFunction<$type$[]> fa, IntFunction<$type$[]> fb) {
|
||||
static void [[TEST]]$vectorteststype$Shift(IntFunction<$type$[]> fa, IntFunction<$type$[]> fb) {
|
||||
[[KERNEL]]
|
||||
assertShiftArraysEquals(r, a, b, $vectorteststype$::[[TEST]]_unary);
|
||||
}
|
||||
|
@ -1383,30 +1383,6 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static $type$ ROL_scalar($type$ a, $type$ b) {
|
||||
#if[intOrLong]
|
||||
return $Wideboxtype$.rotateLeft(a, ((int)b));
|
||||
#else[intOrLong]
|
||||
#if[short]
|
||||
return (short)(((((short)a) & 0xFFFF) << (b & 15)) | ((((short)a) & 0xFFFF) >>> (16 - (b & 15))));
|
||||
#else[short]
|
||||
return (byte)(((((byte)a) & 0xFF) << (b & 7)) | ((((byte)a) & 0xFF) >>> (8 - (b & 7))));
|
||||
#end[short]
|
||||
#end[intOrLong]
|
||||
}
|
||||
|
||||
static $type$ ROR_scalar($type$ a, $type$ b) {
|
||||
#if[intOrLong]
|
||||
return $Wideboxtype$.rotateRight(a, ((int)b));
|
||||
#else[intOrLong]
|
||||
#if[short]
|
||||
return (short)(((((short)a) & 0xFFFF) >>> (b & 15)) | ((((short)a) & 0xFFFF) << (16 - (b & 15))));
|
||||
#else[short]
|
||||
return (byte)(((((byte)a) & 0xFF) >>> (b & 7)) | ((((byte)a) & 0xFF) << (8 - (b & 7))));
|
||||
#end[short]
|
||||
#end[intOrLong]
|
||||
}
|
||||
#end[BITWISE]
|
||||
|
||||
static boolean eq($type$ a, $type$ b) {
|
||||
|
@ -1,214 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
|
||||
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
//
|
||||
// This code is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License version 2 only, as
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
// version 2 for more details (a copy is included in the LICENSE file that
|
||||
// accompanied this code).
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License version
|
||||
// 2 along with this work; if not, write to the Free Software Foundation,
|
||||
// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
//
|
||||
// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
// or visit www.oracle.com if you need additional information or have any
|
||||
// questions.
|
||||
//
|
||||
//
|
||||
package org.openjdk.bench.jdk.incubator.vector;
|
||||
|
||||
import java.util.Random;
|
||||
import jdk.incubator.vector.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.openjdk.jmh.annotations.*;
|
||||
import org.openjdk.jmh.infra.Blackhole;
|
||||
|
||||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
||||
@State(Scope.Thread)
|
||||
public class RotateBenchmark {
|
||||
@Param({"256","512"})
|
||||
int size;
|
||||
|
||||
@Param({"128","256", "512"})
|
||||
int bits;
|
||||
|
||||
@Param({"7","15","31"})
|
||||
int shift;
|
||||
|
||||
byte[] byteinp;
|
||||
byte[] byteres;
|
||||
|
||||
short[] shortinp;
|
||||
short[] shortres;
|
||||
|
||||
int[] intinp;
|
||||
int[] intres;
|
||||
|
||||
long[] longinp;
|
||||
long[] longres;
|
||||
|
||||
VectorSpecies<Byte> bspecies;
|
||||
VectorSpecies<Short> sspecies;
|
||||
VectorSpecies<Integer> ispecies;
|
||||
VectorSpecies<Long> lspecies;
|
||||
|
||||
static final byte[] specialvalsbyte = {0, -0, Byte.MIN_VALUE, Byte.MAX_VALUE};
|
||||
static final short[] specialvalsshort = {0, -0, Short.MIN_VALUE, Short.MAX_VALUE};
|
||||
static final int[] specialvalsint = {0, -0, Integer.MIN_VALUE, Integer.MAX_VALUE};
|
||||
static final long[] specialvalslong = {0L, -0L, Long.MIN_VALUE, Long.MAX_VALUE};
|
||||
|
||||
@Setup(Level.Trial)
|
||||
public void BmSetup() {
|
||||
Random r = new Random(1024);
|
||||
byteinp = new byte[size];
|
||||
byteres = new byte[size];
|
||||
shortinp = new short[size];
|
||||
shortres = new short[size];
|
||||
intinp = new int[size];
|
||||
intres = new int[size];
|
||||
longinp = new long[size];
|
||||
longres = new long[size];
|
||||
|
||||
bspecies = VectorSpecies.of(byte.class, VectorShape.forBitSize(bits));
|
||||
sspecies = VectorSpecies.of(short.class, VectorShape.forBitSize(bits));
|
||||
ispecies = VectorSpecies.of(int.class, VectorShape.forBitSize(bits));
|
||||
lspecies = VectorSpecies.of(long.class, VectorShape.forBitSize(bits));
|
||||
|
||||
for (int i = 4; i < size; i++) {
|
||||
byteinp[i] = (byte)i;
|
||||
shortinp[i] = (short)i;
|
||||
intinp[i] = i;
|
||||
longinp[i] = i;
|
||||
}
|
||||
for (int i = 0; i < specialvalsbyte.length; i++) {
|
||||
byteinp[i] = specialvalsbyte[i];
|
||||
}
|
||||
for (int i = 0; i < specialvalsshort.length; i++) {
|
||||
shortinp[i] = specialvalsshort[i];
|
||||
}
|
||||
for (int i = 0; i < specialvalsint.length; i++) {
|
||||
intinp[i] = specialvalsint[i];
|
||||
}
|
||||
for (int i = 0; i < specialvalslong.length; i++) {
|
||||
longinp[i] = specialvalslong[i];
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void testRotateLeftB() {
|
||||
for (int j = 0; j < size; j += bspecies.length()) {
|
||||
ByteVector.fromArray(bspecies, byteinp, j)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift).intoArray(byteres, j);
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void testRotateRightB() {
|
||||
for (int j = 0; j < size; j += bspecies.length()) {
|
||||
ByteVector.fromArray(bspecies, byteinp, j)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift).intoArray(byteres, j);
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void testRotateLeftS() {
|
||||
for (int j = 0; j < size; j += sspecies.length()) {
|
||||
ShortVector.fromArray(sspecies, shortinp, j)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift).intoArray(shortres, j);
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void testRotateRightS() {
|
||||
for (int j = 0; j < size; j += sspecies.length()) {
|
||||
ShortVector.fromArray(sspecies, shortinp, j)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift).intoArray(shortres, j);
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void testRotateLeftI() {
|
||||
for (int j = 0; j < size; j += ispecies.length()) {
|
||||
IntVector.fromArray(ispecies, intinp, j)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift).intoArray(intres, j);
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void testRotateRightI() {
|
||||
for (int j = 0; j < size; j += ispecies.length()) {
|
||||
IntVector.fromArray(ispecies, intinp, j)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift).intoArray(intres, j);
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void testRotateLeftL() {
|
||||
for (int j = 0; j < size; j += lspecies.length()) {
|
||||
LongVector.fromArray(lspecies, longinp, j)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift)
|
||||
.lanewise(VectorOperators.ROL, shift).intoArray(longres, j);
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void testRotateRightL() {
|
||||
for (int j = 0; j < size; j += lspecies.length()) {
|
||||
LongVector.fromArray(lspecies, longinp, j)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift)
|
||||
.lanewise(VectorOperators.ROR, shift).intoArray(longres, j);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user