News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Could you help ...

Started by RuiLoureiro, April 02, 2013, 05:14:39 AM

Previous topic - Next topic

RuiLoureiro

Hi
   Soon as possible i want to post some code
   to work with matrices.
   But now i want to test this code in TestCnvDD1.zip.
   Could you help ?
   Thanks

Results on my P4 XP
-------------------

12345.678
12345.678
*** STOP ***
0 Real 0.0
112 cycles, GetStrLen -HIGH_PRIORITY_CLASS
124 cycles, szLen -HIGH_PRIORITY_CLASS

248 cycles, rep movsb -HIGH_PRIORITY_CLASS
78 cycles, mov  eax -HIGH_PRIORITY_CLASS

181 cycles, CnvIDDtoRcl, _Integer4_1 -HIGH_PRIORITY_CLASS
177 cycles, CnvIDDtoRcl, _Integer4_2 -HIGH_PRIORITY_CLASS
175 cycles, IDDtoRclCnv, _Integer4_1 -HIGH_PRIORITY_CLASS
172 cycles, CnvIDDtoRcl+_RclBuf, _Integer4_1 -HIGH_PRIORITY_CLASS
175 cycles, IDDtoRclCnv+_RclBuf, _Integer4_1 -HIGH_PRIORITY_CLASS
116 cycles, DDtoRclCnv, _Dword_1 -HIGH_PRIORITY_CLASS
167 cycles, DDtoRclCnv, _Dword_2 -HIGH_PRIORITY_CLASS
109 cycles, CnvDDtoRcl, _Dword_1 -HIGH_PRIORITY_CLASS
119 cycles, DDtoRclCnv+_RclBuf, _Dword_1 -HIGH_PRIORITY_CLASS
108 cycles, CnvDQtoRcl+_RclBuf, _Dword_1 -HIGH_PRIORITY_CLASS
136 cycles, QwordRevCnv+_RclBuf, _Dword_1 -HIGH_PRIORITY_CLASS
123456


1100 cycles, ConvertFloat4Z, _Real4_1 -HIGH_PRIORITY_CLASS
-123.45678
1236 cycles, ConvertFloat4Z, _Real4_2 -HIGH_PRIORITY_CLASS
12345.678
************************
1077 cycles, ConvertFloat4ZX, _Real4_1 -HIGH_PRIORITY_CLASS
************************
-123.45678
1215 cycles, ConvertFloat4ZX, _Real4_2 -HIGH_PRIORITY_CLASS
12345.678

1320 cycles, CnvFloat4ToRcl+_RclBuf, _Real4_2 -HIGH_PRIORITY_CLASS
1314 cycles, CnvFloat4ToRcl, _Real4_2 -HIGH_PRIORITY_CLASS
1228 cycles, CnvReal4ToRcl+_RclBuf, _Real4_2 -HIGH_PRIORITY_CLASS
1230 cycles, CnvReal4ToRcl, _Real4_2 -HIGH_PRIORITY_CLASS

1342 cycles, CnvFloat4ToStr+_RclBuf, _Real4_2 -HIGH_PRIORITY_CLASS
1344 cycles, CnvFloat4ToStr, _Real4_2 -HIGH_PRIORITY_CLASS
1342 cycles, CnvReal4ToStr+_RclBuf, _Real4_2 -HIGH_PRIORITY_CLASS
1340 cycles, CnvReal4ToStr, _Real4_2 -HIGH_PRIORITY_CLASS
*** END ***   


Results from TestCnvDQ6.zip

Quote
2 cycles, LEA -REALTIME_PRIORITY_CLASS
1 cycles, ADD -REALTIME_PRIORITY_CLASS
96 cycles, CnvToRcl -REALTIME_PRIORITY_CLASS
55555
111 cycles, dwtoa -REALTIME_PRIORITY_CLASS
55555
1504 cycles, ConvertFloat8Z -REALTIME_PRIORITY_CLASS
12345.3456
2216 cycles, FloatToStr from MASM -REALTIME_PRIORITY_CLASS
12345.35
*** END ***

jj2007


RuiLoureiro

        Thanks Jochen

Results from TestCnvDQ7.zip

note 1: ConvertFloat8Z and ConvertFloat8ZX uses the same BCD method
          as used in FloatToStr from MASM

note 2: ConvertFloat8Z and ConvertFloat8ZX gives also
             the length of the string and the string is null terminated too.
             They also remove the last zeros.

First SAMPLE

Quote
1 cycles, LEA -REALTIME_PRIORITY_CLASS
1 cycles, ADD -REALTIME_PRIORITY_CLASS
96 cycles, CnvToRcl -REALTIME_PRIORITY_CLASS
55555
107 cycles, dwtoa -REALTIME_PRIORITY_CLASS
55555
1501 cycles, ConvertFloat8Z -REALTIME_PRIORITY_CLASS
12345.3456
2217 cycles, FloatToStr from MASM -REALTIME_PRIORITY_CLASS
12345.35
1098 cycles, ConvertFloat8ZX -REALTIME_PRIORITY_CLASS
12345.3456
*** END ***

Second SAMPLE

Quote
1 cycles, LEA -REALTIME_PRIORITY_CLASS
1 cycles, ADD -REALTIME_PRIORITY_CLASS
95 cycles, CnvToRcl -REALTIME_PRIORITY_CLASS
55555
107 cycles, dwtoa -REALTIME_PRIORITY_CLASS
55555
1500 cycles, ConvertFloat8Z -REALTIME_PRIORITY_CLASS
12345.3456
2210 cycles, FloatToStr from MASM -REALTIME_PRIORITY_CLASS
12345.35
1102 cycles, ConvertFloat8ZX -REALTIME_PRIORITY_CLASS
12345.3456
*** END ***

GoneFishing


RuiLoureiro

 :biggrin:
Many thanks to you vertograd to help me    :t
:icon14:

    But now i want to say something about this converters.   
    The logic behind each converter is this:

        each one needs no more than 2 things:

        1. a pointer to a dword or EAX          (natural number32/integer32/real4)
                        a qword or EDX:EAX          (natural number64/integer64/real8)
                        a tbyte.                              (                                           real10)
                       
        2. a pointer to a rcl string (dd behind the address)
       
           or 0
                which means: «use the internal rcl string and
                return the address in EDI». This is why we see
                ...+_RclBuf -... or not

;)

GoneFishing

I'm glad that I helped you :t

QuoteSoon as possible i want to post some code
I hope to see your new macros soon ;)

RuiLoureiro

Quote from: vertograd on April 03, 2013, 07:19:15 PM
I'm glad that I helped you :t

QuoteSoon as possible i want to post some code
I hope to see your new macros soon ;)
the problem is this: i need to test it !
               it's not macros but we can convert it to macros without any problems
Quote
  note this: 126 views and only 2 positive answers from you and Jochen !

RuiLoureiro

    Here is TestAll1.zip
    Could you show here your results ?
    Thanks

    Here is my results in P4, XP sp3

Quote
**** Show DD data and test it **********

-1234.5601
-1.23456E+17
-1.23456E+37
-0.0012346
-1.23456E-17
-1.23456E-37
*** STOP 1 ***
-1234.5601
-1.23456E+17
-1.23456E+37
-0.0012346
-1.23456E-17
-1.23456E-37
*** STOP 2 ***
-1234.5601
-1.23456E+17
-1.23456E+37
-0.0012346
-1.23456E-17
-1.23456E-37
*** STOP ***
2955 cycles, ConvertFloat4, _Real4_1, Save FPU & all CPU registers -HIGH_PRIORIT
Y_CLASS
1020 cycles, ConvertFloat4Z, _Real4_1 -HIGH_PRIORITY_CLASS
1006 cycles, ConvertFloat4ZX, _Real4_1 -HIGH_PRIORITY_CLASS

869 milliseconds, ConvertFloat4, _Real4_1, Save FPU & all CPU registers -HIGH_PR
IORITY_CLASS
302 milliseconds, ConvertFloat4Z, _Real4_1 -HIGH_PRIORITY_CLASS
296 milliseconds, ConvertFloat4ZX, _Real4_1 -HIGH_PRIORITY_CLASS
*** END DD ***


**** Show DQ data and test it **********

-123.456
-1.23456E+25
-1.23456E+234
-0.0123456
-1.23456E-25
-1.23456E-234
*** STOP 1 ***
-123.456
-1.23456E+25
-1.23456E+234
-0.0123456
-1.23456E-25
-1.23456E-234
*** STOP 2 ***
-123.456
-1.23456E+25
-1.23456E+234
-0.0123456
-1.23456E-25
-1.23456E-234
3099 cycles, ConvertFloat8, _Real8_1, Save FPU & all CPU registers -HIGH_PRIORIT
Y_CLASS
1163 cycles, ConvertFloat8Z, _Real8_1 -HIGH_PRIORITY_CLASS
1148 cycles, ConvertFloat8ZX, _Real8_1 -HIGH_PRIORITY_CLASS

911 milliseconds, ConvertFloat8, _Real8_1, Save FPU & all CPU registers -HIGH_PR
IORITY_CLASS
341 milliseconds, ConvertFloat8Z, _Real8_1 -HIGH_PRIORITY_CLASS
340 milliseconds, ConvertFloat8ZX, _Real8_1 -HIGH_PRIORITY_CLASS
*** END DQ ***


**** Show QQ data and test it **********

-123.45678901234567
-1.2345678901234567E+25
-1.2345678901234567E+0256
-1.2345678901234565E+2567
-0.0123456789012346
-1.2345678901234567E-25
-1.2345678901234567E-0256
-1.2345678901234569E-2567
*** STOP 1 ***
-123.45678901234567
-1.2345678901234567E+25
-1.2345678901234567E+0256
-1.2345678901234565E+2567
-0.0123456789012346
-1.2345678901234567E-25
-1.2345678901234567E-0256
-1.2345678901234569E-2567
*** STOP 2 ***
-123.45678901234567
-1.2345678901234567E+25
-1.2345678901234567E+0256
-1.2345678901234565E+2567
-0.0123456789012346
-1.2345678901234567E-25
-1.2345678901234567E-0256
-1.2345678901234569E-2567
3026 cycles, ConvertFloat10, _Real10_1, Save FPU & all CPU registers -HIGH_PRIOR
ITY_CLASS
1076 cycles, ConvertFloat10Z, _Real10_1 -HIGH_PRIORITY_CLASS
1064 cycles, ConvertFloat10ZX, _Real10_1 -HIGH_PRIORITY_CLASS

892 milliseconds, ConvertFloat10, _Real10_1, Save FPU & all CPU registers -HIGH_
PRIORITY_CLASS
316 milliseconds, ConvertFloat10Z, _Real10_1 -HIGH_PRIORITY_CLASS
310 milliseconds, ConvertFloat10ZX, _Real10_1 -HIGH_PRIORITY_CLASS

*** END QQ and ALL***

GoneFishing

Win7 SP0 ;)
Quote**** Show DD data and test it **********

-1234.5601
-1.23456E+17
-1.23456E+37
-0.0012346
-1.23456E-17
-1.23456E-37
*** STOP 1 ***
-1234.5601
-1.23456E+17
-1.23456E+37
-0.0012346
-1.23456E-17
-1.23456E-37
*** STOP 2 ***
-1234.5601
-1.23456E+17
-1.23456E+37
-0.0012346
-1.23456E-17
-1.23456E-37
*** STOP ***
3014 cycles, ConvertFloat4, _Real4_1, Save FPU & all CPU registers -HIGH_PRIORITY_CLASS
1039 cycles, ConvertFloat4Z, _Real4_1 -HIGH_PRIORITY_CLASS
1017 cycles, ConvertFloat4ZX, _Real4_1 -HIGH_PRIORITY_CLASS

1132 milliseconds, ConvertFloat4, _Real4_1, Save FPU & all CPU registers -HIGH_PRIORITY_CLASS
391 milliseconds, ConvertFloat4Z, _Real4_1 -HIGH_PRIORITY_CLASS
383 milliseconds, ConvertFloat4ZX, _Real4_1 -HIGH_PRIORITY_CLASS
*** END DD ***


**** Show DQ data and test it **********

-123.456
-1.23456E+25
-1.23456E+234
-0.0123456
-1.23456E-25
-1.23456E-234
*** STOP 1 ***
-123.456
-1.23456E+25
-1.23456E+234
-0.0123456
-1.23456E-25
-1.23456E-234
*** STOP 2 ***
-123.456
-1.23456E+25
-1.23456E+234
-0.0123456
-1.23456E-25
-1.23456E-234
3155 cycles, ConvertFloat8, _Real8_1, Save FPU & all CPU registers -HIGH_PRIORITY_CLASS
1191 cycles, ConvertFloat8Z, _Real8_1 -HIGH_PRIORITY_CLASS
1169 cycles, ConvertFloat8ZX, _Real8_1 -HIGH_PRIORITY_CLASS

1187 milliseconds, ConvertFloat8, _Real8_1, Save FPU & all CPU registers -HIGH_PRIORITY_CLASS
446 milliseconds, ConvertFloat8Z, _Real8_1 -HIGH_PRIORITY_CLASS
440 milliseconds, ConvertFloat8ZX, _Real8_1 -HIGH_PRIORITY_CLASS
*** END DQ ***


**** Show QQ data and test it **********

-123.45678901234567
-1.2345678901234567E+25
-1.2345678901234567E+0256
-1.2345678901234565E+2567
-0.0123456789012346
-1.2345678901234567E-25
-1.2345678901234567E-0256
-1.2345678901234569E-2567
*** STOP 1 ***
-123.45678901234567
-1.2345678901234567E+25
-1.2345678901234567E+0256
-1.2345678901234565E+2567
-0.0123456789012346
-1.2345678901234567E-25
-1.2345678901234567E-0256
-1.2345678901234569E-2567
*** STOP 2 ***
-123.45678901234567
-1.2345678901234567E+25
-1.2345678901234567E+0256
-1.2345678901234565E+2567
-0.0123456789012346
-1.2345678901234567E-25
-1.2345678901234567E-0256
-1.2345678901234569E-2567
3056 cycles, ConvertFloat10, _Real10_1, Save FPU & all CPU registers -HIGH_PRIORITY_CLASS
1093 cycles, ConvertFloat10Z, _Real10_1 -HIGH_PRIORITY_CLASS
1082 cycles, ConvertFloat10ZX, _Real10_1 -HIGH_PRIORITY_CLASS

1147 milliseconds, ConvertFloat10, _Real10_1, Save FPU & all CPU registers -HIGH_PRIORITY_CLASS
411 milliseconds, ConvertFloat10Z, _Real10_1 -HIGH_PRIORITY_CLASS
406 milliseconds, ConvertFloat10ZX, _Real10_1 -HIGH_PRIORITY_CLASS

*** END QQ and ALL***


RuiLoureiro


GoneFishing


RuiLoureiro

Hi all
        I need to do some more tests but now
        i need you test this 9 converters
        from string to real4.
        Some converts rcl strings and some null terminated.
        Some use BCD and some are direct.
        Some use local variables and some not.
        Some save FPU and all CPU (but not eax)
        But in all cases i am using tables to get 10^n or 10^-n.
       
        Till now i wrote this: 

                . ConvertString4Z
                . ConvertString4X
                . ConvertString4ZX
                . ConvertString4
                . ConvertString4ZF
                . ConvertString4F
                . ConvertString4Y
                . ConvertString4YF
                . ConvertString4WF
           
The string to be converted is this:

                 dd 12
_RclStr01   db "+123.456E+36",0

In each case i use the three my main real4
to string converters:

                . ConvertFloat4
                . ConvertFloat4Z
                . ConvertFloat4ZX


Please, could you run TestCnvDD8.exe
and show here your results ?
note: i am using MichaelW macros.

Thanks
RuiLoureiro


My results in P4 XP sp3
Quote
ConvertString4Z
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4X
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4ZX
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4ZF
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4F
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4Y
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4YF
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4WF
1.23456E+38

1.23456E+38

1.23456E+38

*** STOP 0 ***
540 cycles, ConvertString4Z, _RclStr01

2651 cycles, ConvertString4X, _RclStr01

510 cycles, ConvertString4ZX, _RclStr01

2598 cycles, ConvertString4, _RclStr01

524 cycles, ConvertString4ZF, _RclStr01

447 cycles, ConvertString4F, _RclStr01

170 cycles, ConvertString4Y, _RclStr01

179 cycles, ConvertString4YF, _RclStr01

240 cycles, ConvertString4WF, _RclStr01

*** STOP 1***

dedndave

i also have a P4 with XP SP3, Rui, so i can't be much help - lol

qWord

Core i7 QM, Ivy Bridge, Q2/2012:
ConvertString4Z
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4X
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4ZX
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4ZF
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4F
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4Y
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4YF
1.23456E+38

1.23456E+38

1.23456E+38

ConvertString4WF
1.23456E+38

1.23456E+38

1.23456E+38

*** STOP 0 ***
236 cycles, ConvertString4Z, _RclStr01

552 cycles, ConvertString4X, _RclStr01

183 cycles, ConvertString4ZX, _RclStr01

547 cycles, ConvertString4, _RclStr01

175 cycles, ConvertString4ZF, _RclStr01

173 cycles, ConvertString4F, _RclStr01

46 cycles, ConvertString4Y, _RclStr01

49 cycles, ConvertString4YF, _RclStr01

70 cycles, ConvertString4WF, _RclStr01

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

RuiLoureiro

Quote from: qWord on April 09, 2013, 07:16:02 AM
Core i7 QM, Ivy Bridge, Q2/2012:

Very nice qWord ! Thank you so much  :t