lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 2010-10-19, David Kastrup <> wrote:
> And just why is it implemented in assembler?  Because the C compilers
> can't be persuaded that two pointers passed into one function don't
> access overlapping memory areas.  Recent language standards allow
> conveying this information, but the required syntax is utterly obtuse,
> so nobody actually uses that.  In particular, you can't give this
> information when using multidimensional array syntax in the function
> arguments.  You need to use pointer syntax for the largest-stride
> dimension.
> Anyway, having overlapping arrays passed into a function is legal in C,
> undefined in Fortran, and very likely leads to unpredictable behavior in
> the assembly language Goto BLAS.
> The original, higher language version of BLAS is written in Fortran.  C
> ports have never been popular due to performance reasons: instead you
> use external interfaces to call the Fortran routines.  Go figure.
> --
> David Kastrup

This is precisely why JIT compilers can be very useful for numerics.
At run-time JIT knows memory layout of matrix objects and can
determine whether they overlap or not and proceed accordingly. The
same is true for assembler optimized libraries that can test matrix
overlap at run time and call appropriate subroutines.

Also, do not forget that these days lots of numerics and signal
processing are done in embeded devices (e.g. medical equipment).
Fortran simply is not portable enough and lacks in many non-numeric
areas of programming (libraries...)