brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · f514407 Raw
31 lines · c
1//===-- divsi3.c - Implement __divsi3 -------------------------------------===//2//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-exception6//7//===----------------------------------------------------------------------===//8//9// This file implements __divsi3 for the compiler_rt library.10//11//===----------------------------------------------------------------------===//12 13#include "int_lib.h"14 15// Returns: a / b16 17#define fixint_t si_int18#define fixuint_t su_int19// On CPUs without unsigned hardware division support,20//  this calls __udivsi3 (notice the cast to su_int).21// On CPUs with unsigned hardware division support,22//  this uses the unsigned division instruction.23#define COMPUTE_UDIV(a, b) ((su_int)(a) / (su_int)(b))24#include "int_div_impl.inc"25 26COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b) { return __divXi3(a, b); }27 28#if defined(__ARM_EABI__)29COMPILER_RT_ALIAS(__divsi3, __aeabi_idiv)30#endif31