Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple M1 compatibility #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Download a pre-built executable binary below and follow instructions. Supported

### Prerequisites

1. macOS: install [brew](https://brew.sh), install libusb, pkg-config & qt through brew (`brew install libusb pkg-config qt`)
1. macOS: install [brew](https://brew.sh), install libusb, pkg-config & qt5 through brew (`brew install libusb pkg-config qt5`)
2. Linux:
- Debian/Ubuntu: install build-essential, libxml2-dev, libusb-dev, libusb-1.0-0-dev, zlib-dev or zlib1g-dev, qtbase5-dev, qttools5, cmake(if use cmake to build)
- Fedora/CentOS: group install "Development Tools", install libxml2-devel, libusb-devel, zlib-devel, qt5-qtbase-devel, qt5-qtbase, cmake3(if use cmake to build)
Expand All @@ -46,7 +46,7 @@ Download a pre-built executable binary below and follow instructions. Supported
You can choose either `qmake` or `cmake` to build

- cmake: run `cmake` to generate Makefile for compiling
- macOS: it cannot produce app bundle, and you need to specify `CMAKE_PREFIX_PATH` if Qt is not installed in default location: `cmake -DCMAKE_PREFIX_PATH=<Path of Qt Root> <Path of Project Root>`
- macOS: it cannot produce app bundle, and you need to specify `CMAKE_PREFIX_PATH` if Qt 5 is not installed in default location: `cmake -DCMAKE_PREFIX_PATH=<Path of Qt 5 Root> <Path of Project Root>`
- qmake: run `qmake` to generate Makefile for compiling, run `make lcopy` in `src` folder to compile translations and copy them to binary folder

## Contribute translations
Expand Down
21 changes: 21 additions & 0 deletions deps/scrypto/aes_x86.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
#include "aes.h"

#include <string.h>

#ifdef __arm64__
#include "sse2neon.h"

__m128i _mm_aesdec_si128 (__m128i a, __m128i RoundKey)
{
return vaesimcq_u8(vaesdq_u8(a, (__m128i){})) ^ RoundKey;
}

__m128i _mm_aesdeclast_si128 (__m128i a, __m128i RoundKey)
{
return vaesdq_u8(a, (__m128i){}) ^ RoundKey;
}

__m128i _mm_aesimc_si128 (__m128i a)
{
return vaesimcq_u8(a);
}

#else
#include <wmmintrin.h> // AESNI
#include <tmmintrin.h> // SSSE3
#endif

#define AES_INIT_128(rkeys, i, rcon) \
{ \
Expand Down
4 changes: 4 additions & 0 deletions deps/scrypto/sc_crc32_x86.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#include "sc_crc32.h"

#ifdef __arm64__
#include "sse2neon.h"
#else
#include <wmmintrin.h> // PCLMUL
#include <tmmintrin.h> // SSSE3
#include <smmintrin.h> // SSS4
#endif

// Whitepaper: https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf
// ZLIB licensed code from https://github.com/jtkukunas/zlib/blob/master/crc_folding.c
Expand Down
Loading