]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
MCL: Optimized compiler flags
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 19 Apr 2008 22:46:16 +0000 (00:46 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 19 Apr 2008 22:46:16 +0000 (00:46 +0200)
-ffast-math is the most important optimization here: update 20% faster

src/mcl/Makefile.omk
src/mcl/mcl.c

index 31e6e9643c62988a616696384c1adda6930a7d48..497cf94d335fdd940719fcd90dcdcdd74d746ea4 100644 (file)
@@ -7,3 +7,6 @@ mcl_SOURCES = mcl.c
 mcl_LIBS = robomath m 
 
 include_HEADERS = mcl.h
+
+# -ffast-math is the most important optimization here
+CFLAGS := $(filter-out -fno-strict-aliasing,$(CFLAGS)) --std=c99 -D_GNU_SOURCE -fgnu89-inline -ffast-math -O3 -funroll-loops -ftree-vectorize
index 47cc5bdf02b3dab5c42065dbd047779623a7ccd6..2bf21ae937085a57678d90bdbee617ef88fd760d 100644 (file)
@@ -116,8 +116,8 @@ void mcl_update(struct mcl_model *mcl, void *data)
 #endif
 void mcl_update2(struct mcl_model *mcl, void *data)
 {
-       struct mcl_particle *parts = (struct mcl_particle *)mcl->parts;
-       struct mcl_angles *angles = (struct mcl_angles*)data;
+       struct mcl_particle * restrict parts = (struct mcl_particle *)mcl->parts;
+       const struct mcl_angles *angles = (struct mcl_angles*)data;
        mcl_thetas theta;
        double p[mcl->beacon_cnt], p1;
        int i, it, im;