|  3DSoftware.com > Programming > Integers > Page 3 |
|
Integers
Page 3
Wide Integers We need large (wide) binary integers represented with a fixed number of bits. We will call these types of integers WideInteger. The number of bits is configured when the wide integer is declared. In this discussion, the length of a WideInteger will be The In our implementation, each digit of a WideInteger number is Each digit is stored in a digit packet. Each digit packet actually contains We use SIMD for optimization on AMD-based computers. We define a |
|
|
Addition
Addition is like the DecInteger addition discussed in the previous page, but now each digit is a First, the two numbers being added together have their corresponding digit packets added together with the PADDD simd instruction (see AMD64 Architecture Programmers Manual Volume 4: 128-Bit Media Instructions for complete listing of simd instructions). The PADDD instruction is for signed numbers, but is performed unsigned here because the high bit of the digit packets will be clear during this operation. Before the PADDD instruction is invoked, Carrying can be done sequentially (not simd) one digit at a time beginning with the least significant digit packet, or can be done with simd instructions as explained in the next page of this article. |
| Page 3 | ||||||
|
|
Copyright © 2008 by 3D Software. All rights reserved. 3D Software, P.O. Box 221190, Sacramento CA 95822 USA www.3DSoftware.com Contact us |
| Thursday, 20-Nov-2008 12:34:48 GMT |