Logo
Explore Help
Sign In
sysadmin/ipxe
1
0
Fork 0
You've already forked ipxe
mirror of https://github.com/ipxe/ipxe synced 2026-03-16 03:02:07 +03:00
Code Issues Packages Projects Releases Wiki Activity
Files
9bdfc36bcc6157da0e6f0713202a9b6891b642d1
ipxe/src/libgcc/__divdi3.c

27 lines
333 B
C
Raw Normal View History

Import various libgcc functions from syslinux. Experimentation reveals that gcc ignores -mrtd for the implicit arithmetic functions (e.g. __udivdi3), but not for the implicit memcpy() and memset() functions. Mark the implicit arithmetic functions with __attribute__((cdecl)) to compensate for this. (Note: we cannot mark with with __cdecl, because we define __cdecl to incorporate regparm(0) as well.)
2007-07-30 02:37:42 +01:00
/*
* arch/i386/libgcc/__divdi3.c
*/
#include "libgcc.h"
[libgcc] Make __libgcc architecture-specific
2008-11-18 16:37:15 -08:00
__libgcc int64_t __divdi3(int64_t num, int64_t den)
Import various libgcc functions from syslinux. Experimentation reveals that gcc ignores -mrtd for the implicit arithmetic functions (e.g. __udivdi3), but not for the implicit memcpy() and memset() functions. Mark the implicit arithmetic functions with __attribute__((cdecl)) to compensate for this. (Note: we cannot mark with with __cdecl, because we define __cdecl to incorporate regparm(0) as well.)
2007-07-30 02:37:42 +01:00
{
int minus = 0;
int64_t v;
if ( num < 0 ) {
num = -num;
minus = 1;
}
if ( den < 0 ) {
den = -den;
minus ^= 1;
}
v = __udivmoddi4(num, den, NULL);
if ( minus )
v = -v;
return v;
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.4 Page: 110ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API