Disable SSE while using STL?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
nbdd0121
Member
Member
Posts: 60
Joined: Thu Jul 25, 2013 8:10 am

Disable SSE while using STL?

Post by nbdd0121 »

I've currently trying to write a kernel in C++. I've written my own libc and compiled libstdc++ on top of it. I've tested the library and it is working fine on bare metal. However, when I turned on

Code: Select all

-mno-mmx -mno-sse -mno-sse2
then g++ refuses to compile the code giving the message

Code: Select all

include/c++/6.1.0/bits/basic_string.h:5438:46: error: SSE register return with SSE disabled
   stof(const string& __str, size_t* __idx = 0)
Is there a way to use STL while turning off MMX & SSE?
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: Disable SSE while using STL?

Post by thepowersgang »

You need to tell the compiler to use a software floating point ABI ("soft-float") I think it's just `-fsoft-float` but you will probably want to check that in the GCC documentation.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Post Reply