Code: Select all
Define d1.d, d2.d, d3.d
d1 = Int(d2) & Int(d3)
If I change it to this it works:
Code: Select all
Procedure.d Double( MyInt.i )
ProcedureReturn MyInt
EndProcedure
Define d1.d, d2.d, d3.d
d1 = Double(Int(d2) & Int(d3))
Code: Select all
Define d1.d, d2.d, d3.d
d1 = Int(d2) & Int(d3)
Code: Select all
Procedure.d Double( MyInt.i )
ProcedureReturn MyInt
EndProcedure
Define d1.d, d2.d, d3.d
d1 = Double(Int(d2) & Int(d3))
Code: Select all
Procedure testSSE2()
!mov eax, 1
!cpuid
!and edx, $4000000
!sar edx,26
!mov eax,edx
ProcedureReturn
EndProcedure
Procedure.f fand(a.f,b.f)
Protected result.f
!movss xmm0, [p.v_a]
!movss xmm1, [p.v_b]
!andps xmm0,xmm1
!movss [p.v_result],xmm0
ProcedureReturn result
EndProcedure
Procedure.d dand(a.d,b.d)
Protected result.d
!movsd xmm0, [p.v_a]
!movsd xmm1, [p.v_b]
!andpd xmm0,xmm1
!movsd [p.v_result] , xmm0
ProcedureReturn result
EndProcedure
Debug testSSE2()
Debug fand(123.456,111.456)
Debug dand(123.456,111.456)
You are addressing someone with the username of 'idle', not 'addict'.TeraByte wrote:Thank you Addict for the code for Logical And on doubles.
At this stage of your learning I would suggest you focus more on 'correct result' than 'efficient'.TeraByte wrote:Sorry if it seems silly, but I'm new to PB and am just trying to make sure I'm not coding it inefficiently.