~ubuntu-branches/ubuntu/vivid/mpich/vivid-proposed

« back to all changes in this revision

Viewing changes to src/mpid/common/datatype/dataloop/veccpy.h

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-04-01 20:24:20 UTC
  • mfrom: (5.2.4 sid)
  • Revision ID: package-import@ubuntu.com-20140401202420-t5ey1ia2klt5dkq3
Tags: 3.1-4
* [c3e3398] Disable test_primitives, which is unreliable on some platforms.
            (Closes: #743047)
* [265a699] Add minimal autotest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
{                                                               \
55
55
    type * l_src = (type *) src, * l_dest = (type *) dest;      \
56
56
    type * tmp_src = l_src;                                     \
57
 
    register int _i, j, k;                                      \
 
57
    register int k;                                             \
 
58
    register unsigned long _i, j;                               \
58
59
    unsigned long total_count = count * nelms;                  \
59
 
    const int l_stride = stride;                                \
 
60
    const DLOOP_Offset l_stride = stride;                       \
60
61
                                                                \
 
62
    DLOOP_Assert(stride <= INT_MAX);                            \
 
63
    DLOOP_Assert(total_count <= INT_MAX);                       \
 
64
    DLOOP_Assert(nelms <= INT_MAX);                             \
61
65
    if (nelms == 1) {                                           \
62
 
        for (_i = total_count; _i; _i--) {                              \
 
66
        for (_i = (int)total_count; _i; _i--) {                 \
63
67
            *l_dest++ = *l_src;                                 \
64
68
            l_src += l_stride;                                  \
65
69
        }                                                       \
66
70
    }                                                           \
67
71
    else if (nelms == 2) {                                      \
68
 
        for (_i = total_count; _i; _i -= 2) {                   \
 
72
        for (_i = (int)total_count; _i; _i -= 2) {              \
69
73
            *l_dest++ = l_src[0];                               \
70
74
            *l_dest++ = l_src[1];                               \
71
75
            l_src += l_stride;                                  \
72
76
        }                                                       \
73
77
    }                                                           \
74
78
    else if (nelms == 3) {                                      \
75
 
        for (_i = total_count; _i; _i -= 3) {                   \
 
79
        for (_i = (int)total_count; _i; _i -= 3) {              \
76
80
            *l_dest++ = l_src[0];                               \
77
81
            *l_dest++ = l_src[1];                               \
78
82
            *l_dest++ = l_src[2];                               \
80
84
        }                                                       \
81
85
    }                                                           \
82
86
    else if (nelms == 4) {                                      \
83
 
        for (_i = total_count; _i; _i -= 4) {                   \
 
87
        for (_i = (int)total_count; _i; _i -= 4) {              \
84
88
            *l_dest++ = l_src[0];                               \
85
89
            *l_dest++ = l_src[1];                               \
86
90
            *l_dest++ = l_src[2];                               \
89
93
        }                                                       \
90
94
    }                                                           \
91
95
    else if (nelms == 5) {                                      \
92
 
        for (_i = total_count; _i; _i -= 5) {                   \
 
96
        for (_i = (int)total_count; _i; _i -= 5) {              \
93
97
            *l_dest++ = l_src[0];                               \
94
98
            *l_dest++ = l_src[1];                               \
95
99
            *l_dest++ = l_src[2];                               \
99
103
        }                                                       \
100
104
    }                                                           \
101
105
    else if (nelms == 6) {                                      \
102
 
        for (_i = total_count; _i; _i -= 6) {                   \
 
106
        for (_i = (int)total_count; _i; _i -= 6) {              \
103
107
            *l_dest++ = l_src[0];                               \
104
108
            *l_dest++ = l_src[1];                               \
105
109
            *l_dest++ = l_src[2];                               \
110
114
        }                                                       \
111
115
    }                                                           \
112
116
    else if (nelms == 7) {                                      \
113
 
        for (_i = total_count; _i; _i -= 7) {                   \
 
117
        for (_i = (int)total_count; _i; _i -= 7) {              \
114
118
            *l_dest++ = l_src[0];                               \
115
119
            *l_dest++ = l_src[1];                               \
116
120
            *l_dest++ = l_src[2];                               \
122
126
        }                                                       \
123
127
    }                                                           \
124
128
    else if (nelms == 8) {                                      \
125
 
        for (_i = total_count; _i; _i -= 8) {                   \
 
129
        for (_i = (int)total_count; _i; _i -= 8) {              \
126
130
            *l_dest++ = l_src[0];                               \
127
131
            *l_dest++ = l_src[1];                               \
128
132
            *l_dest++ = l_src[2];                               \
135
139
        }                                                       \
136
140
    }                                                           \
137
141
    else {                                                      \
138
 
        _i = total_count;                                        \
 
142
        _i = (int)total_count;                                  \
139
143
        while (_i) {                                             \
140
144
            tmp_src = l_src;                                    \
141
 
            j = nelms;                                          \
 
145
            j = (int)nelms;                                     \
142
146
            while (j >= 8) {                                    \
143
147
                *l_dest++ = tmp_src[0];                         \
144
148
                *l_dest++ = tmp_src[1];                         \
166
170
{                                                               \
167
171
    type * l_src = (type *) src, * l_dest = (type *) dest;      \
168
172
    type * tmp_src = l_src;                                     \
169
 
    register int _i, j, k;                                      \
170
 
    unsigned long total_count = count * nelms;                  \
171
 
    const int l_stride = stride;                                \
 
173
    register int k;                                                     \
 
174
    register unsigned long _i, j, total_count = count * nelms;          \
 
175
    const DLOOP_Offset l_stride = stride;                               \
172
176
                                                                \
 
177
    DLOOP_Assert(stride <= INT_MAX);                            \
 
178
    DLOOP_Assert(total_count <= INT_MAX);                       \
 
179
    DLOOP_Assert(nelms <= INT_MAX);                             \
173
180
    if (nelms == 1) {                                           \
174
 
        for (_i = total_count; _i; _i--) {                              \
 
181
        for (_i = (int)total_count; _i; _i--) {                 \
175
182
            *l_dest++ = *l_src;                                 \
176
183
            l_src = (type *) ((char *) l_src + l_stride);       \
177
184
        }                                                       \
178
185
    }                                                           \
179
186
    else if (nelms == 2) {                                      \
180
 
        for (_i = total_count; _i; _i -= 2) {                   \
 
187
        for (_i = (int)total_count; _i; _i -= 2) {              \
181
188
            *l_dest++ = l_src[0];                               \
182
189
            *l_dest++ = l_src[1];                               \
183
190
            l_src = (type *) ((char *) l_src + l_stride);       \
184
191
        }                                                       \
185
192
    }                                                           \
186
193
    else if (nelms == 3) {                                      \
187
 
        for (_i = total_count; _i; _i -= 3) {                   \
 
194
        for (_i = (int)total_count; _i; _i -= 3) {              \
188
195
            *l_dest++ = l_src[0];                               \
189
196
            *l_dest++ = l_src[1];                               \
190
197
            *l_dest++ = l_src[2];                               \
192
199
        }                                                       \
193
200
    }                                                           \
194
201
    else if (nelms == 4) {                                      \
195
 
        for (_i = total_count; _i; _i -= 4) {                   \
 
202
        for (_i = (int)total_count; _i; _i -= 4) {              \
196
203
            *l_dest++ = l_src[0];                               \
197
204
            *l_dest++ = l_src[1];                               \
198
205
            *l_dest++ = l_src[2];                               \
201
208
        }                                                       \
202
209
    }                                                           \
203
210
    else if (nelms == 5) {                                      \
204
 
        for (_i = total_count; _i; _i -= 5) {                   \
 
211
        for (_i = (int)total_count; _i; _i -= 5) {              \
205
212
            *l_dest++ = l_src[0];                               \
206
213
            *l_dest++ = l_src[1];                               \
207
214
            *l_dest++ = l_src[2];                               \
211
218
        }                                                       \
212
219
    }                                                           \
213
220
    else if (nelms == 6) {                                      \
214
 
        for (_i = total_count; _i; _i -= 6) {                   \
 
221
        for (_i = (int)total_count; _i; _i -= 6) {              \
215
222
            *l_dest++ = l_src[0];                               \
216
223
            *l_dest++ = l_src[1];                               \
217
224
            *l_dest++ = l_src[2];                               \
222
229
        }                                                       \
223
230
    }                                                           \
224
231
    else if (nelms == 7) {                                      \
225
 
        for (_i = total_count; _i; _i -= 7) {                   \
 
232
        for (_i = (int)total_count; _i; _i -= 7) {              \
226
233
            *l_dest++ = l_src[0];                               \
227
234
            *l_dest++ = l_src[1];                               \
228
235
            *l_dest++ = l_src[2];                               \
234
241
        }                                                       \
235
242
    }                                                           \
236
243
    else if (nelms == 8) {                                      \
237
 
        for (_i = total_count; _i; _i -= 8) {                   \
 
244
        for (_i = (int)total_count; _i; _i -= 8) {              \
238
245
            *l_dest++ = l_src[0];                               \
239
246
            *l_dest++ = l_src[1];                               \
240
247
            *l_dest++ = l_src[2];                               \
247
254
        }                                                       \
248
255
    }                                                           \
249
256
    else {                                                      \
250
 
        _i = total_count;                                        \
 
257
        _i = (int)total_count;                                  \
251
258
        while (_i) {                                             \
252
259
            tmp_src = l_src;                                    \
253
 
            j = nelms;                                          \
 
260
            j = (int)nelms;                                     \
254
261
            while (j >= 8) {                                    \
255
262
                *l_dest++ = tmp_src[0];                         \
256
263
                *l_dest++ = tmp_src[1];                         \
278
285
{                                                               \
279
286
    type * l_src = (type *) src, * l_dest = (type *) dest;      \
280
287
    type * tmp_dest = l_dest;                                   \
281
 
    register int _i, j, k;                                      \
 
288
    register int k;                                             \
 
289
    register unsigned long _i, j;                               \
282
290
    unsigned long total_count = count * nelms;                  \
283
 
    const int l_stride = stride;                                \
 
291
    const DLOOP_Offset l_stride = stride;                               \
284
292
                                                                \
 
293
    DLOOP_Assert(stride <= INT_MAX);                            \
 
294
    DLOOP_Assert(total_count <= INT_MAX);                       \
 
295
    DLOOP_Assert(nelms <= INT_MAX);                             \
285
296
    if (nelms == 1) {                                           \
286
 
        for (_i = total_count; _i; _i--) {                              \
 
297
        for (_i = (int)total_count; _i; _i--) {                 \
287
298
            *l_dest = *l_src++;                                 \
288
299
            l_dest += l_stride;                                 \
289
300
        }                                                       \
290
301
    }                                                           \
291
302
    else if (nelms == 2) {                                      \
292
 
        for (_i = total_count; _i; _i -= 2) {                   \
 
303
        for (_i = (int)total_count; _i; _i -= 2) {              \
293
304
            l_dest[0] = *l_src++;                               \
294
305
            l_dest[1] = *l_src++;                               \
295
306
            l_dest += l_stride;                                 \
296
307
        }                                                       \
297
308
    }                                                           \
298
309
    else if (nelms == 3) {                                      \
299
 
        for (_i = total_count; _i; _i -= 3) {                   \
 
310
        for (_i = (int)total_count; _i; _i -= 3) {              \
300
311
            l_dest[0] = *l_src++;                               \
301
312
            l_dest[1] = *l_src++;                               \
302
313
            l_dest[2] = *l_src++;                               \
304
315
        }                                                       \
305
316
    }                                                           \
306
317
    else if (nelms == 4) {                                      \
307
 
        for (_i = total_count; _i; _i -= 4) {                   \
 
318
        for (_i = (int)total_count; _i; _i -= 4) {              \
308
319
            l_dest[0] = *l_src++;                               \
309
320
            l_dest[1] = *l_src++;                               \
310
321
            l_dest[2] = *l_src++;                               \
313
324
        }                                                       \
314
325
    }                                                           \
315
326
    else if (nelms == 5) {                                      \
316
 
        for (_i = total_count; _i; _i -= 5) {                   \
 
327
        for (_i = (int)total_count; _i; _i -= 5) {              \
317
328
            l_dest[0] = *l_src++;                               \
318
329
            l_dest[1] = *l_src++;                               \
319
330
            l_dest[2] = *l_src++;                               \
323
334
        }                                                       \
324
335
    }                                                           \
325
336
    else if (nelms == 6) {                                      \
326
 
        for (_i = total_count; _i; _i -= 6) {                   \
 
337
        for (_i = (int)total_count; _i; _i -= 6) {              \
327
338
            l_dest[0] = *l_src++;                               \
328
339
            l_dest[1] = *l_src++;                               \
329
340
            l_dest[2] = *l_src++;                               \
334
345
        }                                                       \
335
346
    }                                                           \
336
347
    else if (nelms == 7) {                                      \
337
 
        for (_i = total_count; _i; _i -= 7) {                   \
 
348
        for (_i = (int)total_count; _i; _i -= 7) {              \
338
349
            l_dest[0] = *l_src++;                               \
339
350
            l_dest[1] = *l_src++;                               \
340
351
            l_dest[2] = *l_src++;                               \
346
357
        }                                                       \
347
358
    }                                                           \
348
359
    else if (nelms == 8) {                                      \
349
 
        for (_i = total_count; _i; _i -= 8) {                   \
 
360
        for (_i = (int)total_count; _i; _i -= 8) {              \
350
361
            l_dest[0] = *l_src++;                               \
351
362
            l_dest[1] = *l_src++;                               \
352
363
            l_dest[2] = *l_src++;                               \
359
370
        }                                                       \
360
371
    }                                                           \
361
372
    else {                                                      \
362
 
        _i = total_count;                                        \
 
373
        _i = (int)total_count;                                  \
363
374
        while (_i) {                                             \
364
375
            tmp_dest = l_dest;                                  \
365
 
            j = nelms;                                          \
 
376
            j = (int)nelms;                                     \
366
377
            while (j >= 8) {                                    \
367
378
                tmp_dest[0] = *l_src++;                         \
368
379
                tmp_dest[1] = *l_src++;                         \
390
401
{                                                               \
391
402
    type * l_src = (type *) src, * l_dest = (type *) dest;      \
392
403
    type * tmp_dest = l_dest;                                   \
393
 
    register int _i, j, k;                                      \
 
404
    register int k;                                             \
 
405
    register unsigned long _i, j;                               \
394
406
    unsigned long total_count = count * nelms;                  \
395
 
    const int l_stride = stride;                                \
 
407
    const DLOOP_Offset l_stride = stride;                       \
396
408
                                                                \
 
409
    DLOOP_Assert(stride <= INT_MAX);                            \
 
410
    DLOOP_Assert(total_count <= INT_MAX);                       \
 
411
    DLOOP_Assert(nelms <= INT_MAX);                             \
397
412
    if (nelms == 1) {                                           \
398
 
        for (_i = total_count; _i; _i--) {                              \
 
413
        for (_i = (int)total_count; _i; _i--) {                 \
399
414
            *l_dest = *l_src++;                                 \
400
415
            l_dest = (type *) ((char *) l_dest + l_stride);     \
401
416
        }                                                       \
402
417
    }                                                           \
403
418
    else if (nelms == 2) {                                      \
404
 
        for (_i = total_count; _i; _i -= 2) {                   \
 
419
        for (_i = (int)total_count; _i; _i -= 2) {              \
405
420
            l_dest[0] = *l_src++;                               \
406
421
            l_dest[1] = *l_src++;                               \
407
422
            l_dest = (type *) ((char *) l_dest + l_stride);     \
408
423
        }                                                       \
409
424
    }                                                           \
410
425
    else if (nelms == 3) {                                      \
411
 
        for (_i = total_count; _i; _i -= 3) {                   \
 
426
        for (_i = (int)total_count; _i; _i -= 3) {              \
412
427
            l_dest[0] = *l_src++;                               \
413
428
            l_dest[1] = *l_src++;                               \
414
429
            l_dest[2] = *l_src++;                               \
416
431
        }                                                       \
417
432
    }                                                           \
418
433
    else if (nelms == 4) {                                      \
419
 
        for (_i = total_count; _i; _i -= 4) {                   \
 
434
        for (_i = (int)total_count; _i; _i -= 4) {              \
420
435
            l_dest[0] = *l_src++;                               \
421
436
            l_dest[1] = *l_src++;                               \
422
437
            l_dest[2] = *l_src++;                               \
425
440
        }                                                       \
426
441
    }                                                           \
427
442
    else if (nelms == 5) {                                      \
428
 
        for (_i = total_count; _i; _i -= 5) {                   \
 
443
        for (_i = (int)total_count; _i; _i -= 5) {              \
429
444
            l_dest[0] = *l_src++;                               \
430
445
            l_dest[1] = *l_src++;                               \
431
446
            l_dest[2] = *l_src++;                               \
435
450
        }                                                       \
436
451
    }                                                           \
437
452
    else if (nelms == 6) {                                      \
438
 
        for (_i = total_count; _i; _i -= 6) {                   \
 
453
        for (_i = (int)total_count; _i; _i -= 6) {              \
439
454
            l_dest[0] = *l_src++;                               \
440
455
            l_dest[1] = *l_src++;                               \
441
456
            l_dest[2] = *l_src++;                               \
446
461
        }                                                       \
447
462
    }                                                           \
448
463
    else if (nelms == 7) {                                      \
449
 
        for (_i = total_count; _i; _i -= 7) {                   \
 
464
        for (_i = (int)total_count; _i; _i -= 7) {              \
450
465
            l_dest[0] = *l_src++;                               \
451
466
            l_dest[1] = *l_src++;                               \
452
467
            l_dest[2] = *l_src++;                               \
458
473
        }                                                       \
459
474
    }                                                           \
460
475
    else if (nelms == 8) {                                      \
461
 
        for (_i = total_count; _i; _i -= 8) {                   \
 
476
        for (_i = (int)total_count; _i; _i -= 8) {              \
462
477
            l_dest[0] = *l_src++;                               \
463
478
            l_dest[1] = *l_src++;                               \
464
479
            l_dest[2] = *l_src++;                               \
471
486
        }                                                       \
472
487
    }                                                           \
473
488
    else {                                                      \
474
 
        _i = total_count;                                        \
 
489
        _i = (int)total_count;                                  \
475
490
        while (_i) {                                             \
476
491
            tmp_dest = l_dest;                                  \
477
 
            j = nelms;                                          \
 
492
            j = (int)nelms;                                     \
478
493
            while (j >= 8) {                                    \
479
494
                tmp_dest[0] = *l_src++;                         \
480
495
                tmp_dest[1] = *l_src++;                         \