aboutsummaryrefslogtreecommitdiffstats
path: root/awlsim/common/datatypehelpers.pxd.in
blob: 2f8270d0a24ed1c96ba200e4df318baada96158c (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
from awlsim.common.cython_support cimport *

cdef uint16_t swapEndianWord(uint16_t word)
cdef uint32_t swapEndianDWord(uint32_t dword)

cdef int32_t byteToSignedPyInt(uint8_t byte)
cdef int32_t wordToSignedPyInt(uint16_t word)
cdef int32_t dwordToSignedPyInt(uint32_t dword)
cdef int64_t qwordToSignedPyInt(uint64_t dword)

cdef uint32_t pyFloatToDWord(double pyfl)
cdef double dwordToPyFloat(uint32_t dword)

cdef class FloatConst(object):
	cdef public uint32_t minNormPosFloat32DWord
	cdef public double minNormPosFloat32

	cdef public uint32_t minNormNegFloat32DWord
	cdef public double minNormNegFloat32

	cdef public uint32_t maxNormNegFloat32DWord
	cdef public double maxNormNegFloat32

	cdef public uint32_t maxNormPosFloat32DWord
	cdef public double maxNormPosFloat32

	cdef public uint32_t posInfDWord
	cdef public double posInfFloat

	cdef public uint32_t negInfDWord
	cdef public double negInfFloat

	cdef public uint32_t pNaNDWord

	cdef public uint32_t nNaNDWord
	cdef public double nNaNFloat

cdef public FloatConst floatConst

cdef _Bool isNaN(uint32_t dword)
cdef _Bool isDenormalPyFloat(double pyfl)
cdef _Bool pyFloatEqual(double pyfl0, double pyfl1)
cdef _Bool floatEqual(object fl0, object fl1)
cdef uint32_t roundUp(uint32_t n, uint32_t s)
cdef uint32_t intDivRoundUp(uint32_t n, uint32_t d)
bues.ch cgit interface