@@ -58,7 +58,7 @@ __bsrd(int __A) {
58
58
return 31 - __builtin_clz ((unsigned int )__A);
59
59
}
60
60
61
- // / Swaps the bytes in the input. Converting little endian to big endian or
61
+ // / Swaps the bytes in the input, converting little endian to big endian or
62
62
// / vice versa.
63
63
// /
64
64
// / \headerfile <x86intrin.h>
@@ -73,6 +73,16 @@ __bswapd(int __A) {
73
73
return (int )__builtin_bswap32 ((unsigned int )__A);
74
74
}
75
75
76
+ // / Swaps the bytes in the input, converting little endian to big endian or
77
+ // / vice versa.
78
+ // /
79
+ // / \headerfile <x86intrin.h>
80
+ // /
81
+ // / This intrinsic corresponds to the \c BSWAP instruction.
82
+ // /
83
+ // / \param __A
84
+ // / A 32-bit integer operand.
85
+ // / \returns A 32-bit integer containing the swapped bytes.
76
86
static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
77
87
_bswap (int __A) {
78
88
return (int )__builtin_bswap32 ((unsigned int )__A);
@@ -173,25 +183,59 @@ __popcntq(unsigned long long __A)
173
183
#endif /* __x86_64__ */
174
184
175
185
#ifdef __x86_64__
186
+ // / Returns the program status and control \c RFLAGS register with the \c VM
187
+ // / and \c RF flags cleared.
188
+ // /
189
+ // / \headerfile <x86intrin.h>
190
+ // /
191
+ // / This intrinsic corresponds to the \c PUSHFQ + \c POP instruction sequence.
192
+ // /
193
+ // / \returns The 64-bit value of the RFLAGS register.
176
194
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
177
195
__readeflags (void )
178
196
{
179
197
return __builtin_ia32_readeflags_u64 ();
180
198
}
181
199
200
+ // / Writes the specified value to the program status and control \c RFLAGS
201
+ // / register. Reserved bits are not affected.
202
+ // /
203
+ // / \headerfile <x86intrin.h>
204
+ // /
205
+ // / This intrinsic corresponds to the \c PUSH + \c POPFQ instruction sequence.
206
+ // /
207
+ // / \param __f
208
+ // / The 64-bit value to write to \c RFLAGS.
182
209
static __inline__ void __DEFAULT_FN_ATTRS
183
210
__writeeflags (unsigned long long __f)
184
211
{
185
212
__builtin_ia32_writeeflags_u64 (__f);
186
213
}
187
214
188
215
#else /* !__x86_64__ */
216
+ // / Returns the program status and control \c EFLAGS register with the \c VM
217
+ // / and \c RF flags cleared.
218
+ // /
219
+ // / \headerfile <x86intrin.h>
220
+ // /
221
+ // / This intrinsic corresponds to the \c PUSHFD + \c POP instruction sequence.
222
+ // /
223
+ // / \returns The 32-bit value of the EFLAGS register.
189
224
static __inline__ unsigned int __DEFAULT_FN_ATTRS
190
225
__readeflags (void )
191
226
{
192
227
return __builtin_ia32_readeflags_u32 ();
193
228
}
194
229
230
+ // / Writes the specified value to the program status and control \c EFLAGS
231
+ // / register. Reserved bits are not affected.
232
+ // /
233
+ // / \headerfile <x86intrin.h>
234
+ // /
235
+ // / This intrinsic corresponds to the \c PUSH + \c POPFD instruction sequence.
236
+ // /
237
+ // / \param __f
238
+ // / The 32-bit value to write to \c EFLAGS.
195
239
static __inline__ void __DEFAULT_FN_ATTRS
196
240
__writeeflags (unsigned int __f)
197
241
{
@@ -341,12 +385,32 @@ __crc32q(unsigned long long __C, unsigned long long __D)
341
385
}
342
386
#endif /* __x86_64__ */
343
387
388
+ // / Reads the specified performance monitoring counter. Refer to your
389
+ // / processor's documentation to determine which performance counters are
390
+ // / supported.
391
+ // /
392
+ // / \headerfile <x86intrin.h>
393
+ // /
394
+ // / This intrinsic corresponds to the \c RDPMC instruction.
395
+ // /
396
+ // / \param __A
397
+ // / The performance counter to read.
398
+ // / \returns The 64-bit value read from the performance counter.
344
399
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
345
400
__rdpmc (int __A) {
346
401
return __builtin_ia32_rdpmc (__A);
347
402
}
348
403
349
- /* __rdtscp */
404
+ // / Reads the processor's time stamp counter and the \c IA32_TSC_AUX MSR
405
+ // / \c (0xc0000103).
406
+ // /
407
+ // / \headerfile <x86intrin.h>
408
+ // /
409
+ // / This intrinsic corresponds to the \c RDTSCP instruction.
410
+ // /
411
+ // / \param __A
412
+ // / Address of where to store the 32-bit \c IA32_TSC_AUX value.
413
+ // / \returns The 64-bit value of the time stamp counter.
350
414
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
351
415
__rdtscp (unsigned int *__A) {
352
416
return __builtin_ia32_rdtscp (__A);
@@ -361,42 +425,146 @@ _wbinvd(void) {
361
425
__builtin_ia32_wbinvd ();
362
426
}
363
427
428
+ // / Rotates an 8-bit value to the left by the specified number of bits.
429
+ // / This operation is undefined if the number of bits exceeds the size of
430
+ // / the value.
431
+ // /
432
+ // / \headerfile <x86intrin.h>
433
+ // /
434
+ // / This intrinsic corresponds to the \c ROL instruction.
435
+ // /
436
+ // / \param __X
437
+ // / The unsigned 8-bit value to be rotated.
438
+ // / \param __C
439
+ // / The number of bits to rotate the value.
440
+ // / \returns The rotated value.
364
441
static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
365
442
__rolb (unsigned char __X, int __C) {
366
443
return __builtin_rotateleft8 (__X, __C);
367
444
}
368
445
446
+ // / Rotates an 8-bit value to the right by the specified number of bits.
447
+ // / This operation is undefined if the number of bits exceeds the size of
448
+ // / the value.
449
+ // /
450
+ // / \headerfile <x86intrin.h>
451
+ // /
452
+ // / This intrinsic corresponds to the \c ROR instruction.
453
+ // /
454
+ // / \param __X
455
+ // / The unsigned 8-bit value to be rotated.
456
+ // / \param __C
457
+ // / The number of bits to rotate the value.
458
+ // / \returns The rotated value.
369
459
static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
370
460
__rorb (unsigned char __X, int __C) {
371
461
return __builtin_rotateright8 (__X, __C);
372
462
}
373
463
464
+ // / Rotates a 16-bit value to the left by the specified number of bits.
465
+ // / This operation is undefined if the number of bits exceeds the size of
466
+ // / the value.
467
+ // /
468
+ // / \headerfile <x86intrin.h>
469
+ // /
470
+ // / This intrinsic corresponds to the \c ROL instruction.
471
+ // /
472
+ // / \param __X
473
+ // / The unsigned 16-bit value to be rotated.
474
+ // / \param __C
475
+ // / The number of bits to rotate the value.
476
+ // / \returns The rotated value.
374
477
static __inline__ unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR
375
478
__rolw (unsigned short __X, int __C) {
376
479
return __builtin_rotateleft16 (__X, __C);
377
480
}
378
481
482
+ // / Rotates a 16-bit value to the right by the specified number of bits.
483
+ // / This operation is undefined if the number of bits exceeds the size of
484
+ // / the value.
485
+ // /
486
+ // / \headerfile <x86intrin.h>
487
+ // /
488
+ // / This intrinsic corresponds to the \c ROR instruction.
489
+ // /
490
+ // / \param __X
491
+ // / The unsigned 16-bit value to be rotated.
492
+ // / \param __C
493
+ // / The number of bits to rotate the value.
494
+ // / \returns The rotated value.
379
495
static __inline__ unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR
380
496
__rorw (unsigned short __X, int __C) {
381
497
return __builtin_rotateright16 (__X, __C);
382
498
}
383
499
500
+ // / Rotates a 32-bit value to the left by the specified number of bits.
501
+ // / This operation is undefined if the number of bits exceeds the size of
502
+ // / the value.
503
+ // /
504
+ // / \headerfile <x86intrin.h>
505
+ // /
506
+ // / This intrinsic corresponds to the \c ROL instruction.
507
+ // /
508
+ // / \param __X
509
+ // / The unsigned 32-bit value to be rotated.
510
+ // / \param __C
511
+ // / The number of bits to rotate the value.
512
+ // / \returns The rotated value.
384
513
static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR
385
514
__rold (unsigned int __X, int __C) {
386
515
return __builtin_rotateleft32 (__X, (unsigned int )__C);
387
516
}
388
517
518
+ // / Rotates a 32-bit value to the right by the specified number of bits.
519
+ // / This operation is undefined if the number of bits exceeds the size of
520
+ // / the value.
521
+ // /
522
+ // / \headerfile <x86intrin.h>
523
+ // /
524
+ // / This intrinsic corresponds to the \c ROR instruction.
525
+ // /
526
+ // / \param __X
527
+ // / The unsigned 32-bit value to be rotated.
528
+ // / \param __C
529
+ // / The number of bits to rotate the value.
530
+ // / \returns The rotated value.
389
531
static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR
390
532
__rord (unsigned int __X, int __C) {
391
533
return __builtin_rotateright32 (__X, (unsigned int )__C);
392
534
}
393
535
394
536
#ifdef __x86_64__
537
+ // / Rotates a 64-bit value to the left by the specified number of bits.
538
+ // / This operation is undefined if the number of bits exceeds the size of
539
+ // / the value.
540
+ // /
541
+ // / \headerfile <x86intrin.h>
542
+ // /
543
+ // / This intrinsic corresponds to the \c ROL instruction.
544
+ // /
545
+ // / \param __X
546
+ // / The unsigned 64-bit value to be rotated.
547
+ // / \param __C
548
+ // / The number of bits to rotate the value.
549
+ // / \returns The rotated value.
395
550
static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
396
551
__rolq (unsigned long long __X, int __C) {
397
552
return __builtin_rotateleft64 (__X, (unsigned long long )__C);
398
553
}
399
554
555
+ // / Rotates a 64-bit value to the right by the specified number of bits.
556
+ // / This operation is undefined if the number of bits exceeds the size of
557
+ // / the value.
558
+ // /
559
+ // / \headerfile <x86intrin.h>
560
+ // /
561
+ // / This intrinsic corresponds to the \c ROR instruction.
562
+ // /
563
+ // / \param __X
564
+ // / The unsigned 64-bit value to be rotated.
565
+ // / \param __C
566
+ // / The number of bits to rotate the value.
567
+ // / \returns The rotated value.
400
568
static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
401
569
__rorq (unsigned long long __X, int __C) {
402
570
return __builtin_rotateright64 (__X, (unsigned long long )__C);
0 commit comments