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


Groups > comp.lang.forth > #59651

Re: ANN: matmul package available

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: ANN: matmul package available
Date 2017-05-21 13:52 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2017May21.155236@mips.complang.tuwien.ac.at> (permalink)
References (4 earlier) <e319fd1d-4e0c-426e-8495-ff4a0dd24e39@googlegroups.com> <2017May20.180225@mips.complang.tuwien.ac.at> <957871d0-1b59-4846-991d-5a127a4e9dac@googlegroups.com> <2017May21.095205@mips.complang.tuwien.ac.at> <655b323d-90ac-4de0-8b05-593b5b2a3171@googlegroups.com>

Show all headers | View raw


mhx@iae.nl writes:
>On Sunday, May 21, 2017 at 9:55:08 AM UTC+2, Anton Ertl wrote:
>> So iforth is about as fast on FAXPY-NOSTRIDE (all versions) as gcc is
>> on FAXPY.  Impressive!
>
>I'm sorry, but it gets extremely confusing with all these
>indirect references and changes. Is gcc (in gForth) using SSE2
>and auto-vectorizing, or is it forced to use the FPU?

When using AMD64, gcc uses SSE2 scalar (not normally vector)
instructions by default, when using IA-32, it uses 387 instructions by
default.  I don't know what pahihu used.

Vectorization is prevented by the stride argument of FAXPY, and even
for vectorizable code, I have yet to see gcc's auto-vectorization
trigger; seems to be mostly a benchmarketing feature.

>IMHO in practical programs matrix/vector math should not be
>the bottleneck at all (e.g. in SPICE only ~25% of the time
>is spent in the sparse solver). SPICE seems to be written
>by people who were very fond of linked lists, 10-deep
>nested structures and 15 page long functions.

It depends very much on how the program is written*, and that depends
to a good extent on what problem the program solves; but not as much
as many people think.  E.g., one would think that a program like TeX
is not vectorizable, but Bernd Paysan has made a good argument that
paragraph formatting could benefit well from vectorization.  Linked
lists are not amenable to vectorization.

*) That's why I consider auto-vectorization the wrong way to go: you
have to express vectorization to the compiler anyway, so express it
directly, instead of by writing scalar code in an "auto-vectorizable"
style and hoping that the compiler actually manages to auto-vectorize
it.

You can find my thoughts on vector computing in Forth in a video in
German in

<https://wiki.forth-ev.de/doku.php/events:tagung-2016:simd>

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2017: http://www.euroforth.org/ef17/

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


Thread

ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-19 10:43 +0000
  Re: ANN: matmul package available krishna.myneni@ccreweb.org - 2017-05-19 05:20 -0700
    Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-19 14:16 +0000
      Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-19 08:28 -0700
        Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-20 05:25 -0700
        Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-20 13:23 +0000
          Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-20 08:43 -0700
            Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-20 16:02 +0000
              Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-20 11:36 -0700
                Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-21 07:52 +0000
                Re: ANN: matmul package available mhx@iae.nl - 2017-05-21 03:28 -0700
                Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-21 05:32 -0700
                Re: ANN: matmul package available mhx@iae.nl - 2017-05-21 05:52 -0700
                Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-21 07:54 -0700
                Re: ANN: matmul package available mhx@iae.nl - 2017-05-21 08:32 -0700
                Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-21 11:24 -0700
                Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-21 13:52 +0000
                Re: ANN: matmul package available mhx@iae.nl - 2017-05-21 08:47 -0700
                Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-22 09:50 +0000
                Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-22 07:14 -0700
                Re: ANN: matmul package available mhx@iae.nl - 2017-05-22 07:39 -0700
                Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-23 10:06 +0000
  Re: ANN: matmul package available albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-05-19 17:00 +0200
    Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-20 13:59 +0000

csiph-web