Open rohanaggarwal7997 opened 2 years ago
I would be surprised if this code performance hack was checked on ICC,
though with godbolt
, that might actually be possible.
cc @easyaspi314 , the author of this code.
Yeah those should be for GCC only.
It is really annoying that in order to check for actual GCC you have to check for the imposters.
How about just adding something like this
/* Attempts to detect *actual* GCC. */
#define XXH_IS_GCC (defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER))
/* Detects GCC and Clang (in clang-cl mode, clang does not define __GNUC__) */
#define XXH_IS_GNU (defined(__GNUC__) || defined(__clang__))
Just like how XXH_GCC_VERSION
is used.
I like it
So PR missing?
Coming back to this topic,
it seems there are still a few places in the code base where the following preprocessor test is present :
#if defined(__GNUC__) && !defined(__clang__)
I presume it's the kind of test where excluding icc
would (presumably) be useful too.
I had a small question regarding the xxhash code. There is usage of
__GNUC__
in some places in the code(in footnote) to get the performance of the compiled code by GCC similar to clang . My question is that even ICC defines__GNUC__
. Was the code benchmarked for the performance considerations with ICC ? or should we be using an extra!defined(__INTEL_COMPILER)
.I am talking about the following two comments in your code