Commit c127ebc9 authored by Izzard, Robert Dr (Physics)'s avatar Izzard, Robert Dr (Physics)

Merge branch 'master' of gitlab.eps.surrey.ac.uk:ri0005/librinterpolate

parents 838d035e 4082d57c
......@@ -11,7 +11,8 @@ LDFLAGS ?=
C_SRC := $(wildcard *.c)
OBJECTS := $(C_SRC:.c=.o)
#OBJECTS := rinterpolate.o rinterpolate-debug.o
CFLAGS := -fPIC -O2 -march=native -mtune=native -Wall -Wstrict-prototypes -ffast-math -D__RINTERPOLATE__ -D__RINTERPOLATE_BUILD_BUILD_FLAGS__ $(COPTFLAGS)
LIBRINTERPOLATE_ARCHFLAGS ?= -march=native -mtune=native
CFLAGS := -fPIC -O2 -g $(LIBRINTERPOLATE_ARCHFLAGS) -Wall -Wstrict-prototypes -ffast-math -D__RINTERPOLATE__ -D__RINTERPOLATE_BUILD_BUILD_FLAGS__ $(COPTFLAGS)
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
......@@ -44,5 +45,5 @@ install:
install -m 644 rinterpolate.h $(DESTDIR)$(PREFIX)/include
install -m 644 rinterpolate_prototypes.h $(DESTDIR)$(PREFIX)/include
install -m 644 rinterpolate_compiler.h $(DESTDIR)$(PREFIX)/include
/sbin/ldconfig
# /sbin/ldconfig
......@@ -160,7 +160,7 @@ struct rinterpolate_data_t * rinterpolate(
)
{
#if defined RINTERPOLATE_DEBUG && defined RINTERPOLATE_SHOW_TABLE
register rinterpolate_counter_t i=0;
rinterpolate_counter_t i=0;
#endif
Rinterpolate_print("DEBUG RINTERPOLATE datatable=%p n=%d d=%d l=%d x=%p r=%p cache_length=%d\n",
datatable,
......@@ -234,13 +234,14 @@ struct rinterpolate_data_t * rinterpolate(
#ifdef RINTERPOLATE_DEBUG_SHOW_TABLE
if(rinterpolate_debug == TRUE)
{
for(i=0;i<l;i++)
int _i;
for(_i=0;_i<l;_i++)
{
Rinterpolate_print("L%d ",i);
Rinterpolate_print("L%d ",_i);
rinterpolate_counter_t j;
for(j=0;j<table->line_length;j++)
{
Rinterpolate_print("%g ",*(datatable+i*table->line_length+j));
Rinterpolate_print("%g ",*(datatable+_i*table->line_length+j));
}
Rinterpolate_print("\n");
FLUSH;
......
......@@ -31,10 +31,6 @@
};
#endif
/* do we want to try __rinterpolate_register = register variables?
* makes no difference with -O3 */
#define __rinterpolate_register /* */
/* if we're given an ALIGNSIZE, use it */
#if !defined Aligned && defined ALIGNSIZE
#define Aligned __attribute__ ((aligned (ALIGNSIZE)))
......
......@@ -18,7 +18,7 @@ void rinterpolate_construct_hypercube(struct rinterpolate_table_t * RESTRICT tab
Rinterpolate_print("%d (lnl = %d)\n",hypertable->sum[i],table->line_length);
}
register rinterpolate_counter_t k = 0;
rinterpolate_counter_t k = 0;
for(i=0;i<table->hypertable_length;i++)
{
#ifdef RINTERPOLATE_DEBUG
......
......@@ -6,7 +6,7 @@ void rinterpolate_interpolate(
const rinterpolate_float_t * RESTRICT x,
rinterpolate_float_t * RESTRICT r)
{
register rinterpolate_float_t u,v;
rinterpolate_float_t u,v;
rinterpolate_counter_t n = 0;
struct rinterpolate_hypertable_t * hypertable = table->hypertable;
rinterpolate_counter_t g = table->line_length<<(table->n-1);
......
......@@ -6,7 +6,7 @@ void rinterpolate_search_table(
const rinterpolate_float_t * RESTRICT x
)
{
register rinterpolate_counter_t j;
rinterpolate_counter_t j;
#ifdef RINTERPOLATE_DEBUG
Rinterpolate_print("search table for span of { ");
for(j=0;j<table->n;j++)
......@@ -34,7 +34,7 @@ void rinterpolate_search_table(
* limit the value of our given parameter x[j] to the range we have
* and save to the parameter v
*/
register rinterpolate_counter_t b = table->varcount[j];
rinterpolate_counter_t b = table->varcount[j];
#ifdef RINTERPOLATE_PRESEARCH
const rinterpolate_float_t * RESTRICT tpre =
table->presearch[j];
......@@ -85,7 +85,7 @@ void rinterpolate_search_table(
* a and b are the binary search limits, start at a=0
* and b=varcount[j] (the max possible value, set above)
*/
register rinterpolate_counter_t a = 0;
rinterpolate_counter_t a = 0;
if(likely(b>1))
{
......@@ -124,7 +124,7 @@ void rinterpolate_search_table(
*/
//c = ( a + b ) / 2;
//c = a + (b - a) / 2;//use this in case of overflow (unlikely!)
const register rinterpolate_counter_t c = (a+b)>>1; // bit shift
const rinterpolate_counter_t c = (a+b)>>1; // bit shift
#ifdef RINTERPOLATE_POINTER_ARITHMETIC_J_LOOP
#ifdef RINTERPOLATE_PRESEARCH
......@@ -155,18 +155,18 @@ void rinterpolate_search_table(
/* calculate interpolation factor (nasty, sorry...) */
#ifdef RINTERPOLATE_POINTER_ARITHMETIC_J_LOOP
#ifdef RINTERPOLATE_PRESEARCH
const register rinterpolate_float_t u = *(tpre+a);
const rinterpolate_float_t u = *(tpre+a);
*(hypertable->f+j) = (v - u)/( *(tpre + b) - u);
#else
const register rinterpolate_float_t u = *(tj+a*i);
const rinterpolate_float_t u = *(tj+a*i);
*(hypertable->f+j) = (v - u)/( *(tj + b*i) - u);
#endif//RINTERPOLATE_PRESEARCH
#else//RINTERPOLATE_POINTER_ARITHMETIC_J_LOOP
#ifdef RINTERPOLATE_PRESEARCH
const register rinterpolate_float_t u = tpre[a];
const rinterpolate_float_t u = tpre[a];
hypertable->f[j] = (v - u)/(tpre[b] - u);
#else
const register rinterpolate_float_t u = table->data[a*i+j];
const rinterpolate_float_t u = table->data[a*i+j];
hypertable->f[j] = (v - u)/(table->data[b*i+j] - u);
#endif//RINTERPOLATE_PRESEARCH
#endif//RINTERPOLATE_POINTER_ARITHMETIC_J_LOOP
......@@ -186,7 +186,7 @@ void rinterpolate_search_table(
//rinterpolate_counter_t tmp;
/* loop over lines of the hypertable */
register rinterpolate_counter_t m;
rinterpolate_counter_t m;
for(m = 0 ; m < table->hypertable_length; m++)
{
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment