[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gsl] Re: Use of assembler code in matrix get element functions. Co
[Help-gsl] Re: Use of assembler code in matrix get element functions. Could be useful?
Mon, 25 Oct 2010 09:46:38 -0500
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:188.8.131.52) Gecko/20100720 Thunderbird/3.0.6
On 10/23/10 03:36 AM, José Luis García Pallero wrote:
First of all I should say that I don't know nothing about assembler
programming, so this is only a question.
In gsl_matrix_get functions the code that calculates the position of
an element in the storing vector is 'i * m->tda + j', that is a
product plus an addition. Could be a speed improving the
implementation of these operations in assembler via the asm() gcc
facilities? It could be programmed in assembler for x86 machines (so
these are the most common) and in standard C for the others.
I don't think it's that simple. I don't think you can do this
arbitrarily for all compilers. You would need to detect GCC, or
not, and act accordingly. I'd also suggest profiling the current
code to make sure that GCC has not already made this optimization.