1e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff/** @file 2e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff 64-bit left shift function for IA-32. 3e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff 488a75d260cadc67cc0edf6ad5f57241ed89a7d4bMichael Kinney Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> 5bb817c56c51fabe92915fe30b168b4833cb2aed9hhtian This program and the accompanying materials 6e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff are licensed and made available under the terms and conditions of the BSD License 7e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff which accompanies this distribution. The full text of the license may be found at 8e4a34497b48b6721d9f08aa406919d09ef8754abMyronPorter http://opensource.org/licenses/bsd-license.php. 9e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff 10e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff 13e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff**/ 14e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff 151efcc4ae46f52e3845923ffbab68426e068709d2vanjeff 16f734a10ab104f1072f94cab66a5489e0fd8fce8aAJFISH 17e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff 1842eedea958591087603bbacd1c2227d2494026afyshang/** 1942eedea958591087603bbacd1c2227d2494026afyshang Shifts a 64-bit integer left between 0 and 63 bits. The low bits 2042eedea958591087603bbacd1c2227d2494026afyshang are filled with zeros. The shifted value is returned. 2142eedea958591087603bbacd1c2227d2494026afyshang 2242eedea958591087603bbacd1c2227d2494026afyshang This function shifts the 64-bit value Operand to the left by Count bits. The 2342eedea958591087603bbacd1c2227d2494026afyshang low Count bits are set to zero. The shifted value is returned. 2442eedea958591087603bbacd1c2227d2494026afyshang 2542eedea958591087603bbacd1c2227d2494026afyshang @param Operand The 64-bit operand to shift left. 2642eedea958591087603bbacd1c2227d2494026afyshang @param Count The number of bits to shift left. 2742eedea958591087603bbacd1c2227d2494026afyshang 2842eedea958591087603bbacd1c2227d2494026afyshang @return Operand << Count 2942eedea958591087603bbacd1c2227d2494026afyshang 3042eedea958591087603bbacd1c2227d2494026afyshang**/ 31e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeffUINT64 32e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeffEFIAPI 33e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeffInternalMathLShiftU64 ( 34e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff IN UINT64 Operand, 35e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff IN UINTN Count 36e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff ) 37e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff{ 38e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff _asm { 39e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff mov cl, byte ptr [Count] 40e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff xor eax, eax 41e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff mov edx, dword ptr [Operand + 0] 42e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff test cl, 32 // Count >= 32? 4388a75d260cadc67cc0edf6ad5f57241ed89a7d4bMichael Kinney jnz L0 4488a75d260cadc67cc0edf6ad5f57241ed89a7d4bMichael Kinney mov eax, edx 4588a75d260cadc67cc0edf6ad5f57241ed89a7d4bMichael Kinney mov edx, dword ptr [Operand + 4] 4688a75d260cadc67cc0edf6ad5f57241ed89a7d4bMichael KinneyL0: 47e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff shld edx, eax, cl 48e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff shl eax, cl 49e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff } 50e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff} 51e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8vanjeff 52