- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know you can say Z = Int8(X) * int8(Y), or
Z=X*Y
if all quantities are typed integer(8), but
the result can potenially be longer than 64 bits.
What I would like to do is recover BOTH integer(8) words in that case.
I am now breaking the two integer(8) words into two parts each, and reconstructing the
product from the four combinations. This is a rather slow and cumbersome way of doing it, though.
Maybe it could be with assembly code? I think the Pentiums have that multiply in their instruction set (?)
Has anyone ever done this?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did look at what was available, but it was only for Intel 64 CPUs.
Furthermore, the Fortran version did not return the upper 64 bits.
So, I will just coast along as before.
Thanks; Bill
PS: Did anyone ever determine why we somwtimes get a "drop dead" when we hit SUBMIT?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bill,
I would recommend that you write a platform independent function interface with a platform dependent function. The function would have various incarnations for each platform and with one generic incarnation that works on all platforms. On an Intel64 platform the function call dispatches to assembly code that performs
RDX:RAX <- RAX * r/m64
Used
dest128 = Mul64x64(A64, B64)
destInteger16 = MulInteger8s(A8, B8)
call MulInteger8s(dest, A, B)
However you want to write the interface
This way you get portability and speed (when you have written the appropriate C or assembly function).
My 2 cents
Jim

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page