From 7a739a0dfb6d408c6d587e5c7b52abd89fc3fdd3 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 19 Jan 2019 10:56:40 +0000 Subject: Update more file headers across all of the LLVM projects in the monorepo to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351648 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/builtins/fixunsxfti.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/builtins/fixunsxfti.c') diff --git a/lib/builtins/fixunsxfti.c b/lib/builtins/fixunsxfti.c index fb39d00ff..05da75c99 100644 --- a/lib/builtins/fixunsxfti.c +++ b/lib/builtins/fixunsxfti.c @@ -1,9 +1,8 @@ /* ===-- fixunsxfti.c - Implement __fixunsxfti -----------------------------=== * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. + * 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 * * ===----------------------------------------------------------------------=== * -- cgit v1.2.1 From db42a0ccf35e49df3a801d4a7964fce06f587542 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Sun, 28 Apr 2019 21:53:32 +0000 Subject: [builtins] Reformat builtins with clang-format Update formatting to use the LLVM style. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60351 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359410 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/builtins/fixunsxfti.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'lib/builtins/fixunsxfti.c') diff --git a/lib/builtins/fixunsxfti.c b/lib/builtins/fixunsxfti.c index 05da75c99..4bfdc598b 100644 --- a/lib/builtins/fixunsxfti.c +++ b/lib/builtins/fixunsxfti.c @@ -19,31 +19,30 @@ * Negative values all become zero. */ -/* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes - * tu_int is a 128 bit integral type - * value in long double is representable in tu_int or is negative +/* Assumption: long double is an intel 80 bit floating point type padded with 6 + * bytes tu_int is a 128 bit integral type value in long double is representable + * in tu_int or is negative */ -/* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | - * 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm +/* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee + * eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm + * mmmm mmmm mmmm */ -COMPILER_RT_ABI tu_int -__fixunsxfti(long double a) -{ - long_double_bits fb; - fb.f = a; - int e = (fb.u.high.s.low & 0x00007FFF) - 16383; - if (e < 0 || (fb.u.high.s.low & 0x00008000)) - return 0; - if ((unsigned)e > sizeof(tu_int) * CHAR_BIT) - return ~(tu_int)0; - tu_int r = fb.u.low.all; - if (e > 63) - r <<= (e - 63); - else - r >>= (63 - e); - return r; +COMPILER_RT_ABI tu_int __fixunsxfti(long double a) { + long_double_bits fb; + fb.f = a; + int e = (fb.u.high.s.low & 0x00007FFF) - 16383; + if (e < 0 || (fb.u.high.s.low & 0x00008000)) + return 0; + if ((unsigned)e > sizeof(tu_int) * CHAR_BIT) + return ~(tu_int)0; + tu_int r = fb.u.low.all; + if (e > 63) + r <<= (e - 63); + else + r >>= (63 - e); + return r; } #endif /* CRT_HAS_128BIT */ -- cgit v1.2.1 From f0745e8476f069296a7c71accedd061dce4cdf79 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Sun, 28 Apr 2019 22:47:49 +0000 Subject: [builtins] Use single line C++/C99 comment style Use the uniform single line C++/99 style for code comments. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60352 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359411 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/builtins/fixunsxfti.c | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) (limited to 'lib/builtins/fixunsxfti.c') diff --git a/lib/builtins/fixunsxfti.c b/lib/builtins/fixunsxfti.c index 4bfdc598b..508554e4f 100644 --- a/lib/builtins/fixunsxfti.c +++ b/lib/builtins/fixunsxfti.c @@ -1,33 +1,29 @@ -/* ===-- fixunsxfti.c - Implement __fixunsxfti -----------------------------=== - * - * 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 __fixunsxfti for the compiler_rt library. - * - * ===----------------------------------------------------------------------=== - */ +//===-- fixunsxfti.c - Implement __fixunsxfti -----------------------------===// +// +// 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 __fixunsxfti for the compiler_rt library. +// +//===----------------------------------------------------------------------===// #include "int_lib.h" #ifdef CRT_HAS_128BIT -/* Returns: convert a to a unsigned long long, rounding toward zero. - * Negative values all become zero. - */ +// Returns: convert a to a unsigned long long, rounding toward zero. +// Negative values all become zero. -/* Assumption: long double is an intel 80 bit floating point type padded with 6 - * bytes tu_int is a 128 bit integral type value in long double is representable - * in tu_int or is negative - */ +// Assumption: long double is an intel 80 bit floating point type padded with 6 +// bytes tu_int is a 128 bit integral type value in long double is representable +// in tu_int or is negative -/* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee - * eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm - * mmmm mmmm mmmm - */ +// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee +// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm +// mmmm mmmm mmmm COMPILER_RT_ABI tu_int __fixunsxfti(long double a) { long_double_bits fb; @@ -45,4 +41,4 @@ COMPILER_RT_ABI tu_int __fixunsxfti(long double a) { return r; } -#endif /* CRT_HAS_128BIT */ +#endif // CRT_HAS_128BIT -- cgit v1.2.1