userspace: Allow building without SSE

I had added changes that had broken compilation without sse support
This commit is contained in:
2024-09-02 21:25:00 +03:00
parent 700c3444f5
commit 5f92807fdd
9 changed files with 45 additions and 6 deletions

View File

@@ -158,6 +158,7 @@ static T strtoT(const char* str, char** endp, int base, int& error)
return result;
}
#if __enable_sse
template<BAN::floating_point T>
static T strtoT(const char* str, char** endp, int& error)
{
@@ -303,11 +304,14 @@ static T strtoT(const char* str, char** endp, int& error)
result *= BAN::Math::pow<T>((base == 10) ? 10 : 2, exponent);
return result;
}
#endif
#if __enable_sse
double atof(const char* str)
{
return strtod(str, nullptr);
}
#endif
int atoi(const char* str)
{
@@ -324,6 +328,7 @@ long long atoll(const char* str)
return strtoll(str, nullptr, 10);
}
#if __enable_sse
float strtof(const char* __restrict str, char** __restrict endp)
{
return strtoT<float>(str, endp, errno);
@@ -338,6 +343,7 @@ long double strtold(const char* __restrict str, char** __restrict endp)
{
return strtoT<long double>(str, endp, errno);
}
#endif
long strtol(const char* __restrict str, char** __restrict endp, int base)
{