Open barracuda156 opened 7 months ago
Perhaps GCC builtin can be used, like here: https://github.com/nmslib/nmslib/blob/ade4bcdc9dd3719990de2503871450b8a62df4a5/similarity_search/include/portable_prefetch.h#L17-L27
@barracuda156
Thanks for the GitHub issue.
You're referring to the 32-bit PowerPC? Hmmm, I guess I didn't know people still used this. I'm genuinely interested/curious to hear what you're doing with this architecture.
In terms of fixing this, I don't have access to this architecture. You're probably right that conditionals to detect the presence of x86 would work.
I think there are two ways forward:
Sound reasonable? I think the ball is in your court.
Best, Evan
@evanbiederstedt Thank you for responding!
I checked n2
repo, and turns out I have opened an issue there last year: https://github.com/kakao/n2/issues/51
No response ever since.
Let me see if I can fix it. Won’t invest much time if it happens to be non-trivial, but why not try at least.
P. S. It looks like your code is improved over the original, right? And what you define for aarch64
might actually work for PowerPC too: https://github.com/kharchenkolab/N2R/blob/aaf8ac4ee7683bf2508bc5a8b78f2ed88e56a7d9/src/n2/include/n2/simd.h#L50-L53
GCC builtins do work there.
There is a way to use assembler too, but perhaps unneeded, since GCC does that via builtin anyway. Ref: https://github.com/ivmai/bdwgc/blob/58e55d40a1a0220c511feaea9217cffe38dcdccb/include/private/gcconfig.h#L1201-L1207
I'm genuinely interested/curious to hear what you're doing with this architecture.
I got a PowerMac two year ago and thought I can run some Bayesian models with Stan on it. Turned out that R
is broken, new compilers are not there, etc.
Well, since then I have fixed pretty much everything I wanted for R
, and added it to Macports. With a very few exceptions I can do the same on 10.6 PowerPC as on 14.4 aarch64 now :)
The first issue when building on PowerPC that a wrong intrinsics header gets pulled in:
Those implementations are little-endian and require VSX support in ISA, which is a small subset of PowerPC cpus.
When that header is removed, build fails a step further due to a missing define for prefetch:
Perhaps adding proper intrinsics for PowerPC is not easy, but maybe generic CPU fallback can be added (just considering endianness)?