Daniel Dunbar | 4467b65 | 2009-10-27 17:48:46 +0000 | [diff] [blame] | 1 | /* ===-- int_lib.h - configuration header for compiler-rt -----------------=== |
Edward O'Callaghan | 0e4ad9c | 2009-08-05 01:47:29 +0000 | [diff] [blame] | 2 | * |
| 3 | * The LLVM Compiler Infrastructure |
| 4 | * |
Howard Hinnant | 9ad441f | 2010-11-16 22:13:33 +0000 | [diff] [blame] | 5 | * This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | * Source Licenses. See LICENSE.TXT for details. |
Edward O'Callaghan | 0e4ad9c | 2009-08-05 01:47:29 +0000 | [diff] [blame] | 7 | * |
| 8 | * ===----------------------------------------------------------------------=== |
| 9 | * |
Daniel Dunbar | 4467b65 | 2009-10-27 17:48:46 +0000 | [diff] [blame] | 10 | * This file is a configuration header for compiler-rt. |
Edward O'Callaghan | 0e4ad9c | 2009-08-05 01:47:29 +0000 | [diff] [blame] | 11 | * This file is not part of the interface of this library. |
| 12 | * |
| 13 | * ===----------------------------------------------------------------------=== |
| 14 | */ |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 15 | |
| 16 | #ifndef INT_LIB_H |
| 17 | #define INT_LIB_H |
| 18 | |
Daniel Dunbar | 0a3e350 | 2011-11-15 18:56:21 +0000 | [diff] [blame^] | 19 | /* Assumption: Signed integral is 2's complement. */ |
| 20 | /* Assumption: Right shift of signed negative is arithmetic shift. */ |
| 21 | /* Assumption: Endianness is little or big (not mixed). */ |
| 22 | |
Daniel Dunbar | 0ae9d25 | 2011-11-15 18:34:44 +0000 | [diff] [blame] | 23 | /* ABI macro definitions */ |
| 24 | |
| 25 | #if __ARM_EABI__ |
| 26 | # define ARM_EABI_FNALIAS(aeabi_name, name) \ |
| 27 | void __aeabi_##aeabi_name() __attribute__((alias("__" #name))); |
| 28 | # define COMPILER_RT_ABI __attribute__((pcs("aapcs"))) |
| 29 | #else |
| 30 | # define ARM_EABI_FNALIAS(aeabi_name, name) |
| 31 | # define COMPILER_RT_ABI |
| 32 | #endif |
| 33 | |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 34 | #include <limits.h> |
Nick Kledzik | c31717b | 2011-01-07 19:09:06 +0000 | [diff] [blame] | 35 | #include <stdint.h> |
Edward O'Callaghan | df479b6 | 2009-08-04 03:30:10 +0000 | [diff] [blame] | 36 | #include <math.h> |
| 37 | |
Daniel Dunbar | d3d2263 | 2010-03-31 17:00:48 +0000 | [diff] [blame] | 38 | /* If compiling for kernel use, call panic() instead of abort(). */ |
| 39 | #ifdef KERNEL_USE |
| 40 | extern void panic (const char *, ...); |
| 41 | #define compilerrt_abort() \ |
| 42 | panic("%s:%d: abort in %s", __FILE__, __LINE__, __FUNCTION__) |
| 43 | #else |
Daniel Dunbar | 48f46ac | 2010-03-31 17:00:45 +0000 | [diff] [blame] | 44 | #define compilerrt_abort() abort() |
Daniel Dunbar | d3d2263 | 2010-03-31 17:00:48 +0000 | [diff] [blame] | 45 | #endif |
Daniel Dunbar | 48f46ac | 2010-03-31 17:00:45 +0000 | [diff] [blame] | 46 | |
Edward O'Callaghan | df479b6 | 2009-08-04 03:30:10 +0000 | [diff] [blame] | 47 | #if !defined(INFINITY) && defined(HUGE_VAL) |
| 48 | #define INFINITY HUGE_VAL |
Edward O'Callaghan | 0898ee9 | 2009-08-05 19:57:20 +0000 | [diff] [blame] | 49 | #endif /* INFINITY */ |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 50 | |
Daniel Dunbar | 396a72f | 2011-11-15 18:56:13 +0000 | [diff] [blame] | 51 | /* Include the commonly used internal type definitions. */ |
| 52 | #include "int_types.h" |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 53 | |
Edward O'Callaghan | 0898ee9 | 2009-08-05 19:57:20 +0000 | [diff] [blame] | 54 | #endif /* INT_LIB_H */ |