summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-11-01 00:00:03 +0000
committerReid Kleckner <rnk@google.com>2018-11-01 00:00:03 +0000
commitdffe5a3807c8327817c5b72f1fc44f1f39907936 (patch)
tree5c1cda55d2f5d14e66259fb60d1815dfe6378940 /compiler-rt/lib/builtins
parentb61232eacdf1b9fcd3aadb962a83be5b47cc1e1e (diff)
downloadbcm5719-llvm-dffe5a3807c8327817c5b72f1fc44f1f39907936.tar.gz
bcm5719-llvm-dffe5a3807c8327817c5b72f1fc44f1f39907936.zip
Compile and test i128 math builtins for Win64
Summary: Windows has always been LLP64, not LP64, so the macros were incorrect. Check for _WIN64, since AArch64 sets that too. The tests have to be fixed up in two main ways: 1. Use 'ULL' suffixes to avoid sign extension when passing hex literals with the sign bit set to signed 128 arguments. Clang -fms-compatibility makes such hex literals signed, not unsigned. 2. Disable various tests for 80-bit long double interoperation with i128 values. Reviewers: joerg, mstorsjo Subscribers: javed.absar, kristof.beyls, hiraditya, aheejin, llvm-commits Differential Revision: https://reviews.llvm.org/D53918 llvm-svn: 345796
Diffstat (limited to 'compiler-rt/lib/builtins')
-rw-r--r--compiler-rt/lib/builtins/int_types.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h
index 8917ff83e5a..9f8da56cb77 100644
--- a/compiler-rt/lib/builtins/int_types.h
+++ b/compiler-rt/lib/builtins/int_types.h
@@ -60,10 +60,19 @@ typedef union
}s;
} udwords;
-#if (defined(__LP64__) || defined(__wasm__) || defined(__mips64)) || defined(__riscv)
+#if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \
+ defined(__riscv) || defined(_WIN64)
#define CRT_HAS_128BIT
#endif
+/* MSVC doesn't have a working 128bit integer type. Users should really compile
+ * compiler-rt with clang, but if they happen to be doing a standalone build for
+ * asan or something else, disable the 128 bit parts so things sort of work.
+ */
+#if defined(_MSC_VER) && !defined(__clang__)
+#undef CRT_HAS_128BIT
+#endif
+
#ifdef CRT_HAS_128BIT
typedef int ti_int __attribute__ ((mode (TI)));
typedef unsigned tu_int __attribute__ ((mode (TI)));
OpenPOWER on IntegriCloud