2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-22 17:41:55 +00:00

[libgcc] Make __libgcc architecture-specific

This commit is contained in:
Michael Brown 2008-11-18 16:37:15 -08:00
parent dc60c24146
commit 849e4b12d6
7 changed files with 25 additions and 23 deletions

View File

@ -6,6 +6,20 @@
/** Declare a function with standard calling conventions */
#define __asmcall __attribute__ (( cdecl, regparm(0) ))
/**
* Declare a function with libgcc implicit linkage
*
* It seems as though gcc expects its implicit arithmetic functions to
* be cdecl, even if -mrtd is specified. This is somewhat
* inconsistent; for example, if -mregparm=3 is used then the implicit
* functions do become regparm(3).
*
* The implicit calls to memcpy() and memset() which gcc can generate
* do not seem to have this inconsistency; -mregparm and -mrtd affect
* them in the same way as any other function.
*/
#define __libgcc __attribute__ (( cdecl ))
#endif /* ASSEMBLY */
#endif /* _BITS_COMPILER_H */

View File

@ -4,7 +4,7 @@
#include "libgcc.h"
LIBGCC int64_t __divdi3(int64_t num, int64_t den)
__libgcc int64_t __divdi3(int64_t num, int64_t den)
{
int minus = 0;
int64_t v;

View File

@ -4,7 +4,7 @@
#include "libgcc.h"
LIBGCC int64_t __moddi3(int64_t num, int64_t den)
__libgcc int64_t __moddi3(int64_t num, int64_t den)
{
int minus = 0;
int64_t v;

View File

@ -4,7 +4,7 @@
#include "libgcc.h"
LIBGCC uint64_t __udivdi3(uint64_t num, uint64_t den)
__libgcc uint64_t __udivdi3(uint64_t num, uint64_t den)
{
return __udivmoddi4(num, den, NULL);
}

View File

@ -1,6 +1,6 @@
#include "libgcc.h"
LIBGCC uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem_p)
__libgcc uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem_p)
{
uint64_t quot = 0, qbit = 1;

View File

@ -4,7 +4,7 @@
#include "libgcc.h"
LIBGCC uint64_t __umoddi3(uint64_t num, uint64_t den)
__libgcc uint64_t __umoddi3(uint64_t num, uint64_t den)
{
uint64_t v;

View File

@ -4,23 +4,11 @@
#include <stdint.h>
#include <stddef.h>
/*
* It seems as though gcc expects its implicit arithmetic functions to
* be cdecl, even if -mrtd is specified. This is somewhat
* inconsistent; for example, if -mregparm=3 is used then the implicit
* functions do become regparm(3).
*
* The implicit calls to memcpy() and memset() which gcc can generate
* do not seem to have this inconsistency; -mregparm and -mrtd affect
* them in the same way as any other function.
*
*/
#define LIBGCC __attribute__ (( cdecl ))
extern LIBGCC uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem);
extern LIBGCC uint64_t __udivdi3(uint64_t num, uint64_t den);
extern LIBGCC uint64_t __umoddi3(uint64_t num, uint64_t den);
extern LIBGCC int64_t __divdi3(int64_t num, int64_t den);
extern LIBGCC int64_t __moddi3(int64_t num, int64_t den);
extern __libgcc uint64_t __udivmoddi4 ( uint64_t num, uint64_t den,
uint64_t *rem );
extern __libgcc uint64_t __udivdi3 (uint64_t num, uint64_t den );
extern __libgcc uint64_t __umoddi3 ( uint64_t num, uint64_t den );
extern __libgcc int64_t __divdi3 ( int64_t num, int64_t den );
extern __libgcc int64_t __moddi3 ( int64_t num, int64_t den );
#endif /* _LIBGCC_H */