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


Groups > comp.lang.forth > #59561

Re: matrix multiplication

From Alex <alex@rivadpm.com>
Newsgroups comp.lang.forth
Subject Re: matrix multiplication
Date 2017-05-19 18:56 +0100
Organization A noiseless patient Spider
Message-ID <ofnbdn$ci4$1@dont-email.me> (permalink)
References <de96ca50-66d1-4518-a2a5-103dac0bebfb@googlegroups.com> <39defc56-99d0-42d7-8242-c16df26ca409@googlegroups.com> <2017May19.171325@mips.complang.tuwien.ac.at> <2017May19.192659@mips.complang.tuwien.ac.at>

Show all headers | View raw


On 5/19/2017 18:26, Anton Ertl wrote:
> anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>> Results for a 500x500 matrix multiply on a Core i5-6600K:
>>
>> Forth-94 Forth-2012 Forth-2012 Forth-94 Forth-94
>> Myneni  Myneni/Ertl     Ertl   Rees/Ertl   pahihu
>> 109966M     107831M    1046M       1202M    1517M vfxlin Ndp387.fth
>>   2986M       2260M    2220M       2945M    2764M gforth-fast
>>   4028M       4076M    4844M       5067M    5017M SwiftForth HW stack, no WAIT
>>
>> I don't know what in this code slows down VFX so much.  It does not
>> appear to be the classical code-close-to-written-data problem (the
>> inner loop does not write data close to the code, and the number of
>> icache misses (2.8M) is not high enough to explain such a big number
>> of cycles).  The code generated by VFX (see below) for the inner loop
>> looks inconspicuous to me.
> 
> I looked at it with "perf record -e cycles" and "perf report", and got
> the following for the inner loop:
> 
>         ( 080C6E60    FF7500 )       PUSH      [EBP]
>   0.26% ( 080C6E63    53 )           PUSH      EBX
>         ( 080C6E64    53 )           PUSH      EBX
>         ( 080C6E65    8B5D00 )       MOV       EBX, [EBP]
>         ( 080C6E68    DB2B )         FLD       TBYTE 0 [EBX]
>   0.85% ( 080C6E6A    5B )           POP       EBX
>         ( 080C6E6B    DB2B )         FLD       TBYTE 0 [EBX]
>   1.75% ( 080C6E6D    DEC9 )         FMULP     ST(1), ST
> 52.46% ( 080C6E6F    DEC1 )         FADDP     ST(1), ST
> 42.25% ( 080C6E71    5B )           POP       EBX
>   1.11% ( 080C6E72    5A )           POP       EDX
>         ( 080C6E73    031D70340A08 ) ADD       EBX, [080A3470]
>   0.23% ( 080C6E79    53 )           PUSH      EBX
>   0.23% ( 080C6E7A    83C208 )       ADD       EDX, 08
>         ( 080C6E7D    5B )           POP       EBX
>   0.32% ( 080C6E7E    83042401 )     ADD       [ESP], 01
>   0.12% ( 080C6E82    8344240401 )   ADD       [ESP+04], 01
>   0.20% ( 080C6E87    895500 )       MOV       [EBP], EDX
>         ( 080C6E8A    71D4 )         JNO       080C6E60
> 
> Everything else had 0.08% or fewer cycles.  The locations associated
> with the events are not very precise, but in this case they point to
> the FADDP.  It's still unclear to me what the problem is.  One thing
> that one might suspect is denormal numbers, but they cannot occur with
> this input (only integers converted to floats).
> 
> - anton
> 

Have you tried inserting a NOP between the FMULP and FADDP? The FADP 
falls over a 16 byte paragraph boundary.

-- 
Alex

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


Thread

matrix multiplication krishna.myneni@ccreweb.org - 2017-05-17 15:13 -0700
  Re: matrix multiplication stephen@mpeforth.com (Stephen Pelc) - 2017-05-17 22:31 +0000
    Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-17 15:39 -0700
      Re: matrix multiplication rickman <gnuarm@gmail.com> - 2017-05-18 03:22 -0400
        Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-18 00:29 -0700
          Re: matrix multiplication rickman <gnuarm@gmail.com> - 2017-05-18 03:48 -0400
          Re: matrix multiplication anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-18 08:42 +0000
  Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-18 00:25 -0700
    Re: matrix multiplication anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-19 15:13 +0000
      Re: matrix multiplication anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-19 17:26 +0000
        Re: matrix multiplication Alex <alex@rivadpm.com> - 2017-05-19 18:56 +0100
        Re: matrix multiplication Paul Rubin <no.email@nospam.invalid> - 2017-05-19 21:48 -0700
        Re: matrix multiplication anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-20 10:21 +0000
          Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-20 06:12 -0700
          Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-20 09:47 -0700
            Re: matrix multiplication Paul Rubin <no.email@nospam.invalid> - 2017-05-20 15:31 -0700
              Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-21 04:46 -0700
                Re: matrix multiplication mhx@iae.nl - 2017-05-21 13:41 -0700
                Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-21 15:32 -0700
            Re: matrix multiplication anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-21 07:19 +0000
              Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-21 05:10 -0700
                Re: matrix multiplication anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-21 14:29 +0000
                Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-21 09:17 -0700
      Re: matrix multiplication stephen@mpeforth.com (Stephen Pelc) - 2017-05-19 20:54 +0000
      Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-19 14:33 -0700
        Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-19 16:12 -0700
        Re: matrix multiplication anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-20 14:48 +0000
    Re: matrix multiplication krishna.myneni@ccreweb.org - 2017-05-19 18:38 -0700

csiph-web