Re: [fpc-devel] Improving i8086 performance..

2013-12-27 Thread Kostas Michalopoulos
If you want to do speed tests, try some emulator. For example PicoXT
(which emulates an XT clone):
http://www.picofactory.com/free/software/pc-xt-emulator/

On Mon, Dec 23, 2013 at 5:27 PM, Jim Leonard trix...@oldskool.org wrote:
 On 12/23/2013 7:34 AM, Max Nazhalov wrote:

 Hello, Everybody!

 Can anyone having the real i8086 hardware check attached MUL-helpers?
 I've tested them on a modern Intel CPU -- mul_dword is about 4.5..5
 times faster comparing to the generic FPC implementation, and
 mul_qword is about 18..20, but these numbers surely should be quite
 different for the real i8086 due to the progress in the today's ALU
 design.
 Just curious how fast they can be in the silicon of those days..


 I'm not sure how useful a comparison this is because there is no dword or
 qword MUL on i8086.  Also, your request is not clear:  Do you want them
 checked for correctness, or speed?

 Do you need a real 8086 or will an 8088 do?  I have both, but the 8088 is
 set up right now whereas I'd need to drag out the 8086 and set it up.  But
 in either case, I won't write your test harness for you; if you provide me
 with a compiled harness .exe then I'd be happy to run it for you and send
 you the results back.

 If you don't know how to write a harness with decent timing code, just print
 the system time, do 1000 iterations, then print system time again.  808x is
 slow enough that 1000 iterations will be enough to get good numbers.
 --
 Jim Leonard (trix...@oldskool.org)
 Check out some trippy MindCandy: http://www.mindcandydvd.com/
 A child borne of the home computer wars: http://trixter.oldskool.org/
 You're all insane and trying to steal my magic bag!
 ___
 fpc-devel maillist  -  fpc-devel@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-devel
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Improving i8086 performance..

2013-12-27 Thread Jim Leonard

On 12/27/2013 9:35 AM, Kostas Michalopoulos wrote:

If you want to do speed tests, try some emulator. For example PicoXT
(which emulates an XT clone):
http://www.picofactory.com/free/software/pc-xt-emulator/


That emulator is not cycle-exact, so it doesn't have the same 
characteristics as the real hardware.  PCem comes closer, but is also 
not exact.


Because MUL/IMUL/DIV/IDIV on 808x has variable execution times based on 
the inputs, it is best for the OP to test on real hardware if he wants 
an accurate comparison.

--
Jim Leonard (trix...@oldskool.org)
Check out some trippy MindCandy: http://www.mindcandydvd.com/
A child borne of the home computer wars: http://trixter.oldskool.org/
You're all insane and trying to steal my magic bag!
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] DOS GUI

2013-12-27 Thread John Clymer

Very interested !

---
John Clymer
FCC(EXW) USNR

On 2013-12-26 07:45, Anton Kavalenka wrote:

Dear FPC-Developers!

Our institution about 15 years ago was developed Turbo-Vision fork for
VGA/SVGA graphics called GraphVision.
Key features:
* TV-like objects (classes)
* BGI graphics with own clipping
* Windows bitmap, cursors resource support
* resources in external files (streamed objects)

Currently the author agreed to give away the sources to community.

Does anybody interested in the class library,

reagards,
Anton Kavalenka
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Improving i8086 performance..

2013-12-27 Thread Nikolay Nikolov

On 12/23/2013 03:34 PM, Max Nazhalov wrote:

Hello, Everybody!

Can anyone having the real i8086 hardware check attached MUL-helpers?
I've tested them on a modern Intel CPU -- mul_dword is about 4.5..5
times faster comparing to the generic FPC implementation, and
mul_qword is about 18..20, but these numbers surely should be quite
different for the real i8086 due to the progress in the today's ALU design.
Just curious how fast they can be in the silicon of those days..

I made a small benchmark:

http://debian.fmi.uni-sofia.bg/~nickysn/fpc-8086/mul-benchmark/

The generic pascal version is compiled with -O2 for 8086/8088 (so, it 
doesn't use any 186+ instructions).


I ran it on my HP 200LX, which has a 7.91 MHz Intel Hornet 80186 CPU. 
Here are the results:


32-bit multiplication, N=10 (40960 multiplications)

mul32pas: 1902 ticks
mul32asm: 71 ticks

Or, in other words, 26.8 times faster. Not bad at all! :)

64-bit multiplication, N=10 (20480 multiplications)

mul64pas: 2704 ticks
mul64asm: 77 ticks

So the 64-bit multiplication got 35.1 times faster!

However, due to holidays, I'm not at home, where I have an IBM 5150 with 
an 8088 and a NEC V20 CPU (both CPUs are pin compatible, but the NEC is 
slightly faster at the same clockspeed, especially its mul and div 
instructions are faster, so it'd be interesting to test both). In about 
2 weeks I'll be back home and I'll be able to test it on these CPUs. But 
it'd be nice if Jim could run the test on his 8088 machine, because 
we'll know the results sooner and because it'll save me from having to 
swap processors on the 5150, since it currently has the NEC installed.


Also, where I currently am, I have access to a 286 machine with a broken 
PSU, so in the next few days, I'm planning to replace the PSU and run 
the test on a 286 as well :)


As for correctness, I ran the fpc testsuite with no regressions and 
reviewed the asm code (and checked the math). It looks correct, but I 
still haven't reviewed the overflow checking part of the 64-bit 
multiplication routine. I'll commit the patch when I finish that.


Anyway, thanks for the patch, it looks great so far and the speed up 
seems to be even greater on old processors, compared to the modern ones.


Nikolay
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Improving i8086 performance..

2013-12-27 Thread Jim Leonard

On 12/27/2013 5:15 PM, Nikolay Nikolov wrote:

it'd be nice if Jim could run the test on his 8088 machine


Here you go:

32pas: ticks = 4176
32asm: ticks = 190
~22x faster

64pas: ticks = 6089
64asm: ticks = 225
~27x faster

Raw output also attached.
--
Jim Leonard (trix...@oldskool.org)
Check out some trippy MindCandy: http://www.mindcandydvd.com/
A child borne of the home computer wars: http://trixter.oldskool.org/
You're all insane and trying to steal my magic bag!
Number of iterations = 4096 * N. Enter N: Generating random numbers...
Testing mul32...
Done; ticks = 4176
Number of iterations = 4096 * N. Enter N: Generating random numbers...
Testing mul32...
Done; ticks = 190
Number of iterations = 2048 * N. Enter N: Generating random numbers...
Testing mul64...
Done; ticks = 6089
Number of iterations = 2048 * N. Enter N: Generating random numbers...
Testing mul64...
Done; ticks = 225
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel