Add support for all of Chromium's CPU architectures.

BUG=chromium:870747

Change-Id: I421819871f5c45ac07850585e5dcc600d1ff8086
Reviewed-on: https://dawn-review.googlesource.com/c/2140
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2018-11-01 14:30:24 +00:00 committed by Commit Bot service account
parent 4408b7f20c
commit 2960ec3366
2 changed files with 16 additions and 3 deletions

View File

@ -36,7 +36,8 @@
# if defined(__i386__) || defined(__x86_64__) # if defined(__i386__) || defined(__x86_64__)
# define DAWN_BREAKPOINT() __asm__ __volatile__("int $3\n\t") # define DAWN_BREAKPOINT() __asm__ __volatile__("int $3\n\t")
# else # else
# error "Implement BREAKPOINT on your platform" // TODO(cwallez@chromium.org): Implement breakpoint on all supported architectures
# define DAWN_BREAKPOINT()
# endif # endif
# define DAWN_BUILTIN_UNREACHABLE() __builtin_unreachable() # define DAWN_BUILTIN_UNREACHABLE() __builtin_unreachable()

View File

@ -27,10 +27,22 @@
# error "Unsupported platform." # error "Unsupported platform."
#endif #endif
#if defined(_WIN64) || defined(__aarch64__) || defined(__x86_64__) // Distinguish mips32.
#if defined(__mips__) && (_MIPS_SIM == _ABIO32) && !defined(__mips32__)
# define __mips32__
#endif
// Distinguish mips64.
#if defined(__mips__) && (_MIPS_SIM == _ABI64) && !defined(__mips64__)
# define __mips64__
#endif
#if defined(_WIN64) || defined(__aarch64__) || defined(__x86_64__) || defined(__mips64__) || \
defined(__s390x__) || defined(__PPC64__)
# define DAWN_PLATFORM_64_BIT 1 # define DAWN_PLATFORM_64_BIT 1
static_assert(sizeof(sizeof(char)) == 8, "Expect sizeof(size_t) == 8"); static_assert(sizeof(sizeof(char)) == 8, "Expect sizeof(size_t) == 8");
#elif defined(_WIN32) || defined(__i386__) || defined(__arm__) #elif defined(_WIN32) || defined(__arm__) || defined(__i386__) || defined(__mips32__) || \
defined(__s390__)
# define DAWN_PLATFORM_32_BIT 1 # define DAWN_PLATFORM_32_BIT 1
static_assert(sizeof(sizeof(char)) == 4, "Expect sizeof(size_t) == 4"); static_assert(sizeof(sizeof(char)) == 4, "Expect sizeof(size_t) == 4");
#else #else