From 41a5c032f5a6f5e2713d63f22684e804fc5c634e Mon Sep 17 00:00:00 2001 From: Quan Anh Mai Date: Thu, 30 Apr 2026 18:17:38 +0000 Subject: [PATCH] 8382700: C2: Delay inlining instead of giving up when hit NodeCountInliningCutoff Co-authored-by: Vladimir Ivanov Co-authored-by: Maurizio Cimadamore Co-authored-by: Ioannis Tsakpinis Reviewed-by: kvn, vlivanov --- src/hotspot/share/opto/bytecodeInfo.cpp | 12 +- src/hotspot/share/opto/c2_globals.hpp | 6 +- src/hotspot/share/opto/compile.cpp | 8 +- src/hotspot/share/opto/compile.hpp | 6 +- src/hotspot/share/opto/doCall.cpp | 17 + .../TestDelayAfterInliningCutoff.java | 93 ++ .../lang/foreign/FFMStructAccessTest.java | 1466 +++++++++++++++++ 7 files changed, 1598 insertions(+), 10 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/inlining/TestDelayAfterInliningCutoff.java create mode 100644 test/micro/org/openjdk/bench/java/lang/foreign/FFMStructAccessTest.java diff --git a/src/hotspot/share/opto/bytecodeInfo.cpp b/src/hotspot/share/opto/bytecodeInfo.cpp index 5b48b33aa46..56c336dfc73 100644 --- a/src/hotspot/share/opto/bytecodeInfo.cpp +++ b/src/hotspot/share/opto/bytecodeInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -391,11 +391,13 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method, // suppress a few checks for accessors and trivial methods if (callee_method->code_size() > MaxTrivialSize) { - - // don't inline into giant methods + // We don't want to inline a call into a sufficiently large graph. However, this cannot be + // decided during parsing because there are more bytecodes in the caller that need parsing, and + // determining dead nodes is hard. As a result, we stop parse inlining at a relatively + // conservative threshold, and resume during incremental inlining, when there is no more + // parsing in the caller, and node liveness is more easily determined. if (C->over_inlining_cutoff()) { - if ((!callee_method->force_inline() && !caller_method->is_compiled_lambda_form()) - || !IncrementalInline) { + if (!C->should_delay_after_inlining_cutoff(callee_method, caller_method)) { set_msg("NodeCountInliningCutoff"); return false; } else { diff --git a/src/hotspot/share/opto/c2_globals.hpp b/src/hotspot/share/opto/c2_globals.hpp index dacc8ce9c26..401f6110142 100644 --- a/src/hotspot/share/opto/c2_globals.hpp +++ b/src/hotspot/share/opto/c2_globals.hpp @@ -507,9 +507,13 @@ /* controls for heat-based inlining */ \ \ develop(intx, NodeCountInliningCutoff, 18000, \ - "If parser node generation exceeds limit stop inlining") \ + "If node count exceeds limit stop inlining") \ range(0, max_jint) \ \ + product(bool, DelayAfterInliningCutoff, true, DIAGNOSTIC, \ + "If node count exceeds limit during parsing, attempt inlining " \ + "later instead of giving up completely") \ + \ product(intx, MaxNodeLimit, 80000, \ "Maximum number of nodes") \ range(1000, max_jint / 3) \ diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 6d185a9746e..0a615aca430 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -646,6 +646,7 @@ Compile::Compile(ciEnv* ci_env, ciMethod* target, int osr_bci, _stub_id(StubId::NO_STUBID), _stub_entry_point(nullptr), _max_node_limit(MaxNodeLimit), + _node_count_inlining_cutoff(NodeCountInliningCutoff), _post_loop_opts_phase(false), _merge_stores_phase(false), _allow_macro_nodes(true), @@ -922,6 +923,7 @@ Compile::Compile(ciEnv* ci_env, _stub_id(stub_id), _stub_entry_point(nullptr), _max_node_limit(MaxNodeLimit), + _node_count_inlining_cutoff(NodeCountInliningCutoff), _post_loop_opts_phase(false), _merge_stores_phase(false), _allow_macro_nodes(true), @@ -2170,8 +2172,8 @@ void Compile::inline_incrementally(PhaseIterGVN& igvn) { } while (_late_inlines.length() > 0) { - if (live_nodes() > (uint)LiveNodeCountInliningCutoff) { - if (low_live_nodes < (uint)LiveNodeCountInliningCutoff * 8 / 10) { + if (live_nodes() > node_count_inlining_cutoff()) { + if (low_live_nodes < node_count_inlining_cutoff() * 8 / 10) { TracePhase tp(_t_incrInline_ideal); // PhaseIdealLoop is expensive so we only try it once we are // out of live nodes and we only try it again if the previous @@ -2182,7 +2184,7 @@ void Compile::inline_incrementally(PhaseIterGVN& igvn) { _major_progress = true; } - if (live_nodes() > (uint)LiveNodeCountInliningCutoff) { + if (live_nodes() > node_count_inlining_cutoff()) { bool do_print_inlining = print_inlining() || print_intrinsics(); if (do_print_inlining || log() != nullptr) { // Print inlining message for candidates that we couldn't inline for lack of space. diff --git a/src/hotspot/share/opto/compile.hpp b/src/hotspot/share/opto/compile.hpp index ff0085d79de..6db3f27218f 100644 --- a/src/hotspot/share/opto/compile.hpp +++ b/src/hotspot/share/opto/compile.hpp @@ -319,6 +319,7 @@ class Compile : public Phase { int _fixed_slots; // count of frame slots not allocated by the register // allocator i.e. locks, original deopt pc, etc. uintx _max_node_limit; // Max unique node count during a single compilation. + uint _node_count_inlining_cutoff; // Number of nodes in the graph above which inlining is denied bool _post_loop_opts_phase; // Loop opts are finished. bool _merge_stores_phase; // Phase for merging stores, after post loop opts phase. @@ -654,6 +655,8 @@ public: void set_print_intrinsics(bool z) { _print_intrinsics = z; } uint max_node_limit() const { return (uint)_max_node_limit; } void set_max_node_limit(uint n) { _max_node_limit = n; } + uint node_count_inlining_cutoff() const { return _node_count_inlining_cutoff; } + void set_node_count_inlining_cutoff(uint n) { _node_count_inlining_cutoff = n; } bool clinit_barrier_on_entry() { return _clinit_barrier_on_entry; } void set_clinit_barrier_on_entry(bool z) { _clinit_barrier_on_entry = z; } bool has_monitors() const { return _has_monitors; } @@ -1004,6 +1007,7 @@ public: should_delay_boxing_inlining(call_method, jvms) || should_delay_vector_inlining(call_method, jvms); } + bool should_delay_after_inlining_cutoff(ciMethod* callee, ciMethod* caller); bool should_delay_string_inlining(ciMethod* call_method, JVMState* jvms); bool should_delay_boxing_inlining(ciMethod* call_method, JVMState* jvms); bool should_delay_vector_inlining(ciMethod* call_method, JVMState* jvms); @@ -1117,7 +1121,7 @@ public: // and avoid thrashing when live node count is close to the limit. // Keep in mind that live_nodes() isn't accurate during inlining until // dead node elimination step happens (see Compile::inline_incrementally). - return live_nodes() > (uint)LiveNodeCountInliningCutoff * 11 / 10; + return live_nodes() > node_count_inlining_cutoff() * 11 / 10; } } diff --git a/src/hotspot/share/opto/doCall.cpp b/src/hotspot/share/opto/doCall.cpp index d6e75f17f50..90454408a43 100644 --- a/src/hotspot/share/opto/doCall.cpp +++ b/src/hotspot/share/opto/doCall.cpp @@ -415,6 +415,22 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool } } +// After Compile::over_inlining_cutoff, should we decline inlining the callee, or should we try +// inlining again later +bool Compile::should_delay_after_inlining_cutoff(ciMethod* callee, ciMethod* caller) { + if (!IncrementalInline) { + return false; + } + + if (DelayAfterInliningCutoff) { + return true; + } else if (callee->force_inline() || caller->is_compiled_lambda_form()) { + return true; + } else { + return false; + } +} + // Return true for methods that shouldn't be inlined early so that // they are easier to analyze and optimize as intrinsics. bool Compile::should_delay_string_inlining(ciMethod* call_method, JVMState* jvms) { @@ -551,6 +567,7 @@ void Parse::do_call() { // Bump max node limit for JSR292 users if (bc() == Bytecodes::_invokedynamic || orig_callee->is_method_handle_intrinsic()) { C->set_max_node_limit(3*MaxNodeLimit); + C->set_node_count_inlining_cutoff(LiveNodeCountInliningCutoff); } // uncommon-trap when callee is unloaded, uninitialized or will not link diff --git a/test/hotspot/jtreg/compiler/inlining/TestDelayAfterInliningCutoff.java b/test/hotspot/jtreg/compiler/inlining/TestDelayAfterInliningCutoff.java new file mode 100644 index 00000000000..b9564c20c21 --- /dev/null +++ b/test/hotspot/jtreg/compiler/inlining/TestDelayAfterInliningCutoff.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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.inlining; + +import compiler.lib.ir_framework.*; + +/* + * @test + * @bug 8382700 + * @summary verify that method inlining continues during incremental inline after it has stopped + * during parsing due to NodeCountInliningCutoff + * @library /test/lib / + * @run driver ${test.main.class} + */ +public class TestDelayAfterInliningCutoff { + public static void main(String[] args) { + var framework = new TestFramework(); + framework.setDefaultWarmup(1); + framework.addFlags("-XX:+UnlockDiagnosticVMOptions"); + // Workaround the issue with incorrect call count at call sites + framework.addFlags("-XX:MinInlineFrequencyRatio=0"); + framework.addScenarios(new Scenario(0, "-XX:+DelayAfterInliningCutoff")); + framework.addScenarios(new Scenario(1, "-XX:-DelayAfterInliningCutoff")); + framework.start(); + } + + @Test + @IR(failOn = IRNode.CALL, applyIf = {"DelayAfterInliningCutoff", "true"}) + @IR(counts = {IRNode.CALL, ">= 1"}, applyIf = {"DelayAfterInliningCutoff", "false"}) + public static void test() { + call1(); + call1(); + call1(); + call1(); + } + + private static void call1() { + call2(); + call2(); + call2(); + call2(); + } + + private static void call2() { + call3(); + call3(); + call3(); + call3(); + } + + private static void call3() { + call4(); + call4(); + call4(); + call4(); + } + + private static void call4() { + call5(); + call5(); + call5(); + call5(); + } + + private static void call5() { + call6(); + call6(); + call6(); + call6(); + } + + private static void call6() {} +} diff --git a/test/micro/org/openjdk/bench/java/lang/foreign/FFMStructAccessTest.java b/test/micro/org/openjdk/bench/java/lang/foreign/FFMStructAccessTest.java new file mode 100644 index 00000000000..13f18f165bc --- /dev/null +++ b/test/micro/org/openjdk/bench/java/lang/foreign/FFMStructAccessTest.java @@ -0,0 +1,1466 @@ +/* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.bench.java.lang.foreign; + +import java.lang.foreign.*; +import java.lang.invoke.*; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.concurrent.*; +import jdk.internal.misc.Unsafe; +import org.openjdk.jmh.annotations.*; + +@State(Scope.Benchmark) +@Fork(value = 1, jvmArgs = { "--enable-native-access=ALL-UNNAMED", "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED" }) +@Warmup(iterations = 5, time = 1) +@Measurement(iterations = 3, time = 1) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +public class FFMStructAccessTest { + + private static final int ITERS = 10; + + private static final Unsafe UNSAFE = Utils.unsafe; + + private static final GroupLayout LAYOUT = MemoryLayout.structLayout( + ValueLayout.JAVA_INT_UNALIGNED.withName("x"), + ValueLayout.JAVA_INT_UNALIGNED.withName("y"), + ValueLayout.JAVA_INT_UNALIGNED.withName("z"), + ValueLayout.JAVA_INT_UNALIGNED.withName("w") + ).withName("vec4i"); + + private static final VarHandle X = LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("x")) + .withInvokeExactBehavior(); + private static final VarHandle Y = LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("y")) + .withInvokeExactBehavior(); + private static final VarHandle Z = LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("z")) + .withInvokeExactBehavior(); + private static final VarHandle W = LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("w")) + .withInvokeExactBehavior(); + private static final MemorySegment EVERYTHING = MemorySegment.NULL.reinterpret(Long.MAX_VALUE); + + public record Vec4iSegment(MemorySegment segment) { + int x() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 0L); } + int y() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 4L); } + int z() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 8L); } + int w() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 12L); } + + Vec4iSegment x(int value) { + segment.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, value); + return this; + } + Vec4iSegment y(int value) { + segment.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, value); + return this; + } + Vec4iSegment z(int value) { + segment.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, value); + return this; + } + Vec4iSegment w(int value) { + segment.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, value); + return this; + } + } + + public record Vec4iSegmentVH(MemorySegment segment) { + int x() { return (int)X.get(segment, 0L); } + int y() { return (int)Y.get(segment, 0L); } + int z() { return (int)Z.get(segment, 0L); } + int w() { return (int)W.get(segment, 0L); } + + Vec4iSegmentVH x(int value) { + X.set(segment, 0L, value); + return this; + } + Vec4iSegmentVH y(int value) { + Y.set(segment, 0L, value); + return this; + } + Vec4iSegmentVH z(int value) { + Z.set(segment, 0L, value); + return this; + } + Vec4iSegmentVH w(int value) { + W.set(segment, 0L, value); + return this; + } + } + + public record Vec4iSegmentIndirect(MemorySegment segment) { + int x() { return xInternal(); } + int y() { return yInternal(); } + int z() { return zInternal(); } + int w() { return wInternal(); } + + Vec4iSegmentIndirect x(int value) { + xInternal(value); + return this; + } + Vec4iSegmentIndirect y(int value) { + yInternal(value); + return this; + } + Vec4iSegmentIndirect z(int value) { + zInternal(value); + return this; + } + Vec4iSegmentIndirect w(int value) { + wInternal(value); + return this; + } + + int xInternal() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 0L); } + int yInternal() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 4L); } + int zInternal() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 8L); } + int wInternal() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 12L); } + + void xInternal(int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, value); } + void yInternal(int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, value); } + void zInternal(int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, value); } + void wInternal(int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, value); } + } + + public record Vec4iSegmentDeep(MemorySegment segment) { + int x() { return xA(); } + int y() { return yA(); } + int z() { return zA(); } + int w() { return wA(); } + + Vec4iSegmentDeep x(int value) { + xA(value); + return this; + } + Vec4iSegmentDeep y(int value) { + yA(value); + return this; + } + Vec4iSegmentDeep z(int value) { + zA(value); + return this; + } + Vec4iSegmentDeep w(int value) { + wA(value); + return this; + } + + int xA() { return xB(); } + int yA() { return yB(); } + int zA() { return zB(); } + int wA() { return wB(); } + + int xB() { return xC(); } + int yB() { return yC(); } + int zB() { return zC(); } + int wB() { return wC(); } + + int xC() { return xD(); } + int yC() { return yD(); } + int zC() { return zD(); } + int wC() { return wD(); } + + int xD() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 0L); } + int yD() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 4L); } + int zD() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 8L); } + int wD() { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 12L); } + + void xA(int value) { xB(value); } + void yA(int value) { yB(value); } + void zA(int value) { zB(value); } + void wA(int value) { wB(value); } + + void xB(int value) { xC(value); } + void yB(int value) { yC(value); } + void zB(int value) { zC(value); } + void wB(int value) { wC(value); } + + void xC(int value) { xD(value); } + void yC(int value) { yD(value); } + void zC(int value) { zD(value); } + void wC(int value) { wD(value); } + + void xD(int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, value); } + void yD(int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, value); } + void zD(int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, value); } + void wD(int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, value); } + } + + public record Vec4iAddressSegment(long address) { + private MemorySegment asSegment() { + return MemorySegment.ofAddress(address).reinterpret(LAYOUT.byteSize()); + } + + int x() { return asSegment().get(ValueLayout.JAVA_INT_UNALIGNED, 0L); } + int y() { return asSegment().get(ValueLayout.JAVA_INT_UNALIGNED, 4L); } + int z() { return asSegment().get(ValueLayout.JAVA_INT_UNALIGNED, 8L); } + int w() { return asSegment().get(ValueLayout.JAVA_INT_UNALIGNED, 12L); } + + Vec4iAddressSegment x(int value) { + asSegment().set(ValueLayout.JAVA_INT_UNALIGNED, 0L, value); + return this; + } + Vec4iAddressSegment y(int value) { + asSegment().set(ValueLayout.JAVA_INT_UNALIGNED, 4L, value); + return this; + } + Vec4iAddressSegment z(int value) { + asSegment().set(ValueLayout.JAVA_INT_UNALIGNED, 8L, value); + return this; + } + Vec4iAddressSegment w(int value) { + asSegment().set(ValueLayout.JAVA_INT_UNALIGNED, 12L, value); + return this; + } + } + + public record Vec4iAddressUnsafe(long address) { + int x() { return UNSAFE.getIntUnaligned(null, address + 0L); } + int y() { return UNSAFE.getIntUnaligned(null, address + 4L); } + int z() { return UNSAFE.getIntUnaligned(null, address + 8L); } + int w() { return UNSAFE.getIntUnaligned(null, address + 12L); } + + Vec4iAddressUnsafe x(int value) { + UNSAFE.putIntUnaligned(null, address + 0L, value); + return this; + } + Vec4iAddressUnsafe y(int value) { + UNSAFE.putIntUnaligned(null, address + 4L, value); + return this; + } + Vec4iAddressUnsafe z(int value) { + UNSAFE.putIntUnaligned(null, address + 8L, value); + return this; + } + Vec4iAddressUnsafe w(int value) { + UNSAFE.putIntUnaligned(null, address + 12L, value); + return this; + } + } + + public record Vec4iAddressUnsafeIndirect(long address) { + int x() { return xInternal(); } + int y() { return yInternal(); } + int z() { return zInternal(); } + int w() { return wInternal(); } + + Vec4iAddressUnsafeIndirect x(int value) { + xInternal(value); + return this; + } + Vec4iAddressUnsafeIndirect y(int value) { + yInternal(value); + return this; + } + Vec4iAddressUnsafeIndirect z(int value) { + zInternal(value); + return this; + } + Vec4iAddressUnsafeIndirect w(int value) { + wInternal(value); + return this; + } + + int xInternal() { return UNSAFE.getIntUnaligned(null, address + 0L); } + int yInternal() { return UNSAFE.getIntUnaligned(null, address + 4L); } + int zInternal() { return UNSAFE.getIntUnaligned(null, address + 8L); } + int wInternal() { return UNSAFE.getIntUnaligned(null, address + 12L); } + + void xInternal(int value) { UNSAFE.putIntUnaligned(null, address + 0L, value); } + void yInternal(int value) { UNSAFE.putIntUnaligned(null, address + 4L, value); } + void zInternal(int value) { UNSAFE.putIntUnaligned(null, address + 8L, value); } + void wInternal(int value) { UNSAFE.putIntUnaligned(null, address + 12L, value); } + } + + public record Vec4iAddressUnsafeDeep(long address) { + int x() { return xA(); } + int y() { return yA(); } + int z() { return zA(); } + int w() { return wA(); } + + Vec4iAddressUnsafeDeep x(int value) { + xA(value); + return this; + } + Vec4iAddressUnsafeDeep y(int value) { + yA(value); + return this; + } + Vec4iAddressUnsafeDeep z(int value) { + zA(value); + return this; + } + Vec4iAddressUnsafeDeep w(int value) { + wA(value); + return this; + } + + int xA() { return xB(); } + int yA() { return yB(); } + int zA() { return zB(); } + int wA() { return wB(); } + + int xB() { return xC(); } + int yB() { return yC(); } + int zB() { return zC(); } + int wB() { return wC(); } + + int xC() { return xD(); } + int yC() { return yD(); } + int zC() { return zD(); } + int wC() { return wD(); } + + int xD() { return UNSAFE.getIntUnaligned(null, address + 0L); } + int yD() { return UNSAFE.getIntUnaligned(null, address + 4L); } + int zD() { return UNSAFE.getIntUnaligned(null, address + 8L); } + int wD() { return UNSAFE.getIntUnaligned(null, address + 12L); } + + void xA(int value) { xB(value); } + void yA(int value) { yB(value); } + void zA(int value) { zB(value); } + void wA(int value) { wB(value); } + + void xB(int value) { xC(value); } + void yB(int value) { yC(value); } + void zB(int value) { zC(value); } + void wB(int value) { wC(value); } + + void xC(int value) { xD(value); } + void yC(int value) { yD(value); } + void zC(int value) { zD(value); } + void wC(int value) { wD(value); } + + void xD(int value) { UNSAFE.putIntUnaligned(null, address + 0L, value); } + void yD(int value) { UNSAFE.putIntUnaligned(null, address + 4L, value); } + void zD(int value) { UNSAFE.putIntUnaligned(null, address + 8L, value); } + void wD(int value) { UNSAFE.putIntUnaligned(null, address + 12L, value); } + } + + public record Vec4iAddressEverything(long address) { + int x() { return EVERYTHING.get(ValueLayout.JAVA_INT_UNALIGNED, address + 0L); } + int y() { return EVERYTHING.get(ValueLayout.JAVA_INT_UNALIGNED, address + 4L); } + int z() { return EVERYTHING.get(ValueLayout.JAVA_INT_UNALIGNED, address + 8L); } + int w() { return EVERYTHING.get(ValueLayout.JAVA_INT_UNALIGNED, address + 12L); } + + Vec4iAddressEverything x(int value) { + EVERYTHING.set(ValueLayout.JAVA_INT_UNALIGNED, address + 0L, value); + return this; + } + Vec4iAddressEverything y(int value) { + EVERYTHING.set(ValueLayout.JAVA_INT_UNALIGNED, address + 4L, value); + return this; + } + Vec4iAddressEverything z(int value) { + EVERYTHING.set(ValueLayout.JAVA_INT_UNALIGNED, address + 8L, value); + return this; + } + Vec4iAddressEverything w(int value) { + EVERYTHING.set(ValueLayout.JAVA_INT_UNALIGNED, address + 12L, value); + return this; + } + } + + public record Vec4iBuffer(ByteBuffer buffer) { + int x() { return buffer.getInt(0); } + int y() { return buffer.getInt(4); } + int z() { return buffer.getInt(8); } + int w() { return buffer.getInt(12); } + + Vec4iBuffer x(int value) { + buffer.putInt(0, value); + return this; + } + Vec4iBuffer y(int value) { + buffer.putInt(4, value); + return this; + } + Vec4iBuffer z(int value) { + buffer.putInt(8, value); + return this; + } + Vec4iBuffer w(int value) { + buffer.putInt(12, value); + return this; + } + } + + public static final class Vec4iStatic { + static int x(MemorySegment segment) { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 0L); } + static int y(MemorySegment segment) { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 4L); } + static int z(MemorySegment segment) { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 8L); } + static int w(MemorySegment segment) { return segment.get(ValueLayout.JAVA_INT_UNALIGNED, 12L); } + + static void x(MemorySegment segment, int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, value); } + static void y(MemorySegment segment, int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, value); } + static void z(MemorySegment segment, int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, value); } + static void w(MemorySegment segment, int value) { segment.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, value); } + } + + private MemorySegment src = Arena.global().allocate(LAYOUT); + private MemorySegment dst = Arena.global().allocate(LAYOUT); + + private Vec4iSegment ss = new Vec4iSegment(src); + private Vec4iSegment ds = new Vec4iSegment(dst); + + private Vec4iSegmentVH ssv = new Vec4iSegmentVH(src); + private Vec4iSegmentVH dsv = new Vec4iSegmentVH(dst); + + private Vec4iSegmentIndirect ssi = new Vec4iSegmentIndirect(src); + private Vec4iSegmentIndirect dsi = new Vec4iSegmentIndirect(dst); + + private Vec4iSegmentDeep ssdp = new Vec4iSegmentDeep(src); + private Vec4iSegmentDeep dsdp = new Vec4iSegmentDeep(dst); + + private Vec4iAddressSegment sas = new Vec4iAddressSegment(src.address()); + private Vec4iAddressSegment das = new Vec4iAddressSegment(dst.address()); + + private Vec4iAddressUnsafe sau = new Vec4iAddressUnsafe(src.address()); + private Vec4iAddressUnsafe dau = new Vec4iAddressUnsafe(dst.address()); + + private Vec4iAddressUnsafeIndirect saui = new Vec4iAddressUnsafeIndirect(src.address()); + private Vec4iAddressUnsafeIndirect daui = new Vec4iAddressUnsafeIndirect(dst.address()); + + private Vec4iAddressUnsafeDeep saud = new Vec4iAddressUnsafeDeep(src.address()); + private Vec4iAddressUnsafeDeep daud = new Vec4iAddressUnsafeDeep(dst.address()); + + private Vec4iAddressEverything sae = new Vec4iAddressEverything(src.address()); + private Vec4iAddressEverything dae = new Vec4iAddressEverything(dst.address()); + + private Vec4iBuffer sb = new Vec4iBuffer(src.asByteBuffer().order(ByteOrder.nativeOrder())); + private Vec4iBuffer db = new Vec4iBuffer(dst.asByteBuffer().order(ByteOrder.nativeOrder())); + + // ------------------ + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copyUnsafeInline() { + var d = this.dst.address(); + var s = this.src.address(); + + for (var i = 0; i < ITERS; i++) { + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + + UNSAFE.putIntUnaligned(null, d + 0L, UNSAFE.getIntUnaligned(null, s + 0L)); + UNSAFE.putIntUnaligned(null, d + 4L, UNSAFE.getIntUnaligned(null, s + 4L)); + UNSAFE.putIntUnaligned(null, d + 8L, UNSAFE.getIntUnaligned(null, s + 8L)); + UNSAFE.putIntUnaligned(null, d + 12L, UNSAFE.getIntUnaligned(null, s + 12L)); + } + } + + // ------------------ + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copySegmentInline() { + var dst = this.dst; + var src = this.src; + + for (var i = 0; i < ITERS; i++) { + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + } + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copySegmentInlineDouble() { + var dst = this.dst; + var src = this.src; + + for (var i = 0; i < ITERS; i++) { + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 0L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 0L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 4L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 4L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 8L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 8L)); + dst.set(ValueLayout.JAVA_INT_UNALIGNED, 12L, src.get(ValueLayout.JAVA_INT_UNALIGNED, 12L)); + } + } + + // ------------------ + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copySegmentVHInline() { + var d = this.ds; + var s = this.ss; + + for (var i = 0; i < ITERS; i++) { + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + + X.set(d.segment, 0L, (int)X.get(s.segment, 0L)); + Y.set(d.segment, 0L, (int)Y.get(s.segment, 0L)); + Z.set(d.segment, 0L, (int)Z.get(s.segment, 0L)); + W.set(d.segment, 0L, (int)W.get(s.segment, 0L)); + } + } + + // ------------------ + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copyUnsafe() { + var d = this.dau; + var s = this.sau; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copyUnsafeIndirect() { + var d = this.daui; + var s = this.saui; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copyUnsafeDeep() { + var d = this.daud; + var s = this.saud; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copyUnsafeDeepDouble() { + var d = this.daud; + var s = this.saud; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copySegmentDeep() { + var d = this.dsdp; + var s = this.ssdp; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copySegmentDeepDouble() { + var d = this.dsdp; + var s = this.ssdp; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } + + // ------------------ + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copySegment() { + var d = this.ds; + var s = this.ss; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } + + // ------------------ + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copySegmentVH() { + var d = this.dsv; + var s = this.ssv; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } + + // ------------------ + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copySegmentReinterpret() { + var d = this.das; + var s = this.sas; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copySegmentEverything() { + var d = this.dae; + var s = this.sae; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copyBuffer() { + var d = this.db; + var s = this.sb; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copyBufferInline() { + var d = this.db.buffer; + var s = this.sb.buffer; + + for (var i = 0; i < ITERS; i++) { + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + + d.putInt(0, s.getInt(0)); + d.putInt(4, s.getInt(4)); + d.putInt(8, s.getInt(8)); + d.putInt(12, s.getInt(12)); + } + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copySegmentStaticAccessors() { + var d = this.dst; + var s = this.src; + + for (var i = 0; i < ITERS; i++) { + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + + Vec4iStatic.x(d, Vec4iStatic.x(s)); + Vec4iStatic.y(d, Vec4iStatic.y(s)); + Vec4iStatic.z(d, Vec4iStatic.z(s)); + Vec4iStatic.w(d, Vec4iStatic.w(s)); + } + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + public void copySegmentIndirect() { + var d = this.dsi; + var s = this.ssi; + + for (var i = 0; i < ITERS; i++) { + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + d.x(s.x()).y(s.y()).z(s.z()).w(s.w()); + } + } +}