[PATCH] D78300: [builtins] Do not assume sizeof(long long)==8 in int_div_impl.inc
Bjorn Pettersson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 17 01:03:01 PDT 2020
bjope updated this revision to Diff 258243.
bjope added a comment.
Update after feedback (check sizeof(long long) rather than using CHAR_BIT).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78300/new/
https://reviews.llvm.org/D78300
Files:
compiler-rt/lib/builtins/int_div_impl.inc
Index: compiler-rt/lib/builtins/int_div_impl.inc
===================================================================
--- compiler-rt/lib/builtins/int_div_impl.inc
+++ compiler-rt/lib/builtins/int_div_impl.inc
@@ -1,4 +1,16 @@
-#define clz(a) (sizeof(a) == 8 ? __builtin_clzll(a) : __builtin_clz(a))
+//===----- int_div_impl.inc - integer division --------------------*- C -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements helpers for udivXi3 and umodXi3.
+//
+//===----------------------------------------------------------------------===//
+
+#define clz(a) (sizeof(a) == sizeof(long long) ? __builtin_clzll(a) : __builtin_clz(a))
// Adapted from Figure 3-40 of The PowerPC Compiler Writer's Guide
static __inline fixuint_t __udivXi3(fixuint_t n, fixuint_t d) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78300.258243.patch
Type: text/x-patch
Size: 1049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200417/e57d96c7/attachment.bin>
More information about the llvm-commits
mailing list