public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Paul Koning <paulkoning@comcast.net>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 00/31] VAX: Bring the port up to date (yes, MODE_CC conversion is included)
Date: Fri, 11 Dec 2020 14:54:50 +0000 (GMT)	[thread overview]
Message-ID: <alpine.LFD.2.21.2012111359000.2104409@eddie.linux-mips.org> (raw)
In-Reply-To: <973446D7-8F19-4A73-9045-69B184A747A5@comcast.net>

On Wed, 9 Dec 2020, Paul Koning wrote:

> > This all sounds great.  Do you happen to know if it is cycle-accurate 
> > with respect to individual hardware microarchitectures simulated?  That 
> > would be required for performance evaluation of compiler-generated code.
> 
> No, it isn't.  I believe it just charges one time unit per instruction, 
> with the possible exception of CIS instructions.

 Fair enough, from experience most CPU emulators are instruction-accurate 
only.  Of all the generally available emulators I came across (and looked 
into closely enough; maybe I missed something) only ones for the Z80 were 
cycle-accurate, and I believe the MAME project has had cycle-accurate 
emulation, both down to the system level and both out of necessity, as 
software they were written for was often unforgiving when it comes to any 
discrepancy with respect to original hardware.

 Commercially, MIPS Technologies used to have cycle-accurate MIPSsim, 
actually used for hardware verification, and taking into account all the 
implementation details such as the TLB and caches of individual CPU cores 
supported.  And you could choose the topology of these resources according 
to what actual silicon could have.  Some LV hardware has had it too for 
evaluation purposes:

YAMON> scpu
Current settings :
  I-Cache bytes per way = 0x1000
  I-Cache associativity = 4
  D-Cache bytes per way = 0x1000
  D-Cache associativity = 4
  MMU                   = tlb
YAMON> scpu -a
Available settings :
  I-Cache bytes per way : 0x1000, 0x0
  I-Cache associativity : 4, 3, 2, 1
  D-Cache bytes per way : 0x1000, 0x0
  D-Cache associativity : 4, 3, 2, 1
  MMU types             : tlb, fixed
YAMON> scpu -i 0x1000 2
YAMON> scpu -d 0x1000 2
YAMON> scpu fixed
YAMON> scpu
Current settings :
  I-Cache bytes per way = 0x1000
  I-Cache associativity = 2
  D-Cache bytes per way = 0x1000
  D-Cache associativity = 2
  MMU                   = fixed
YAMON> 

But then even cycle-accurate MIPSsim would not take every parameter of a 
system into account, such as the latency of peripheral components.  Not 
sure about DRAM either, though being predictable I guess that might have 
been simulated.

> I don't know of any cycle accurate PDP-11 emulators.  It's not even 
> clear if it is possible to build one, given the asynchronous operation 
> of the UNIBUS.  It certainly would be extremely difficult since even the 
> documented timing is amazingly complex, never mind the possibility that 
> the reality is different from what is documented.

 For the purpose of compiler's performance evaluation however I don't 
think we need to go down as far as the external bus, so however UNIBUS 
performs should not really matter.  Even with the modern systems all the 
pipeline descriptions and operation timings we have recorded within GCC 
reflect perfect operating conditions such as hot caches, no TLB misses, no 
branch mispredictions, to say nothing of disruption to all that caused by 
hardware interrupts and context switches.

 So I guess with cycle-accurate PDP-11 emulation it would be sufficient if 
relative CPU instruction execution timings were correctly reflected, such 
as the latency of say MOV vs DIV, as I am fairly sure they are not even 
close to being equivalent.  But that does come at a cost; cycle-accurate 
MIPSsim was much slower than its instruction-accurate counterpart which 
also existed.

> The pdp11 back end uses a very rough approximation of the documented 
> 11/70 timing, but GCC doesn't make it easy (or maybe not even possible) 
> to use the full timing details.  It's not something I'd expect to refine 
> a whole lot further.

 Understood.

> More interesting would be to tweak the optimizing machinery to improve 
> parts that either have bitrotted or never actually worked. The code 
> generation for auto-increment etc. isn't particularly effective and I 
> think that's a known limitation.  Ditto indirect addressing, since few 
> other machines have that.  (VAX does, of course; it might benefit too.)  
> And with LRA things are more limited still, again this seems to be known 
> and is caused by the focus on modern machine architectures.

 Correctness absolutely has to take precedence over performance, but that 
does not mean the latter has to be completely ignored either.  And the 
presence of tools may only help with that.  We may not have the resources 
available commercially significant ports have, but that does not mean we 
should decide upfront to abandon any kind of performance QA.  I think we 
can still act professionally and try to do our best to make the quality of 
code produced as good as possible within our available resources.

 FWIW,

  Maciej

  reply	other threads:[~2020-12-11 14:54 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20  3:38 Maciej W. Rozycki
2020-11-20  3:34 ` [PATCH 01/31] PR target/58901: reload: Handle SUBREG of MEM with a mode-dependent address Maciej W. Rozycki
2020-11-20 10:55   ` Eric Botcazou
2020-11-20 15:30     ` Maciej W. Rozycki
2020-11-24  6:19       ` [PATCH v2 " Maciej W. Rozycki
2020-11-24 11:03         ` Eric Botcazou
2020-11-26 17:22           ` Maciej W. Rozycki
2020-11-27  3:51             ` Maciej W. Rozycki
2020-11-27 10:52         ` Ulrich Weigand
2020-11-27 19:22           ` Maciej W. Rozycki
2020-11-27 20:47             ` Maciej W. Rozycki
2020-11-27 20:50               ` [PATCH v3 " Maciej W. Rozycki
2020-11-30 18:51                 ` Jeff Law
2020-11-29 17:31             ` [PATCH v2 " Jeff Law
2020-11-20  3:34 ` [PATCH 02/31] VAX: Remove `c' operand format specifier overload Maciej W. Rozycki
2020-11-20 23:16   ` Jeff Law
2020-11-24  1:12   ` Segher Boessenkool
2020-11-20  3:34 ` [PATCH 03/31] VAX: Define LEGITIMATE_PIC_OPERAND_P Maciej W. Rozycki
2020-11-21  3:17   ` Jeff Law
2020-11-20  3:34 ` [PATCH 04/31] VAX/testsuite: Run target testing over all the usual optimization levels Maciej W. Rozycki
2020-11-20 23:17   ` Jeff Law
2020-11-20  3:34 ` [PATCH 05/31] VAX: Rationalize expression and address costs Maciej W. Rozycki
2020-11-21  3:48   ` Jeff Law
2020-11-20  3:34 ` [PATCH 06/31] VAX: Correct fatal issues with the `ffs' builtin Maciej W. Rozycki
2020-11-20 23:19   ` Jeff Law
2020-11-20  3:34 ` [PATCH 07/31] RTL: Also support HOST_WIDE_INT with int iterators Maciej W. Rozycki
2020-11-21  4:19   ` Jeff Law
2020-11-20  3:34 ` [PATCH 08/31] jump: Also handle jumps wrapped in UNSPEC or UNSPEC_VOLATILE Maciej W. Rozycki
2020-11-21  4:25   ` Jeff Law
2020-12-03  3:50     ` [PATCH v2 " Maciej W. Rozycki
2020-12-03 22:20       ` Jeff Law
2020-11-20  3:34 ` [PATCH 09/31] VAX: Use a mode iterator to produce individual interlocked branches Maciej W. Rozycki
2020-11-20 23:20   ` Jeff Law
2020-11-20  3:34 ` [PATCH 10/31] VAX: Use an int " Maciej W. Rozycki
2020-11-20 23:20   ` Jeff Law
2020-11-20  3:35 ` [PATCH 11/31] VAX: Correct `sync_lock_test_and_set' and `sync_lock_release' builtins Maciej W. Rozycki
2020-11-21  4:26   ` Jeff Law
2020-11-20  3:35 ` [PATCH 12/31] VAX: Actually enable `builtins.md' now that it is fully functional Maciej W. Rozycki
2020-11-20 23:21   ` Jeff Law
2020-11-20  3:35 ` [PATCH 13/31] VAX: Add a test for the SImode `ffs' operation Maciej W. Rozycki
2020-11-20 23:22   ` Jeff Law
2020-11-20  3:35 ` [PATCH 14/31] VAX: Add tests for `sync_lock_test_and_set' and `sync_lock_release' Maciej W. Rozycki
2020-11-20 23:22   ` Jeff Law
2020-11-20  3:35 ` [PATCH 15/31] VAX: Provide the `ctz' operation Maciej W. Rozycki
2020-11-20 23:23   ` Jeff Law
2020-11-20  3:35 ` [PATCH 16/31] VAX: Also provide QImode and HImode `ctz' and `ffs' operations Maciej W. Rozycki
2020-11-20 23:24   ` Jeff Law
2020-11-20  3:35 ` [PATCH 17/31] VAX: Actually produce QImode and HImode `ctz' operations Maciej W. Rozycki
2020-11-20 23:24   ` Jeff Law
2020-11-20  3:35 ` [PATCH 18/31] VAX: Add a test for the `cpymemhi' instruction Maciej W. Rozycki
2020-11-20 23:25   ` Jeff Law
2020-11-20  3:35 ` [PATCH 19/31] VAX: Add the `movmemhi' instruction Maciej W. Rozycki
2020-11-20 23:25   ` Jeff Law
2020-11-20  3:35 ` [PATCH 20/31] VAX: Fix predicates and constraints for EXTV/EXTZV/INSV insns Maciej W. Rozycki
2020-11-21 17:01   ` Jeff Law
2020-11-20  3:35 ` [PATCH 21/31] VAX: Remove EXTV/EXTZV/INSV instruction use from aligned case insns Maciej W. Rozycki
2020-11-21 17:25   ` Jeff Law
2020-11-20  3:35 ` [PATCH 22/31] VAX: Ensure PIC mode address is adjustable with aligned bitfield insns Maciej W. Rozycki
2020-11-21 17:03   ` Jeff Law
2020-11-20  3:36 ` [PATCH 23/31] VAX: Make `extv' an expander matching the remaining bitfield operations Maciej W. Rozycki
2020-11-21 17:26   ` Jeff Law
2020-11-20  3:36 ` [PATCH 24/31] VAX: Fix predicates and constraints for bitfield comparison insns Maciej W. Rozycki
2020-11-21 17:27   ` Jeff Law
2020-11-20  3:36 ` [PATCH 25/31] VAX: Fix predicates for widening multiply and multiply-add insns Maciej W. Rozycki
2020-11-21  4:05   ` Jeff Law
2020-11-30 16:02     ` Maciej W. Rozycki
2020-11-30 18:29       ` Jeff Law
2020-11-20  3:36 ` [PATCH 26/31] VAX: Correct issues with commented-out insns Maciej W. Rozycki
2020-11-21  4:05   ` Jeff Law
2020-11-20  3:36 ` [PATCH 27/31] VAX: Make the `divmoddisi4' and `*amulsi4' comment notation consistent Maciej W. Rozycki
2020-11-21  4:06   ` Jeff Law
2020-11-24  1:37   ` Segher Boessenkool
2020-11-20  3:36 ` [PATCH 28/31] RTL: Add `const_double_zero' syntactic rtx Maciej W. Rozycki
2020-11-21 17:29   ` Jeff Law
2020-11-20  3:36 ` [PATCH 29/31] PDP11: Use `const_double_zero' to express double zero constant Maciej W. Rozycki
2020-11-21  4:07   ` Jeff Law
2020-12-15  8:26   ` Martin Liška
2020-12-15 14:06     ` Maciej W. Rozycki
2020-12-15 18:02       ` Paul Koning
2020-12-15 18:38         ` Maciej W. Rozycki
2020-11-20  3:36 ` [PATCH 30/31] PR target/95294: VAX: Convert backend to MODE_CC representation Maciej W. Rozycki
2020-11-22  3:27   ` Jeff Law
2020-12-09 16:09   ` Maciej W. Rozycki
2020-11-20  3:37 ` [PATCH 31/31] PR target/95294: VAX: Add test cases for " Maciej W. Rozycki
2020-11-21  4:08   ` Jeff Law
2020-12-05 18:40     ` Maciej W. Rozycki
2020-11-20  7:58 ` [PATCH 00/31] VAX: Bring the port up to date (yes, MODE_CC conversion is included) Anders Magnusson
2020-11-23 20:31   ` Maciej W. Rozycki
2020-11-21 21:02 ` Toon Moene
2020-11-23 21:51   ` Maciej W. Rozycki
2020-11-23 22:12     ` Thomas Koenig
2020-11-24  4:28       ` Maciej W. Rozycki
2020-11-24  5:27         ` Maciej W. Rozycki
2020-11-24  6:04           ` Maciej W. Rozycki
2020-11-24  6:16             ` Thomas Koenig
2020-11-25 19:22               ` Maciej W. Rozycki
2020-11-25 18:26             ` Maciej W. Rozycki
2020-11-25 22:20               ` Joseph Myers
2020-11-26 18:01                 ` Maciej W. Rozycki
2020-11-26 18:08                   ` Martin Husemann
2020-12-08 14:38                     ` Maciej W. Rozycki
2020-12-08 15:22                       ` Martin Husemann
2020-11-25 22:26           ` coypu
2020-11-26 17:59             ` Maciej W. Rozycki
2020-11-26 19:35               ` Maciej W. Rozycki
2020-11-23 15:48 ` Paul Koning
2020-11-25 17:07   ` Maciej W. Rozycki
2020-11-28 18:48     ` Paul Koning
2020-12-09 14:06       ` Maciej W. Rozycki
2020-12-10  1:33         ` Paul Koning
2020-12-11 14:54           ` Maciej W. Rozycki [this message]
2020-12-11 21:50             ` Paul Koning
2020-11-25 18:36 ` Maciej W. Rozycki
2020-11-26 14:46   ` Ian Lance Taylor
2020-11-26 18:07     ` Maciej W. Rozycki
2020-11-29 17:56   ` Martin Sebor
2020-12-07 14:25     ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.21.2012111359000.2104409@eddie.linux-mips.org \
    --to=macro@linux-mips.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=paulkoning@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).