Re: SSE2 register addition (linux gas)



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

.



Relevant Pages

  • Re: SSE2 register addition (linux gas)
    ... would the carry bit be added to the next higher dword? ... independantly, and the carry flag goes into the EFLAGS register, if I ... SSE instructions are NOT meant to operate on ... They are meant to work on, up to, qwords. ...
    (comp.lang.asm.x86)
  • Re: Frage zu DWORD
    ... Objekt und noch ein zusätzliches Flag setzen. ... DWORD in LowWord und HiWord aufzuteilen und ins eine den Pointer zu ... in neueren Versionen wurde dieses DWORD durch einen ... Zeiger zum Flag extern dazu. ...
    (microsoft.public.de.vc)
  • Re: Interprocess communication using message queue
    ... DWORD size, flag; ... DWORD err = GetLastError; ... DWORD err1 = GetLastError(); ...
    (microsoft.public.pocketpc.developer)
  • Re: RegQueryValueEx() returns zero
    ... "Starglider 4 (Marco Knoester)" wrote: ... DWORD _s=sizeof; ... REG_DWORD value is just a flag. ... Alex ...
    (microsoft.public.vc.language)
  • Re: Bad habits
    ... mov dword,8 ... into a register and rotate within the register than ... not eax ...
    (alt.lang.asm)