Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #23724

Re: Moving 2/ from assembler to loadable extension

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: Moving 2/ from assembler to loadable extension
Date 2013-06-18 00:49 +0200
Organization 1&1 Internet AG
Message-ID <kpo3pp$8cu$1@online.de> (permalink)
References (3 earlier) <98SdnU-Gr6seUyDMnZ2dnUVZ_q2dnZ2d@supernews.com> <kpl8fa$r64$1@online.de> <1x8xyx5q30urn.1fkwzme6d87l2.dlg@40tude.net> <kpmt8u$65c$1@online.de> <n5bf1wplvvg.1tzdamt947ck6.dlg@40tude.net>

Show all headers | View raw


Coos Haak wrote:

> Op Mon, 17 Jun 2013 13:51:58 +0200 schreef Bernd Paysan:
> 
>> Coos Haak wrote:
>> 
>>> Op Sun, 16 Jun 2013 22:50:49 +0200 schreef Bernd Paysan:
>>>> And Forth Inc's style is a few cycles faster than the built-in singed
>>>> division on Intel, so if fastest is best, Forth Inc should have won.
>>>> They didn't, they didn't even convince the TC to allow this as an
>>>> option, despite Elizabeth was the chair.
>>> 
>>> s/the built-in signed division/standard floored division on Intel/
>> 
>> No, Forth Inc's style is a few cycles faster than the built-in signed
>> division, which is a few cycles faster than teh standard floored division
>> on
>> Intel.  Really!  Forth Inc's style bases on an unsigned division, which
>> is faster, and the code around to handle the signed argument is pretty
>> simple - it's just add the divider to the high part of the dividend if
>> that is negative.
> 
> You apperently use a different implementation. My SF uses IDIV for / MOD
> and /MOD.

And Forth Inc's method uses DIV with a conditional add.  DIV is faster than 
IDIV, so much faster that the conditional add takes slightly less time than 
the difference between IDIV and DIV.

> Surprisingly, SM/REM is _very_ long, extracting signs, according to your
> description. Of course, FM/MOD is still longer.

You can do SM/REM with IDIV, and FM/MOD, too, with a conditional decrement 
and add after doing so.

In the end, I suppose modern CPUs have just a DIV circuit, and the IDIV 
logic is injected as several additional operations.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Moving 2/ from assembler to loadable extension albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-10 14:10 +0000
  Re: Moving 2/ from assembler to loadable extension The Beez <the.beez.speaks@gmail.com> - 2013-06-10 08:12 -0700
    Re: Moving 2/ from assembler to loadable extension Coos Haak <chforth@hccnet.nl> - 2013-06-10 21:50 +0200
  Re: Moving 2/ from assembler to loadable extension anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-11 12:52 +0000
    Re: Moving 2/ from assembler to loadable extension Sieur de Bienville <morrimichael@gmail.com> - 2013-06-15 21:21 -0700
      Re: Moving 2/ from assembler to loadable extension Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-16 09:41 -0500
        Re: Moving 2/ from assembler to loadable extension Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-16 22:50 +0200
          Re: Moving 2/ from assembler to loadable extension Coos Haak <chforth@hccnet.nl> - 2013-06-17 01:21 +0200
            Re: Moving 2/ from assembler to loadable extension Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-17 13:51 +0200
              Re: Moving 2/ from assembler to loadable extension Coos Haak <chforth@hccnet.nl> - 2013-06-17 17:04 +0200
                Re: Moving 2/ from assembler to loadable extension Coos Haak <chforth@hccnet.nl> - 2013-06-17 17:07 +0200
                Re: Moving 2/ from assembler to loadable extension Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-18 00:49 +0200
                Re: Moving 2/ from assembler to loadable extension anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-18 07:41 +0000
                Re: Moving 2/ from assembler to loadable extension "Elizabeth D. Rather" <erather@forth.com> - 2013-06-17 22:11 -1000
                Re: Moving 2/ from assembler to loadable extension Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-18 04:13 -0500
                Re: Moving 2/ from assembler to loadable extension Coos Haak <chforth@hccnet.nl> - 2013-06-18 13:37 +0200
                Re: Moving 2/ from assembler to loadable extension Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-18 09:42 -0500
                Re: Moving 2/ from assembler to loadable extension anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-18 15:51 +0000
                Re: Moving 2/ from assembler to loadable extension Coos Haak <chforth@hccnet.nl> - 2013-06-18 22:52 +0200
                Re: Moving 2/ from assembler to loadable extension albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-19 00:12 +0000
              Re: Moving 2/ from assembler to loadable extension albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-17 19:55 +0000
      Re: Moving 2/ from assembler to loadable extension anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-17 16:04 +0000
        Re: Moving 2/ from assembler to loadable extension Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-17 16:16 -0500
          Re: Moving 2/ from assembler to loadable extension albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-17 22:59 +0000
          Euclidian division (was: Moving 2/ from assembler ...) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-18 07:49 +0000
          Re: Moving 2/ from assembler to loadable extension rickman <gnuarm@gmail.com> - 2013-06-18 17:29 -0400
            Re: Moving 2/ from assembler to loadable extension Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-18 18:18 -0500
              Re: Moving 2/ from assembler to loadable extension rickman <gnuarm@gmail.com> - 2013-06-18 19:47 -0400
            Re: Moving 2/ from assembler to loadable extension albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-19 00:16 +0000
            Re: Moving 2/ from assembler to loadable extension Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-19 15:09 +0200
              Re: Moving 2/ from assembler to loadable extension rickman <gnuarm@gmail.com> - 2013-06-19 17:55 -0400
          Euclidian Division (was: Moving 2/ from assembler ...) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-28 14:49 +0000
            Re: Euclidian Division Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-28 11:20 -0500
      Re: Moving 2/ from assembler to loadable extension Marc Olschok <nobody@nowhere.invalid> - 2013-06-19 23:11 +0000
  Re: Moving 2/ from assembler to loadable extension Pablo Hugo Reda <pabloreda@gmail.com> - 2013-06-18 17:05 -0700

csiph-web