-
Notifications
You must be signed in to change notification settings - Fork 263
Development Environment
Being able to run native instructions is important during SIMDe development, especially to generate test vectors, but getting access to an enviroment to do that can be a bit painful. What follows is basic information options for various architectures.
I'm going to assume you're running Linux, but macOS will probably be okay (you'll likely need to use Homebrew). For Windows, you might be okay depending on what you're trying target.
Please consider submitting edits to this document if you have anything to add, such as hints for other operating systems, architectures, etc.
I'm going to assume you're developing on x86 / x86_64, because almost everyone is. So, this assumes that your development machine doesn't support the ISA extension you're working on. For example, if your machine doesn't do AVX-512.
The best thing to do is to use the Intel Software Development Emulator. You just have to explicity target the instruction set you're interested in when you compile, then run it in the SDE.
Once you've downloaded and extracted the SDE, the process looks like:
mkdir test/build && cd test/build
cmake .. -DCMAKE_{C,CXX}_FLAGS='-mavx512bw'
make -j
/path/to/sde/sd64 -- ./run-tests
Performance is obviously not as good as native, but it's definitely fast enough for SIMDe development.
WASM SIMD is a very new development, and isn't really stable anywhere yet, so you'll need to be using very recent software, possibly even unreleased versions. Hopefully this won't be required for long.
To compile, you'll need to use emscripten. See their installation documentation for instruction on installation; the version that ships with your Linux distribution probably isn't new enough: you should be using at least 1.39.10.
You'll also need to install d8 (a CLI for the V8 JavaScript engine), since the version of v8 that currently ships in Node.js is missing some crucial fixes. I suggest using jsvu to install it.
Installation instructions for jsvu are in their README.md. After
installing jsvu, you can install d8 with jsvu --engines=v8
.
After you source emsdk_env.sh, you can compile and test with something like:
mkdir test/build && cd test/build
emcmake cmake .. -DCMAKE_{C,CXX}_FLAGS="-msimd128 -s SIMD=1 -O3"
make -j
~/.jsvu/v8 --experimental-wasm-simd run-tests.js
If you have a Raspberry Pi or something sitting around, that's probably the easiest way to go. You can install all the tools and just use them natively. Compilation can be a bit slow, but it's quite usable. Just remember that Raspbian runs in armv7 mode, so if you want to use AArch64, or even just ARMv8, you'll want to use something else. Fedora has good instructions, or there is a good chance that your distro of choice is also avaliable.
I have a Raspberry Pi 3 on which I do SIMDe development sometimes, I can probably arrange remote access for developing SIMDe.
I (rosbif) use cheap ($30 to $50) Chinese TV boxes. I recommend one with a Rockchip RK3328 or an Amlogic S905X2 or X3 processor. They are quad-core AArch64 processors with USB3.0 and you can find ones with 4GB RAM and Gigabit Ethernet. The RK3399* and S922* processors are more powerful but the boxes are significantly more expensive. The Alfawise Z28 Pro has the advantage of being (community) supported by Armbian but it is aging and only has 2GB RAM. The Armbian Debian and Ubuntu distributions work well and mainline Linux support is improving rapidly. For other boxes you may have a little work writing a correct DTS. However most functions are native to the processor, hence common, but if you need WiFi this can be a problem as there are many different chips.
We have Travis CI builds for armv7, armv8, and aarch64. If you just need to check something you can just submit a PR, but please don't over-use this method. It's slow and eats up a lot of Travis' resources, which they are providing for free.
Barring that, you can use QEMU.
There are several places that offer free access to PPC environments for developing open source applications:
Note that you'll probably need to already be an active contributor to SIMDe to get an account, or at least have some sort of official connection (like being a GSoC student).
Barring that, you can use QEMU. It's painfully slow, but it does work. IIRC Alpine's instructions seem pretty easy to follow, or there is a blog post about Ubuntu guests.
QEMU. Sorry, it's going to be pretty slow. I strongly recommend cross-compiling, not attempting to compile natively. For the VM, IIRC last time I did this I used this blog post as a guide.