From e87f8e48e17754a8413bda66e6da67daf933cee2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 11 Dec 2022 01:18:26 +0200 Subject: [PATCH] Add support for SSE3 and SSE4.1 FPUs --- source/architecture.cpp | 2 ++ source/gnucompiler.cpp | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/source/architecture.cpp b/source/architecture.cpp index 58f435d..212f148 100644 --- a/source/architecture.cpp +++ b/source/architecture.cpp @@ -49,6 +49,8 @@ const char *fpus[] = { "387", "x86", "sse", "x86", + "sse3", "x86", + "sse4.1", "x86", "vfpv3", "arm", "neon", "arm", 0 diff --git a/source/gnucompiler.cpp b/source/gnucompiler.cpp index a6e838d..2752ff4 100644 --- a/source/gnucompiler.cpp +++ b/source/gnucompiler.cpp @@ -305,9 +305,17 @@ Task *GnuCompiler::run(const Target &target) const { if(architecture->get_type()=="x86") { - argv.push_back("-mfpmath="+architecture->get_fpu()); + if(architecture->get_fpu()=="387") + argv.push_back("-mfpmath=387"); + else if(!architecture->get_fpu().compare(0, 3, "sse")) + argv.push_back("-mfpmath=sse"); + if(architecture->get_fpu()=="sse") argv.push_back("-msse2"); + else if(architecture->get_fpu()=="sse3") + argv.push_back("-msse3"); + else if(architecture->get_fpu()=="sse4.1") + argv.push_back("-msse4.1"); } else if(architecture->get_type()=="arm") { -- 2.45.2