[compiler-rt] 1777299 - [builtins] Add missing header in D77912 and make __builtin_clzll more robust

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 08:32:51 PDT 2020


Author: Fangrui Song
Date: 2020-04-17T08:29:58-07:00
New Revision: 17772995d48b8c10a3142d602e228f3ebeed85bf

URL: https://github.com/llvm/llvm-project/commit/17772995d48b8c10a3142d602e228f3ebeed85bf
DIFF: https://github.com/llvm/llvm-project/commit/17772995d48b8c10a3142d602e228f3ebeed85bf.diff

LOG: [builtins] Add missing header in D77912 and make __builtin_clzll more robust

Added: 
    

Modified: 
    compiler-rt/lib/builtins/int_div_impl.inc

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/int_div_impl.inc b/compiler-rt/lib/builtins/int_div_impl.inc
index 972a1085ae2c..d194ae1e3028 100644
--- a/compiler-rt/lib/builtins/int_div_impl.inc
+++ b/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
+//
+//===----------------------------------------------------------------------===//
+//
+// Helpers used by __udivsi3, __umodsi3, __udivdi3, and __umodsi3.
+//
+//===----------------------------------------------------------------------===//
+
+#define clz(a) (sizeof(a) == sizeof(unsigned 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) {


        


More information about the llvm-commits mailing list