Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: murari@sousa.ako.dec.com (Srinivasan Murari)
Subject: Re: Strange behaviour of Alpha Floating Point Load/Stores wrt cache misses
Date: 7 Mar 1994 14:08:15 GMT	[thread overview]
Message-ID: <2lfcgf$mnb@sousa.ako.dec.com> (raw)
In-Reply-To: TLB.94Mar3183240@chardonnay.harvard.edu


In article <TLB.94Mar3183240@chardonnay.harvard.edu>,
tlb@chardonnay.harvard.edu (Trevor Blackwell) writes:
|>
|>> I am pretty sure I am controlling for all extraneous factors. My
|>> measurement code runs 100 times, only referencing an array where it
|>> sticks the running time. All the code fits in the I-cache. I'm not
|>> getting interrupts (the whole measurement takes about 10 uS, and
|>the
|>> effect of interrupts is real obvious when they do occur.)  The
|>whole
|>> shebang (code & data) fits in the off-chip B-cache, and my flush
|>> vector should not flush the register load/store areas out of there.
|>
|>Well, I controlled them all except one. In order that I could call
|>the context switch code from a C program, I replaced the loads and
|>stores to all the miscellaneous registers, with loads and stores to
|>$31 (the one which reads as zero). It turns out that the instruction
|>
|>    LDQ $31,address
|>
|>is a NOP - it never actually references any memory. I am quite
|>surprised that it actually does this - I'm sure on a MIPS or most
|>other RISCs it would do the load anyway, and just let the bits fall
|>off the end of the wire in the register file. So that explains
|>everything. It even sort of suggests that this might happen in the
|>manual.
|>
|>In fact, it appears that the way Dirk Grunwald originally wrote the
|>AweSime context switcher is the fastest way possible - loads and
|>stores interleaved.
|>
|>--
|>--
|>Trevor Blackwell         tlb@das.harvard.edu          (617) 495-8912
|>(info and words of wit in my .plan)
|>Disavowal: My opinions.
|>

As trevor correctly observed the LDQ $31, address is thrown away

From page 3-1 of the Alpha Architecture reference manual

For all cases except Unconditional branch and Jump instructions, results of
an instruction that specifies R31 as the destination operand are
discarded. Also it is UNPREDICTABLE whether the other destination
operands (implicit and explicit) are changed by the instruction. It is
implementation dependent to what extent the instruction is actually executed
once it has been fetched. It is also UNPREDICTABLE whether exceptions are
signalled during the execution of such an instruction.

I believe the DECChip 20164 discards the R31 target LDQ at the issue
stage. This would explain the anamolies you have been seeing. Try loading
your data into some register other than R31 to see more consistent behavior.

/murari


      parent reply	other threads:[~1994-03-07 14:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-03-03  2:53 Strange behaviour of Alpha Floating Point Load/Stores wrt cache misses Trevor Blackwell
1994-03-03 23:32 ` Trevor Blackwell
1994-03-04  1:36   ` Dirk Grunwald
1994-03-07 14:08   ` Srinivasan Murari [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox