Skip to content

Commit a51ed15

Browse files
committed
disable memcmpne for EMU_AVX2
1 parent 7a3945d commit a51ed15

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

jsrc/je.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ extern D xdouble(X);
979979
extern void readlock(S*,S);
980980
extern void writelock(S*,S);
981981
#endif
982-
#if C_AVX2 || EMU_AVX2
982+
#if C_AVX2 //|| EMU_AVX2
983983
extern I memcmpne(void*, void*, I);
984984
#else
985985
#define memcmpne(s,t,l) (!!memcmp((s),(t),(l)))

jsrc/v1.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ oneloop:;
135135
}
136136
// memcmpne: test for inequality, not caring about order, for exact inputs
137137
// We use AVX2 instructions always, so this might be a little slower for repeat matches on short inputs; but it avoids misbranches
138+
#if !EMU_AVX2
138139
I memcmpne(void *s, void *t, I l){
139140
if(unlikely(l==0))R 0; // loops require nonempty arrays - empties compare equal. If there are no atoms we can't safely fetch anything from memory
140141
// If the first fetch miscompares, we can avoid the setup overhead. This will be worthwhile on long compares, and not too
@@ -174,6 +175,7 @@ I memcmpne(void *s, void *t, I l){
174175
R !_mm256_testc_pd(_mm256_castsi256_pd(_mm256_cmpeq_epi64(u,v)),ones); // return 1 if any mismatch
175176
// obsolete R 0!=~_mm256_movemask_epi8(_mm256_cmpeq_epi8(u,v)); // no miscompares, compare equal
176177
}
178+
#endif
177179

178180
// memcmpnefl: test for inequality, not caring about order, for float inputs, possibly with tolerance
179181
// We use AVX2 instructions always, so this might be a little slower for repeat matches on short inputs; but it avoids misbranches

0 commit comments

Comments
 (0)