blob: e7aeb74771640e5f59a6e8c929fcd003245e55d4 [file] [log] [blame]
buzbee54330722011-08-23 16:46:55 -07001// Copyright 2011 Google Inc. All Rights Reserved.
2
3#ifndef ART_SRC_RUNTIME_SUPPORT_H_
4#define ART_SRC_RUNTIME_SUPPORT_H_
5
Ian Rogersad42e132011-09-17 20:23:33 -07006/* Helper for both JNI and regular compiled code */
Ian Rogersff1ed472011-09-20 13:46:24 -07007extern "C" void art_deliver_exception_from_code(void*);
Ian Rogersad42e132011-09-17 20:23:33 -07008
buzbee54330722011-08-23 16:46:55 -07009#if defined(__arm__)
buzbee7b1b86d2011-08-26 18:59:10 -070010 /* Compiler helpers */
Ian Rogersff1ed472011-09-20 13:46:24 -070011 extern "C" void art_check_cast_from_code(void*, void*);
12 extern "C" void art_handle_fill_data_from_code(void*, void*);
13 extern "C" void art_invoke_interface_trampoline(void*, void*, void*, void*);
14 extern "C" void art_throw_array_bounds_from_code(int32_t index, int32_t limit);
15 extern "C" void art_throw_div_zero_from_code();
16 extern "C" void art_throw_null_pointer_exception_from_code();
17 extern "C" void art_unlock_object_from_code(void*, void*);
buzbee54330722011-08-23 16:46:55 -070018 extern "C" uint64_t art_shl_long(uint64_t, uint32_t);
19 extern "C" uint64_t art_shr_long(uint64_t, uint32_t);
20 extern "C" uint64_t art_ushr_long(uint64_t, uint32_t);
Ian Rogers9651f422011-09-19 20:26:07 -070021 extern "C" void art_throw_null_pointer_exception_from_code();
22 extern "C" void art_throw_div_zero_from_code();
23 extern "C" void art_throw_array_bounds_from_code(int32_t index, int32_t limit);
buzbee4a3164f2011-09-03 11:25:10 -070024 extern "C" void art_invoke_interface_trampoline(void*, void*, void*, void*);
buzbeec1f45042011-09-21 16:03:19 -070025 extern "C" void art_test_suspend();
buzbee7b1b86d2011-08-26 18:59:10 -070026
27 /* Conversions */
28 extern "C" float __aeabi_i2f(int op1); // OP_INT_TO_FLOAT
29 extern "C" int __aeabi_f2iz(float op1); // OP_FLOAT_TO_INT
30 extern "C" float __aeabi_d2f(double op1); // OP_DOUBLE_TO_FLOAT
31 extern "C" double __aeabi_f2d(float op1); // OP_FLOAT_TO_DOUBLE
32 extern "C" double __aeabi_i2d(int op1); // OP_INT_TO_DOUBLE
33 extern "C" int __aeabi_d2iz(double op1); // OP_DOUBLE_TO_INT
34 extern "C" float __aeabi_l2f(long op1); // OP_LONG_TO_FLOAT
35 extern "C" double __aeabi_l2d(long op1); // OP_LONG_TO_DOUBLE
36
37 /* Single-precision FP arithmetics */
38 extern "C" float __aeabi_fadd(float a, float b); // OP_ADD_FLOAT[_2ADDR]
39 extern "C" float __aeabi_fsub(float a, float b); // OP_SUB_FLOAT[_2ADDR]
40 extern "C" float __aeabi_fdiv(float a, float b); // OP_DIV_FLOAT[_2ADDR]
41 extern "C" float __aeabi_fmul(float a, float b); // OP_MUL_FLOAT[_2ADDR]
42 extern "C" float fmodf(float a, float b); // OP_REM_FLOAT[_2ADDR]
43
44 /* Double-precision FP arithmetics */
45 extern "C" double __aeabi_dadd(double a, double b); // OP_ADD_DOUBLE[_2ADDR]
46 extern "C" double __aeabi_dsub(double a, double b); // OP_SUB_DOUBLE[_2ADDR]
47 extern "C" double __aeabi_ddiv(double a, double b); // OP_DIV_DOUBLE[_2ADDR]
48 extern "C" double __aeabi_dmul(double a, double b); // OP_MUL_DOUBLE[_2ADDR]
49 extern "C" double fmod(double a, double b); // OP_REM_DOUBLE[_2ADDR]
50
51 /* Integer arithmetics */
52 extern "C" int __aeabi_idivmod(int op1, int op2); // OP_REM_INT[_2ADDR|_LIT8|_LIT16]
53 extern "C" int __aeabi_idiv(int op1, int op2); // OP_DIV_INT[_2ADDR|_LIT8|_LIT16]
54
Ian Rogersff1ed472011-09-20 13:46:24 -070055 /* Long long arithmetics - OP_REM_LONG[_2ADDR] & OP_DIV_LONG[_2ADDR] */
56 extern "C" long long __aeabi_ldivmod(long long op1, long long op2);
57 extern "C" long long __aeabi_lmul(long long op1, long long op2);
buzbee7b1b86d2011-08-26 18:59:10 -070058
buzbee54330722011-08-23 16:46:55 -070059#endif
60
buzbee54330722011-08-23 16:46:55 -070061#endif // ART_SRC_RUNTIME_SUPPORT_H_