Page 1 of 1

[SOLVED] Questions about SSE

Posted: Sat Sep 09, 2023 10:25 am
by Mijikai
I struggle with SSE :oops:

How can i make the Procedure return the result directly ?

How to compare two results and branch if they are less/greater ?
Why is cmpsd not recognised as instruction ?

Code:

Code: Select all

EnableExplicit

Procedure.d Dummy(A.d,B.d,*C)
  !movsd xmm0,[p.v_A]
  !movsd xmm1,[p.v_B]
  !divsd xmm0,xmm1;<- A = A / B
 
  ;i would like to compare two xmm
  ;!cmpsd xmm0,xmm1 <- invalid instruction !?
  
  !mov rax,[p.p_C]
  !movsd [rax],xmm0;<- returns to variable via ptr
  
  ProcedureReturn
EndProcedure

Procedure.i Main()
  Protected test.d
  
  Debug Dummy(100.0,2.0,@test)
  Debug test
  
  ProcedureReturn #Null
EndProcedure

End Main()

Re: Questions about SSE

Posted: Sat Sep 09, 2023 11:06 am
by STARGÅTE
CMPSD needs a third parameter used as comparison predicate.

If you want to return a double directly (Procedure.d), you have to use the FPU instructions.

Re: Questions about SSE

Posted: Sat Sep 09, 2023 11:22 am
by Mijikai
@STARGÅTE
Thanks for the quick help, i completely missed the third parameter :oops: