From df4d60e77996401095b5c5072e32a99478f7d8fa Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 4 Jan 2026 12:02:27 +0100 Subject: [PATCH] Use __builtin_sqrt instead of using std library functions __builtin_sqrt is already used in a few other places in the semantics. This commit just makes this consistent for all sqrt computations. --- lib/Arch/X86/Runtime/Instructions.cpp | 2 +- lib/Arch/X86/Semantics/SSE.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Arch/X86/Runtime/Instructions.cpp b/lib/Arch/X86/Runtime/Instructions.cpp index a3b94006..a06b0d66 100644 --- a/lib/Arch/X86/Runtime/Instructions.cpp +++ b/lib/Arch/X86/Runtime/Instructions.cpp @@ -191,7 +191,7 @@ DEF_HELPER(SquareRoot32, float32_t src_float)->float32_t { uint32_t indef_qnan = 0xFFC00000U; square_root = reinterpret_cast(indef_qnan); } else { - square_root = std::sqrt(src_float); + square_root = __builtin_sqrtf(src_float); } } diff --git a/lib/Arch/X86/Semantics/SSE.cpp b/lib/Arch/X86/Semantics/SSE.cpp index 33fd9469..d70615e3 100644 --- a/lib/Arch/X86/Semantics/SSE.cpp +++ b/lib/Arch/X86/Semantics/SSE.cpp @@ -1794,7 +1794,7 @@ DEF_HELPER(SquareRoot64, float64_t src_float)->float64_t { uint64_t indef_qnan = 0xFFF8000000000000ULL; square_root = reinterpret_cast(indef_qnan); } else { - square_root = std::sqrt(src_float); + square_root = __builtin_sqrt(src_float); } }