Recent Posts

Pages: [1] 2 3 ... 10
1
The Workshop / Windows API differences 32/64-bit
« Last post by sinsi on Today at 12:04:28 AM »
Are there any Windows API calls with a different count of arguments between 32- and 64-bit? Logic says no, but never assume...
2
The Laboratory / Re: Other floating point macros.
« Last post by HSE on August 14, 2018, 10:50:26 PM »
It's just not worth the effort, because fpu is really simple and concise once you get the hang of it.

In 32bit, using last Hutch macros is 0.5% faster. A posible adventage of that macros (in future?) is to check that fpu instructions are not in procedures in wich MMX registers are used as regular registers (Hutch idea), but there is others ways. Of course, in complex programs, preprocessing eat time  :biggrin: (and make things more complex eat brains?  :icon_confused:)

Otoh, there is an advanced set of macros by Qword, SmplMath. Any users around who could talk about their experience?

SmplMath is another kind of macros, it's a system that allow to write eficiently equations with no penalties (perhaps I have 1/100 penalties making things more easy, no matter).
Code: [Select]
fSlv8 dnam = (0.143 * (iprot ^ 0.73)) /( (0.0461 * nut2) ^ (1.0 / 0.73));
If you only have one equation is nice, but in one model I have around 1200 lines! Without SmplMath is totally crazy to work that. 

3
The Workshop / Re: Multiply matrix MxN by NxK real4 any size
« Last post by LiaoMi on August 14, 2018, 10:18:21 PM »
Hi RuiLoureiro,

my test results ..
4
The Campus / Re: Student in technikal college
« Last post by hutch-- on August 14, 2018, 10:02:36 PM »
Try posting your code but keep in mind we will not do your homework for you.
5
UASM Assembler Development / Re: Lambda Function Feedback
« Last post by LiaoMi on August 14, 2018, 09:49:51 PM »
Hi johnsa,

I think its a really cool idea  :P, C++ Lambdas Under The Hood https://web.mst.edu/~nmjxv3/articles/lambdas.html
6
The Laboratory / Re: Other floating point macros.
« Last post by RuiLoureiro on August 14, 2018, 09:08:56 PM »
where is the error?
the result is ok when _LoopFrequency=1,2,3
error:
_LoopFrequency=4, result=1.0
_LoopFrequency=5, result=6.0
_LoopFrequency=6, result=1.0
_LoopFrequency=7, result=6.0
...

_floating_pointAdd Proc uses rbx _LoopFrequency:QWORD
   
   fninit                      ;; clear FPU registers and flags
   fldz                        ;; zero st(0)   <<<<<<<<<<<<<<<<<<---- st(0) = 0.0
;**********************************
;               remove fldz above
;**********************************

   mov   rbx,_LoopFrequency

   fld   _One_real8
   fld   _One_real8
   faddp
@@:
   fld   _One_real8
   faddp
   fld   _One_real8
   faddp
   fld   _One_real8
   faddp
   fld   _One_real8
   faddp
   fld   _One_real8
   faddp
   
   sub   rbx,1
   jnz   @B
   
   fld   _One_real8
   fsubp

   fstp   result
;----------------------------------------------------
; HERE we have st(0) = 0.0 FPU is not cleaned
;---------------------------------------------------
   
     invoke   RtlZeroMemory,ADDR szBuffer, sizeof szBuffer
   invoke   FpuFLtoA64, ADDR result,40,ADDR szBuffer,SRC1_REAL Or SRC2_DIMM       
   invoke   SetWindowText,hEdithWnd,addr szBuffer
   
   ret
   
_floating_pointAdd Endp
7
The Laboratory / Re: Other floating point macros.
« Last post by six_L on August 14, 2018, 08:28:43 PM »
where is the error?
the result is ok when _LoopFrequency=1,2,3
error:
_LoopFrequency=4, result=1.0
_LoopFrequency=5, result=6.0
_LoopFrequency=6, result=1.0
_LoopFrequency=7, result=6.0
...
Code: [Select]
_floating_pointAdd Proc uses rbx _LoopFrequency:QWORD

fninit                      ;; clear FPU registers and flags
fldz                        ;; zero st(0)

mov rbx,_LoopFrequency

fld _One_real8
fld _One_real8
faddp
@@:
fld _One_real8
faddp
fld _One_real8
faddp
fld _One_real8
faddp
fld _One_real8
faddp
fld _One_real8
faddp

sub rbx,1
jnz @B

fld _One_real8
fsubp

fstp result
   
  invoke RtlZeroMemory,ADDR szBuffer, sizeof szBuffer
invoke FpuFLtoA64, ADDR result,40,ADDR szBuffer,SRC1_REAL Or SRC2_DIMM       
invoke SetWindowText,hEdithWnd,addr szBuffer

ret

_floating_pointAdd Endp
8
The Laboratory / Other floating point macros.
« Last post by jj2007 on August 14, 2018, 07:38:48 PM »
As you all know, I am a great fan of macros. But I rarely use my handful of fpu macros. It's just not worth the effort, because fpu is really simple and concise once you get the hang of it.

Otoh, there is an advanced set of macros by Qword, SmplMath. Any users around who could talk about their experience?
9
The Laboratory / Re: Simple floating point macros.
« Last post by RuiLoureiro on August 14, 2018, 07:04:41 PM »
fpercent seems to be OK, doenst give any problem.
Let me say that when we want to use an integer constant we load it this way

fpconst    macro   cst
push       cst    ;100
fild         dword ptr [esp]   ; load 100 into st(0)
pop         eax                  ; remove from stack
endm

so we may do this also

fld num
fpconst 100
fdivp
fld   pcnt
fmulp    ; st(0)= (num/100)*pcnt


Another way for fpercent:

fld pnct            ; load pnct     <<<<<< st(2) >> st(1)     >>> removed
fld num            ; load num     <<<<<< st(1) >>removed
fld FLT8(100.0) ; load constant 100  << st(0) >>removed
fdivp                ; st(0)= num/100.0    >>>>>>> st(0)     >>> removed
fmulp               ; st(0)= (num/100.0)*pcnt  >>>>>>>>>>>> st(0)
10
UASM Assembler Development / Lambda Function Feedback
« Last post by johnsa on August 14, 2018, 06:16:52 PM »
Hi,

I've recently come into some spare-time, haha.. so will be working on finishing off 2.47 and 2.48 releases which will include plt/got support and a few other fixes still pending.
I was thinking adding support for lambda style functions might be nice, they could work something along these lines:

Code: [Select]

SomeFunction PROTO pHandler:PTR

...

invoke SomeFunction, ADDR aHander  ; This would be the traditional way to pass a handler/callback to another function.

...

with C-style calling we have:

SomeFunction(&aHandler) ; Possible now..

...

As an extension to this...

SomeFunction( (arg1:BYTE, arg2:DWORD) => {
   ; handler code...
})


Just a thought.. if anyone has any ideas about this.
Pages: [1] 2 3 ... 10