Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* RPCC under Digital Unix
@ 1999-03-05  5:00 Thomas Womack
  1999-03-05  5:00 ` Thomas Womack
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Womack @ 1999-03-05  5:00 UTC (permalink / raw)


From what I understand of the specification documents,

unsigned long prectime(void)
{
  unsigned long pook,pook2;
  __asm__ __volatile__("rpcc %0" : "=r" (pook));
  pook2 = pook>>32;
  pook -= pook2<<32;
  pook2 += pook;
  return(pook2);
}

should give me something similar to the results of RDTSC on an x86.

Under DU4 on the big Alpha box here, it doesn't; it gives me a result on
the order of 10^6, incrementing by about 10^5 per second - which is four
orders of magnitude less accuracy than I expected and needed for some
calculations about speeds of L1 and L2 cache.

What am I doing wrong?

Tom




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RPCC under Digital Unix
  1999-03-05  5:00 RPCC under Digital Unix Thomas Womack
@ 1999-03-05  5:00 ` Thomas Womack
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Womack @ 1999-03-05  5:00 UTC (permalink / raw)


>Under DU4 on the big Alpha box here, it doesn't; it gives me a result
on
>the order of 10^6, incrementing by about 10^5 per second - which is
four
>orders of magnitude less accuracy than I expected and needed for some
>calculations about speeds of L1 and L2 cache.

Thanks very much for your help; I'm an idiot.

sleep(1) suspends my process; so if I do

RPCC-and-add-the-two-halves
sleep(1)
RPCC-and-add-the-two-halves
Find-the-difference

I'm timing how long it takes to call sleep(1), not an interval of one
second.

Also, the big Alpha box has 4 CPUs and each of them has its own counter,
and I was forgetting to use runon to keep my process CPU-bound.

Thanks again, and hoping my experience saves someone somewhere some
hair,

Tom




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-03-05  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-05  5:00 RPCC under Digital Unix Thomas Womack
1999-03-05  5:00 ` Thomas Womack

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