1 /* ===-------- ia32intrin.h ---------------------------------------------------===
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *===-----------------------------------------------------------------------===
11 #error "Never use <ia32intrin.h> directly; include <x86intrin.h> instead."
14 #ifndef __IA32INTRIN_H
15 #define __IA32INTRIN_H
17 /* Define the default attributes for the functions in this file. */
18 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
19 #define __DEFAULT_FN_ATTRS_CRC32 __attribute__((__always_inline__, __nodebug__, __target__("crc32")))
21 #if defined(__cplusplus) && (__cplusplus >= 201103L)
22 #define __DEFAULT_FN_ATTRS_CAST __attribute__((__always_inline__)) constexpr
23 #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
25 #define __DEFAULT_FN_ATTRS_CAST __attribute__((__always_inline__))
26 #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
29 /// Finds the first set bit starting from the least significant bit. The result
30 /// is undefined if the input is 0.
32 /// \headerfile <x86intrin.h>
34 /// This intrinsic corresponds to the \c BSF instruction or the
35 /// \c TZCNT instruction.
38 /// A 32-bit integer operand.
39 /// \returns A 32-bit integer containing the bit number.
40 /// \see _bit_scan_forward
41 static __inline__
int __DEFAULT_FN_ATTRS_CONSTEXPR
43 return __builtin_ctz((unsigned int)__A
);
46 /// Finds the first set bit starting from the most significant bit. The result
47 /// is undefined if the input is 0.
49 /// \headerfile <x86intrin.h>
51 /// This intrinsic corresponds to the \c BSR instruction or the
52 /// \c LZCNT instruction and an \c XOR.
55 /// A 32-bit integer operand.
56 /// \returns A 32-bit integer containing the bit number.
57 /// \see _bit_scan_reverse
58 static __inline__
int __DEFAULT_FN_ATTRS_CONSTEXPR
60 return 31 - __builtin_clz((unsigned int)__A
);
63 /// Swaps the bytes in the input, converting little endian to big endian or
66 /// \headerfile <x86intrin.h>
68 /// This intrinsic corresponds to the \c BSWAP instruction.
71 /// A 32-bit integer operand.
72 /// \returns A 32-bit integer containing the swapped bytes.
73 static __inline__
int __DEFAULT_FN_ATTRS_CONSTEXPR
75 return (int)__builtin_bswap32((unsigned int)__A
);
78 /// Swaps the bytes in the input, converting little endian to big endian or
81 /// \headerfile <x86intrin.h>
83 /// This intrinsic corresponds to the \c BSWAP instruction.
86 /// A 32-bit integer operand.
87 /// \returns A 32-bit integer containing the swapped bytes.
88 static __inline__
int __DEFAULT_FN_ATTRS_CONSTEXPR
90 return (int)__builtin_bswap32((unsigned int)__A
);
93 /// Finds the first set bit starting from the least significant bit. The result
94 /// is undefined if the input is 0.
96 /// \headerfile <x86intrin.h>
99 /// int _bit_scan_forward(int A);
102 /// This intrinsic corresponds to the \c BSF instruction or the
103 /// \c TZCNT instruction.
106 /// A 32-bit integer operand.
107 /// \returns A 32-bit integer containing the bit number.
109 #define _bit_scan_forward(A) __bsfd((A))
111 /// Finds the first set bit starting from the most significant bit. The result
112 /// is undefined if the input is 0.
114 /// \headerfile <x86intrin.h>
117 /// int _bit_scan_reverse(int A);
120 /// This intrinsic corresponds to the \c BSR instruction or the
121 /// \c LZCNT instruction and an \c XOR.
124 /// A 32-bit integer operand.
125 /// \returns A 32-bit integer containing the bit number.
127 #define _bit_scan_reverse(A) __bsrd((A))
130 /// Finds the first set bit starting from the least significant bit. The result
131 /// is undefined if the input is 0.
133 /// \headerfile <x86intrin.h>
135 /// This intrinsic corresponds to the \c BSF instruction or the
136 /// \c TZCNT instruction.
139 /// A 64-bit integer operand.
140 /// \returns A 32-bit integer containing the bit number.
141 static __inline__
int __DEFAULT_FN_ATTRS_CONSTEXPR
142 __bsfq(long long __A
) {
143 return (long long)__builtin_ctzll((unsigned long long)__A
);
146 /// Finds the first set bit starting from the most significant bit. The result
147 /// is undefined if input is 0.
149 /// \headerfile <x86intrin.h>
151 /// This intrinsic corresponds to the \c BSR instruction or the
152 /// \c LZCNT instruction and an \c XOR.
155 /// A 64-bit integer operand.
156 /// \returns A 32-bit integer containing the bit number.
157 static __inline__
int __DEFAULT_FN_ATTRS_CONSTEXPR
158 __bsrq(long long __A
) {
159 return 63 - __builtin_clzll((unsigned long long)__A
);
162 /// Swaps the bytes in the input, converting little endian to big endian or
165 /// \headerfile <x86intrin.h>
167 /// This intrinsic corresponds to the \c BSWAP instruction.
170 /// A 64-bit integer operand.
171 /// \returns A 64-bit integer containing the swapped bytes.
173 static __inline__
long long __DEFAULT_FN_ATTRS_CONSTEXPR
174 __bswapq(long long __A
) {
175 return (long long)__builtin_bswap64((unsigned long long)__A
);
178 /// Swaps the bytes in the input, converting little endian to big endian or
181 /// \headerfile <x86intrin.h>
184 /// long long _bswap64(long long A);
187 /// This intrinsic corresponds to the \c BSWAP instruction.
190 /// A 64-bit integer operand.
191 /// \returns A 64-bit integer containing the swapped bytes.
193 #define _bswap64(A) __bswapq((A))
194 #endif /* __x86_64__ */
196 /// Counts the number of bits in the source operand having a value of 1.
198 /// \headerfile <x86intrin.h>
200 /// This intrinsic corresponds to the \c POPCNT instruction or a
201 /// sequence of arithmetic and logic operations to calculate it.
204 /// An unsigned 32-bit integer operand.
205 /// \returns A 32-bit integer containing the number of bits with value 1 in the
208 static __inline__
int __DEFAULT_FN_ATTRS_CONSTEXPR
209 __popcntd(unsigned int __A
)
211 return __builtin_popcount(__A
);
214 /// Counts the number of bits in the source operand having a value of 1.
216 /// \headerfile <x86intrin.h>
219 /// int _popcnt32(int A);
222 /// This intrinsic corresponds to the \c POPCNT instruction or a
223 /// sequence of arithmetic and logic operations to calculate it.
226 /// An unsigned 32-bit integer operand.
227 /// \returns A 32-bit integer containing the number of bits with value 1 in the
230 #define _popcnt32(A) __popcntd((A))
233 /// Counts the number of bits in the source operand having a value of 1.
235 /// \headerfile <x86intrin.h>
237 /// This intrinsic corresponds to the \c POPCNT instruction or a
238 /// sequence of arithmetic and logic operations to calculate it.
241 /// An unsigned 64-bit integer operand.
242 /// \returns A 64-bit integer containing the number of bits with value 1 in the
245 static __inline__
long long __DEFAULT_FN_ATTRS_CONSTEXPR
246 __popcntq(unsigned long long __A
)
248 return __builtin_popcountll(__A
);
251 /// Counts the number of bits in the source operand having a value of 1.
253 /// \headerfile <x86intrin.h>
256 /// long long _popcnt64(unsigned long long A);
259 /// This intrinsic corresponds to the \c POPCNT instruction or a
260 /// sequence of arithmetic and logic operations to calculate it.
263 /// An unsigned 64-bit integer operand.
264 /// \returns A 64-bit integer containing the number of bits with value 1 in the
267 #define _popcnt64(A) __popcntq((A))
268 #endif /* __x86_64__ */
271 /// Returns the program status-and-control \c RFLAGS register with the \c VM
272 /// and \c RF flags cleared.
274 /// \headerfile <x86intrin.h>
276 /// This intrinsic corresponds to the \c PUSHFQ + \c POP instruction sequence.
278 /// \returns The 64-bit value of the RFLAGS register.
279 static __inline__
unsigned long long __DEFAULT_FN_ATTRS
282 return __builtin_ia32_readeflags_u64();
285 /// Writes the specified value to the program status-and-control \c RFLAGS
286 /// register. Reserved bits are not affected.
288 /// \headerfile <x86intrin.h>
290 /// This intrinsic corresponds to the \c PUSH + \c POPFQ instruction sequence.
293 /// The 64-bit value to write to \c RFLAGS.
294 static __inline__
void __DEFAULT_FN_ATTRS
295 __writeeflags(unsigned long long __f
)
297 __builtin_ia32_writeeflags_u64(__f
);
300 #else /* !__x86_64__ */
301 /// Returns the program status-and-control \c EFLAGS register with the \c VM
302 /// and \c RF flags cleared.
304 /// \headerfile <x86intrin.h>
306 /// This intrinsic corresponds to the \c PUSHFD + \c POP instruction sequence.
308 /// \returns The 32-bit value of the EFLAGS register.
309 static __inline__
unsigned int __DEFAULT_FN_ATTRS
312 return __builtin_ia32_readeflags_u32();
315 /// Writes the specified value to the program status-and-control \c EFLAGS
316 /// register. Reserved bits are not affected.
318 /// \headerfile <x86intrin.h>
320 /// This intrinsic corresponds to the \c PUSH + \c POPFD instruction sequence.
323 /// The 32-bit value to write to \c EFLAGS.
324 static __inline__
void __DEFAULT_FN_ATTRS
325 __writeeflags(unsigned int __f
)
327 __builtin_ia32_writeeflags_u32(__f
);
329 #endif /* !__x86_64__ */
331 /// Casts a 32-bit float value to a 32-bit unsigned integer value.
333 /// \headerfile <x86intrin.h>
335 /// This intrinsic corresponds to the \c VMOVD / \c MOVD instruction in x86_64,
336 /// and corresponds to the \c VMOVL / \c MOVL instruction in ia32.
339 /// A 32-bit float value.
340 /// \returns A 32-bit unsigned integer containing the converted value.
341 static __inline__
unsigned int __DEFAULT_FN_ATTRS_CAST
342 _castf32_u32(float __A
) {
343 return __builtin_bit_cast(unsigned int, __A
);
346 /// Casts a 64-bit float value to a 64-bit unsigned integer value.
348 /// \headerfile <x86intrin.h>
350 /// This intrinsic corresponds to the \c VMOVQ / \c MOVQ instruction in x86_64,
351 /// and corresponds to the \c VMOVL / \c MOVL instruction in ia32.
354 /// A 64-bit float value.
355 /// \returns A 64-bit unsigned integer containing the converted value.
356 static __inline__
unsigned long long __DEFAULT_FN_ATTRS_CAST
357 _castf64_u64(double __A
) {
358 return __builtin_bit_cast(unsigned long long, __A
);
361 /// Casts a 32-bit unsigned integer value to a 32-bit float value.
363 /// \headerfile <x86intrin.h>
365 /// This intrinsic corresponds to the \c VMOVQ / \c MOVQ instruction in x86_64,
366 /// and corresponds to the \c FLDS instruction in ia32.
369 /// A 32-bit unsigned integer value.
370 /// \returns A 32-bit float value containing the converted value.
371 static __inline__
float __DEFAULT_FN_ATTRS_CAST
372 _castu32_f32(unsigned int __A
) {
373 return __builtin_bit_cast(float, __A
);
376 /// Casts a 64-bit unsigned integer value to a 64-bit float value.
378 /// \headerfile <x86intrin.h>
380 /// This intrinsic corresponds to the \c VMOVQ / \c MOVQ instruction in x86_64,
381 /// and corresponds to the \c FLDL instruction in ia32.
384 /// A 64-bit unsigned integer value.
385 /// \returns A 64-bit float value containing the converted value.
386 static __inline__
double __DEFAULT_FN_ATTRS_CAST
387 _castu64_f64(unsigned long long __A
) {
388 return __builtin_bit_cast(double, __A
);
391 /// Adds the unsigned integer operand to the CRC-32C checksum of the
392 /// unsigned char operand.
394 /// \headerfile <x86intrin.h>
396 /// This intrinsic corresponds to the \c CRC32B instruction.
399 /// An unsigned integer operand to add to the CRC-32C checksum of operand
402 /// An unsigned 8-bit integer operand used to compute the CRC-32C checksum.
403 /// \returns The result of adding operand \a __C to the CRC-32C checksum of
405 static __inline__
unsigned int __DEFAULT_FN_ATTRS_CRC32
406 __crc32b(unsigned int __C
, unsigned char __D
)
408 return __builtin_ia32_crc32qi(__C
, __D
);
411 /// Adds the unsigned integer operand to the CRC-32C checksum of the
412 /// unsigned short operand.
414 /// \headerfile <x86intrin.h>
416 /// This intrinsic corresponds to the \c CRC32W instruction.
419 /// An unsigned integer operand to add to the CRC-32C checksum of operand
422 /// An unsigned 16-bit integer operand used to compute the CRC-32C checksum.
423 /// \returns The result of adding operand \a __C to the CRC-32C checksum of
425 static __inline__
unsigned int __DEFAULT_FN_ATTRS_CRC32
426 __crc32w(unsigned int __C
, unsigned short __D
)
428 return __builtin_ia32_crc32hi(__C
, __D
);
431 /// Adds the unsigned integer operand to the CRC-32C checksum of the
432 /// second unsigned integer operand.
434 /// \headerfile <x86intrin.h>
436 /// This intrinsic corresponds to the \c CRC32D instruction.
439 /// An unsigned integer operand to add to the CRC-32C checksum of operand
442 /// An unsigned 32-bit integer operand used to compute the CRC-32C checksum.
443 /// \returns The result of adding operand \a __C to the CRC-32C checksum of
445 static __inline__
unsigned int __DEFAULT_FN_ATTRS_CRC32
446 __crc32d(unsigned int __C
, unsigned int __D
)
448 return __builtin_ia32_crc32si(__C
, __D
);
452 /// Adds the unsigned integer operand to the CRC-32C checksum of the
453 /// unsigned 64-bit integer operand.
455 /// \headerfile <x86intrin.h>
457 /// This intrinsic corresponds to the \c CRC32Q instruction.
460 /// An unsigned integer operand to add to the CRC-32C checksum of operand
463 /// An unsigned 64-bit integer operand used to compute the CRC-32C checksum.
464 /// \returns The result of adding operand \a __C to the CRC-32C checksum of
466 static __inline__
unsigned long long __DEFAULT_FN_ATTRS_CRC32
467 __crc32q(unsigned long long __C
, unsigned long long __D
)
469 return __builtin_ia32_crc32di(__C
, __D
);
471 #endif /* __x86_64__ */
473 /// Reads the specified performance-monitoring counter. Refer to your
474 /// processor's documentation to determine which performance counters are
477 /// \headerfile <x86intrin.h>
479 /// This intrinsic corresponds to the \c RDPMC instruction.
482 /// The performance counter to read.
483 /// \returns The 64-bit value read from the performance counter.
485 static __inline__
unsigned long long __DEFAULT_FN_ATTRS
487 return __builtin_ia32_rdpmc(__A
);
490 /// Reads the processor's time-stamp counter and the \c IA32_TSC_AUX MSR
493 /// \headerfile <x86intrin.h>
495 /// This intrinsic corresponds to the \c RDTSCP instruction.
498 /// The address of where to store the 32-bit \c IA32_TSC_AUX value.
499 /// \returns The 64-bit value of the time-stamp counter.
500 static __inline__
unsigned long long __DEFAULT_FN_ATTRS
501 __rdtscp(unsigned int *__A
) {
502 return __builtin_ia32_rdtscp(__A
);
505 /// Reads the processor's time-stamp counter.
507 /// \headerfile <x86intrin.h>
510 /// unsigned long long _rdtsc();
513 /// This intrinsic corresponds to the \c RDTSC instruction.
515 /// \returns The 64-bit value of the time-stamp counter.
516 #define _rdtsc() __rdtsc()
518 /// Reads the specified performance monitoring counter. Refer to your
519 /// processor's documentation to determine which performance counters are
522 /// \headerfile <x86intrin.h>
525 /// unsigned long long _rdpmc(int A);
528 /// This intrinsic corresponds to the \c RDPMC instruction.
531 /// The performance counter to read.
532 /// \returns The 64-bit value read from the performance counter.
534 #define _rdpmc(A) __rdpmc(A)
536 static __inline__
void __DEFAULT_FN_ATTRS
538 __builtin_ia32_wbinvd();
541 /// Rotates an 8-bit value to the left by the specified number of bits.
542 /// This operation is undefined if the number of bits exceeds the size of
545 /// \headerfile <x86intrin.h>
547 /// This intrinsic corresponds to the \c ROL instruction.
550 /// The unsigned 8-bit value to be rotated.
552 /// The number of bits to rotate the value.
553 /// \returns The rotated value.
554 static __inline__
unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
555 __rolb(unsigned char __X
, int __C
) {
556 return __builtin_rotateleft8(__X
, __C
);
559 /// Rotates an 8-bit value to the right by the specified number of bits.
560 /// This operation is undefined if the number of bits exceeds the size of
563 /// \headerfile <x86intrin.h>
565 /// This intrinsic corresponds to the \c ROR instruction.
568 /// The unsigned 8-bit value to be rotated.
570 /// The number of bits to rotate the value.
571 /// \returns The rotated value.
572 static __inline__
unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
573 __rorb(unsigned char __X
, int __C
) {
574 return __builtin_rotateright8(__X
, __C
);
577 /// Rotates a 16-bit value to the left by the specified number of bits.
578 /// This operation is undefined if the number of bits exceeds the size of
581 /// \headerfile <x86intrin.h>
583 /// This intrinsic corresponds to the \c ROL instruction.
586 /// The unsigned 16-bit value to be rotated.
588 /// The number of bits to rotate the value.
589 /// \returns The rotated value.
591 static __inline__
unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR
592 __rolw(unsigned short __X
, int __C
) {
593 return __builtin_rotateleft16(__X
, __C
);
596 /// Rotates a 16-bit value to the right by the specified number of bits.
597 /// This operation is undefined if the number of bits exceeds the size of
600 /// \headerfile <x86intrin.h>
602 /// This intrinsic corresponds to the \c ROR instruction.
605 /// The unsigned 16-bit value to be rotated.
607 /// The number of bits to rotate the value.
608 /// \returns The rotated value.
610 static __inline__
unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR
611 __rorw(unsigned short __X
, int __C
) {
612 return __builtin_rotateright16(__X
, __C
);
615 /// Rotates a 32-bit value to the left by the specified number of bits.
616 /// This operation is undefined if the number of bits exceeds the size of
619 /// \headerfile <x86intrin.h>
621 /// This intrinsic corresponds to the \c ROL instruction.
624 /// The unsigned 32-bit value to be rotated.
626 /// The number of bits to rotate the value.
627 /// \returns The rotated value.
629 static __inline__
unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR
630 __rold(unsigned int __X
, int __C
) {
631 return __builtin_rotateleft32(__X
, (unsigned int)__C
);
634 /// Rotates a 32-bit value to the right by the specified number of bits.
635 /// This operation is undefined if the number of bits exceeds the size of
638 /// \headerfile <x86intrin.h>
640 /// This intrinsic corresponds to the \c ROR instruction.
643 /// The unsigned 32-bit value to be rotated.
645 /// The number of bits to rotate the value.
646 /// \returns The rotated value.
648 static __inline__
unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR
649 __rord(unsigned int __X
, int __C
) {
650 return __builtin_rotateright32(__X
, (unsigned int)__C
);
654 /// Rotates a 64-bit value to the left by the specified number of bits.
655 /// This operation is undefined if the number of bits exceeds the size of
658 /// \headerfile <x86intrin.h>
660 /// This intrinsic corresponds to the \c ROL instruction.
663 /// The unsigned 64-bit value to be rotated.
665 /// The number of bits to rotate the value.
666 /// \returns The rotated value.
667 static __inline__
unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
668 __rolq(unsigned long long __X
, int __C
) {
669 return __builtin_rotateleft64(__X
, (unsigned long long)__C
);
672 /// Rotates a 64-bit value to the right by the specified number of bits.
673 /// This operation is undefined if the number of bits exceeds the size of
676 /// \headerfile <x86intrin.h>
678 /// This intrinsic corresponds to the \c ROR instruction.
681 /// The unsigned 64-bit value to be rotated.
683 /// The number of bits to rotate the value.
684 /// \returns The rotated value.
685 static __inline__
unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
686 __rorq(unsigned long long __X
, int __C
) {
687 return __builtin_rotateright64(__X
, (unsigned long long)__C
);
689 #endif /* __x86_64__ */
692 /* These are already provided as builtins for MSVC. */
693 /* Select the correct function based on the size of long. */
695 /// Rotates a 64-bit value to the left by the specified number of bits.
696 /// This operation is undefined if the number of bits exceeds the size of
699 /// \headerfile <x86intrin.h>
702 /// unsigned long long _lrotl(unsigned long long a, int b);
705 /// This intrinsic corresponds to the \c ROL instruction.
708 /// The unsigned 64-bit value to be rotated.
710 /// The number of bits to rotate the value.
711 /// \returns The rotated value.
713 #define _lrotl(a,b) __rolq((a), (b))
715 /// Rotates a 64-bit value to the right by the specified number of bits.
716 /// This operation is undefined if the number of bits exceeds the size of
719 /// \headerfile <x86intrin.h>
722 /// unsigned long long _lrotr(unsigned long long a, int b);
725 /// This intrinsic corresponds to the \c ROR instruction.
728 /// The unsigned 64-bit value to be rotated.
730 /// The number of bits to rotate the value.
731 /// \returns The rotated value.
733 #define _lrotr(a,b) __rorq((a), (b))
735 /// Rotates a 32-bit value to the left by the specified number of bits.
736 /// This operation is undefined if the number of bits exceeds the size of
739 /// \headerfile <x86intrin.h>
742 /// unsigned int _lrotl(unsigned int a, int b);
745 /// This intrinsic corresponds to the \c ROL instruction.
748 /// The unsigned 32-bit value to be rotated.
750 /// The number of bits to rotate the value.
751 /// \returns The rotated value.
753 #define _lrotl(a,b) __rold((a), (b))
755 /// Rotates a 32-bit value to the right by the specified number of bits.
756 /// This operation is undefined if the number of bits exceeds the size of
759 /// \headerfile <x86intrin.h>
762 /// unsigned int _lrotr(unsigned int a, int b);
765 /// This intrinsic corresponds to the \c ROR instruction.
768 /// The unsigned 32-bit value to be rotated.
770 /// The number of bits to rotate the value.
771 /// \returns The rotated value.
773 #define _lrotr(a,b) __rord((a), (b))
776 /// Rotates a 32-bit value to the left by the specified number of bits.
777 /// This operation is undefined if the number of bits exceeds the size of
780 /// \headerfile <x86intrin.h>
783 /// unsigned int _rotl(unsigned int a, int b);
786 /// This intrinsic corresponds to the \c ROL instruction.
789 /// The unsigned 32-bit value to be rotated.
791 /// The number of bits to rotate the value.
792 /// \returns The rotated value.
794 #define _rotl(a,b) __rold((a), (b))
796 /// Rotates a 32-bit value to the right by the specified number of bits.
797 /// This operation is undefined if the number of bits exceeds the size of
800 /// \headerfile <x86intrin.h>
803 /// unsigned int _rotr(unsigned int a, int b);
806 /// This intrinsic corresponds to the \c ROR instruction.
809 /// The unsigned 32-bit value to be rotated.
811 /// The number of bits to rotate the value.
812 /// \returns The rotated value.
814 #define _rotr(a,b) __rord((a), (b))
817 /* These are not builtins so need to be provided in all modes. */
818 /// Rotates a 16-bit value to the left by the specified number of bits.
819 /// This operation is undefined if the number of bits exceeds the size of
822 /// \headerfile <x86intrin.h>
825 /// unsigned short _rotwl(unsigned short a, int b);
828 /// This intrinsic corresponds to the \c ROL instruction.
831 /// The unsigned 16-bit value to be rotated.
833 /// The number of bits to rotate the value.
834 /// \returns The rotated value.
836 #define _rotwl(a,b) __rolw((a), (b))
838 /// Rotates a 16-bit value to the right by the specified number of bits.
839 /// This operation is undefined if the number of bits exceeds the size of
842 /// \headerfile <x86intrin.h>
845 /// unsigned short _rotwr(unsigned short a, int b);
848 /// This intrinsic corresponds to the \c ROR instruction.
851 /// The unsigned 16-bit value to be rotated.
853 /// The number of bits to rotate the value.
854 /// \returns The rotated value.
856 #define _rotwr(a,b) __rorw((a), (b))
858 #undef __DEFAULT_FN_ATTRS
859 #undef __DEFAULT_FN_ATTRS_CAST
860 #undef __DEFAULT_FN_ATTRS_CRC32
861 #undef __DEFAULT_FN_ATTRS_CONSTEXPR
863 #endif /* __IA32INTRIN_H */