Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* char access is not so fast (:-<)
@ 1995-05-02  4:00 Tetsuro KUGE
  1995-05-02  4:00 ` Dan Pop
  1995-05-02  4:00 ` Stephen Hoffman
  0 siblings, 2 replies; 4+ messages in thread
From: Tetsuro KUGE @ 1995-05-02  4:00 UTC (permalink / raw)


Hi, speedsters (^^;),

It is seemed the access to char *array on Alpha CPU
is NOT so faster than the "slower" chips of Sparc etc.

On the Alpha server 4/275 with OSF/1 V.3.0B,
the cc opitons -O* does not improve the situation (:-<).

Is it my misunderstanding ?
--
T.Kuge <kuge@STRL.nhk.or.jp>








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

* Re: char access is not so fast (:-<)
  1995-05-02  4:00 char access is not so fast (:-<) Tetsuro KUGE
@ 1995-05-02  4:00 ` Dan Pop
  1995-05-05  4:00   ` Fred Kleinsorge
  1995-05-02  4:00 ` Stephen Hoffman
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Pop @ 1995-05-02  4:00 UTC (permalink / raw)


In <KUGE.95May2125112@k1ss.strl.nhk.or.jp> kuge@strl.nhk.or.jp (Tetsuro KUGE) writes:

>Hi, speedsters (^^;),
>
>It is seemed the access to char *array on Alpha CPU
>is NOT so faster than the "slower" chips of Sparc etc.
>
>On the Alpha server 4/275 with OSF/1 V.3.0B,
>the cc opitons -O* does not improve the situation (:-<).
>
>Is it my misunderstanding ?

It's not your misunderstanding, it's the Alpha architecture not being
able to access bytes.  The only data sizes that can be directly accessed
by Alpha are 32 and 64 bit.  For characters and short int's there is a
certain overhead, as the accesses have to be implemented in software (with
more than one instruction :-)

Dan
--
Dan Pop
CERN, CN Division
Email: danpop@afsmail.cern.ch 
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland



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

* Re: char access is not so fast (:-<)
  1995-05-02  4:00 char access is not so fast (:-<) Tetsuro KUGE
  1995-05-02  4:00 ` Dan Pop
@ 1995-05-02  4:00 ` Stephen Hoffman
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hoffman @ 1995-05-02  4:00 UTC (permalink / raw)



In article <KUGE.95May2125112@k1ss.strl.nhk.or.jp>, kuge@strl.nhk.or.jp (Tetsuro KUGE) writes:
:It is seemed the access to char *array on Alpha CPU
:is NOT so faster than the "slower" chips of Sparc etc.
:
:On the Alpha server 4/275 with OSF/1 V.3.0B,
:the cc opitons -O* does not improve the situation (:-<).

  Alpha processors operate fastest on aligned data references.

  Which C compiler are you using?  (It looks like the default C compiler.
  If so, do you have DEC C available?)  And what is the particular C code
  in use?  (A short sample of the offending code would be helpful.)

  ------------------------------ Opinionative -------------------------------
   Stephen Hoffman, NR EMT-I, WEMT, N1THN        hoffman@xdelta.enet.dec.com
   General Info: info@digital.com     OpenVMS Info: openvms-info@digital.com
        OpenVMS Engineering, Digital Equipment Corporation, Nashua NH




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

* Re: char access is not so fast (:-<)
  1995-05-02  4:00 ` Dan Pop
@ 1995-05-05  4:00   ` Fred Kleinsorge
  0 siblings, 0 replies; 4+ messages in thread
From: Fred Kleinsorge @ 1995-05-05  4:00 UTC (permalink / raw)



In article <danpop.799413227@rscernix>, danpop@afsmail.cern.ch (Dan Pop)
writes:
>In <KUGE.95May2125112@k1ss.strl.nhk.or.jp> kuge@strl.nhk.or.jp (Tetsuro
>KUGE) writes:
>
>>Hi, speedsters (^^;),
>>
>>It is seemed the access to char *array on Alpha CPU
>>is NOT so faster than the "slower" chips of Sparc etc.
>>
>>On the Alpha server 4/275 with OSF/1 V.3.0B,
>>the cc opitons -O* does not improve the situation (:-<).
>>
>>Is it my misunderstanding ?
>
>It's not your misunderstanding, it's the Alpha architecture not being
>able to access bytes.  The only data sizes that can be directly
>accessed
>by Alpha are 32 and 64 bit.  For characters and short int's there is a
>certain overhead, as the accesses have to be implemented in software
>(with
>more than one instruction :-)
>

  The Alpha rchitecture doesn't deal with bytes, it deals with blocks
  of 4 or 8 bytes at minimum.  It leaves the handling of bytes to the
  compilers.  How good the generated code from the compiler is depends
  on: the quality of the compiler, the quality of the source code, and
  the constraints on the code and the compiler.

  The compilers have gotten better about partial word manipulation,
  but in general you will always get better performance if your code
  is written to deal in terms of 32 or 64 bit ints, and do the
  byte manipulation by hand.

  The general problem is that the generated code tends to be "safe"
  that is, it's guaranteed to work, and not generate alignment faults.
  So what you see is code that will have sequences like:

	LDQ_U	R21, (R0)
	EXTBL	R21, R0, R0

  Just to simply fetch a byte in a foo[bar] array type operation.

  In general the generated code is fast enough for most purposes, and
  getting better.  However, in performance critical code, like the
  inner loop of say a image operation - you can get 2x performance
  increases by using pointers to int32 or int64 data, and shifting,
  masking, and ORing by hand.  Most of the performance win comes from
  doing aligned fetching of the data once, and then doing operations
  on that block of data in registers.


-- 
                              +--------------------------------------+
Fred Kleinsorge               | All opinions expressed are mine, and |
kleinsorge@star.enet.dec.com  | may not reflect those of my employer |
                              +--------------------------------------+



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

end of thread, other threads:[~1995-05-05  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-05-02  4:00 char access is not so fast (:-<) Tetsuro KUGE
1995-05-02  4:00 ` Dan Pop
1995-05-05  4:00   ` Fred Kleinsorge
1995-05-02  4:00 ` Stephen Hoffman

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