blob: 9725f6e62a784d85a6795a9d7e66b75750cec9ca [file] [log] [blame]
Daniel Dunbar4467b652009-10-27 17:48:46 +00001/* ===-- int_lib.h - configuration header for compiler-rt -----------------===
Edward O'Callaghan0e4ad9c2009-08-05 01:47:29 +00002 *
3 * The LLVM Compiler Infrastructure
4 *
Howard Hinnant9ad441f2010-11-16 22:13:33 +00005 * This file is dual licensed under the MIT and the University of Illinois Open
6 * Source Licenses. See LICENSE.TXT for details.
Edward O'Callaghan0e4ad9c2009-08-05 01:47:29 +00007 *
8 * ===----------------------------------------------------------------------===
9 *
Daniel Dunbar4467b652009-10-27 17:48:46 +000010 * This file is a configuration header for compiler-rt.
Edward O'Callaghan0e4ad9c2009-08-05 01:47:29 +000011 * This file is not part of the interface of this library.
12 *
13 * ===----------------------------------------------------------------------===
14 */
Daniel Dunbarb3a69012009-06-26 16:47:03 +000015
16#ifndef INT_LIB_H
17#define INT_LIB_H
18
Daniel Dunbar0a3e3502011-11-15 18:56:21 +000019/* 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 Dunbar0ae9d252011-11-15 18:34:44 +000023/* 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 Dunbar2bf93402011-11-16 00:20:36 +000034/* Include the standard compiler builtin headers we use functionality from. */
Daniel Dunbarb3a69012009-06-26 16:47:03 +000035#include <limits.h>
Nick Kledzikc31717b2011-01-07 19:09:06 +000036#include <stdint.h>
Daniel Dunbar23d15422011-11-15 19:02:22 +000037#include <stdbool.h>
Daniel Dunbar2bf93402011-11-16 00:20:36 +000038#include <float.h>
39
40/* Include the system math.h, which we use in a number of places. */
Edward O'Callaghandf479b62009-08-04 03:30:10 +000041#include <math.h>
42
Daniel Dunbard3d22632010-03-31 17:00:48 +000043/* If compiling for kernel use, call panic() instead of abort(). */
44#ifdef KERNEL_USE
45extern void panic (const char *, ...);
46#define compilerrt_abort() \
47 panic("%s:%d: abort in %s", __FILE__, __LINE__, __FUNCTION__)
48#else
Daniel Dunbar48f46ac2010-03-31 17:00:45 +000049#define compilerrt_abort() abort()
Daniel Dunbard3d22632010-03-31 17:00:48 +000050#endif
Daniel Dunbar48f46ac2010-03-31 17:00:45 +000051
Edward O'Callaghandf479b62009-08-04 03:30:10 +000052#if !defined(INFINITY) && defined(HUGE_VAL)
53#define INFINITY HUGE_VAL
Edward O'Callaghan0898ee92009-08-05 19:57:20 +000054#endif /* INFINITY */
Daniel Dunbarb3a69012009-06-26 16:47:03 +000055
Daniel Dunbar396a72f2011-11-15 18:56:13 +000056/* Include the commonly used internal type definitions. */
57#include "int_types.h"
Daniel Dunbarb3a69012009-06-26 16:47:03 +000058
Edward O'Callaghan0898ee92009-08-05 19:57:20 +000059#endif /* INT_LIB_H */