diff options
author | 2022-02-10 18:03:34 +0530 | |
---|---|---|
committer | 2022-02-15 11:32:16 +0000 | |
commit | b414a4cc18a9e46b2674dcc81bbe1742e9fe5022 (patch) | |
tree | a50b959c266430813f81783aadf14109743a8291 /test/641-checker-arraycopy | |
parent | 4f5b7cb3dfef3ea175439a8a541f8c9f9458d34a (diff) |
Intrinsify System.ArrayCopy for Primitive data types
This patch implements System.ArrayCopy intrinsic for
byte and int data types
14% improvement in microbench below:
public static void time_System_arrayCopy_byte(int reps) {
byte[] src = new byte[8192];
for (int rep = 0; rep < reps; ++rep) {
byte[] dst = new byte[8192];
System.arraycopy(src, 0, dst, 0, 8192);
}
}
public static void time_System_arrayCopy_byte(int reps) {
int[] src = new int[8192];
for (int rep = 0; rep < reps; ++rep) {
int[] dst = new int[8192];
System.arraycopy(src, 0, dst, 0, 8192);
}
}
Time for base version: 4057 ms
Time for intrinsic version: 3487 ms
Test: ./art/test/testrunner/testrunner.py --host --optimizing
Signed-off-by: Shalini Salomi Bodapati <shalini.salomi.bodapati@intel.com>
Change-Id: I87aced30330d031efea04554c6fa0c05f84e3bb9
Diffstat (limited to 'test/641-checker-arraycopy')
-rw-r--r-- | test/641-checker-arraycopy/src/Main.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/641-checker-arraycopy/src/Main.java b/test/641-checker-arraycopy/src/Main.java index 939fc00b12..bede9026f7 100644 --- a/test/641-checker-arraycopy/src/Main.java +++ b/test/641-checker-arraycopy/src/Main.java @@ -22,8 +22,8 @@ public class Main { /// CHECK-START-X86: void Main.typedCopy(java.lang.Object, byte[]) disassembly (after) /// CHECK: InvokeStaticOrDirect method_name:java.lang.System.arraycopy intrinsic:SystemArrayCopy /// CHECK-NOT: call - /// CHECK: InvokeStaticOrDirect method_name:java.lang.System.arraycopy intrinsic:SystemArrayCopy - /// CHECK: call + /// CHECK: InvokeStaticOrDirect method_name:java.lang.System.arraycopy intrinsic:SystemArrayCopyByte + /// CHECK-NOT: call /// CHECK: ReturnVoid public static void typedCopy(Object o, byte[] foo) { System.arraycopy(o, 1, o, 0, 1); @@ -40,8 +40,8 @@ public class Main { /// CHECK-START-X86: void Main.untypedCopyCaller(java.lang.Object, byte[]) disassembly (after) /// CHECK: InvokeStaticOrDirect method_name:java.lang.System.arraycopy intrinsic:SystemArrayCopy /// CHECK-NOT: call - /// CHECK: InvokeStaticOrDirect method_name:java.lang.System.arraycopy intrinsic:SystemArrayCopy - /// CHECK: call + /// CHECK: InvokeStaticOrDirect method_name:java.lang.System.arraycopy intrinsic:SystemArrayCopyByte + /// CHECK-NOT: call /// CHECK: ReturnVoid public static void untypedCopyCaller(Object o, byte[] array) { untypedCopy(o, array); |