summaryrefslogtreecommitdiffstats
path: root/src/ssx/ppc32/ppc32_gcc.h
blob: 1925107128f9a5bf292d3083ec6bae05394ca185 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef __PPC32_GCC_H__
#define __PPC32_GCC_H__

// $Id: ppc32_gcc.h,v 1.1.1.1 2013/12/11 21:03:25 bcbrock Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ssx/ppc32/ppc32_gcc.h,v $
//-----------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2013
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
//-----------------------------------------------------------------------------

/// \file ppc32_gcc.h
/// \brief 32-bit PowerPC functions expected by GCC

#ifndef __ASSEMBLER__

#include <stdint.h>

/// A 64-bit unsigned integer type

typedef union {
    uint64_t value;
    uint32_t word[2];
} Uint64;

/// A 64-bit signed integer type

typedef union {
    int64_t value;
    int32_t word[2];
} Int64;

uint64_t
__lshrdi3(uint64_t x, int i);

uint64_t
__ashldi3(uint64_t x, int i);

uint64_t
__ashrdi3(uint64_t x, int i);

int
__popcountsi2(uint32_t x);

int
__popcountdi2(uint64_t x);

/// Unsigned 64/64 bit divide, returning quotient and remainder via pointers.

void
__ppc32_udiv64(uint64_t u, uint64_t v, uint64_t *q, uint64_t *r);

/// Signed 64/64 bit divide, returning quotient and remainder via pointers.

void
__ppc32_sdiv64(int64_t u, int64_t v, int64_t *q, int64_t *r);

uint64_t 
__udivdi3(uint64_t u, uint64_t v);

int64_t
__divdi3(int64_t u, int64_t v);

int64_t
__moddi3(int64_t u, int64_t v);

uint64_t 
__umoddi3(uint64_t u, uint64_t v);

int
__ucmpdi2(uint64_t a, uint64_t b);

#endif /* __ASSEMBLER__ */

#endif /* __PPC32_GCC_H__ */
OpenPOWER on IntegriCloud