Files
wuffs/internal/cgen/base
Nigel Tao fb769ff82f base: disable SIMD on MSVC x86_64 by default
This recreates the case as of commit f1698226 (tag v0.4.0-alpha.4), in
that, by default (without #define'ing a macro or passing an /arch:ETC
compiler flag), Wuffs does not use SIMD on MSVC x86_64.

Commit b64a7610 (after tag v0.4.0-alpha.4, before tag v0.4.0-alpha.5)
changed the default so that x86_64_v2 (roughly equivalent to SSE4.2) was
enabled by default, since the user from issue #148 was enabling that
anyway (in an unsupported way, by #define'ing a macro that was a private
implementation detail) with no problems (and better performance).

However, another user later reported (in issue #151) that enabling SIMD
on MSVC x86_64 somehow lead to ICEs (Internal Compiler Errors).

This commit restores the default to "no SIMD" and it is up to the MSVC
user to opt in to the SIMD code paths. Clang and GCC are unaffected:
SIMD remains enabled by default.

Updates #148
Updates #151
2024-07-31 17:12:55 +10:00
..
2024-03-01 09:52:54 +11:00
2021-09-04 15:54:31 +10:00

C Base Code

This directory (base) and its sibling (auxiliary) contain C and C++ code respectively. This C/C++ code combines with the transpiled-to-C/C++ form of the Wuffs code in the top-level std directory to create the "single file C/C++ library" form of the Wuffs standard library.

  • From Wuffs-the-language's point of view, this directory contains implementations of the built-in base package types, such as I/O buffers, ranges and rects and statuses.
  • From application code's point of view (Wuffs is for writing libraries not applications), this directory also contains helper functions for working with those base types, such as constructing an I/O buffer from a pointer and a length, that aren't relevant to Wuffs-the-language code.
  • This directory also contains some functionality (e.g. pixel conversion and string conversion) that, in the future, could possibly be Wuffs packages under std. For optimal performance, they sometimes require programming language features (e.g. function-pointer typed variables, SIMD acceleration) that are not yet available in Wuffs-the-language (or were not available at the time they were added). In the short term, it was more practical to implement them in carefully hand-written C/C++, in this directory. In the long term, they could migrate out of base to be under std, but any base API removal would require a Wuffs version number bump.

Making Changes

After editing source code in this directory, to see those changes when generating the C/C++ form of Wuffs' standard library:

go install github.com/google/wuffs/cmd/wuffs-c && wuffs gen base

This should modify the wuffs-unsupported-snapshot.c file.