My Project
Chargement...
Recherche...
Aucune correspondance
include
manux
arith64.h
Aller à la documentation de ce fichier.
1
/*----------------------------------------------------------------------------*/
2
/*----------------------------------------------------------------------------*/
3
#ifndef ARITH64_DEF
4
#define ARITH64_DEF
5
6
#define arith64_u64 unsigned long long int
7
#define arith64_s64 signed long long int
8
#define arith64_u32 unsigned int
9
#define arith64_s32 int
10
11
typedef
union
12
{
13
arith64_u64
u64
;
14
arith64_s64
s64
;
15
struct
16
{
17
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
18
arith64_u32
hi
;
arith64_u32
lo;
19
#else
20
arith64_u32
lo;
arith64_u32
hi;
21
#endif
22
} u32;
23
struct
24
{
25
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
26
arith64_s32
hi
;
arith64_s32
lo;
27
#else
28
arith64_s32
lo;
arith64_s32
hi;
29
#endif
30
} s32;
31
}
arith64_word
;
32
33
// extract hi and lo 32-bit words from 64-bit value
34
#define arith64_hi(n) (arith64_word){.u64=n}.u32.hi
35
#define arith64_lo(n) (arith64_word){.u64=n}.u32.lo
36
37
// Negate a if b is negative, via invert and increment.
38
#define arith64_neg(a, b) (((a) ^ ((((arith64_s64)(b)) >= 0) - 1)) + (((arith64_s64)(b)) < 0))
39
#define arith64_abs(a) arith64_neg(a, a)
40
41
/*
42
*/
43
arith64_s64
__moddi3
(
arith64_s64
a
,
arith64_s64
b
);
44
45
/*
46
*/
47
arith64_s64
__divdi3
(
arith64_s64
a
,
arith64_s64
b
);
48
49
50
#endif
__divdi3
arith64_s64 __divdi3(arith64_s64 a, arith64_s64 b)
Definition
arith64.c:159
arith64_u32
#define arith64_u32
Definition
arith64.h:8
__moddi3
arith64_s64 __moddi3(arith64_s64 a, arith64_s64 b)
Definition
arith64.c:192
arith64_s64
#define arith64_s64
Definition
arith64.h:7
arith64_s32
#define arith64_s32
Definition
arith64.h:9
arith64_u64
#define arith64_u64
Definition
arith64.h:6
b
uint16_t b
Definition
main-bootreg.c:24
a
uint16_t a
Exemple de fonction de mise-à-jour d'un paramètre dans un registre.
Definition
main-bootreg.c:24
arith64_word
Definition
arith64.h:12
arith64_word::hi
arith64_s32 hi
Definition
arith64.h:26
arith64_word::u64
arith64_u64 u64
Definition
arith64.h:13
arith64_word::s64
arith64_s64 s64
Definition
arith64.h:14
arith64_word::hi
arith64_u32 hi
Definition
arith64.h:18
Généré par
1.9.8