]>
git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/math.c
3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 64-bit Math worker functions for Intel Itanium(TM) processors.
35 This routine allows a 64 bit value to be left shifted by 32 bits and
36 returns the shifted value.
37 Count is valid up 63. (Only Bits 0-5 is valid for Count)
41 Operand - Value to be shifted
42 Count - Number of times to shift left.
46 Value shifted left identified by the Count.
50 return Operand
<< Count
;
62 This routine allows a 64 bit value to be right shifted by 32 bits and returns the
64 Count is valid up 63. (Only Bits 0-5 is valid for Count)
68 Operand - Value to be shifted
69 Count - Number of times to shift right.
73 Value shifted right identified by the Count.
77 return Operand
>> Count
;
82 IN UINT64 Multiplicand
,
89 This routine allows a 64 bit value to be multiplied with a 32 bit
90 value returns 64bit result.
91 No checking if the result is greater than 64bits
95 Multiplicand - multiplicand
96 Multiplier - multiplier
100 Multiplicand * Multiplier
104 return Multiplicand
* Multiplier
;
111 OUT UINTN
*Remainder OPTIONAL
117 This routine allows a 64 bit value to be divided with a 32 bit value returns
118 64bit result and the Remainder.
119 N.B. only works for 31bit divisors!!
125 Remainder - buffer for remainder
130 Remainder = Dividend mod Divisor
135 *Remainder
= Dividend
% Divisor
;
138 return Dividend
/ Divisor
;