summaryrefslogtreecommitdiff
path: root/ace/CDR_Base.cpp
blob: f6149d108e7e09fde5432787a46b6086ffdc8541 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
// -*- C++ -*-
//
// $Id$

#include "ace/CDR_Base.h"
#include "ace/Message_Block.h"

#if !defined (__ACE_INLINE__)
# include "ace/CDR_Base.inl"
#endif /* ! __ACE_INLINE__ */

ACE_RCSID(ace, CDR_Base, "$Id$")


//
// See comments in CDR_Base.i about optimization cases for swap_XX_array.
//

void
ACE_CDR::swap_2_array (const char* orig, char* target, size_t n)
{
  // ACE_ASSERT(n > 0); The caller checks that n > 0

  // Later, we try to read in 32 or 64 bit chunks,
  // so make sure we don't do that for unaligned addresses.
#if ACE_SIZEOF_LONG == 8
  const char* const o8 = ACE_ptr_align_binary(orig, 8);
  while (orig < o8 && n > 0)
    {
      ACE_CDR::swap_2 (orig, target);
      orig += 2;
      target += 2;
      --n;
    }
#else
  const char* const o4 = ACE_ptr_align_binary(orig, 4);
  // this is an _if_, not a _while_. The mistmatch can only be by 2.
  if (orig != o4)
    {
      ACE_CDR::swap_2 (orig, target);
      orig += 2;
      target += 2;
      --n;
    }
#endif
  if (n == 0)
    return;

  //
  // Loop unrolling. Here be dragons.
  //

  // (n & (~3)) is the greatest multiple of 4 not bigger than n.
  // In the while loop ahead, orig will move over the array by 8 byte
  // increments (4 elements of 2 bytes).
  // end marks our barrier for not falling outside.
  const char* const end = orig + 2*(n & (~3));

  // See if we're aligned for writting in 64 or 32 bit chunks...
#if ACE_SIZEOF_LONG == 8
  if (target == ACE_ptr_align_binary(target, 8))
#else
  if (target == ACE_ptr_align_binary(target, 4))
#endif
    {
      while (orig < end)
	{
#if defined(ACE_HAS_PENTIUM) && defined(__GNUG__)
	  unsigned int a =
	    * ACE_reinterpret_cast(const unsigned int*, orig);
	  unsigned int b =
	    * ACE_reinterpret_cast(const unsigned int*, orig + 4);
	  asm( "bswap %1"      : "=r" (a) : "0" (a) );
	  asm( "bswap %1"      : "=r" (b) : "0" (b) );
	  asm( "rol $16, %1"   : "=r" (a) : "0" (a) );
	  asm( "rol $16, %1"   : "=r" (b) : "0" (b) );
	  * ACE_reinterpret_cast(unsigned int*, target) = a;
	  * ACE_reinterpret_cast(unsigned int*, target + 4) = b;
#elif defined(ACE_HAS_PENTIUM) \
      && (defined(_MSC_VER) || defined(__BORLANDC__)) \
      && !defined(ACE_LACKS_INLINE_ASSEMBLY)
	  __asm mov ecx, orig;
	  __asm mov edx, target;
	  __asm mov eax, [ecx];
	  __asm mov ebx, 4[ecx];
	  __asm bswap eax;
	  __asm bswap ebx;
	  __asm rol eax, 16;
	  __asm rol ebx, 16;
	  __asm mov [edx], eax;
	  __asm mov 4[edx], ebx;
#elif ACE_SIZEOF_LONG == 8
	  // 64 bit architecture.
	  register unsigned long a =
	    * ACE_reinterpret_cast(const unsigned long*, orig);

	  register unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8;
	  register unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8;

	  a = (a1 | a2);

	  * ACE_reinterpret_cast(unsigned long*, target) = a;
#else
	  register ACE_UINT32 a =
	    * ACE_reinterpret_cast(const ACE_UINT32*, orig);
	  register ACE_UINT32 b =
	    * ACE_reinterpret_cast(const ACE_UINT32*, orig + 4);

	  register ACE_UINT32 a1 = (a & 0x00ff00ffU) << 8;
	  register ACE_UINT32 b1 = (b & 0x00ff00ffU) << 8;
	  register ACE_UINT32 a2 = (a & 0xff00ff00U) >> 8;
	  register ACE_UINT32 b2 = (b & 0xff00ff00U) >> 8;

	  a = (a1 | a2);
	  b = (b1 | b2);

	  * ACE_reinterpret_cast(ACE_UINT32*, target) = a;
	  * ACE_reinterpret_cast(ACE_UINT32*, target + 4) = b;
#endif
	  orig += 8;
	  target += 8;
	}
    }
  else
    {
      // We're out of luck. We have to write in 2 byte chunks.
      while (orig < end)
	{
#if defined(ACE_HAS_PENTIUM) && defined(__GNUG__)
	  unsigned int a =
	    * ACE_reinterpret_cast(const unsigned int*, orig);
	  unsigned int b =
	    * ACE_reinterpret_cast(const unsigned int*, orig + 4);
	  asm( "bswap %1" : "=r" (a) : "0" (a) );
	  asm( "bswap %1" : "=r" (b) : "0" (b) );
	  // We're little endian.
	  * ACE_reinterpret_cast(unsigned short*, target + 2)
	      = (unsigned short) (a & 0xffff);
	  * ACE_reinterpret_cast(unsigned short*, target + 6)
	      = (unsigned short) (b & 0xffff);
	  asm( "shrl $16, %1" : "=r" (a) : "0" (a) );
	  asm( "shrl $16, %1" : "=r" (b) : "0" (b) );
	  * ACE_reinterpret_cast(unsigned short*, target + 0)
	      = (unsigned short) (a & 0xffff);
	  * ACE_reinterpret_cast(unsigned short*, target + 4)
	      = (unsigned short) (b & 0xffff);
#elif defined(ACE_HAS_PENTIUM) \
      && (defined(_MSC_VER) || defined(__BORLANDC__)) \
      && !defined(ACE_LACKS_INLINE_ASSEMBLY)
	  __asm mov ecx, orig;
	  __asm mov edx, target;
	  __asm mov eax, [ecx];
	  __asm mov ebx, 4[ecx];
	  __asm bswap eax;
	  __asm bswap ebx;
	  // We're little endian.
	  __asm mov 2[edx], ax;
	  __asm mov 6[edx], bx;
	  __asm shr eax, 16;
	  __asm shr ebx, 16;
	  __asm mov 0[edx], ax;
	  __asm mov 4[edx], bx;
#elif ACE_SIZEOF_LONG == 8
	  // 64 bit architecture.
	  register unsigned long a =
	    * ACE_reinterpret_cast(const unsigned long*, orig);

	  register unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8;
	  register unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8;

	  a = (a1 | a2);

	  ACE_UINT16 b1 = ACE_static_cast(ACE_UINT16, (a >> 48));
	  ACE_UINT16 b2 = ACE_static_cast(ACE_UINT16, ((a >> 32) & 0xffff));
	  ACE_UINT16 b3 = ACE_static_cast(ACE_UINT16, ((a >> 16) & 0xffff));
	  ACE_UINT16 b4 = ACE_static_cast(ACE_UINT16, (a & 0xffff));

#if defined(ACE_LITTLE_ENDIAN)
	  * ACE_reinterpret_cast(ACE_UINT16*, target) = b4;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 2) = b3;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 4) = b2;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 6) = b1;
#else
	  * ACE_reinterpret_cast(ACE_UINT16*, target) = b1;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 2) = b2;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 4) = b3;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 6) = b4;
#endif
#else
	  register ACE_UINT32 a =
	    * ACE_reinterpret_cast(const ACE_UINT32*, orig);
	  register ACE_UINT32 b =
	    * ACE_reinterpret_cast(const ACE_UINT32*, orig + 4);

	  register ACE_UINT32 a1 = (a & 0x00ff00ff) << 8;
	  register ACE_UINT32 b1 = (b & 0x00ff00ff) << 8;
	  register ACE_UINT32 a2 = (a & 0xff00ff00) >> 8;
	  register ACE_UINT32 b2 = (b & 0xff00ff00) >> 8;

	  a = (a1 | a2);
	  b = (b1 | b2);

	  ACE_UINT32 c1 = ACE_static_cast(ACE_UINT16, (a >> 16));
	  ACE_UINT32 c2 = ACE_static_cast(ACE_UINT16, (a & 0xffff));
	  ACE_UINT32 c3 = ACE_static_cast(ACE_UINT16, (b >> 16));
	  ACE_UINT32 c4 = ACE_static_cast(ACE_UINT16, (b & 0xffff));

#if defined(ACE_LITTLE_ENDIAN)
	  * ACE_reinterpret_cast(ACE_UINT16*, target) = c2;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 2) = c1;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 4) = c4;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 6) = c3;
#else
	  * ACE_reinterpret_cast(ACE_UINT16*, target) = c1;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 2) = c2;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 4) = c3;
	  * ACE_reinterpret_cast(ACE_UINT16*, target + 6) = c4;
#endif
#endif

	  orig += 8;
	  target += 8;
	}
    }

  // (n & 3) == (n % 4).
  switch (n&3) {
  case 3:
    ACE_CDR::swap_2 (orig, target);
    orig += 2;
    target += 2;
  case 2:
    ACE_CDR::swap_2 (orig, target);
    orig += 2;
    target += 2;
  case 1:
    ACE_CDR::swap_2 (orig, target);
  }
}

void
ACE_CDR::swap_4_array (const char* orig, char* target, size_t n)
{
  // ACE_ASSERT(n > 0); The caller checks that n > 0

#if ACE_LONG_SIZE == 8
  // Later, we read from *orig in 64 bit chunks,
  // so make sure we don't generate unaligned readings.
  const char* const o8 = ACE_ptr_align_binary(orig, 8);
  // The mistmatch can only be by 4.
  if (orig != o8)
    {
      ACE_CDR::swap_4 (orig, target);
      orig += 4;
      target += 4;
      --n;
    }
#endif
  if (n == 0)
    return;

  //
  // Loop unrolling. Here be dragons.
  //

  // (n & (~3)) is the greatest multiple of 4 not bigger than n.
  // In the while loop, orig will move over the array by 16 byte
  // increments (4 elements of 4 bytes).
  // ends marks our barrier for not falling outside.
  const char* const end = orig + 4*(n & (~3));

#if ACE_LONG_SIZE == 8
  // 64 bits architecture.
  // See if we can write in 8 byte chunks.
  if (target == ACE_ptr_align_binary(target, 8))
    {
      while (orig < end)
	{
	  register unsigned long a =
	    * ACE_reinterpret_cast(const long*, orig);
	  register unsigned long b =
	    * ACE_reinterpret_cast(const long*, orig + 8);

	  register unsigned long a84 = (a & 0x000000ff000000ffL) << 24;
	  register unsigned long b84 = (b & 0x000000ff000000ffL) << 24;
	  register unsigned long a73 = (a & 0x0000ff000000ff00L) << 8;
	  register unsigned long b73 = (b & 0x0000ff000000ff00L) << 8;
	  register unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8;
	  register unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8;
	  register unsigned long a51 = (a & 0xff000000ff000000L) >> 24;
	  register unsigned long b51 = (b & 0xff000000ff000000L) >> 24;

	  a = (a84 | a73 | a62 | a51);
	  b = (b84 | b73 | b62 | b51);

	  * ACE_reinterpret_cast(long*, target) = a;
	  * ACE_reinterpret_cast(long*, target + 8) = b;

	  orig += 16;
	  target += 16;
	}
    }
  else
    {
      // We are out of luck, we have to write in 4 byte chunks.
      while (orig < end)
	{
	  register unsigned long a =
	    * ACE_reinterpret_cast(const long*, orig);
	  register unsigned long b =
	    * ACE_reinterpret_cast(const long*, orig + 8);

	  register unsigned long a84 = (a & 0x000000ff000000ffL) << 24;
	  register unsigned long b84 = (b & 0x000000ff000000ffL) << 24;
	  register unsigned long a73 = (a & 0x0000ff000000ff00L) << 8;
	  register unsigned long b73 = (b & 0x0000ff000000ff00L) << 8;
	  register unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8;
	  register unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8;
	  register unsigned long a51 = (a & 0xff000000ff000000L) >> 24;
	  register unsigned long b51 = (b & 0xff000000ff000000L) >> 24;

	  a = (a84 | a73 | a62 | a51);
	  b = (b84 | b73 | b62 | b51);

	  ACE_UINT32 c1 = ACE_static_cast(ACE_UINT32, (a >> 32));
	  ACE_UINT32 c2 = ACE_static_cast(ACE_UINT32, (a & 0xffffffff));
	  ACE_UINT32 c3 = ACE_static_cast(ACE_UINT32, (b >> 32));
	  ACE_UINT32 c4 = ACE_static_cast(ACE_UINT32, (b & 0xffffffff));

#if defined(ACE_LITTLE_ENDIAN)
	  * ACE_reinterpret_cast(ACE_UINT32*, target + 0) = c2;
	  * ACE_reinterpret_cast(ACE_UINT32*, target + 4) = c1;
	  * ACE_reinterpret_cast(ACE_UINT32*, target + 8) = c4;
	  * ACE_reinterpret_cast(ACE_UINT32*, target + 12) = c3;
#else
	  * ACE_reinterpret_cast(ACE_UINT32*, target + 0) = c1;
	  * ACE_reinterpret_cast(ACE_UINT32*, target + 4) = c2;
	  * ACE_reinterpret_cast(ACE_UINT32*, target + 8) = c3;
	  * ACE_reinterpret_cast(ACE_UINT32*, target + 12) = c4;
#endif
	  orig += 16;
	  target += 16;
	}
    }

#else /* ACE_LONG_SIZE != 8 */

  while (orig < end)
    {
#if defined(ACE_HAS_PENTIUM) && defined(__GNUG__)
      register unsigned int a =
	*ACE_reinterpret_cast(const unsigned int*, orig);
      register unsigned int b =
	*ACE_reinterpret_cast(const unsigned int*, orig + 4);
      register unsigned int c =
	*ACE_reinterpret_cast(const unsigned int*, orig + 8);
      register unsigned int d =
	*ACE_reinterpret_cast(const unsigned int*, orig + 12);

      asm ("bswap %1" : "=r" (a) : "0" (a));
      asm ("bswap %1" : "=r" (b) : "0" (b));
      asm ("bswap %1" : "=r" (c) : "0" (c));
      asm ("bswap %1" : "=r" (d) : "0" (d));

      *ACE_reinterpret_cast(unsigned int*, target) = a;
      *ACE_reinterpret_cast(unsigned int*, target + 4) = b;
      *ACE_reinterpret_cast(unsigned int*, target + 8) = c;
      *ACE_reinterpret_cast(unsigned int*, target + 12) = d;
#elif defined(ACE_HAS_PENTIUM) \
      && (defined(_MSC_VER) || defined(__BORLANDC__)) \
      && !defined(ACE_LACKS_INLINE_ASSEMBLY)
      __asm mov eax, orig
      __asm mov esi, target
      __asm mov edx, [eax]
      __asm mov ecx, 4[eax]
      __asm mov ebx, 8[eax]
      __asm mov eax, 12[eax]
      __asm bswap edx
      __asm bswap ecx
      __asm bswap ebx
      __asm bswap eax
      __asm mov [esi], edx
      __asm mov 4[esi], ecx
      __asm mov 8[esi], ebx
      __asm mov 12[esi], eax
#else
      register ACE_UINT32 a =
	* ACE_reinterpret_cast(const ACE_UINT32*, orig);
      register ACE_UINT32 b =
	* ACE_reinterpret_cast(const ACE_UINT32*, orig + 4);
      register ACE_UINT32 c =
	* ACE_reinterpret_cast(const ACE_UINT32*, orig + 8);
      register ACE_UINT32 d =
	* ACE_reinterpret_cast(const ACE_UINT32*, orig + 12);

      // Expect the optimizer reordering this A LOT.
      // We leave it this way for clarity.
      a = (a << 24) | ((a & 0xff00) << 8) | ((a & 0xff0000) >> 8) | (a >> 24);
      b = (b << 24) | ((b & 0xff00) << 8) | ((b & 0xff0000) >> 8) | (b >> 24);
      c = (c << 24) | ((c & 0xff00) << 8) | ((c & 0xff0000) >> 8) | (c >> 24);
      d = (d << 24) | ((d & 0xff00) << 8) | ((d & 0xff0000) >> 8) | (d >> 24);

      * ACE_reinterpret_cast(ACE_UINT32*, target) = a;
      * ACE_reinterpret_cast(ACE_UINT32*, target + 4) = b;
      * ACE_reinterpret_cast(ACE_UINT32*, target + 8) = c;
      * ACE_reinterpret_cast(ACE_UINT32*, target + 12) = d;
#endif

      orig += 16;
      target += 16;
    }

#endif /* ACE_LONG_SIZE == 8 */

  // (n & 3) == (n % 4).
  switch (n&3) {
  case 3:
    ACE_CDR::swap_4 (orig, target);
    orig += 4;
    target += 4;
  case 2:
    ACE_CDR::swap_4 (orig, target);
    orig += 4;
    target += 4;
  case 1:
    ACE_CDR::swap_4 (orig, target);
  }
}

//
// We don't benefit from unrolling in swap_8_array and swap_16_array
// (swap_8 and swap_16 are big enough).
//
void
ACE_CDR::swap_8_array (const char* orig, char* target, size_t n)
{
  // ACE_ASSERT(n > 0); The caller checks that n > 0

  const char* const end = orig + 8*n;
  while (orig < end)
    {
      swap_8(orig, target);
      orig += 8;
      target += 8;
    }
}

void
ACE_CDR::swap_16_array (const char* orig, char* target, size_t n)
{
  // ACE_ASSERT(n > 0); The caller checks that n > 0

  const char* const end = orig + 16*n;
  while (orig < end)
    {
      swap_16(orig, target);
      orig += 16;
      target += 16;
    }
}

int
ACE_CDR::grow (ACE_Message_Block *mb, size_t minsize)
{
  size_t newsize =
    ACE_CDR::first_size (minsize + ACE_CDR::MAX_ALIGNMENT);

  if (newsize <= mb->size ())
    return 0;

  ACE_Data_Block *db =
    mb->data_block ()->clone_nocopy ();
  db->size (newsize);

  ACE_Message_Block tmp (db);
  ACE_CDR::mb_align (&tmp);

  tmp.copy (mb->rd_ptr (), mb->length());
  mb->data_block (tmp.data_block ()->duplicate ());
  mb->rd_ptr (tmp.rd_ptr ());
  mb->wr_ptr (tmp.wr_ptr ());

  return 0;
}

size_t
ACE_CDR::total_length (const ACE_Message_Block* begin,
                       const ACE_Message_Block* end)
{
  size_t l = 0;
  // Compute the total size.
  for (const ACE_Message_Block *i = begin;
       i != end;
       i = i->cont ())
    l += i->length ();
  return l;
}

void
ACE_CDR::consolidate (ACE_Message_Block *dst,
                      const ACE_Message_Block *src)
{
  if (src == 0)
    return;

  size_t newsize =
    ACE_CDR::first_size (ACE_CDR::total_length (src, 0)
                         + ACE_CDR::MAX_ALIGNMENT);
  dst->size (newsize);

  // We must copy the contents of <src> into the new buffer, but
  // respecting the alignment.
  ptr_arith_t srcalign =
    ptr_arith_t(src->rd_ptr ()) % ACE_CDR::MAX_ALIGNMENT;
  ptr_arith_t dstalign =
    ptr_arith_t(dst->rd_ptr ()) % ACE_CDR::MAX_ALIGNMENT;
  int offset = srcalign - dstalign;
  if (offset < 0)
    offset += ACE_CDR::MAX_ALIGNMENT;
  dst->rd_ptr (offset);
  dst->wr_ptr (dst->rd_ptr ());

  for (const ACE_Message_Block* i = src;
       i != 0;
       i = i->cont ())
    {
      dst->copy (i->rd_ptr (), i->length ());
    }
}

#if defined (NONNATIVE_LONGDOUBLE)
int
ACE_CDR::LongDouble::operator== (const ACE_CDR::LongDouble &rhs) const
{
  return ACE_OS::memcmp (this->ld, rhs.ld, 16) == 0;
}

int
ACE_CDR::LongDouble::operator!= (const ACE_CDR::LongDouble &rhs) const
{
  return ACE_OS::memcmp (this->ld, rhs.ld, 16) != 0;
}
#endif /* NONNATIVE_LONGDOUBLE */

#if defined(_UNICOS) && !defined(_CRAYMPP)
// placeholders to get things compiling
ACE_CDR::Float::Float()
{
}

ACE_CDR::Float::Float(const float & init)
{
}

ACE_CDR::Float &
ACE_CDR::Float::operator= (const float &rhs)
{
  return *this;
}

int
ACE_CDR::Float::operator!= (const ACE_CDR::Float &rhs) const
{
  return 0;
}
#endif /* _UNICOS */