Author Topic: fTest() in SmplMath  (Read 2378 times)


  • Member
  • *****
  • Posts: 1319
  • <AMD>< 7-32>
fTest() in SmplMath
« on: July 13, 2017, 02:51:59 AM »
Hi qWord!!

I'm using:
Code: [Select]
.if !fTest(variable, NaN)
and I think the macro left something in FPU registers, because apparently requiere:
Code: [Select]
Finit      <--------
The fcmpx macro is still beyond my capacity  :biggrin:

Thanks. HSE


  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: fTest() in SmplMath
« Reply #1 on: July 13, 2017, 06:56:46 AM »
yes, there is a bug.
Remove the line:
FSBE_PROC %FSBE_LOAD_ARG,%fcmpx_factor,0
from the macro fcmpx (intended for internal use only, BTW).
There also a problem when using fTest with the SEE2-backend, but I've currently no time to track that down.

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


  • Member
  • *****
  • Posts: 1319
  • <AMD>< 7-32>
Re: fTest() in SmplMath
« Reply #2 on: July 13, 2017, 07:45:14 AM »
Maybe not that line.

There is no hurry. It's working with Finit.


Code: [Select]
0040E735    DD05 CC4F4300   FLD QWORD PTR DS:[NaN]
0040E73B    DD45 EC         FLD QWORD PTR SS:[EBP-14]
0040E73E    DB05 10314300   FILD DWORD PTR DS:[fcmp_lbl3_2]
0040E744    50              PUSH EAX
0040E745    6A 00           PUSH 0
0040E747    FF35 10314300   PUSH DWORD PTR DS:[fcmp_lbl3_2]
0040E74D    E8 AE280200     CALL AnimalM.fpu_zero_test
0040E752    DDD8            FSTP ST
0040E754    DDD8            FSTP ST
0040E756    85C0            TEST EAX, EAX
0040E758    0F9545 DC       SETNE BYTE PTR SS:[EBP-24]
0040E75C    58              POP EAX
0040E75D    807D DC 00      CMP BYTE PTR SS:[EBP-24], 0
0040E761    75 19           JNZ SHORT AnimalM.0040E77C