[llvm-commits] [compiler-rt] r144668 - in /compiler-rt/trunk/lib: int_lib.h int_types.h
Daniel Dunbar
daniel at zuster.org
Tue Nov 15 10:56:13 PST 2011
Author: ddunbar
Date: Tue Nov 15 12:56:13 2011
New Revision: 144668
URL: http://llvm.org/viewvc/llvm-project?rev=144668&view=rev
Log:
lib: Split out int_types.h, for readability.
Added:
compiler-rt/trunk/lib/int_types.h
- copied, changed from r144662, compiler-rt/trunk/lib/int_lib.h
Modified:
compiler-rt/trunk/lib/int_lib.h
Modified: compiler-rt/trunk/lib/int_lib.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/int_lib.h?rev=144668&r1=144667&r2=144668&view=diff
==============================================================================
--- compiler-rt/trunk/lib/int_lib.h (original)
+++ compiler-rt/trunk/lib/int_lib.h Tue Nov 15 12:56:13 2011
@@ -48,120 +48,7 @@
#define INFINITY HUGE_VAL
#endif /* INFINITY */
-typedef int si_int;
-typedef unsigned su_int;
-
-typedef long long di_int;
-typedef unsigned long long du_int;
-
-typedef union
-{
- di_int all;
- struct
- {
-#if _YUGA_LITTLE_ENDIAN
- su_int low;
- si_int high;
-#else
- si_int high;
- su_int low;
-#endif /* _YUGA_LITTLE_ENDIAN */
- }s;
-} dwords;
-
-typedef union
-{
- du_int all;
- struct
- {
-#if _YUGA_LITTLE_ENDIAN
- su_int low;
- su_int high;
-#else
- su_int high;
- su_int low;
-#endif /* _YUGA_LITTLE_ENDIAN */
- }s;
-} udwords;
-
-#if __x86_64
-
-typedef int ti_int __attribute__ ((mode (TI)));
-typedef unsigned tu_int __attribute__ ((mode (TI)));
-
-typedef union
-{
- ti_int all;
- struct
- {
-#if _YUGA_LITTLE_ENDIAN
- du_int low;
- di_int high;
-#else
- di_int high;
- du_int low;
-#endif /* _YUGA_LITTLE_ENDIAN */
- }s;
-} twords;
-
-typedef union
-{
- tu_int all;
- struct
- {
-#if _YUGA_LITTLE_ENDIAN
- du_int low;
- du_int high;
-#else
- du_int high;
- du_int low;
-#endif /* _YUGA_LITTLE_ENDIAN */
- }s;
-} utwords;
-
-static inline ti_int make_ti(di_int h, di_int l) {
- twords r;
- r.s.high = h;
- r.s.low = l;
- return r.all;
-}
-
-static inline tu_int make_tu(du_int h, du_int l) {
- utwords r;
- r.s.high = h;
- r.s.low = l;
- return r.all;
-}
-
-#endif /* __x86_64 */
-
-typedef union
-{
- su_int u;
- float f;
-} float_bits;
-
-typedef union
-{
- udwords u;
- double f;
-} double_bits;
-
-typedef struct
-{
-#if _YUGA_LITTLE_ENDIAN
- udwords low;
- udwords high;
-#else
- udwords high;
- udwords low;
-#endif /* _YUGA_LITTLE_ENDIAN */
-} uqwords;
-
-typedef union
-{
- uqwords u;
- long double f;
-} long_double_bits;
+/* Include the commonly used internal type definitions. */
+#include "int_types.h"
#endif /* INT_LIB_H */
Copied: compiler-rt/trunk/lib/int_types.h (from r144662, compiler-rt/trunk/lib/int_lib.h)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/int_types.h?p2=compiler-rt/trunk/lib/int_types.h&p1=compiler-rt/trunk/lib/int_lib.h&r1=144662&r2=144668&rev=144668&view=diff
==============================================================================
--- compiler-rt/trunk/lib/int_lib.h (original)
+++ compiler-rt/trunk/lib/int_types.h Tue Nov 15 12:56:13 2011
@@ -7,46 +7,18 @@
*
* ===----------------------------------------------------------------------===
*
- * This file is a configuration header for compiler-rt.
* This file is not part of the interface of this library.
*
+ * This file defines various standard types, most importantly a number of unions
+ * used to access parts of larger types.
+ *
* ===----------------------------------------------------------------------===
*/
-#ifndef INT_LIB_H
-#define INT_LIB_H
-
-/* ABI macro definitions */
-
-#if __ARM_EABI__
-# define ARM_EABI_FNALIAS(aeabi_name, name) \
- void __aeabi_##aeabi_name() __attribute__((alias("__" #name)));
-# define COMPILER_RT_ABI __attribute__((pcs("aapcs")))
-#else
-# define ARM_EABI_FNALIAS(aeabi_name, name)
-# define COMPILER_RT_ABI
-#endif
-
-/* Assumption: signed integral is 2's complement */
-/* Assumption: right shift of signed negative is arithmetic shift */
+#ifndef INT_TYPES_H
+#define INT_TYPES_H
-#include <limits.h>
-#include <stdint.h>
#include "endianness.h"
-#include <math.h>
-
-/* If compiling for kernel use, call panic() instead of abort(). */
-#ifdef KERNEL_USE
-extern void panic (const char *, ...);
-#define compilerrt_abort() \
- panic("%s:%d: abort in %s", __FILE__, __LINE__, __FUNCTION__)
-#else
-#define compilerrt_abort() abort()
-#endif
-
-#if !defined(INFINITY) && defined(HUGE_VAL)
-#define INFINITY HUGE_VAL
-#endif /* INFINITY */
typedef int si_int;
typedef unsigned su_int;
@@ -164,4 +136,5 @@
long double f;
} long_double_bits;
-#endif /* INT_LIB_H */
+#endif /* INT_TYPES_H */
+
More information about the llvm-commits
mailing list