News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Backend change in SmplMath

Started by HSE, October 23, 2017, 12:40:01 PM

Previous topic - Next topic

HSE

Hi qWord!

I change between fpu and sse2:     ifidn abb_backend_entity, <FSLV_X86_FPU_ENTITY>
    fSlv8 = 0.85
    else           ; FSLV_X86_SSE2_FPU_ENTITY
    fSlv8 tempR8 = 0.85
    fld tempR8
    endif


It's not a good solution, for sure there is a better one.

I don't know if it's posible to force the backend in some program fragment.

Thanks.
Equations in Assembly: SmplMath

qWord

You can change the back-end in several ways, e.g. fSlvLoadBackEnd or fSlvSelectBackEnd (see doc). However, there is no push/pop semantic for that, so it is up to you keep track of current used back-end.


BTW: I've upload anew version that contains some bug fixes that had been collected over the years
https://sourceforge.net/projects/smplmath/files/2.0.2/SmplMath.rar/download
MREAL macros - when you need floating point arithmetic while assembling!

HSE

Thanks very much. Next week I will try new version.
Equations in Assembly: SmplMath

HSE

Hi qWord!

Itsn't working.

If you remove  "FSBE_PROC %FSBE_LOAD_ARG,%fcmpx_factor,0"
then " !fTest([esi].Observation.weight_lb, NaN)" fail.

Equations in Assembly: SmplMath

qWord

HSE,

please show a small test case reproducing the unexpected behavior. Regardless that, testing if some value is negligible in compare to an NaN-Encoding (Not a Number) doesn't look right.

regards
MREAL macros - when you need floating point arithmetic while assembling!

HSE

Yes, I was thinking to make something little because what I'm running now is unpublished.

And Yes, certainlly there is a better way to represent missing data, just I don't know it. But work very well with SmplMath 2.0.1 (except for fpu-stack imbalance, of course).
Equations in Assembly: SmplMath

qWord

There are the macros r4IsValid and r8IsValid that test the passed variable for NaN:
.if r4IsValid(myreal4)
; not a NaN
.elseif
; is NaN
.endif


MREAL macros - when you need floating point arithmetic while assembling!

HSE

Perfect  :t

Perhaps more specific in this case:r8IsNotNaN macro mem64:req
IF @WordSize EQ 4
push DWORD ptr mem64+4
and DWORD ptr [esp],7FF80000h
xor DWORD ptr [esp],7FF80000h
lea esp,[esp+4]
ELSE
push rax
mov eax,DWORD ptr mem64+4
and eax,7FF80000h
xor eax,7FF80000h
pop rax
ENDIF
EXITM <!ZERO?>
endm

Thanks.
Equations in Assembly: SmplMath