-/**\r
- Calculate the maximum value which is a power of 2, but less the Input.\r
-\r
- @param[in] Input The number to pass in.\r
-\r
- @return The maximum value which is align to power of 2 and less the Input.\r
-**/\r
-UINT32\r
-SetPower2 (\r
- IN UINT32 Input\r
- )\r
-{\r
- UINT32 Result;\r
-\r
- Result = 0;\r
-#if defined(__GCC__)\r
- asm("bsr %1, \\r
- %%eax; \\r
- bts %%eax, \\r
- %0;" :"=r"(Result) :\r
- "r"(Input)\r
- );\r
-#elif defined(_MSC_VER)\r
- _asm {\r
- bsr eax, Input\r
- bts Result, eax\r
- }\r
-#endif\r
- return Result;\r
-}\r
-\r