buzbee | 5433072 | 2011-08-23 16:46:55 -0700 | [diff] [blame] | 1 | // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 | |
| 3 | #ifndef ART_SRC_RUNTIME_SUPPORT_H_ |
| 4 | #define ART_SRC_RUNTIME_SUPPORT_H_ |
| 5 | |
Ian Rogers | ad42e13 | 2011-09-17 20:23:33 -0700 | [diff] [blame] | 6 | /* Helper for both JNI and regular compiled code */ |
| 7 | extern "C" void art_deliver_exception(void*); |
| 8 | |
buzbee | 5433072 | 2011-08-23 16:46:55 -0700 | [diff] [blame] | 9 | #if defined(__arm__) |
buzbee | 7b1b86d | 2011-08-26 18:59:10 -0700 | [diff] [blame] | 10 | /* Compiler helpers */ |
buzbee | 5433072 | 2011-08-23 16:46:55 -0700 | [diff] [blame] | 11 | extern "C" uint64_t art_shl_long(uint64_t, uint32_t); |
| 12 | extern "C" uint64_t art_shr_long(uint64_t, uint32_t); |
| 13 | extern "C" uint64_t art_ushr_long(uint64_t, uint32_t); |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 14 | extern "C" void art_invoke_interface_trampoline(void*, void*, void*, void*); |
buzbee | 7b1b86d | 2011-08-26 18:59:10 -0700 | [diff] [blame] | 15 | |
| 16 | /* Conversions */ |
| 17 | extern "C" float __aeabi_i2f(int op1); // OP_INT_TO_FLOAT |
| 18 | extern "C" int __aeabi_f2iz(float op1); // OP_FLOAT_TO_INT |
| 19 | extern "C" float __aeabi_d2f(double op1); // OP_DOUBLE_TO_FLOAT |
| 20 | extern "C" double __aeabi_f2d(float op1); // OP_FLOAT_TO_DOUBLE |
| 21 | extern "C" double __aeabi_i2d(int op1); // OP_INT_TO_DOUBLE |
| 22 | extern "C" int __aeabi_d2iz(double op1); // OP_DOUBLE_TO_INT |
| 23 | extern "C" float __aeabi_l2f(long op1); // OP_LONG_TO_FLOAT |
| 24 | extern "C" double __aeabi_l2d(long op1); // OP_LONG_TO_DOUBLE |
| 25 | |
| 26 | /* Single-precision FP arithmetics */ |
| 27 | extern "C" float __aeabi_fadd(float a, float b); // OP_ADD_FLOAT[_2ADDR] |
| 28 | extern "C" float __aeabi_fsub(float a, float b); // OP_SUB_FLOAT[_2ADDR] |
| 29 | extern "C" float __aeabi_fdiv(float a, float b); // OP_DIV_FLOAT[_2ADDR] |
| 30 | extern "C" float __aeabi_fmul(float a, float b); // OP_MUL_FLOAT[_2ADDR] |
| 31 | extern "C" float fmodf(float a, float b); // OP_REM_FLOAT[_2ADDR] |
| 32 | |
| 33 | /* Double-precision FP arithmetics */ |
| 34 | extern "C" double __aeabi_dadd(double a, double b); // OP_ADD_DOUBLE[_2ADDR] |
| 35 | extern "C" double __aeabi_dsub(double a, double b); // OP_SUB_DOUBLE[_2ADDR] |
| 36 | extern "C" double __aeabi_ddiv(double a, double b); // OP_DIV_DOUBLE[_2ADDR] |
| 37 | extern "C" double __aeabi_dmul(double a, double b); // OP_MUL_DOUBLE[_2ADDR] |
| 38 | extern "C" double fmod(double a, double b); // OP_REM_DOUBLE[_2ADDR] |
| 39 | |
| 40 | /* Integer arithmetics */ |
| 41 | extern "C" int __aeabi_idivmod(int op1, int op2); // OP_REM_INT[_2ADDR|_LIT8|_LIT16] |
| 42 | extern "C" int __aeabi_idiv(int op1, int op2); // OP_DIV_INT[_2ADDR|_LIT8|_LIT16] |
| 43 | |
| 44 | /* Long long arithmetics - OP_REM_LONG[_2ADDR] & OP_DIV_LONG[_2ADDR] */ |
| 45 | extern "C" long long __aeabi_ldivmod(long long op1, long long op2); |
buzbee | 439c4fa | 2011-08-27 15:59:07 -0700 | [diff] [blame] | 46 | extern "C" long long __aeabi_lmul(long long op1, long long op2); |
buzbee | 7b1b86d | 2011-08-26 18:59:10 -0700 | [diff] [blame] | 47 | |
buzbee | 5433072 | 2011-08-23 16:46:55 -0700 | [diff] [blame] | 48 | #endif |
| 49 | |
buzbee | 5433072 | 2011-08-23 16:46:55 -0700 | [diff] [blame] | 50 | #endif // ART_SRC_RUNTIME_SUPPORT_H_ |