Path: blob/main/contrib/llvm-project/compiler-rt/lib/builtins/arm/aeabi_div0.c
35292 views
//===-- aeabi_div0.c - ARM Runtime ABI support routines for compiler-rt ---===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file implements the division by zero helper routines as specified by the9// Run-time ABI for the ARM Architecture.10//11//===----------------------------------------------------------------------===//1213// RTABI 4.3.2 - Division by zero14//15// The *div0 functions:16// - Return the value passed to them as a parameter17// - Or, return a fixed value defined by the execution environment (such as 0)18// - Or, raise a signal (often SIGFPE) or throw an exception, and do not return19//20// An application may provide its own implementations of the *div0 functions to21// for a particular behaviour from the *div and *divmod functions called out of22// line.2324#include "../int_lib.h"2526// provide an unused declaration to pacify pendantic compilation27extern unsigned char declaration;2829#if defined(__ARM_EABI__)30AEABI_RTABI int __attribute__((weak)) __attribute__((visibility("hidden")))31__aeabi_idiv0(int return_value) {32return return_value;33}3435AEABI_RTABI long long __attribute__((weak))36__attribute__((visibility("hidden"))) __aeabi_ldiv0(long long return_value) {37return return_value;38}39#endif404142