Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* rpcc
@ 1999-01-12  3:55 Christoph Dworzak
  1999-01-12  3:20 ` rpcc Peter Petrakis
  1999-01-12  4:59 ` rpcc Richard Henderson
  0 siblings, 2 replies; 30+ messages in thread
From: Christoph Dworzak @ 1999-01-12  3:55 UTC (permalink / raw)
  To: axp-list

Hi

With some help from this list, I'm getting better
with axp-asm :)

Now my next question is, how do I measure the speed
of my code?

My test looks like this:

--------------------------------------------------------
unsigned long c1, c2, ccm=~0UL, ccs=0, n;

    
for (n=0; n<(1UL<<19); n++){
    asm volatile("rpcc %0" : "=r"(c1) : : "memory");
    core();
    asm volatile("rpcc %0" : "=r"(c2) : : "memory");
    c1 = (c1 + (c1<<32)) >> 32;
    c2 = (c2 + (c2<<32)) >> 32;
    c2 = (c2>c1) ? c2-c1 : c2+(1UL<<32)-c1;
    ccs += c2;
    if (c2<ccm) ccm = c2;
}
printf("\nMin=%ld Avg=%ld\n\n", ccm, ccs/n;
--------------------------------------------------------

When I run this several times, I get strange results
(see end of my mail)


Why does it take up to 50% longer sometimes? (it really
does, checking with my wrist-watch.)

Of course I know, there are some task-switches or interupts,
but I would expect, that at least one loop out of one million
runs uninteruptet on full speed...

Has it something to do with alignment of the code in memory
and if so, how could I place the code so it runs at full speed?

Bye
 dworz

--------------------------------------------------------
[dworz@really speed]# time ./speedtest

Min=6063 Avg=6552

13.85user 0.00system 0:15.11elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest

Min=6065 Avg=6546

13.84user 0.00system 0:15.54elapsed 89%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest

Min=7961 Avg=8975

18.93user 0.00system 0:20.66elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest

Min=6063 Avg=6532

13.80user 0.00system 0:15.52elapsed 88%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest

Min=7975 Avg=8970

18.92user 0.00system 0:20.66elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest

Min=6062 Avg=6477

13.69user 0.00system 0:14.96elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest

Min=6063 Avg=6520

13.78user 0.00system 0:15.06elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
--------------------------------------------------------


^ permalink raw reply	[flat|nested] 30+ messages in thread
* Alpha 21264.
@ 1999-01-13 14:10 Andy Almond
  1999-01-13 16:36 ` Jeff Sturm
  0 siblings, 1 reply; 30+ messages in thread
From: Andy Almond @ 1999-01-13 14:10 UTC (permalink / raw)
  To: 'axp-list@redhat.com'

Three questions relating to the 21264 CPU and 264DP motherboard.

(a) I haven't used a dual processor before, so how much performance can you expect over a single CPU machine when working on a single job using an SMP linux kernel. Can you configure the system to use both CPUs for an ordinary job, or does that require a special compilation option/re-coding?

(b) Are DEC fortran/C ev6 compilers going to be available under linux? or is DEC UNIX or NT the only way to achieve this? I assume that the performance of gcc will be relatively poor compared with DECs C compiler, as is the case for the 21164 processor.

(c) Will code already compiled for ev56 CPUs run efficiently on an ev6 CPU?

Any comments appreciated.

Dr. Andrew Almond.
University of Manchester. UK.


^ permalink raw reply	[flat|nested] 30+ messages in thread
* RE: Alpha 21264.
@ 1999-01-13 15:18 Mailinglist --> PUBLIC
  1999-01-13 20:50 ` Joachim Wesner
  0 siblings, 1 reply; 30+ messages in thread
From: Mailinglist --> PUBLIC @ 1999-01-13 15:18 UTC (permalink / raw)
  To: 'axp-list@redhat.com'


Hi !

(a) I haven't used a dual processor before, so how much performance can you
expect over a single CPU machine when working on a single job using an SMP
linux kernel. Can you configure the system to use both CPUs for an ordinary
job, or does that require a special compilation option/re-coding?

In general if you run only a single non-threaded application the performance
is not better than on a SMP system.
In fact your application may run slower, because there is some overhead to
keep the processors in sync (locks).
So SMP works on a thread base.

(c) Will code already compiled for ev56 CPUs run efficiently on an ev6 CPU?

The design is different, so for optimal performance you need to optimize for
EV6.

  ciao - 
    Stefan Traby
    Quant-X Alpha Linux Support

QUANT-X SERVICE & CONSULTING GMBH.
Your European source for ALPHA based systems
SAMSUNG ALPHA SUPPORT PARTNER

A-9300 ST. Veit / Glan
AUSTRIA GERMANY

TEL: +43 4212 90555-0    TEL:+49 89 21939181
FAX: +43 4212 90555-555  FAX:+49 89 21939182
HTTP://www.quant-x.com HTTP://www.quant-x.de
mailto:office@quant-x.com mailto:office@quant-x.com 
  

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com


^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: patch_v2: (on Alpha) emulating missing instructions
@ 1999-10-18 14:46 Robert Harley
  1999-10-18 15:31 ` Phil Carmody
  1999-10-21 16:23 ` patch_v3: emulating missing instructions on Alpha Luke Deller
  0 siblings, 2 replies; 30+ messages in thread
From: Robert Harley @ 1999-10-18 14:46 UTC (permalink / raw)
  To: axp-list

BTW, here is a fast and short way of doing minuw():

------------------------------------------------------------------------------
#define CMPBGE(a, b, c) \
  asm("cmpbge %1, %2, %0" : "=r" (c) : "r" (a), "r" (b))
#define ZAP(a, b, c) \
  asm("zap %1, %2, %0" : "=r" (c) : "r" (a), "r" (b))
#define ZAPNOT(a, b, c) \
  asm("zapnot %1, %2, %0" : "=r" (c) : "r" (a), "r" (b))

static u64 minuw(u64 x, u64 y) {
  u64 eq, ge1, ge2;

  CMPBGE(x, y, ge1);
  CMPBGE(0, x ^ y, eq);

  ge2 = (ge1 & ~eq | eq & ge1<<1) & 0xAA;
  ge2 |= ge2>>1;

  ZAP(x, ge2, x);
  ZAPNOT(y, ge2, y);

  return x | y;
} /* end function minuw */
------------------------------------------------------------------------------


The output from gcc 2.95 looks like:

------------------------------------------------------------------------------
minuw:
        cmpbge $16, $17, $1
        xor $16,$17,$3
        mov $31,$2
        cmpbge $2, $3, $2
        addq $1,$1,$4
        bic $1,$2,$1
        and $2,$4,$2
        bis $1,$2,$1
        and $1,170,$1
        srl $1,1,$2
        bis $1,$2,$1
        zapnot $17, $1, $17
        zap $16, $1, $16
        bis $16,$17,$0
        ret $31,($26),1
        .end minuw
------------------------------------------------------------------------------


This bit:

        mov $31,$2
        cmpbge $2, $3, $2

would be better as:

        cmpbge $31, $3, $2


Bye,
  Rob.


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

end of thread, other threads:[~1999-10-28 23:34 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-01-12  3:55 rpcc Christoph Dworzak
1999-01-12  3:20 ` rpcc Peter Petrakis
1999-01-12  4:59 ` rpcc Richard Henderson
     [not found]   ` <rth@twiddle.net>
1999-01-12 16:59     ` rpcc Christoph Dworzak
1999-01-12 19:27       ` rpcc Richard Henderson
1999-01-12 21:06         ` rpcc Wes Bauske
1999-01-13  2:16           ` rpcc Richard Henderson
1999-01-14 16:17     ` Alpha 21264 Christoph Dworzak
1999-01-14 15:46       ` Greg Lindahl
1999-01-14 17:27       ` Richard Henderson
1999-10-24 15:04     ` patch_v2: (on Alpha) emulating missing instructions Christoph Dworzak
1999-10-25  9:47       ` Phil Carmody
  -- strict thread matches above, loose matches on Subject: below --
1999-01-13 14:10 Alpha 21264 Andy Almond
1999-01-13 16:36 ` Jeff Sturm
1999-01-14  6:50   ` Richard Henderson
1999-01-13 15:18 Mailinglist --> PUBLIC
1999-01-13 20:50 ` Joachim Wesner
1999-01-13 21:12   ` Ross A. Knepper
1999-01-13 22:58     ` Joachim Wesner
1999-01-14  6:45       ` Richard Henderson
1999-01-14 10:02       ` Thorsten Koch
1999-01-14  0:16     ` Wes Bauske
1999-10-18 14:46 patch_v2: (on Alpha) emulating missing instructions Robert Harley
1999-10-18 15:31 ` Phil Carmody
1999-10-23 20:39   ` Richard Henderson
1999-10-21 16:23 ` patch_v3: emulating missing instructions on Alpha Luke Deller
1999-10-23 20:55   ` Richard Henderson
1999-10-24  0:28     ` Daniel Potts
1999-10-25  1:22     ` Luke Deller
1999-10-28 23:34       ` Richard Henderson

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