Re: SSE2 register addition (linux gas)
- From: Alexander Knopf <spamtrap@xxxxxxxxxx>
- Date: Fri, 25 Aug 2006 23:01:30 +0200
ldb wrote:
Alexander Knopf wrote:
quick questions about the above.
i'm writing a program that handles large numbers, over 128 bits.
now i understand i could just put 4 DWord sections of any number into an
xmm register, put another 4 DWords into a second and add them.
however, i don't know how the carry flag is handled.
so questions as follows:
1) which byte order would i have to use ?
2) would the carry bit be added to the next higher dword ?
3) what happens if the highest dword addition produces a carry ?
any help is greatly appreciated.
-Alexander Knopf
The short answer is: They will add the four dwords completely
independantly, and the carry flag goes into the EFLAGS register, if I
remember correctly. SSE instructions are NOT meant to operate on
128-bit data types. They are meant to work on, up to, qwords. Doing
higher than qword math in SSE registers correctly is not obvious and
generally done incorrectly.
so basically what you're saying is, since i can do addition of 2 QWords,
and there's only one carry flag i would have to check the values anyhow.
now then, would it be easier to use 32 bit registers and use adc to add
the carry flag to the next value ?
-Alexander Knopf
.
- Follow-Ups:
- Re: SSE2 register addition (linux gas)
- From: ldb
- Re: SSE2 register addition (linux gas)
- References:
- SSE2 register addition (linux gas)
- From: Alexander Knopf
- Re: SSE2 register addition (linux gas)
- From: ldb
- SSE2 register addition (linux gas)
- Prev by Date: Re: Suggestion for some good ASM books?
- Next by Date: Re: Best way to emulate BSR?
- Previous by thread: Re: SSE2 register addition (linux gas)
- Next by thread: Re: SSE2 register addition (linux gas)
- Index(es):
Relevant Pages
|