blob: f1c1b11895f281740e78b8c6f137c85bc28c625a [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 Dunbar0ae9d252011-11-15 18:34:44 +000019/* ABI macro definitions */
20
21#if __ARM_EABI__
22# define ARM_EABI_FNALIAS(aeabi_name, name) \
23 void __aeabi_##aeabi_name() __attribute__((alias("__" #name)));
24# define COMPILER_RT_ABI __attribute__((pcs("aapcs")))
25#else
26# define ARM_EABI_FNALIAS(aeabi_name, name)
27# define COMPILER_RT_ABI
28#endif
29
Edward O'Callaghan0e4ad9c2009-08-05 01:47:29 +000030/* Assumption: signed integral is 2's complement */
31/* Assumption: right shift of signed negative is arithmetic shift */
Daniel Dunbarb3a69012009-06-26 16:47:03 +000032
33#include <limits.h>
Nick Kledzikc31717b2011-01-07 19:09:06 +000034#include <stdint.h>
Edward O'Callaghan1fcb40b2009-08-05 19:06:50 +000035#include "endianness.h"
Edward O'Callaghandf479b62009-08-04 03:30:10 +000036#include <math.h>
37
Daniel Dunbard3d22632010-03-31 17:00:48 +000038/* If compiling for kernel use, call panic() instead of abort(). */
39#ifdef KERNEL_USE
40extern void panic (const char *, ...);
41#define compilerrt_abort() \
42 panic("%s:%d: abort in %s", __FILE__, __LINE__, __FUNCTION__)
43#else
Daniel Dunbar48f46ac2010-03-31 17:00:45 +000044#define compilerrt_abort() abort()
Daniel Dunbard3d22632010-03-31 17:00:48 +000045#endif
Daniel Dunbar48f46ac2010-03-31 17:00:45 +000046
Edward O'Callaghandf479b62009-08-04 03:30:10 +000047#if !defined(INFINITY) && defined(HUGE_VAL)
48#define INFINITY HUGE_VAL
Edward O'Callaghan0898ee92009-08-05 19:57:20 +000049#endif /* INFINITY */
Daniel Dunbarb3a69012009-06-26 16:47:03 +000050
Daniel Dunbar396a72f2011-11-15 18:56:13 +000051/* Include the commonly used internal type definitions. */
52#include "int_types.h"
Daniel Dunbarb3a69012009-06-26 16:47:03 +000053
Edward O'Callaghan0898ee92009-08-05 19:57:20 +000054#endif /* INT_LIB_H */