1 //===-- aeabi_div0.c - ARM Runtime ABI support routines for compiler-rt ---===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file implements the division by zero helper routines as specified by the
10 // Run-time ABI for the ARM Architecture.
12 //===----------------------------------------------------------------------===//
14 // RTABI 4.3.2 - Division by zero
16 // The *div0 functions:
17 // - Return the value passed to them as a parameter
18 // - Or, return a fixed value defined by the execution environment (such as 0)
19 // - Or, raise a signal (often SIGFPE) or throw an exception, and do not return
21 // An application may provide its own implementations of the *div0 functions to
22 // for a particular behaviour from the *div and *divmod functions called out of
25 #include "../int_lib.h"
27 // provide an unused declaration to pacify pendantic compilation
28 extern unsigned char declaration
;
30 #if defined(__ARM_EABI__)
31 AEABI_RTABI
int __attribute__((weak
)) __attribute__((visibility("hidden")))
32 __aeabi_idiv0(int return_value
) {
36 AEABI_RTABI
long long __attribute__((weak
))
37 __attribute__((visibility("hidden"))) __aeabi_ldiv0(long long return_value
) {