Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

gcc compilation flags

gcc compilation flags

gcc    -falign-functions -msse2 -mfpmath=sse

Why not used something like gcc -march=native -O3 autodetecting run host optmimizations like -msse avtomatically ?

Re: gcc compilation flags

Because the dassl code does not work with i387 FPU current/sad

Re: gcc compilation flags

What about SSE3/4 on modern CPU (Intel i7) (gcc -Ofast -march=native -mfpmath=sse ) ?

Edited by: dponyatov - Jan-21-16 10:56:02

Re: gcc compilation flags

SSE3/4 is not disabled by setting -mfpmath=sse. The only valid options to that are: 387, sse, or both. -O3 is disabled by default because it typically then takes longer to compile the code than it takes to compile+run the code using -O0. But you can set cflags manually to override it.

Re: gcc compilation flags

I'm first concerned by -msse2 flag mainly, locking down gcc sse codegen to limited sse command set,
but now I think that this selection was done to circumvent some low-level incompatibility in some library or solver, like dassl/x387 said before.

Edited by: dponyatov - Jan-21-16 11:37:10

Re: gcc compilation flags

By default, GCC is tuned to the generic architecture, so -msse2 enables instructions. (I think it was only necessary to specify -mfpmath=sse -msse2 on 32-bit x86 though.)

It does not limit SSE3/4 from being used (unless -march=native, etc is given earlier on the command-line). But again, if you want faster code, appending for example -O3 -march=native to the CFLAGS will enable everything your CPU supports.

There are 0 guests and 0 other users also viewing this topic