Re: Why C is much slower than Fortran

"Peter Mayne" <Peter.Mayne@compaq.com>
3 Jun 1999 02:24:42 -0400

          From comp.compilers

Related articles
[8 earlier articles]
Re: Why C is much slower than Fortran jhallen@world.std.com (1999-05-29)
Re: Why C is much slower than Fortran hwstock@wizard.com (H.W. Stockman) (1999-06-02)
Re: Why C is much slower than Fortran erik@arbat.com (Erik Corry) (1999-06-02)
Re: Why C is much slower than Fortran lindahl@pbm.com (1999-06-02)
Re: Why C is much slower than Fortran sokal@holyrood.ed.ac.uk (Daniel Barker) (1999-06-02)
Re: Why C is much slower than Fortran djb@koobera.math.uic.edu (1999-06-02)
Re: Why C is much slower than Fortran Peter.Mayne@compaq.com (Peter Mayne) (1999-06-03)
Re: Why C is much slower than Fortran lindahl@pbm.com (1999-06-06)
Re: Why C is much slower than Fortran john@iastate.edu (1999-06-12)
Re: Why C is much slower than Fortran erik@arbat.com (Erik Corry) (1999-06-14)
Re: Why C is much slower than Fortran jeff@jeff-jackson.com (Jeffrey Glen Jackson) (1999-06-19)
| List of all articles for this month |

From: "Peter Mayne" <Peter.Mayne@compaq.com>
Newsgroups: comp.lang.c++,comp.compilers,comp.arch
Date: 3 Jun 1999 02:24:42 -0400
Organization: Digital Equipment Corporation, Palo Alto, CA, USA
References: 99-05-142 99-06-006
Keywords: architecture, design, comment

Greg Lindahl <lindahl@pbm.com> wrote
> how many hardware architectures have hardware bounds checking?


VAX for one.


From the architecture handbok:


The FORTRAN statements:
        INTEGER*4 A(L1:U1,L2:U2),I,J
        A(I,J) = 1
are equivalent to:
        INDEX J,#L2,#U2,#M1,#0,R0 ;M1=U1-L1+1
        INDEX I,#L1,#U1,#1,R0,R0
        MOVL #1,A-a[R0] ;a={{L2*M1}+L1}*4


If the subscript operand is less than the low operand or greater than the high
operand, a subscript range trap is taken.


PJDM
----
Peter Mayne, Compaq Computer Australia, Canberra, ACT
[Not to belabor the obvious, but the x86 has a bounds checking instruction
also, although I've never seen it used, -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.