Skip to content

Commit

Permalink
readme tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
oconnor663-zoom committed Oct 20, 2020
1 parent 5361572 commit b928701
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ expects to be linked with code for five different instruction sets:
portable C, SSE2, SSE4.1, AVX2, and AVX-512.
For each of the x86 SIMD instruction sets, two versions are available,
one in assembly (with three flavors: Unix, Windows MSVC, and Windows
GNU) and one using C intrinsics. The assembly versions are generally
preferred: they perform better, they perform more consistently across
different compilers, and they build more quickly. On the other hand, the
assembly versions are x86\_64-only, and you need to select the right
flavor for your target platform.
one in assembly (which is further divided into three flavors: Unix,
Windows MSVC, and Windows GNU) and one using C intrinsics. The assembly
versions are generally preferred: they perform better, they perform more
consistently across different compilers, and they build more quickly. On
the other hand, the assembly versions are x86\_64-only, and you need to
select the right flavor for your target platform.
Here's an example of building a shared library on x86\_64 Linux using
the assembly implementations:
Expand All @@ -212,12 +212,12 @@ gcc -shared -O3 -o libblake3.so blake3.c blake3_dispatch.c blake3_portable.c \
```

Note above that building `blake3_avx512.c` requires both `-mavx512f` and
`-mavx512vl` under GCC and Clang, as shown above. Under MSVC, the single
`/arch:AVX512` flag is sufficient. The MSVC equivalent of `-mavx2` is
`/arch:AVX2`. MSVC enables SSE4.1 by defaut, and it doesn't have a
`-mavx512vl` under GCC and Clang. Under MSVC, the single `/arch:AVX512`
flag is sufficient. The MSVC equivalent of `-mavx2` is `/arch:AVX2`.
MSVC enables SSE2 and SSE4.1 by defaut, and it doesn't have a
corresponding flag.

If you want to omit SIMD code on x86, you need to explicitly disable
If you want to omit SIMD code entirely, you need to explicitly disable
each instruction set. Here's an example of building a shared library on
x86 with only portable code:

Expand Down

0 comments on commit b928701

Please sign in to comment.