Skip to content

Support for ARM? #20

@cjpatton

Description

@cjpatton

The code doesn't build on my machine (Apple M3). I believe the problem is that the code doesn't (yet!) support ARM? If so, I'm curious if you have plans to do this in the future?

➜  lazer git:(main) make
cat src/lazer-in1.h > lazer.h
echo "" >> lazer.h
echo "#ifndef LAZER_CONFIG_H" >> lazer.h
echo "#define LAZER_CONFIG_H" >> lazer.h
echo "" >> lazer.h
cat config.h >> lazer.h
echo "" >> lazer.h
echo "#endif" >> lazer.h
echo "" >> lazer.h
cat src/lazer-in2.h >> lazer.h
echo "" >> lazer.h
cat src/moduli.h >> lazer.h
cd third_party && unzip Falcon-impl-20211101.zip
Archive:  Falcon-impl-20211101.zip
   creating: Falcon-impl-20211101
  inflating: Falcon-impl-20211101/codec.c
  inflating: Falcon-impl-20211101/common.c
  inflating: Falcon-impl-20211101/config.h
  inflating: Falcon-impl-20211101/falcon.c
  inflating: Falcon-impl-20211101/falcon.h
  inflating: Falcon-impl-20211101/fft.c
  inflating: Falcon-impl-20211101/fpr.c
  inflating: Falcon-impl-20211101/fpr.h
  inflating: Falcon-impl-20211101/inner.h
  inflating: Falcon-impl-20211101/keygen.c
  inflating: Falcon-impl-20211101/Makefile
  inflating: Falcon-impl-20211101/README.txt
  inflating: Falcon-impl-20211101/rng.c
  inflating: Falcon-impl-20211101/shake.c
  inflating: Falcon-impl-20211101/sign.c
  inflating: Falcon-impl-20211101/speed.c
  inflating: Falcon-impl-20211101/test_falcon.c
  inflating: Falcon-impl-20211101/vrfy.c
patch -d third_party/Falcon-impl-20211101 -p1 < src/falcon.patch
patching file inner.h
patching file vrfy.c
/opt/homebrew/opt/llvm@16/bin/clang -DNDEBUG -Wall -Wextra -O3 -g -march=native -mtune=native -fomit-frame-pointer -DFALCON_FPNATIVE -DFALCON_AVX2 -DFALCON_FMA  -Ithird_party/Falcon-impl-20211101 -I. -c -o src/lazer_static.o src/lazer.c
In file included from src/lazer.c:1:
In file included from src/abdlop.c:1:
In file included from ./lazer.h:212:
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/immintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
 ^
In file included from src/lazer.c:1:
In file included from src/abdlop.c:1:
In file included from ./lazer.h:212:
In file included from /opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/immintrin.h:17:
In file included from /opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/x86gprintrin.h:15:
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/hresetintrin.h:42:27: error: invalid input constraint 'a' in asm
  __asm__ ("hreset $0" :: "a"(__eax));
                          ^
In file included from src/lazer.c:1:
In file included from src/abdlop.c:1:
In file included from ./lazer.h:212:
In file included from /opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/immintrin.h:21:
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
 ^
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:54:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:133:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:163:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:193:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:220:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:243:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:264:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:291:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:314:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:335:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:356:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:377:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:398:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:420:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:443:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm@16/16.0.6_1/lib/clang/16/include/mmintrin.h:465:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddusb((__v8qi)__m1, (__v8qi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [src/lazer_static.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions