aboutsummaryrefslogtreecommitdiff
path: root/arch/all/core-sh/include/fixed.h
blob: 65234cc3f09d798435c6364279ee59e71c2d916a (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
/* ****************************************************************************
 * fixed.h -- Fixed-point numbers, Renesas' way.
 * Copyright (C) 2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
 *
 * This file is part of the 'all/core-sh' module,
 * in libcarrot, an experimental modular libc project.
 *
 * This file is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option)
 * any later version.
 *
 * This file is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Lesser Public
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this file.  If not, see <http://www.gnu.org/licenses/>.
 * ************************************************************************* */
#include <cdefs.h>

#ifdef _DSPC
# include "stdfix.h" /* XXX: not a good idea? */
# define  FIXED_BIT      UFRACT_FBIT
# define  FIXED_MIN      UFRACT_MIN
# define  FIXED_MAX      UFRACT_MAX
# define  FIXED_EPSILON  UFRACT_EPSILON

# define LFIXED_BIT      ULFRACT_FBIT
# define LFIXED_MIN      ULFRACT_MIN
# define LFIXED_MAX      ULFRACT_MAX
# define LFIXED_EPSILON  ULFRACT_EPSILON

# undef   ACCUM_FBIT
# define  ACCUM_FBIT     UACCUM_FBIT
# undef   ACCUM_IBIT
# define  ACCUM_IBIT     UACCUM_IBIT
# define  ACCUM_BIT      UACCUM_FBIT
# undef   ACCUM_MIN
# define  ACCUM_MIN      UACCUM_MIN
# undef   ACCUM_MAX
# define  ACCUM_MAX      UACCUM_MAX
# undef   ACCUM_EPSILON
# define  ACCUM_EPSILON  UACCUM_EPSILON

# undef  LACCUM_FBIT
# define LACCUM_FBIT     ULACCUM_FBIT
# undef  LACCUM_IBIT
# define LACCUM_IBIT     ULACCUM_IBIT
# define LACCUM_BIT      ULACCUM_IBIT
# undef  LACCUM_MIN
# define LACCUM_MIN      ULACCUM_MIN
# undef  LACCUM_MAX
# define LACCUM_MAX      ULACCUM_MAX
# undef  LACCUM_EPSILON
# define LACCUM_EPSILON  ULACCUM_EPSILON
#endif