mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-15 08:34:30 +02:00
8293488: Add EOR3 backend rule for aarch64 SHA3 extension
Reviewed-by: haosun, njian, eliu, aturbanov, ngasson
This commit is contained in:
parent
69ede5baed
commit
54e6d6aaeb
7 changed files with 325 additions and 35 deletions
|
@ -1368,6 +1368,30 @@ instruct vxorImmL(vReg dst_src, immLLog con) %{
|
|||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// vector eor3 (unpredicated)
|
||||
|
||||
instruct veor3_neon(vReg dst, vReg src1, vReg src2, vReg src3) %{
|
||||
predicate(VM_Version::supports_sha3() &&
|
||||
VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n)));
|
||||
match(Set dst (XorV src1 (XorV src2 src3)));
|
||||
format %{ "veor3_neon $dst, $src1, $src2, $src3" %}
|
||||
ins_encode %{
|
||||
__ eor3($dst$$FloatRegister, __ T16B, $src1$$FloatRegister,
|
||||
$src2$$FloatRegister, $src3$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct veor3_sve(vReg dst_src1, vReg src2, vReg src3) %{
|
||||
predicate(UseSVE == 2 && !VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n)));
|
||||
match(Set dst_src1 (XorV dst_src1 (XorV src2 src3)));
|
||||
format %{ "veor3_sve $dst_src1, $dst_src1, $src2, $src3" %}
|
||||
ins_encode %{
|
||||
__ sve_eor3($dst_src1$$FloatRegister, $src2$$FloatRegister, $src3$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// ------------------------------ Vector not -----------------------------------
|
||||
|
||||
// vector not
|
||||
|
|
|
@ -695,6 +695,30 @@ BITWISE_OP_IMM(vxorImmS, S, XorV, sve_eor, H)
|
|||
BITWISE_OP_IMM(vxorImmI, I, XorV, sve_eor, S)
|
||||
BITWISE_OP_IMM(vxorImmL, L, XorV, sve_eor, D)
|
||||
|
||||
// vector eor3 (unpredicated)
|
||||
|
||||
instruct veor3_neon(vReg dst, vReg src1, vReg src2, vReg src3) %{
|
||||
predicate(VM_Version::supports_sha3() &&
|
||||
VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n)));
|
||||
match(Set dst (XorV src1 (XorV src2 src3)));
|
||||
format %{ "veor3_neon $dst, $src1, $src2, $src3" %}
|
||||
ins_encode %{
|
||||
__ eor3($dst$$FloatRegister, __ T16B, $src1$$FloatRegister,
|
||||
$src2$$FloatRegister, $src3$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct veor3_sve(vReg dst_src1, vReg src2, vReg src3) %{
|
||||
predicate(UseSVE == 2 && !VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n)));
|
||||
match(Set dst_src1 (XorV dst_src1 (XorV src2 src3)));
|
||||
format %{ "veor3_sve $dst_src1, $dst_src1, $src2, $src3" %}
|
||||
ins_encode %{
|
||||
__ sve_eor3($dst_src1$$FloatRegister, $src2$$FloatRegister, $src3$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// ------------------------------ Vector not -----------------------------------
|
||||
|
||||
dnl
|
||||
|
|
|
@ -3943,6 +3943,17 @@ void sve_fcm(Condition cond, PRegister Pd, SIMD_RegVariant T,
|
|||
INSN(sve_bdep, 0b01);
|
||||
#undef INSN
|
||||
|
||||
// SVE2 bitwise ternary operations
|
||||
#define INSN(NAME, opc) \
|
||||
void NAME(FloatRegister Zdn, FloatRegister Zm, FloatRegister Zk) { \
|
||||
starti; \
|
||||
f(0b00000100, 31, 24), f(opc, 23, 21), rf(Zm, 16); \
|
||||
f(0b001110, 15, 10), rf(Zk, 5), rf(Zdn, 0); \
|
||||
}
|
||||
|
||||
INSN(sve_eor3, 0b001); // Bitwise exclusive OR of three vectors
|
||||
#undef INSN
|
||||
|
||||
Assembler(CodeBuffer* code) : AbstractAssembler(code) {
|
||||
}
|
||||
|
||||
|
|
|
@ -1011,7 +1011,7 @@ class SVEVectorOp(Instruction):
|
|||
self._bitwiseop = False
|
||||
if name[0] == 'f':
|
||||
self._width = RegVariant(2, 3)
|
||||
elif not self._isPredicated and (name in ["and", "eor", "orr", "bic"]):
|
||||
elif not self._isPredicated and (name in ["and", "eor", "orr", "bic", "eor3"]):
|
||||
self._width = RegVariant(3, 3)
|
||||
self._bitwiseop = True
|
||||
elif name == "revb":
|
||||
|
@ -1040,7 +1040,8 @@ class SVEVectorOp(Instruction):
|
|||
width +
|
||||
[str(self.reg[i]) for i in range(1, self.numRegs)]))
|
||||
def astr(self):
|
||||
formatStr = "%s%s" + ''.join([", %s" for i in range(1, self.numRegs)])
|
||||
firstArg = 0 if self._name == "eor3" else 1
|
||||
formatStr = "%s%s" + ''.join([", %s" for i in range(firstArg, self.numRegs)])
|
||||
if self._dnm == 'dn':
|
||||
formatStr += ", %s"
|
||||
dnReg = [str(self.reg[0]) + self._width.astr()]
|
||||
|
@ -1050,7 +1051,7 @@ class SVEVectorOp(Instruction):
|
|||
if self._isPredicated:
|
||||
restRegs = [str(self.reg[1]) + self._merge] + dnReg + [str(self.reg[i]) + self._width.astr() for i in range(2, self.numRegs)]
|
||||
else:
|
||||
restRegs = dnReg + [str(self.reg[i]) + self._width.astr() for i in range(1, self.numRegs)]
|
||||
restRegs = dnReg + [str(self.reg[i]) + self._width.astr() for i in range(firstArg, self.numRegs)]
|
||||
return (formatStr
|
||||
% tuple([Instruction.astr(self)] +
|
||||
[str(self.reg[0]) + self._width.astr()] +
|
||||
|
@ -1926,6 +1927,7 @@ generate(SVEVectorOp, [["add", "ZZZ"],
|
|||
# SVE2 instructions
|
||||
["bext", "ZZZ"],
|
||||
["bdep", "ZZZ"],
|
||||
["eor3", "ZZZ"],
|
||||
])
|
||||
|
||||
generate(SVEReductionOp, [["andv", 0], ["orv", 0], ["eorv", 0], ["smaxv", 0], ["sminv", 0],
|
||||
|
|
|
@ -1212,17 +1212,18 @@
|
|||
__ sve_fabd(z13, __ D, p7, z22); // fabd z13.d, p7/m, z13.d, z22.d
|
||||
__ sve_bext(z30, __ S, z25, z17); // bext z30.s, z25.s, z17.s
|
||||
__ sve_bdep(z14, __ D, z11, z12); // bdep z14.d, z11.d, z12.d
|
||||
__ sve_eor3(z20, z5, z1); // eor3 z20.d, z20.d, z5.d, z1.d
|
||||
|
||||
// SVEReductionOp
|
||||
__ sve_andv(v20, __ H, p1, z1); // andv h20, p1, z1.h
|
||||
__ sve_orv(v13, __ H, p0, z7); // orv h13, p0, z7.h
|
||||
__ sve_eorv(v11, __ D, p4, z4); // eorv d11, p4, z4.d
|
||||
__ sve_smaxv(v15, __ D, p0, z3); // smaxv d15, p0, z3.d
|
||||
__ sve_sminv(v0, __ S, p5, z5); // sminv s0, p5, z5.s
|
||||
__ sve_fminv(v30, __ S, p7, z13); // fminv s30, p7, z13.s
|
||||
__ sve_fmaxv(v8, __ S, p3, z29); // fmaxv s8, p3, z29.s
|
||||
__ sve_fadda(v14, __ S, p7, z3); // fadda s14, p7, s14, z3.s
|
||||
__ sve_uaddv(v25, __ H, p2, z24); // uaddv d25, p2, z24.h
|
||||
__ sve_andv(v13, __ H, p0, z7); // andv h13, p0, z7.h
|
||||
__ sve_orv(v11, __ D, p4, z4); // orv d11, p4, z4.d
|
||||
__ sve_eorv(v15, __ D, p0, z3); // eorv d15, p0, z3.d
|
||||
__ sve_smaxv(v0, __ S, p5, z5); // smaxv s0, p5, z5.s
|
||||
__ sve_sminv(v30, __ H, p7, z13); // sminv h30, p7, z13.h
|
||||
__ sve_fminv(v8, __ S, p3, z29); // fminv s8, p3, z29.s
|
||||
__ sve_fmaxv(v14, __ S, p7, z3); // fmaxv s14, p7, z3.s
|
||||
__ sve_fadda(v25, __ S, p2, z24); // fadda s25, p2, s25, z24.s
|
||||
__ sve_uaddv(v1, __ H, p6, z10); // uaddv d1, p6, z10.h
|
||||
|
||||
__ bind(forth);
|
||||
|
||||
|
@ -1241,30 +1242,30 @@
|
|||
0x9101a1a0, 0xb10a5cc8, 0xd10810aa, 0xf10fd061,
|
||||
0x120cb166, 0x321764bc, 0x52174681, 0x720c0227,
|
||||
0x9241018e, 0xb25a2969, 0xd278b411, 0xf26aad01,
|
||||
0x14000000, 0x17ffffd7, 0x14000401, 0x94000000,
|
||||
0x97ffffd4, 0x940003fe, 0x3400000a, 0x34fffa2a,
|
||||
0x34007f6a, 0x35000008, 0x35fff9c8, 0x35007f08,
|
||||
0xb400000b, 0xb4fff96b, 0xb4007eab, 0xb500001d,
|
||||
0xb5fff91d, 0xb5007e5d, 0x10000013, 0x10fff8b3,
|
||||
0x10007df3, 0x90000013, 0x36300016, 0x3637f836,
|
||||
0x36307d76, 0x3758000c, 0x375ff7cc, 0x37587d0c,
|
||||
0x14000000, 0x17ffffd7, 0x14000402, 0x94000000,
|
||||
0x97ffffd4, 0x940003ff, 0x3400000a, 0x34fffa2a,
|
||||
0x34007f8a, 0x35000008, 0x35fff9c8, 0x35007f28,
|
||||
0xb400000b, 0xb4fff96b, 0xb4007ecb, 0xb500001d,
|
||||
0xb5fff91d, 0xb5007e7d, 0x10000013, 0x10fff8b3,
|
||||
0x10007e13, 0x90000013, 0x36300016, 0x3637f836,
|
||||
0x36307d96, 0x3758000c, 0x375ff7cc, 0x37587d2c,
|
||||
0x128313a0, 0x528a32c7, 0x7289173b, 0x92ab3acc,
|
||||
0xd2a0bf94, 0xf2c285e8, 0x9358722f, 0x330e652f,
|
||||
0x53067f3b, 0x93577c53, 0xb34a1aac, 0xd35a4016,
|
||||
0x13946c63, 0x93c3dbc8, 0x54000000, 0x54fff5a0,
|
||||
0x54007ae0, 0x54000001, 0x54fff541, 0x54007a81,
|
||||
0x54000002, 0x54fff4e2, 0x54007a22, 0x54000002,
|
||||
0x54fff482, 0x540079c2, 0x54000003, 0x54fff423,
|
||||
0x54007963, 0x54000003, 0x54fff3c3, 0x54007903,
|
||||
0x54000004, 0x54fff364, 0x540078a4, 0x54000005,
|
||||
0x54fff305, 0x54007845, 0x54000006, 0x54fff2a6,
|
||||
0x540077e6, 0x54000007, 0x54fff247, 0x54007787,
|
||||
0x54000008, 0x54fff1e8, 0x54007728, 0x54000009,
|
||||
0x54fff189, 0x540076c9, 0x5400000a, 0x54fff12a,
|
||||
0x5400766a, 0x5400000b, 0x54fff0cb, 0x5400760b,
|
||||
0x5400000c, 0x54fff06c, 0x540075ac, 0x5400000d,
|
||||
0x54fff00d, 0x5400754d, 0x5400000e, 0x54ffefae,
|
||||
0x540074ee, 0x5400000f, 0x54ffef4f, 0x5400748f,
|
||||
0x54007b00, 0x54000001, 0x54fff541, 0x54007aa1,
|
||||
0x54000002, 0x54fff4e2, 0x54007a42, 0x54000002,
|
||||
0x54fff482, 0x540079e2, 0x54000003, 0x54fff423,
|
||||
0x54007983, 0x54000003, 0x54fff3c3, 0x54007923,
|
||||
0x54000004, 0x54fff364, 0x540078c4, 0x54000005,
|
||||
0x54fff305, 0x54007865, 0x54000006, 0x54fff2a6,
|
||||
0x54007806, 0x54000007, 0x54fff247, 0x540077a7,
|
||||
0x54000008, 0x54fff1e8, 0x54007748, 0x54000009,
|
||||
0x54fff189, 0x540076e9, 0x5400000a, 0x54fff12a,
|
||||
0x5400768a, 0x5400000b, 0x54fff0cb, 0x5400762b,
|
||||
0x5400000c, 0x54fff06c, 0x540075cc, 0x5400000d,
|
||||
0x54fff00d, 0x5400756d, 0x5400000e, 0x54ffefae,
|
||||
0x5400750e, 0x5400000f, 0x54ffef4f, 0x540074af,
|
||||
0xd40658e1, 0xd4014d22, 0xd4046543, 0xd4273f60,
|
||||
0xd44cad80, 0xd503201f, 0xd503203f, 0xd503205f,
|
||||
0xd503209f, 0xd50320bf, 0xd503219f, 0xd50323bf,
|
||||
|
@ -1495,8 +1496,9 @@
|
|||
0x65f1fba5, 0x65bd4dc1, 0x65fe7040, 0x044c57b6,
|
||||
0x049761c2, 0x04393260, 0x04b53197, 0x046a3021,
|
||||
0x04f7326b, 0x05b16bc8, 0x05a46e93, 0x65c89ecd,
|
||||
0x4591b33e, 0x45ccb56e, 0x045a2434, 0x045820ed,
|
||||
0x04d9308b, 0x04c8206f, 0x048a34a0, 0x65873dbe,
|
||||
0x65862fa8, 0x65983c6e, 0x04412b19,
|
||||
0x4591b33e, 0x45ccb56e, 0x04253834, 0x045a20ed,
|
||||
0x04d8308b, 0x04d9206f, 0x048834a0, 0x044a3dbe,
|
||||
0x65872fa8, 0x65863c6e, 0x65982b19, 0x04413941,
|
||||
|
||||
};
|
||||
// END Generated code -- do not edit
|
||||
|
|
118
test/hotspot/jtreg/compiler/vectorization/TestEor3AArch64.java
Normal file
118
test/hotspot/jtreg/compiler/vectorization/TestEor3AArch64.java
Normal file
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Arm Limited. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package compiler.vectorization;
|
||||
|
||||
import jdk.test.lib.Asserts;
|
||||
import compiler.lib.ir_framework.*;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import jdk.test.lib.Utils;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8293488
|
||||
* @summary Test EOR3 Neon/SVE2 instruction for aarch64 SHA3 extension
|
||||
* @library /test/lib /
|
||||
* @requires os.arch == "aarch64"
|
||||
* @run driver compiler.vectorization.TestEor3AArch64
|
||||
*/
|
||||
|
||||
public class TestEor3AArch64 {
|
||||
|
||||
private static final int LENGTH = 2048;
|
||||
private static final Random RD = Utils.getRandomInstance();
|
||||
|
||||
private static int[] ia;
|
||||
private static int[] ib;
|
||||
private static int[] ic;
|
||||
private static int[] ir;
|
||||
|
||||
private static long[] la;
|
||||
private static long[] lb;
|
||||
private static long[] lc;
|
||||
private static long[] lr;
|
||||
|
||||
static {
|
||||
ia = new int[LENGTH];
|
||||
ib = new int[LENGTH];
|
||||
ic = new int[LENGTH];
|
||||
ir = new int[LENGTH];
|
||||
|
||||
la = new long[LENGTH];
|
||||
lb = new long[LENGTH];
|
||||
lc = new long[LENGTH];
|
||||
lr = new long[LENGTH];
|
||||
|
||||
for (int i = 0; i < LENGTH; i++) {
|
||||
ia[i] = RD.nextInt(30);
|
||||
ib[i] = RD.nextInt(30);
|
||||
ic[i] = RD.nextInt(30);
|
||||
|
||||
la[i] = RD.nextLong(30);
|
||||
lb[i] = RD.nextLong(30);
|
||||
lc[i] = RD.nextLong(30);
|
||||
}
|
||||
}
|
||||
|
||||
// Test for eor3 Neon and SVE2 instruction for integers
|
||||
@Test
|
||||
@IR(counts = {"veor3_neon", "> 0"}, applyIf = {"MaxVectorSize", "16"}, applyIfCPUFeature = {"sha3", "true"})
|
||||
@IR(counts = {"veor3_sve", "> 0"}, applyIfAnd = {"UseSVE", "2", "MaxVectorSize", "> 16"})
|
||||
public static void testIntEor3() {
|
||||
for (int i = 0; i < LENGTH; i++) {
|
||||
ir[i] = ia[i] ^ ib[i] ^ ic[i];
|
||||
}
|
||||
}
|
||||
|
||||
@Run(test = "testIntEor3")
|
||||
public static void testIntEor3_runner() {
|
||||
testIntEor3();
|
||||
for (int i = 0; i < LENGTH; i++) {
|
||||
Asserts.assertEquals((ia[i] ^ ib[i] ^ ic[i]), ir[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Test for eor3 Neon and SVE2 instruction for longs
|
||||
@Test
|
||||
@IR(counts = {"veor3_neon", "> 0"}, applyIf = {"MaxVectorSize", "16"}, applyIfCPUFeature = {"sha3", "true"})
|
||||
@IR(counts = {"veor3_sve", "> 0"}, applyIfAnd = {"UseSVE", "2", "MaxVectorSize", "> 16"})
|
||||
public static void testLongEor3() {
|
||||
for (int i = 0; i < LENGTH; i++) {
|
||||
lr[i] = la[i] ^ lb[i] ^ lc[i];
|
||||
}
|
||||
}
|
||||
|
||||
@Run(test = "testLongEor3")
|
||||
public static void testLongEor3_runner() {
|
||||
testLongEor3();
|
||||
for (int i = 0; i < LENGTH; i++) {
|
||||
Asserts.assertEquals((la[i] ^ lb[i] ^ lc[i]), lr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
TestFramework.run();
|
||||
}
|
||||
}
|
109
test/micro/org/openjdk/bench/vm/compiler/TestEor3.java
Normal file
109
test/micro/org/openjdk/bench/vm/compiler/TestEor3.java
Normal file
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Arm Limited. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package org.openjdk.bench.vm.compiler;
|
||||
|
||||
import org.openjdk.jmh.annotations.*;
|
||||
import org.openjdk.jmh.infra.*;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.Random;
|
||||
|
||||
@BenchmarkMode(Mode.AverageTime)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@State(Scope.Thread)
|
||||
@Warmup(iterations = 4, time = 2, timeUnit = TimeUnit.SECONDS)
|
||||
@Measurement(iterations = 4, time = 2, timeUnit = TimeUnit.SECONDS)
|
||||
@Fork(value = 3)
|
||||
public class TestEor3 {
|
||||
@Param({"2048"})
|
||||
private int LENGTH;
|
||||
|
||||
private int[] ia;
|
||||
private int[] ib;
|
||||
private int[] ic;
|
||||
private int[] id;
|
||||
|
||||
private long[] la;
|
||||
private long[] lb;
|
||||
private long[] lc;
|
||||
private long[] ld;
|
||||
|
||||
@Param("0")
|
||||
private int seed;
|
||||
private Random random = new Random(seed);
|
||||
|
||||
@Setup
|
||||
public void init() {
|
||||
ia = new int[LENGTH];
|
||||
ib = new int[LENGTH];
|
||||
ic = new int[LENGTH];
|
||||
id = new int[LENGTH];
|
||||
|
||||
la = new long[LENGTH];
|
||||
lb = new long[LENGTH];
|
||||
lc = new long[LENGTH];
|
||||
ld = new long[LENGTH];
|
||||
|
||||
for (int i = 0; i < LENGTH; i++) {
|
||||
ia[i] = random.nextInt();
|
||||
ib[i] = random.nextInt();
|
||||
ic[i] = random.nextInt();
|
||||
|
||||
la[i] = random.nextLong();
|
||||
lb[i] = random.nextLong();
|
||||
lc[i] = random.nextLong();
|
||||
}
|
||||
}
|
||||
|
||||
// Test EOR3 for int arrays
|
||||
@Benchmark
|
||||
public void test1Int() {
|
||||
for (int i = 0; i < LENGTH; i++) {
|
||||
id[i] = ia[i] ^ ib[i] ^ ic[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Test EOR3 for int arrays with multiple eor operations
|
||||
@Benchmark
|
||||
public void test2Int() {
|
||||
for (int i = 0; i < LENGTH; i++) {
|
||||
id[i] = ia[i] ^ ib[i] ^ ic[i] ^ ia[i] ^ ib[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Test EOR3 for long arrays
|
||||
@Benchmark
|
||||
public void test1Long() {
|
||||
for (int i = 0; i < LENGTH; i++) {
|
||||
ld[i] = la[i] ^ lb[i] ^ lc[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Test EOR3 for long arrays with multiple eor operations
|
||||
@Benchmark
|
||||
public void test2Long() {
|
||||
for (int i = 0; i < LENGTH; i++) {
|
||||
ld[i] = la[i] ^ lb[i] ^ lc[i] ^ la[i] ^ lb[i];
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue