powerpc/64: memcmp() optimization
v3 cover powerpc/64: memcmp() optimization
From: Simon Guo <[email protected]>
There is some room to optimize memcmp() in powerpc 64 bits version for following 2 cases:
(1) Even src/dst addresses are not aligned with 8 bytes at the beginning, memcmp() can align them and go with .Llong comparision mode without fallback to .Lshort comparision mode do compare buffer byte by byte.
(2) VMX instructions can be used to speed up for large size comparision, currently the threshold is set for 4K bytes.
glibc commit dec4a7105e (powerpc: Improve memcmp performance for POWER8) did the similar. Thanks Cyril Bur's information.
This patch set also updates memcmp selftest case to make it compiled and incorporate large size comparison case.
v2 -> v3:
- add optimization for src/dst with different offset against 8 bytes boundary.
- renamed some label names.
- reworked some comments from Cyril Bur, such as fill the pipeline, and use VMX when size == 4K.
- fix a bug of enter/exit_vmx_ops pairness issue. And revised test case to test whether enter/exit_vmx_ops are paired.
v1 -> v2:
- update 8bytes unaligned bytes comparison method.
- fix a VMX comparision bug.
- enhanced the original memcmp() selftest.
- add powerpc/64 to subject/commit message.
Simon Guo (3):
powerpc/64: Align bytes before fall back to .Lshort in powerpc64
memcmp().
powerpc/64: enhance memcmp() with VMX instruction for long bytes
comparision
powerpc:selftest update memcmp_64 selftest for VMX implementation
arch/powerpc/include/asm/asm-prototypes.h | 4 +- arch/powerpc/lib/copypage_power7.S | 4 +- arch/powerpc/lib/memcmp_64.S | 374 ++++++++++++++++++++- arch/powerpc/lib/memcpy_power7.S | 6 +- arch/powerpc/lib/vmx-helper.c | 4 +- .../selftests/powerpc/copyloops/asm/ppc_asm.h | 4 +- .../selftests/powerpc/stringloops/asm/ppc_asm.h | 22 ++ .../testing/selftests/powerpc/stringloops/memcmp.c | 98 ++++-- 8 files changed, 476 insertions(+), 40 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v3 1/3 powerpc/64: Align bytes before fall back to .Lshort in powerpc64 memcmp().
From: Simon Guo <[email protected]>
Currently memcmp() 64bytes version in powerpc will fall back to .Lshort (compare per byte mode) if either src or dst address is not 8 bytes aligned. It can be opmitized in 2 situations:
1) if both addresses are with the same offset with 8 bytes boundary:memcmp() can compare the unaligned bytes within 8 bytes boundary firstly and then compare the rest 8-bytes-aligned content with .Llong mode.
2) If src/dst addrs are not with the same offset of 8 bytes boundary:memcmp() can align src addr with 8 bytes, increment dst addr accordingly,
then load src with aligned mode and load dst with unaligned mode.
This patch optmizes memcmp() behavior in the above 2 situations.
Tested with both little/big endian. Performance result below is based on little endian.
Following is the test result with src/dst having the same offset case:
(a similar result was observed when src/dst having different offset):
(1) 256 bytes
Test with the existing tools/testing/selftests/powerpc/stringloops/memcmp:
- without patch
29.773018302 seconds time elapsed ( +- 0.09% )
- with patch
16.485568173 seconds time elapsed ( +- 0.02% ) -> There is ~+80% percent improvement
(2) 32 bytes
To observe performance impact on < 32 bytes, modify tools/testing/selftests/powerpc/stringloops/memcmp.c with following:
-------
#include <string.h>
#include "utils.h"
-#define SIZE 256
+#define SIZE 32
#define ITERATIONS 10000
int test_memcmp(const void *s1, const void *s2, size_t n);
--------
- Without patch
0.244746482 seconds time elapsed ( +- 0.36%)
- with patch
0.215069477 seconds time elapsed ( +- 0.51%) -> There is ~+13% improvement
(3) 0~8 bytes
To observe <8 bytes performance impact, modify tools/testing/selftests/powerpc/stringloops/memcmp.c with following:
-------
#include <string.h>
#include "utils.h"
-#define SIZE 256
-#define ITERATIONS 10000
+#define SIZE 8
+#define ITERATIONS 1000000
int test_memcmp(const void *s1, const void *s2, size_t n);
-------
- Without patch
1.845642503 seconds time elapsed ( +- 0.12% )
- With patch
1.849767135 seconds time elapsed ( +- 0.26% )
-> They are nearly the same. (-0.2%)
--- arch/powerpc/lib/memcmp_64.S | 143 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 136 insertions(+), 7 deletions(-)
arch/powerpc/lib/memcmp_64.S +136 -7
@@ -24,28 +24,41 @@ #define rH r31 #ifdef __LITTLE_ENDIAN__ +#define LH lhbrx +#define LW lwbrx #define LD ldbrx #else +#define LH lhzx +#define LW lwzx #define LD ldx #endif +/* + * There are 2 categories for memcmp: + * 1) src/dst has the same offset to the 8 bytes boundary. The handlers + * are named like .Lsameoffset_xxxx + * 2) src/dst has different offset to the 8 bytes boundary. The handlers + * are named like .Ldiffoffset_xxxx + */ _GLOBAL(memcmp) cmpdi cr1,r5,0 - /* Use the short loop if both strings are not 8B aligned */ - or r6,r3,r4 + /* Use the short loop if the src/dst addresses are not + * with the same offset of 8 bytes align boundary. + */ + xor r6,r3,r4 andi. r6,r6,7 - /* Use the short loop if length is less than 32B */ - cmpdi cr6,r5,31 + /* Fall back to short loop if compare at aligned addrs + * with less than 8 bytes. + */ + cmpdi cr6,r5,7 beq cr1,.Lzero - bne .Lshort - bgt cr6,.Llong + bgt cr6,.Lno_short .Lshort: mtctr r5 - 1: lbz rA,0(r3) lbz rB,0(r4) subf. rC,rB,rA
@@ -78,11 +91,90 @@ _GLOBAL(memcmp) li r3,0 blr +.Lno_short: + dcbt 0,r3 + dcbt 0,r4 + bne .Ldiffoffset_8bytes_make_align_start + b .Lsameoffset_8bytes_make_align_start + +.Lsameoffset_8bytes_make_align_start: + /* attempt to compare bytes not aligned with 8 bytes so that + * rest comparison can run based on 8 bytes alignment. + */ + andi. r6,r3,7 + + /* Try to compare the first double word which is not 8 bytes aligned: + * load the first double word at (src & ~7UL) and shift left appropriate + * bits before comparision. + */ + clrlwi r6,r3,29 + rlwinm r6,r6,3,0,28 + beq .Lsameoffset_8bytes_aligned + clrrdi r3,r3,3 + clrrdi r4,r4,3 + LD rA,0,r3 + LD rB,0,r4 + sld rA,rA,r6 + sld rB,rB,r6 + cmpld cr0,rA,rB + srwi r6,r6,3 + bne cr0,.LcmpAB_lightweight + subfic r6,r6,8 + subfc. r5,r6,r5 + addi r3,r3,8 + addi r4,r4,8 + beq .Lzero + +.Lsameoffset_8bytes_aligned: + /* now we are aligned with 8 bytes. + * Use .Llong loop if left cmp bytes are equal or greater than 32B. + */ + cmpdi cr6,r5,31 + bgt cr6,.Llong + +.Lcmp_lt32bytes: + /* compare 1 ~ 32 bytes, at least r3 addr is 8 bytes aligned now */ + cmpdi cr5,r5,7 + srdi r0,r5,3 + ble cr5,.Lcmp_rest_lt8bytes + + /* handle 8 ~ 31 bytes */ + clrldi r5,r5,61 + mtctr r0 +2: + LD rA,0,r3 + LD rB,0,r4 + cmpld cr0,rA,rB + addi r3,r3,8 + addi r4,r4,8 + bne cr0,.LcmpAB_lightweight + bdnz 2b + + cmpwi r5,0 + beq .Lzero + +.Lcmp_rest_lt8bytes: + /* Here we have only less than 8 bytes to compare with. at least s1 + * Address is aligned with 8 bytes. + * The next double words are load and shift right with appropriate + * bits. + */ + subfic r6,r5,8 + rlwinm r6,r6,3,0,28 + LD rA,0,r3 + LD rB,0,r4 + srd rA,rA,r6 + srd rB,rB,r6 + cmpld cr0,rA,rB + bne cr0,.LcmpAB_lightweight + b .Lzero + .Lnon_zero: mr r3,rC blr .Llong: + /* At least s1 addr is aligned with 8 bytes */ li off8,8 li off16,16 li off24,24
@@ -232,4 +324,41 @@ _GLOBAL(memcmp) ld r28,-32(r1) ld r27,-40(r1) blr + +.LcmpAB_lightweight: /* skip NV GPRS restore */ + li r3,1 + bgt cr0,8f + li r3,-1 +8: + blr + +.Ldiffoffset_8bytes_make_align_start: + /* now try to align s1 with 8 bytes */ + andi. r6,r3,0x7 + rlwinm r6,r6,3,0,28 + beq .Ldiffoffset_align_s1_8bytes + + clrrdi r3,r3,3 + LD rA,0,r3 + LD rB,0,r4 /* unaligned load */ + sld rA,rA,r6 + srd rA,rA,r6 + srd rB,rB,r6 + cmpld cr0,rA,rB + srwi r6,r6,3 + bne cr0,.LcmpAB_lightweight + + subfic r6,r6,8 + subfc. r5,r6,r5 + addi r3,r3,8 + add r4,r4,r6 + + beq .Lzero + +.Ldiffoffset_align_s1_8bytes: + /* now s1 is aligned with 8 bytes. */ + cmpdi cr5,r5,31 + ble cr5,.Lcmp_lt32bytes + b .Llong + EXPORT_SYMBOL(memcmp)
Signature · 1 line
1.8.3.1
PATCH v3 2/3 powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision
In reply to [email protected]From: Simon Guo <[email protected]>
This patch add VMX primitives to do memcmp() in case the compare size exceeds 4K bytes. KSM feature can benefit from this.
Test result with following test program(replace the "^>" with ""):
------
Quoted 8 lines
# cat tools/testing/selftests/powerpc/stringloops/memcmp.c #include <malloc.h> #include <stdlib.h> #include <string.h> #include <time.h> #include "utils.h" #define SIZE (1024 * 1024 * 900) #define ITERATIONS 40
int test_memcmp(const void *s1, const void *s2, size_t n);
static int testcase(void)
{
char *s1;
char *s2;
unsigned long i;
s1 = memalign(128, SIZE);
if (!s1) {
perror("memalign");
exit(1);
}
s2 = memalign(128, SIZE);
if (!s2) {
perror("memalign");
exit(1);
}
for (i = 0; i < SIZE; i++) {
s1[i] = i & 0xff;
s2[i] = i & 0xff;
}
for (i = 0; i < ITERATIONS; i++) {
int ret = test_memcmp(s1, s2, SIZE);
if (ret) {
printf("return %d at[%ld]! should have returned zero\n", ret, i);
abort();
}
}
return 0;
}int main(void)
{
return test_harness(testcase, "memcmp");
}------
Without this patch (but with the first patch "powerpc/64: Align bytes before fall back to .Lshort in powerpc64 memcmp()." in the series):
4.726728762 seconds time elapsed ( +- 3.54%)
With VMX patch:
4.234335473 seconds time elapsed ( +- 2.63%)
There is ~+10% improvement.
Testing with unaligned and different offset version (make s1 and s2 shift random offset within 16 bytes) can archieve higher improvement than 10%..
--- arch/powerpc/include/asm/asm-prototypes.h | 4 +- arch/powerpc/lib/copypage_power7.S | 4 +- arch/powerpc/lib/memcmp_64.S | 231 ++++++++++++++++++++++++++++++ arch/powerpc/lib/memcpy_power7.S | 6 +- arch/powerpc/lib/vmx-helper.c | 4 +- 5 files changed, 240 insertions(+), 9 deletions(-)
arch/powerpc/include/asm/asm-prototypes.h +2 -2
@@ -49,8 +49,8 @@ void __trace_hcall_exit(long opcode, unsigned long retval,/* VMX copying */ int enter_vmx_usercopy (void );int exit_vmx_usercopy (void ); -int enter_vmx_copy (void ); -void *exit_vmx_copy (void *dest); +int enter_vmx_ops (void ); +void *exit_vmx_ops (void *dest);/* Traps */ long machine_check_early (struct pt_regs *regs);
arch/powerpc/lib/copypage_power7.S +2 -2
@@ -60,7 +60,7 @@ _GLOBAL(copypage_power7) std r4,-STACKFRAMESIZE+STK_REG(R30)(r1) std r0,16(r1) stdu r1,-STACKFRAMESIZE(r1) - bl enter_vmx_copy + bl enter_vmx_ops cmpwi r3,0 ld r0,STACKFRAMESIZE+16(r1) ld r3,STK_REG(R31)(r1)
@@ -103,7 +103,7 @@ _GLOBAL(copypage_power7) addi r3,r3,128 bdnz 1b - b exit_vmx_copy /* tail call optimise */ + b exit_vmx_ops /* tail call optimise */ #else li r0,(PAGE_SIZE/128)
arch/powerpc/lib/memcmp_64.S +231 -0
262 lines not on this page · raw message
arch/powerpc/lib/memcpy_power7.S +3 -3
@@ -230,7 +230,7 @@ _GLOBAL(memcpy_power7) std r5,-STACKFRAMESIZE+STK_REG(R29)(r1) std r0,16(r1) stdu r1,-STACKFRAMESIZE(r1) - bl enter_vmx_copy + bl enter_vmx_ops cmpwi cr1,r3,0 ld r0,STACKFRAMESIZE+16(r1) ld r3,STK_REG(R31)(r1)
@@ -448,7 +448,7 @@ _GLOBAL(memcpy_power7) 15: addi r1,r1,STACKFRAMESIZE ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) - b exit_vmx_copy /* tail call optimise */ + b exit_vmx_ops /* tail call optimise */ .Lvmx_unaligned_copy: /* Get the destination 16B aligned */
@@ -652,5 +652,5 @@ _GLOBAL(memcpy_power7) 15: addi r1,r1,STACKFRAMESIZE ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) - b exit_vmx_copy /* tail call optimise */ + b exit_vmx_ops /* tail call optimise */ #endif /* CONFIG_ALTIVEC */
arch/powerpc/lib/vmx-helper.c +2 -2
@@ -53,7 +53,7 @@ int exit_vmx_usercopy(void)return 0 ; } -int enter_vmx_copy (void ) +int enter_vmx_ops (void ) {if (in_interrupt ())return 0 ;
@@ -70,7 +70,7 @@ int enter_vmx_copy(void)* passed a pointer to the destination which we return as required by a * memcpy implementation. */ -void *exit_vmx_copy (void *dest) +void *exit_vmx_ops (void *dest) {disable_kernel_altivec ();preempt_enable ();
Signature · 1 line
1.8.3.1
PATCH v3 3/3 powerpc:selftest update memcmp_64 selftest for VMX implementation
In reply to [email protected]From: Simon Guo <[email protected]>
This patch adjust selftest memcmp_64 so that memcmp selftest can be compiled successfully.
It also adds testcases for:
- memcmp over 4K bytes size.
- s1/s2 with different/random offset on 16 bytes boundary.
- enter/exit_vmx_ops pairness.
--- .../selftests/powerpc/copyloops/asm/ppc_asm.h | 4 +- .../selftests/powerpc/stringloops/asm/ppc_asm.h | 22 +++++ .../testing/selftests/powerpc/stringloops/memcmp.c | 98 +++++++++++++++++----- 3 files changed, 100 insertions(+), 24 deletions(-)
tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h +2 -2
@@ -35,11 +35,11 @@ li r3,0 blr -FUNC_START(enter_vmx_copy) +FUNC_START(enter_vmx_ops) li r3,1 blr -FUNC_START(exit_vmx_copy) +FUNC_START(exit_vmx_ops) blr FUNC_START(memcpy_power7)
tools/testing/selftests/powerpc/stringloops/asm/ppc_asm.h +22 -0
@@ -1,3 +1,5 @@ +#ifndef _PPC_ASM_H +#define __PPC_ASM_H#include <ppc-asm.h> #ifndef r1
@@ -5,3 +7,23 @@#endif #define _GLOBAL (A ) FUNC_START(test_ ## A) + +#define CONFIG_ALTIVEC + +#define R14 r14 +#define R15 r15 +#define R16 r16 +#define R17 r17 +#define R18 r18 +#define R19 r19 +#define R20 r20 +#define R21 r21 +#define R22 r22 +#define R29 r29 +#define R30 r30 +#define R31 r31 + +#define STACKFRAMESIZE 256 +#define STK_REG (i) (112 + ((i)-14)*8) + +#endif
tools/testing/selftests/powerpc/stringloops/memcmp.c +76 -22
166 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Re: [PATCH v3 3/3] powerpc:selftest update memcmp_64 selftest for VMX implementation
Quoted 5 lines · On Fri, 2017-10-13 at 12:30 +0800, [email protected] wrote:
From: Simon Guo <[email protected]>
This patch adjust selftest
memcmp_64so that memcmp selftest can be compiled successfully.
Do they not compile at the moment?
Quoted 5 lines
It also adds testcases for:
- memcmp over 4K bytes size.
- s1/s2 with different/random offset on 16 bytes boundary.
- enter/exit_vmx_ops pairness.
This is a great idea, just a thought though - perhaps it might make more sense to have each condition be tested for in a separate binary rather than a single binary that tests everything.
Quoted 231 lines
Signed-off-by Simon Guo <[email protected]>--- .../selftests/powerpc/copyloops/asm/ppc_asm.h | 4 +- .../selftests/powerpc/stringloops/asm/ppc_asm.h | 22 +++++ .../testing/selftests/powerpc/stringloops/memcmp.c | 98 +++++++++++++++++----- 3 files changed, 100 insertions(+), 24 deletions(-)tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h +2
-2@@ -35,11 +35,11 @@ li r3,0 blr -FUNC_START(enter_vmx_copy) +FUNC_START(enter_vmx_ops) li r3,1 blr -FUNC_START(exit_vmx_copy) +FUNC_START(exit_vmx_ops) blr FUNC_START(memcpy_power7)tools/testing/selftests/powerpc/stringloops/asm/ppc_asm.h +22
-0@@ -1,3 +1,5 @@ +#ifndef _PPC_ASM_H +#define __PPC_ASM_H#include <ppc-asm.h> #ifndef r1@@ -5,3 +7,23 @@#endif #define _GLOBAL (A ) FUNC_START(test_ ## A) + +#define CONFIG_ALTIVEC + +#define R14 r14 +#define R15 r15 +#define R16 r16 +#define R17 r17 +#define R18 r18 +#define R19 r19 +#define R20 r20 +#define R21 r21 +#define R22 r22 +#define R29 r29 +#define R30 r30 +#define R31 r31 + +#define STACKFRAMESIZE 256 +#define STK_REG (i) (112 + ((i)-14)*8) + +#endif tools/testing/selftests/powerpc/stringloops/memcmp.c +76
-22@@ -1,20 +1,40 @@#include <malloc.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include "utils.h" #define SIZE 256#define ITERATIONS 10000 +#define LARGE_SIZE (5 * 1024) +#define LARGE_ITERATIONS 1000 +#define LARGE_MAX_OFFSET 32 +#define LARGE_SIZE_START 4096 + +#define MAX_OFFSET_DIFF_S1_S2 48 + +int vmx_count; +int enter_vmx_ops (void ) +{ + vmx_count++; +return 1 ; +} + +void exit_vmx_ops (void ) +{ + vmx_count--; +}int test_memcmp (const void *s1,const void *s2,size_t n);/* test all offsets and lengths */ -static void test_one (char *s1,char *s2) +static void test_one (char *s1,char *s2,unsigned long max_offset, +unsigned long size_start,unsigned long max_size) {unsigned long offset, size; -for (offset =0 ; offset <SIZE ; offset++) { -for (size =0 ; size < (SIZE -offset); size++) { +for (offset =0 ; offset < max_offset; offset++) { +for (size = size_start; size < (max_size - offset); size++) {int x, y;unsigned long i;@@ -34,70 +54,104 @@ static void test_one(char *s1, char *s2)printf ("\n" );abort (); } + +if (vmx_count !=0 ) { +printf ("vmx enter/exit not paired.(offset:%ld size:%ld s1:%p s2:%p vc:%d\n" , + offset, size, s1, s2, vmx_count); +printf ("\n" ); +abort (); + } } } } -static int testcase (void ) +static int testcase (bool islarge) {char *s1;char *s2;unsigned long i; - s1 =memalign (128 ,SIZE ); +unsigned long comp_size = (islarge ?LARGE_SIZE :SIZE ); +unsigned long alloc_size = comp_size +MAX_OFFSET_DIFF_S1_S2 ; +int iterations = islarge ?LARGE_ITERATIONS :ITERATIONS ; + + s1 =memalign (128 , alloc_size);if (!s1) {perror ("memalign" );exit (1 ); } - s2 =memalign (128 ,SIZE ); + s2 =memalign (128 , alloc_size);if (!s2) {perror ("memalign" );exit (1 ); } -srandom (1 ); +srandom (time (0 )); -for (i =0 ; i <ITERATIONS ; i++) { +for (i =0 ; i < iterations; i++) {unsigned long j;unsigned long change; +char *rand_s1 = s1; +char *rand_s2 = s2; -for (j =0 ; j <SIZE ; j++) +for (j =0 ; j < alloc_size; j++) s1[j] =random (); -memcpy (s2, s1,SIZE ); + rand_s1 +=random () %MAX_OFFSET_DIFF_S1_S2 ; + rand_s2 +=random () %MAX_OFFSET_DIFF_S1_S2 ; +memcpy (rand_s2, rand_s1, comp_size);/* change one byte */ - change =random () %SIZE ; - s2[change] =random () &0xff ; - -test_one (s1, s2); + change =random () % comp_size; + rand_s2[change] =random () &0xff ; + +if (islarge) +test_one (rand_s1, rand_s2,LARGE_MAX_OFFSET , +LARGE_SIZE_START , comp_size); +else +test_one (rand_s1, rand_s2,SIZE ,0 , comp_size); } -srandom (1 ); +srandom (time (0 )); -for (i =0 ; i <ITERATIONS ; i++) { +for (i =0 ; i < iterations; i++) {unsigned long j;unsigned long change; +char *rand_s1 = s1; +char *rand_s2 = s2; -for (j =0 ; j <SIZE ; j++) +for (j =0 ; j < alloc_size; j++) s1[j] =random (); -memcpy (s2, s1,SIZE ); + rand_s1 +=random () %MAX_OFFSET_DIFF_S1_S2 ; + rand_s2 +=random () %MAX_OFFSET_DIFF_S1_S2 ; +memcpy (rand_s2, rand_s1, comp_size);/* change multiple bytes, 1/8 of total */ -for (j =0 ; j <SIZE /8 ; j++) { - change =random () %SIZE ; +for (j =0 ; j < comp_size /8 ; j++) { + change =random () % comp_size; s2[change] =random () &0xff ; } -test_one (s1, s2); +if (islarge) +test_one (rand_s1, rand_s2,LARGE_MAX_OFFSET , +LARGE_SIZE_START , comp_size); +else +test_one (rand_s1, rand_s2,SIZE ,0 , comp_size); }return 0 ; } +static int testcases (void ) +{ +testcase (0 ); +testcase (1 ); +return 0 ; +} +int main (void ) { -return test_harness (testcase,"memcmp" ); +return test_harness (testcases,"memcmp" ); }
Re: [PATCH v3 3/3] powerpc:selftest update memcmp_64 selftest for VMX implementation
Hi Cyril,
Thanks for the review.
Quoted 9 lines · Cyril Bur
Quoted 5 lines · On Fri, 2017-10-13 at 12:30 +0800, [email protected] wrote:
From: Simon Guo <[email protected]>
This patch adjust selftest
memcmp_64so that memcmp selftest can be compiled successfully.Do they not compile at the moment?
Since I renamed enter/exit_vmx_copy() to enter/exit_vmx_ops() in patch 2nd, this patch is necessary to make selftest compiled based on patch 2nd.
Quoted 10 lines
Quoted 5 lines
It also adds testcases for:
- memcmp over 4K bytes size.
- s1/s2 with different/random offset on 16 bytes boundary.
- enter/exit_vmx_ops pairness.This is a great idea, just a thought though - perhaps it might make more sense to have each condition be tested for in a separate binary rather than a single binary that tests everything.
I am not sure whether it is better to seperate those test cases on the same memcmp func. Currently the time to execute this single test bin is within 35 secs, and keeping them in one exec will make people test more comprehensively. So Personally I prefer to keep them in one at present.
Thanks,
- Simon