simde icon indicating copy to clipboard operation
simde copied to clipboard

Invalid type conversions on M1 Mac

Open aberthel opened this issue 5 months ago • 2 comments

Hello! I have been trying to use simd-everywhere to compile the RADULS sorting library for a Mac with an M1 chip. I am running into a problem that seems to originate from sse4.2.h, where a conversion between incompatible types is taking place. I get the following error message:

gcc-13 -IRaduls -Wall -fopenmp -O3 -march=armv8.5-a+fp+simd+crc+crypto -fno-ipa-ra -fno-tree-vrp -fno-tree-pre -m64 -std=c++14 -pthread  -c Example/main.cpp -o Example/main.o
In file included from Raduls/simde/x86/sse4.2.h:34,
                 from Raduls/simde/x86/avx.h:32,
                 from Raduls/raduls.h:19,
                 from Example/main.cpp:11:
/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current/gcc/aarch64-apple-darwin21/13/include/arm_acle.h: In function 'int __rndr(uint64_t*)':
/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current/gcc/aarch64-apple-darwin21/13/include/arm_acle.h:282:34: error: invalid conversion from 'uint64_t*' {aka 'long long unsigned int*'} to 'long unsigned int*' [-fpermissive]
  282 |   return __builtin_aarch64_rndr (__res);
      |                                  ^~~~~
      |                                  |
      |                                  uint64_t* {aka long long unsigned int*}
<built-in>: note:   initializing argument 1 of 'int __builtin_aarch64_rndr(long unsigned int*)'
/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current/gcc/aarch64-apple-darwin21/13/include/arm_acle.h: In function 'int __rndrrs(uint64_t*)':
/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current/gcc/aarch64-apple-darwin21/13/include/arm_acle.h:289:36: error: invalid conversion from 'uint64_t*' {aka 'long long unsigned int*'} to 'long unsigned int*' [-fpermissive]
  289 |   return __builtin_aarch64_rndrrs (__res);
      |                                    ^~~~~
      |                                    |
      |                                    uint64_t* {aka long long unsigned int*}
<built-in>: note:   initializing argument 1 of 'int __builtin_aarch64_rndrrs(long unsigned int*)'
make: *** [Example/main.o] Error 1

I'm not really a C programmer, just trying to get this library compiled for use in another project, and I haven't been able to figure out the root cause of the issue. Any insights would be much appreciated.

aberthel avatar Jan 30 '24 22:01 aberthel