My Project
Loading...
Searching...
No Matches
omMemOps.h
Go to the documentation of this file.
1/*******************************************************************
2 * File: omMemOps.h
3 * Purpose: low-level Macros for memory operations
4 * Author: obachman (Olaf Bachmann)
5 * Created: 11/99
6 *******************************************************************/
7
8#ifndef OM_MEM_OPS_H
9#define OM_MEM_OPS_H
10
11#ifdef DO_DEEP_PROFILE
12extern void _omMemcpyW(long* p1, long* p2, long l);
13#define omMemcpy_nwEVEN(p1, p2, l) _omMemcpyW((long*) p1, (long*) p2, (long) l)
14#define omMemcpy_nwODD(p1, p2, l) _omMemcpyW((long*) p1, (long*) p2, (long) l)
15#define omMemcpyW(p1, p2, l) _omMemcpyW((long*) p1, (long*) p2, (long) l)
16
17extern void _omMemaddW(long* p1, long* p2, long* p3, long l);
18#define omMemaddW(p1, p2, p3, l) _omMemaddW(p1, p2, p3, l)
19#define omMemadd_nwODD(p1, p2, p3, l) _omMemaddW(p1, p2, p3, l)
20#define omMemadd_nwEVEN(p1, p2, p3, l) _omMemaddW(p1, p2, p3, l)
21#define omMemadd_nwONE(p1, p2, p3) _omMemaddW(p1, p2, p3, 1)
22#define omMemadd_nwTWO(p1, p2, p3) _omMemaddW(p1, p2, p3, 2)
23
24extern void _omMemsetW(long* p1, long w, long l);
25#define omMemsetW(p1, w, l) _omMemsetW(p1, w, l)
26
27#else /* ! DO_DEEP_PROFILE */
28
29#define omMemcpyW(p1, p2, l) \
30do \
31{ \
32 long _i = l; \
33 long* _s1 = (long*) (p1); \
34 const long* _s2 = (long*) (p2); \
35 \
36 for (;;) \
37 { \
38 *_s1 = *_s2; \
39 _i--; \
40 if (_i == 0) break; \
41 _s1++; \
42 _s2++; \
43 } \
44} \
45while(0)
46
47#define omMemcpy_nwODD(p1, p2, l) \
48do \
49{ \
50 long _i = (l) - 1; \
51 long* _s1 = (long*) (p1); \
52 const long* _s2 = (long*) (p2); \
53 \
54 *_s1++ = *_s2++; \
55 for (;;) \
56 { \
57 *_s1++ = *_s2++; \
58 *_s1++ = *_s2++; \
59 _i -= 2; \
60 if (_i == 0) break; \
61 } \
62} \
63while(0)
64
65#define omMemcpy_nwEVEN(p1, p2, l) \
66do \
67{ \
68 long _i = l; \
69 long* _s1 = (long*) (p1); \
70 const long* _s2 = (long*) (p2); \
71 \
72 for (;;) \
73 { \
74 *_s1++ = *_s2++; \
75 *_s1++ = *_s2++; \
76 _i -= 2; \
77 if (_i == 0) break; \
78 } \
79} \
80while(0)
81
82#define omMemaddW(P1, P2, P3, L) \
83do \
84{ \
85 unsigned long* _p1 = P1; \
86 const unsigned long* _p2 = P2; \
87 const unsigned long* _p3 = P3; \
88 unsigned long l = L; \
89 \
90 do \
91 { \
92 *_p1++ = *_p2++ + *_p3++; \
93 l--; \
94 } \
95 while(l); \
96} \
97while(0)
98
99#define omMemadd_nwODD(P1, P2, P3, L) \
100do \
101{ \
102 unsigned long* _p1 = P1; \
103 const unsigned long* _p2 = P2; \
104 const unsigned long* _p3 = P3; \
105 unsigned long l = L; \
106 \
107 *_p1++ = *_p2++ + *_p3++; \
108 l--; \
109 \
110 do \
111 { \
112 *_p1++ = *_p2++ + *_p3++; \
113 *_p1++ = *_p2++ + *_p3++; \
114 l -=2; \
115 } \
116 while(l); \
117} \
118while(0)
119
120#define omMemadd_nwEVEN(P1, P2, P3, L) \
121do \
122{ \
123 unsigned long* _p1 = P1; \
124 const unsigned long* _p2 = P2; \
125 const unsigned long* _p3 = P3; \
126 unsigned long l = L; \
127 \
128 do \
129 { \
130 *_p1++ = *_p2++ + *_p3++; \
131 *_p1++ = *_p2++ + *_p3++; \
132 l -=2; \
133 } \
134 while(l); \
135} \
136while(0)
137
138#define omMemadd_nwONE(P1, P2, P3) \
139do \
140{ \
141 unsigned long* _p1 = P1; \
142 const unsigned long* _p2 = P2; \
143 const unsigned long* _p3 = P3; \
144 \
145 *_p1 = *_p2 + *_p3; \
146} \
147while(0)
148
149#define omMemadd_nwTWO(P1, P2, P3) \
150do \
151{ \
152 unsigned long* _p1 = P1; \
153 const unsigned long* _p2 = P2; \
154 const unsigned long* _p3 = P3; \
155 \
156 *_p1++ = *_p2++ + *_p3++; \
157 *_p1 = *_p2 + *_p3; \
158} \
159while(0)
160
161#define omMemsetW(P1, W, L) \
162do \
163{ \
164 long* _p1 = (long*) (P1); \
165 unsigned long _l = L; \
166 unsigned long _w = W; \
167 while(_l) \
168 { \
169 *_p1++ = _w; \
170 _l--; \
171 } \
172} \
173while(0)
174
175#endif /* DO_DEEP_PROFILE */
176
177#endif /* OM_LIST_H */
int l
Definition: cfEzgcd.cc:100
const CanonicalForm & w
Definition: facAbsFact.cc:51