flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > Mingw32 did supported SSE2 or SSE mode compilation ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1792
Roman 29 Aug 2024, 17:19
I get FPU instructions, after compiled.
I want compiling code to sse instructions.
How do this ?
My bat file:
C:\MinGW32\bin\mingw32-make.exe -f Makefile CC=gcc config=release32

Or Premake4 set to sse instructions.
Post 29 Aug 2024, 17:19
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4039
Location: vpcmpistri
bitRAKE 29 Aug 2024, 19:15
Many compiler flags can build closer to your specific target from "-mfpmath=sse" to "-march=native". For a local build I usually just use "-march=native".

Modifying projects makefile:
Code:
CFLAGS += -msse2 -mfpmath=sse    
In your Premake4 script, you can modify the buildoptions for your project to include the desired flags:
Code:
solution "MySolution"
    configurations { "Release32" }

    project "MyProject"
        kind "ConsoleApp"
        language "C"
        targetdir "bin/%{cfg.buildcfg}"
        objdir "obj/%{cfg.buildcfg}"

        files { "**.c" }

        configuration "Release32"
            defines { "NDEBUG" }
            optimize "Speed"
            buildoptions { "-msse2", "-mfpmath=sse" }
    end
end    

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 29 Aug 2024, 19:15
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1792
Roman 30 Aug 2024, 06:11
Thanks.
I do sse2 dll.
In bat file:
C:\MinGW32\bin\mingw32-make.exe -f Makefile CC=gcc config=release32 pmath=sse

Code:
;was in premake.lua file
 if _OPTIONS["with-ou"] or not _OPTIONS["no-threading-intf"] then
      if _ACTION == "gmake" then
        if os.get() == "windows" then
          buildoptions { "-mthreads" }
          linkoptions { "-mthreads" }
          defines { "HAVE_PTHREAD_ATTR_SETINHERITSCHED=1", "HAVE_PTHREAD_ATTR_SETSTACKLAZY=1" }
        else
          buildoptions { "-pthread" }
          linkoptions { "-pthread" }
        end
      end
    end               
;new variant
 if _OPTIONS["with-ou"] or not _OPTIONS["no-threading-intf"] then
      if _ACTION == "gmake" then
        if os.get() == "windows" then
          buildoptions { "-mthreads","-msse2", "-mfpmath=sse" }
          linkoptions { "-mthreads","-msse2", "-mfpmath=sse" }
          defines { "HAVE_PTHREAD_ATTR_SETINHERITSCHED=1", "HAVE_PTHREAD_ATTR_SETSTACKLAZY=1" }
        else
          buildoptions { "-pthread" }
          linkoptions { "-pthread" }
        end
      end
    end               
    
Post 30 Aug 2024, 06:11
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.