]>
Commit | Line | Data |
---|---|---|
e1f414b6 | 1 | /** @file\r |
2 | Math worker functions.\r | |
3 | \r | |
bb817c56 | 4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
e1f414b6 | 6 | \r |
7 | **/\r | |
8 | \r | |
e1f414b6 | 9 | #include "BaseLibInternals.h"\r |
10 | \r | |
11 | /**\r | |
12 | Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits\r | |
13 | with the low bits that were rotated.\r | |
14 | \r | |
15 | This function rotates the 32-bit value Operand to the right by Count bits.\r | |
16 | The high Count bits are fill with the low Count bits of Operand. The rotated\r | |
17 | value is returned.\r | |
18 | \r | |
19 | If Count is greater than 31, then ASSERT().\r | |
20 | \r | |
21 | @param Operand The 32-bit operand to rotate right.\r | |
22 | @param Count The number of bits to rotate right.\r | |
23 | \r | |
127010dd | 24 | @return Operand >> Count.\r |
e1f414b6 | 25 | \r |
26 | **/\r | |
27 | UINT32\r | |
28 | EFIAPI\r | |
29 | RRotU32 (\r | |
2f88bd3a MK |
30 | IN UINT32 Operand,\r |
31 | IN UINTN Count\r | |
e1f414b6 | 32 | )\r |
33 | {\r | |
5385a579 | 34 | ASSERT (Count < 32);\r |
e1f414b6 | 35 | return (Operand >> Count) | (Operand << (32 - Count));\r |
36 | }\r |