source: soft/giet_vm/applications/rosenfeld/nrc2/include/nrarith0.h @ 772

Last change on this file since 772 was 772, checked in by meunier, 8 years ago
  • Ajout de l'application rosenfeld
  • Changement du nom du flag O_CREATE en O_CREAT
File size: 4.7 KB
Line 
1/* ------------------ */
2/* --- nrarith0.h --- */
3/* ------------------ */
4
5/*
6 * Copyright (c) 2000-2014, Lionel Lacassagne, All rights reserved
7 * Univ Paris Sud XI, CNRS
8*/
9
10#ifndef __NRARITH0_H__
11#define __NRARITH0_H__
12
13#ifdef __cplusplus
14#pragma message ("C++")
15extern "C" {
16#endif
17
18#ifdef VERBOSE_PRAGMA
19//#pragma message(" -include nrarith0.h")
20#endif
21
22/* ---------- */
23/* -- Swap -- */
24/* ---------- */
25
26ROUTINE(void)   i8swap(int8    *a, int8    *b);
27ROUTINE(void)  i16swap(int16   *a, int16   *b);
28ROUTINE(void)  i32swap(int32   *a, int32   *b);
29ROUTINE(void)  i64swap(int64   *a, int64   *b);
30ROUTINE(void)  f32swap(float32 *a, float32 *b);
31ROUTINE(void)  f64swap(float64 *a, float64 *b);
32ROUTINE(void)  rgb8swap(rgb8   *a, rgb8    *b);
33ROUTINE(void) rgbx8swap(rgbx8  *a, rgbx8   *b);
34
35/* --------- */
36/* -- Min -- */
37/* --------- */
38
39ROUTINE(float32) f32min (float32 x1, float32 x2);
40ROUTINE(float32) f32min2(float32 x1, float32 x2);
41ROUTINE(float32) f32min3(float32 x1, float32 x2, float32 x3);
42ROUTINE(float32) f32min4(float32 x1, float32 x2, float32 x3, float32 x4);
43ROUTINE(float32) f32min5(float32 x1, float32 x2, float32 x3, float32 x4, float32 x5);
44
45ROUTINE(float64) f64min (float64 x1, float64 x2);
46ROUTINE(float64) f64min2(float64 x1, float64 x2);
47ROUTINE(float64) f64min3(float64 x1, float64 x2, float64 x3);
48ROUTINE(float64) f64min4(float64 x1, float64 x2, float64 x3, float64 x4);
49ROUTINE(float64) f64min5(float64 x1, float64 x2, float64 x3, float64 x4, float64 x5);
50
51ROUTINE(byte)  bmin (byte x1, byte x2);
52ROUTINE(byte)  bmin2(byte x1, byte x2);
53ROUTINE(byte)  bmin3(byte x1, byte x2, byte x3);
54ROUTINE(byte)  bmin4(byte x1, byte x2, byte x3, byte x4);
55ROUTINE(byte)  bmin5(byte x1, byte x2, byte x3, byte x4, byte x5);
56
57ROUTINE(uint16) ui16min (uint16 x1, uint16 x2);
58ROUTINE(uint16) ui16min2(uint16 x1, uint16 x2);
59ROUTINE(uint16) ui16min3(uint16 x1, uint16 x2, uint16 x3);
60ROUTINE(uint16) ui16min4(uint16 x1, uint16 x2, uint16 x3, uint16 x4);
61ROUTINE(uint16) ui16min5(uint16 x1, uint16 x2, uint16 x3, uint16 x4, uint16 x5);
62
63ROUTINE(int32) i32min (int32 x1, int32 x2);
64ROUTINE(int32) i32min2(int32 x1, int32 x2);
65ROUTINE(int32) i32min3(int32 x1, int32 x2, int32 x3);
66ROUTINE(int32) i32min4(int32 x1, int32 x2, int32 x3, int32 x4);
67ROUTINE(int32) i32min5(int32 x1, int32 x2, int32 x3, int32 x4, int32 x5);
68
69ROUTINE(rgb8) rgb8min (rgb8 x1, rgb8 x2);
70ROUTINE(rgb8) rgb8min2(rgb8 x1, rgb8 x2);
71ROUTINE(rgb8) rgb8min3(rgb8 x1, rgb8 x2, rgb8 x3);
72ROUTINE(rgb8) rgb8min4(rgb8 x1, rgb8 x2, rgb8 x3, rgb8 x4);
73ROUTINE(rgb8) rgb8min5(rgb8 x1, rgb8 x2, rgb8 x3, rgb8 x4, rgb8 x5);
74
75/* --------- */
76/* -- Max -- */
77/* --------- */
78ROUTINE(float32) f32max (float32 x1, float32 x2);
79ROUTINE(float32) f32max2(float32 x1, float32 x2);
80ROUTINE(float32) f32max3(float32 x1, float32 x2, float32 x3);
81ROUTINE(float32) f32max4(float32 x1, float32 x2, float32 x3, float32 x4);
82ROUTINE(float32) f32max5(float32 x1, float32 x2, float32 x3, float32 x4, float32 x5);
83
84ROUTINE(float64) f64max (float64 x1, float64 x2);
85ROUTINE(float64) f64max2(float64 x1, float64 x2);
86ROUTINE(float64) f64max3(float64 x1, float64 x2, float64 x3);
87ROUTINE(float64) f64max4(float64 x1, float64 x2, float64 x3, float64 x4);
88ROUTINE(float64) f64max5(float64 x1, float64 x2, float64 x3, float64 x4, float64 x5);
89
90ROUTINE(byte)  bmax (byte x1,  byte x2);
91ROUTINE(byte)  bmax2(byte x1,  byte x2);
92ROUTINE(byte)  bmax3(byte x1,  byte x2, byte x3);
93ROUTINE(byte)  bmax4(byte x1,  byte x2, byte x3, byte x4);
94ROUTINE(byte)  bmax5(byte x1,  byte x2, byte x3, byte x4, byte x5);
95
96ROUTINE(uint16) ui16max (uint16 x1, uint16 x2);
97ROUTINE(uint16) ui16max2(uint16 x1, uint16 x2);
98ROUTINE(uint16) ui16max3(uint16 x1, uint16 x2, uint16 x3);
99ROUTINE(uint16) ui16max4(uint16 x1, uint16 x2, uint16 x3, uint16 x4);
100ROUTINE(uint16) ui16max5(uint16 x1, uint16 x2, uint16 x3, uint16 x4, uint16 x5);
101
102ROUTINE(int32) i32max (int32 x1, int32 x2);
103ROUTINE(int32) i32max2(int32 x1, int32 x2);
104ROUTINE(int32) i32max3(int32 x1, int32 x2, int32 x3);
105ROUTINE(int32) i32max4(int32 x1, int32 x2, int32 x3, int32 x4);
106ROUTINE(int32) i32max5(int32 x1, int32 x2, int32 x3, int32 x4, int32 x5);
107
108ROUTINE(rgb8) rgb8max (rgb8 x1, rgb8 x2);
109ROUTINE(rgb8) rgb8max2(rgb8 x1, rgb8 x2);
110ROUTINE(rgb8) rgb8max3(rgb8 x1, rgb8 x2, rgb8 x3);
111ROUTINE(rgb8) rgb8max4(rgb8 x1, rgb8 x2, rgb8 x3, rgb8 x4);
112ROUTINE(rgb8) rgb8max5(rgb8 x1, rgb8 x2, rgb8 x3, rgb8 x4, rgb8 x5);
113
114/* ----------- */
115/* -- Other -- */
116/* ----------- */
117
118ROUTINE(byte) ibit(int32 x, int n);
119ROUTINE(int32) sym_int32(int32 x);
120ROUTINE(int) myLog2(int x);
121ROUTINE(int) next_power2(int x);
122ROUTINE(int) myGCD(int u, int v);
123ROUTINE(int) myLCM(int u, int v);
124
125#ifdef __cplusplus
126}
127#endif
128
129#else
130//#pragma message(" Warning : attempt to re-include nrarith0.h")
131#endif
132
Note: See TracBrowser for help on using the repository browser.