Article View: comp.sys.ibm.pc.programmer
Article #1409Re: How is a 68000 as fast as an 80386??
From: Jay B. Harlow
Date: Wed, 28 Feb 1990 16:33
Date: Wed, 28 Feb 1990 16:33
55 lines
3563 bytes
3563 bytes
In article <505@bilver.UUCP> alex@bilver.UUCP (Alex Matulich) writes:
>Can someone help me with a puzzling problem?
>
>In my current C programming project, I have written some functions that
>perform statistical things on 400 separate data sets (linear regressions,
>standard errors, etc). This number-crunching part takes about a minute to
>complete when I run it on my Amiga. My Amiga uses a 68000 running at 14 MHz
>(twice the normal cpu speed) and no math chip. The compiler is Lattice C
>4.0 in 32-bit addressing mode (similar to the IBM "large" memory model).
>
>Naturally, I wanted more speed, so I ported the program to an AT&T 386WGS
>at work, which is a 25 MHz 80386 IBM compatible. I compiled it using
^^^^^^^ only creates 16-bit code....
>Turbo C 2.0, large memory model. Then I watched in chagrined disbelief as
>that number-crunching section still took about a minute to execute --
16-bit code on 386 can you say lame duck (read below....)
>actually a few seconds longer than my Amiga. All source code was the same!
>
>5) I know the 80386 has special modes of operation, incompatible with
> previous chips, that allow it to run at its full potential. Is this
> the reason my program isn't running at its rightful speed? Are these
Yes partly, 1) 32-bit inst in real mode 2) 32-bit Protected mode
> special modes accessible when using DOS? If so, how?
Alex,
the reason your program ran 'slow' on the 386 is because you compiled it
for a 286 (at best) LARGE model, a large model on a x86 means all addresses
have segment offset, haveing the x86 load segments is very 'expensive'
time wise (i normally use a small model & put large data out in far memory...)
(on a 286 or below memory accesses are restricted to 64K segments so any thing
larger then 64K (128K if you count code & data...) needs new segment)
I don't know of any compilers (in turbo C price range) that will handle
386 specific instructions. Yes you can get 386 compilers but all the
ones i know of need a 386 *nix or DOS Extenders (can you say a grand $$)
there is hope, MASM & TASM (& others...) support 386 instructions.
if you can find the 'busy' work, you could recode the busy stuff in 386
assembler (real mode) which would have a nice speed up (40% is what pkzip
claims) then the 386 'should' blow the pants off of YOUR 14mhz 68000,
**** I AM NOT REFERING TO 680x0's IN GENERAL JUST HIS CASE!!!!! ****
the other possiblility under dos is DOS Extenders, but like i mentioned
above the cost $$$$, ( i know my budget says NO ;-) which allow
one to write FULL 32 bit programs (nice, about the same as YOUR 32-bit
addressing mode) A DOS Extended puts the processor in Protected mode for
your program to run, handles the interface to DOS, returns to DOS when
your programs 'exits'.
I hope this helps.....
Jay
--
Jay B. Harlow <harlow@plains.nodak.edu>
uunet!plains!harlow (UUCP) harlow@plains (Bitnet)
Of course the above is personal opinion, And has no bearing on reality...
Technical Details
Message-ID:
<3666@plains.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!ogicse!plains!harlowReferences:
<505@bilver.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!ogicse!plains!harlow From: harlow@plains.UUCP (Jay B. Harlow) Newsgroups: comp.sys.ibm.pc.programmer,comp.sys.ibm.pc Subject: Re: How is a 68000 as fast as an 80386?? Keywords: I need more speed from my compiler Message-ID: <3666@plains.UUCP> Date: 28 Feb 90 16:33:23 GMT References: <505@bilver.UUCP> Reply-To: harlow@plains.UUCP (Jay B. Harlow) Distribution: na Organization: North Dakota State University, Fargo Lines: 55