[libc-commits] [compiler-rt] [libc] [llvm] [compiler-rt][builtins] add libc-backed arithmetic builtins (PR #207092)
via libc-commits
libc-commits at lists.llvm.org
Wed Jul 8 18:15:29 PDT 2026
https://github.com/hulxv updated https://github.com/llvm/llvm-project/pull/207092
>From df9e0b6f8783d505297441a0287258fd44134258 Mon Sep 17 00:00:00 2001
From: hulxv <hulxxv at gmail.com>
Date: Thu, 28 May 2026 02:12:37 +0300
Subject: [PATCH 1/9] [compiler-rt][builtins] introduce libc math routines
---
.../compiler-rt-libc-builtins-tests.yml | 58 +++++++++++++++++++
1 file changed, 58 insertions(+)
create mode 100644 .github/workflows/compiler-rt-libc-builtins-tests.yml
diff --git a/.github/workflows/compiler-rt-libc-builtins-tests.yml b/.github/workflows/compiler-rt-libc-builtins-tests.yml
new file mode 100644
index 0000000000000..3dab28c0387a7
--- /dev/null
+++ b/.github/workflows/compiler-rt-libc-builtins-tests.yml
@@ -0,0 +1,58 @@
+# Pre-commit CI for the compiler-rt + LLVM-libc builtins integration.
+name: compiler-rt + libc Builtins Tests
+permissions:
+ contents: read
+on:
+ pull_request:
+ branches: ["main"]
+ paths:
+ - "compiler-rt/lib/builtins/**"
+ - "compiler-rt/test/builtins/**"
+ - "libc/shared/builtins.h"
+ - "libc/shared/builtins/**"
+ - "libc/src/__support/builtins/**"
+ - "libc/src/__support/FPUtil/**"
+ - ".github/workflows/compiler-rt-libc-builtins-tests.yml"
+
+jobs:
+ build:
+ name: builtins (${{ matrix.os }})
+ if: github.repository_owner == 'llvm'
+ runs-on: ${{ matrix.os }}
+ container:
+ image: ${{ (startsWith(matrix.os, 'ubuntu-24.04-arm') && 'ghcr.io/llvm/arm64v8/libc-ubuntu-24.04') || 'ghcr.io/llvm/libc-ubuntu-24.04' }}
+ options: >-
+ --privileged
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-24.04, ubuntu-24.04-arm]
+
+ steps:
+ - uses: actions/checkout at de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+
+ - name: Configure CMake
+ shell: bash
+ run: |
+ cmake \
+ -B build \
+ -S llvm \
+ -G Ninja \
+ -DCMAKE_C_COMPILER=clang-23 \
+ -DCMAKE_CXX_COMPILER=clang++-23 \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_ENABLE_ASSERTIONS=ON \
+ -DLLVM_ENABLE_PROJECTS=clang \
+ -DLLVM_ENABLE_RUNTIMES="compiler-rt" \
+ -DCOMPILER_RT_USE_LIBC_MATH=ON \
+ -DCOMPILER_RT_INCLUDE_TESTS=ON
+
+ - name: Test compiler-rt builtins
+ shell: bash
+ run: |
+ cmake \
+ --build build \
+ --parallel \
+ --target check-builtins
>From 705ce2b4a1f0562c1d72d8b3f1627ce0b72b939f Mon Sep 17 00:00:00 2001
From: hulxv <hulxxv at gmail.com>
Date: Mon, 1 Jun 2026 00:50:36 +0300
Subject: [PATCH 2/9] allow all branches
---
.github/workflows/compiler-rt-libc-builtins-tests.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/compiler-rt-libc-builtins-tests.yml b/.github/workflows/compiler-rt-libc-builtins-tests.yml
index 3dab28c0387a7..ba9c9ecf38bdb 100644
--- a/.github/workflows/compiler-rt-libc-builtins-tests.yml
+++ b/.github/workflows/compiler-rt-libc-builtins-tests.yml
@@ -4,7 +4,6 @@ permissions:
contents: read
on:
pull_request:
- branches: ["main"]
paths:
- "compiler-rt/lib/builtins/**"
- "compiler-rt/test/builtins/**"
>From 0f0b9f0f02efb3bb281a6203049304e7e8868d80 Mon Sep 17 00:00:00 2001
From: hulxv <hulxxv at gmail.com>
Date: Mon, 1 Jun 2026 00:52:23 +0300
Subject: [PATCH 3/9] remove `--privileged`` option
---
.github/workflows/compiler-rt-libc-builtins-tests.yml | 2 --
1 file changed, 2 deletions(-)
diff --git a/.github/workflows/compiler-rt-libc-builtins-tests.yml b/.github/workflows/compiler-rt-libc-builtins-tests.yml
index ba9c9ecf38bdb..66e511b45d95a 100644
--- a/.github/workflows/compiler-rt-libc-builtins-tests.yml
+++ b/.github/workflows/compiler-rt-libc-builtins-tests.yml
@@ -20,8 +20,6 @@ jobs:
runs-on: ${{ matrix.os }}
container:
image: ${{ (startsWith(matrix.os, 'ubuntu-24.04-arm') && 'ghcr.io/llvm/arm64v8/libc-ubuntu-24.04') || 'ghcr.io/llvm/libc-ubuntu-24.04' }}
- options: >-
- --privileged
strategy:
fail-fast: false
matrix:
>From f713a1d01779b007126b08c0f1e66dca27fb9ef8 Mon Sep 17 00:00:00 2001
From: hulxv <hulxxv at gmail.com>
Date: Mon, 1 Jun 2026 00:53:52 +0300
Subject: [PATCH 4/9] remove shell option
---
.github/workflows/compiler-rt-libc-builtins-tests.yml | 2 --
1 file changed, 2 deletions(-)
diff --git a/.github/workflows/compiler-rt-libc-builtins-tests.yml b/.github/workflows/compiler-rt-libc-builtins-tests.yml
index 66e511b45d95a..8605892a701fd 100644
--- a/.github/workflows/compiler-rt-libc-builtins-tests.yml
+++ b/.github/workflows/compiler-rt-libc-builtins-tests.yml
@@ -31,7 +31,6 @@ jobs:
persist-credentials: false
- name: Configure CMake
- shell: bash
run: |
cmake \
-B build \
@@ -47,7 +46,6 @@ jobs:
-DCOMPILER_RT_INCLUDE_TESTS=ON
- name: Test compiler-rt builtins
- shell: bash
run: |
cmake \
--build build \
>From 38eb247a901d05554af1dd664b02c5cbcd41f412 Mon Sep 17 00:00:00 2001
From: hulxv <hulxxv at gmail.com>
Date: Fri, 26 Jun 2026 21:42:17 +0300
Subject: [PATCH 5/9] Split "[CI] Add precommit CIs to test compiler-rt + LLVM
libc integration"
---
.../compiler-rt-libc-builtins-tests.yml | 53 -------------------
1 file changed, 53 deletions(-)
delete mode 100644 .github/workflows/compiler-rt-libc-builtins-tests.yml
diff --git a/.github/workflows/compiler-rt-libc-builtins-tests.yml b/.github/workflows/compiler-rt-libc-builtins-tests.yml
deleted file mode 100644
index 8605892a701fd..0000000000000
--- a/.github/workflows/compiler-rt-libc-builtins-tests.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-# Pre-commit CI for the compiler-rt + LLVM-libc builtins integration.
-name: compiler-rt + libc Builtins Tests
-permissions:
- contents: read
-on:
- pull_request:
- paths:
- - "compiler-rt/lib/builtins/**"
- - "compiler-rt/test/builtins/**"
- - "libc/shared/builtins.h"
- - "libc/shared/builtins/**"
- - "libc/src/__support/builtins/**"
- - "libc/src/__support/FPUtil/**"
- - ".github/workflows/compiler-rt-libc-builtins-tests.yml"
-
-jobs:
- build:
- name: builtins (${{ matrix.os }})
- if: github.repository_owner == 'llvm'
- runs-on: ${{ matrix.os }}
- container:
- image: ${{ (startsWith(matrix.os, 'ubuntu-24.04-arm') && 'ghcr.io/llvm/arm64v8/libc-ubuntu-24.04') || 'ghcr.io/llvm/libc-ubuntu-24.04' }}
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-24.04, ubuntu-24.04-arm]
-
- steps:
- - uses: actions/checkout at de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- persist-credentials: false
-
- - name: Configure CMake
- run: |
- cmake \
- -B build \
- -S llvm \
- -G Ninja \
- -DCMAKE_C_COMPILER=clang-23 \
- -DCMAKE_CXX_COMPILER=clang++-23 \
- -DCMAKE_BUILD_TYPE=Release \
- -DLLVM_ENABLE_ASSERTIONS=ON \
- -DLLVM_ENABLE_PROJECTS=clang \
- -DLLVM_ENABLE_RUNTIMES="compiler-rt" \
- -DCOMPILER_RT_USE_LIBC_MATH=ON \
- -DCOMPILER_RT_INCLUDE_TESTS=ON
-
- - name: Test compiler-rt builtins
- run: |
- cmake \
- --build build \
- --parallel \
- --target check-builtins
>From a44de08af68cc6ab8b21f116baafbc1c63019d51 Mon Sep 17 00:00:00 2001
From: hulxv <hulxxv at gmail.com>
Date: Thu, 2 Jul 2026 01:16:36 +0300
Subject: [PATCH 6/9] [compiler-rt][builtins] add libc-backed arithmetic
builtins
---
compiler-rt/lib/builtins/CMakeLists.txt | 7 +++++++
compiler-rt/lib/builtins/adddf3.cpp | 22 ++++++++++++++++++++++
compiler-rt/lib/builtins/divdf3.cpp | 22 ++++++++++++++++++++++
compiler-rt/lib/builtins/divtf3.cpp | 22 ++++++++++++++++++++++
compiler-rt/lib/builtins/muldf3.cpp | 22 ++++++++++++++++++++++
compiler-rt/lib/builtins/multf3.cpp | 22 ++++++++++++++++++++++
compiler-rt/lib/builtins/subdf3.cpp | 22 ++++++++++++++++++++++
compiler-rt/lib/builtins/subtf3.cpp | 22 ++++++++++++++++++++++
8 files changed, 161 insertions(+)
create mode 100644 compiler-rt/lib/builtins/adddf3.cpp
create mode 100644 compiler-rt/lib/builtins/divdf3.cpp
create mode 100644 compiler-rt/lib/builtins/divtf3.cpp
create mode 100644 compiler-rt/lib/builtins/muldf3.cpp
create mode 100644 compiler-rt/lib/builtins/multf3.cpp
create mode 100644 compiler-rt/lib/builtins/subdf3.cpp
create mode 100644 compiler-rt/lib/builtins/subtf3.cpp
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index e128fea6a3415..659e149b5a307 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -264,7 +264,14 @@ if(COMPILER_RT_USE_LIBC_MATH)
include_directories(SYSTEM ${_libc_include_dirs})
add_definitions(-DCOMPILER_RT_USE_LIBC_MATH)
+ use_libc_builtin(GENERIC_SOURCES adddf3)
use_libc_builtin(GENERIC_TF_SOURCES addtf3)
+ use_libc_builtin(GENERIC_SOURCES divdf3)
+ use_libc_builtin(GENERIC_TF_SOURCES divtf3)
+ use_libc_builtin(GENERIC_SOURCES muldf3)
+ use_libc_builtin(GENERIC_TF_SOURCES multf3)
+ use_libc_builtin(GENERIC_SOURCES subdf3)
+ use_libc_builtin(GENERIC_TF_SOURCES divtf3)
endif()
option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN
diff --git a/compiler-rt/lib/builtins/adddf3.cpp b/compiler-rt/lib/builtins/adddf3.cpp
new file mode 100644
index 0000000000000..0bae3c92c3d3b
--- /dev/null
+++ b/compiler-rt/lib/builtins/adddf3.cpp
@@ -0,0 +1,22 @@
+//===-- lib/adddf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __adddf3 implemented on top of LLVM-libc's shared::adddf3 instruction.
+//
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/adddf3.h"
+
+extern "C" COMPILER_RT_ABI fp_t __adddf3(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::adddf3(a, b);
+}
diff --git a/compiler-rt/lib/builtins/divdf3.cpp b/compiler-rt/lib/builtins/divdf3.cpp
new file mode 100644
index 0000000000000..ea01a3c719c51
--- /dev/null
+++ b/compiler-rt/lib/builtins/divdf3.cpp
@@ -0,0 +1,22 @@
+//===-- lib/divdf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __divdf3 implemented on top of LLVM-libc's shared::divdf3 instruction.
+//
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/divdf3.h"
+
+extern "C" COMPILER_RT_ABI fp_t __divdf3(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::divdf3(a, b);
+}
diff --git a/compiler-rt/lib/builtins/divtf3.cpp b/compiler-rt/lib/builtins/divtf3.cpp
new file mode 100644
index 0000000000000..7b16174ce16d9
--- /dev/null
+++ b/compiler-rt/lib/builtins/divtf3.cpp
@@ -0,0 +1,22 @@
+//===-- lib/divtf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __divtf3 implemented on top of LLVM-libc's shared::divtf3 instruction.
+//
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/divtf3.h"
+
+extern "C" COMPILER_RT_ABI fp_t __divtf3(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::divtf3(a, b);
+}
diff --git a/compiler-rt/lib/builtins/muldf3.cpp b/compiler-rt/lib/builtins/muldf3.cpp
new file mode 100644
index 0000000000000..d1d4c70fdb837
--- /dev/null
+++ b/compiler-rt/lib/builtins/muldf3.cpp
@@ -0,0 +1,22 @@
+//===-- lib/muldf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __muldf3 implemented on top of LLVM-libc's shared::muldf3 instruction.
+//
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/muldf3.h"
+
+extern "C" COMPILER_RT_ABI fp_t __muldf3(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::muldf3(a, b);
+}
diff --git a/compiler-rt/lib/builtins/multf3.cpp b/compiler-rt/lib/builtins/multf3.cpp
new file mode 100644
index 0000000000000..bafc7016bddfb
--- /dev/null
+++ b/compiler-rt/lib/builtins/multf3.cpp
@@ -0,0 +1,22 @@
+//===-- lib/multf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __multf3 implemented on top of LLVM-libc's shared::multf3 instruction.
+//
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/multf3.h"
+
+extern "C" COMPILER_RT_ABI fp_t __multf3(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::multf3(a, b);
+}
diff --git a/compiler-rt/lib/builtins/subdf3.cpp b/compiler-rt/lib/builtins/subdf3.cpp
new file mode 100644
index 0000000000000..c688d7dcab4c9
--- /dev/null
+++ b/compiler-rt/lib/builtins/subdf3.cpp
@@ -0,0 +1,22 @@
+//===-- lib/subdf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __subdf3 implemented on top of LLVM-libc's shared::subdf3 instruction.
+//
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/subdf3.h"
+
+extern "C" COMPILER_RT_ABI fp_t __subdf3(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::subdf3(a, b);
+}
diff --git a/compiler-rt/lib/builtins/subtf3.cpp b/compiler-rt/lib/builtins/subtf3.cpp
new file mode 100644
index 0000000000000..6868293f4043f
--- /dev/null
+++ b/compiler-rt/lib/builtins/subtf3.cpp
@@ -0,0 +1,22 @@
+//===-- lib/subtf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __subtf3 implemented on top of LLVM-libc's shared::subtf3 instruction.
+//
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/subtf3.h"
+
+extern "C" COMPILER_RT_ABI fp_t __subtf3(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::subtf3(a, b);
+}
>From 57ba3e842f0ca2874c8efcc400d73ede253b06a6 Mon Sep 17 00:00:00 2001
From: hulxv <hulxxv at gmail.com>
Date: Sat, 4 Jul 2026 20:03:09 +0300
Subject: [PATCH 7/9] [compiler-rt][builtins] add libc-backed arithmetic
builtins
---
compiler-rt/lib/builtins/CMakeLists.txt | 4 ++-
compiler-rt/lib/builtins/adddf3.cpp | 3 +-
compiler-rt/lib/builtins/divdf3.cpp | 3 +-
compiler-rt/lib/builtins/divtf3.cpp | 2 +-
compiler-rt/lib/builtins/muldf3.cpp | 2 +-
compiler-rt/lib/builtins/multf3.cpp | 2 +-
compiler-rt/lib/builtins/negdf2.cpp | 21 ++++++++++++
compiler-rt/lib/builtins/negsf2.cpp | 22 +++++++++++++
compiler-rt/lib/builtins/subdf3.cpp | 3 +-
compiler-rt/lib/builtins/subtf3.cpp | 2 +-
libc/shared/builtins.h | 2 ++
libc/shared/builtins/negdf2.h | 29 +++++++++++++++++
libc/shared/builtins/negsf2.h | 29 +++++++++++++++++
libc/src/__support/builtins/CMakeLists.txt | 16 ++++++++++
libc/src/__support/builtins/negdf2.h | 37 ++++++++++++++++++++++
libc/src/__support/builtins/negsf2.h | 37 ++++++++++++++++++++++
libc/test/shared/CMakeLists.txt | 2 ++
libc/test/shared/shared_builtins_test.cpp | 2 ++
18 files changed, 207 insertions(+), 11 deletions(-)
create mode 100644 compiler-rt/lib/builtins/negdf2.cpp
create mode 100644 compiler-rt/lib/builtins/negsf2.cpp
create mode 100644 libc/shared/builtins/negdf2.h
create mode 100644 libc/shared/builtins/negsf2.h
create mode 100644 libc/src/__support/builtins/negdf2.h
create mode 100644 libc/src/__support/builtins/negsf2.h
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 659e149b5a307..3a7751425d73f 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -270,8 +270,10 @@ if(COMPILER_RT_USE_LIBC_MATH)
use_libc_builtin(GENERIC_TF_SOURCES divtf3)
use_libc_builtin(GENERIC_SOURCES muldf3)
use_libc_builtin(GENERIC_TF_SOURCES multf3)
+ use_libc_builtin(GENERIC_SOURCES negdf2)
+ use_libc_builtin(GENERIC_SOURCES negsf2)
use_libc_builtin(GENERIC_SOURCES subdf3)
- use_libc_builtin(GENERIC_TF_SOURCES divtf3)
+ use_libc_builtin(GENERIC_TF_SOURCES subtf3)
endif()
option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN
diff --git a/compiler-rt/lib/builtins/adddf3.cpp b/compiler-rt/lib/builtins/adddf3.cpp
index 0bae3c92c3d3b..03da4a1e33fb1 100644
--- a/compiler-rt/lib/builtins/adddf3.cpp
+++ b/compiler-rt/lib/builtins/adddf3.cpp
@@ -1,4 +1,4 @@
-//===-- lib/adddf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//===-- lib/adddf3.cpp - double-precision addition --------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,7 +10,6 @@
//
//===----------------------------------------------------------------------===//
-#define QUAD_PRECISION
#include "fp_lib.h"
#include "fp_libc_config.h"
diff --git a/compiler-rt/lib/builtins/divdf3.cpp b/compiler-rt/lib/builtins/divdf3.cpp
index ea01a3c719c51..50ce7372b0647 100644
--- a/compiler-rt/lib/builtins/divdf3.cpp
+++ b/compiler-rt/lib/builtins/divdf3.cpp
@@ -1,4 +1,4 @@
-//===-- lib/divdf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//===-- lib/divdf3.cpp - double-precision division --------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,7 +10,6 @@
//
//===----------------------------------------------------------------------===//
-#define QUAD_PRECISION
#include "fp_lib.h"
#include "fp_libc_config.h"
diff --git a/compiler-rt/lib/builtins/divtf3.cpp b/compiler-rt/lib/builtins/divtf3.cpp
index 7b16174ce16d9..bd099280aead6 100644
--- a/compiler-rt/lib/builtins/divtf3.cpp
+++ b/compiler-rt/lib/builtins/divtf3.cpp
@@ -1,4 +1,4 @@
-//===-- lib/divtf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//===-- lib/divtf3.cpp - quad-precision division ----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/compiler-rt/lib/builtins/muldf3.cpp b/compiler-rt/lib/builtins/muldf3.cpp
index d1d4c70fdb837..d2effb1c7d665 100644
--- a/compiler-rt/lib/builtins/muldf3.cpp
+++ b/compiler-rt/lib/builtins/muldf3.cpp
@@ -1,4 +1,4 @@
-//===-- lib/muldf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//===-- lib/muldf3.cpp - double-precision multiplication --------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/compiler-rt/lib/builtins/multf3.cpp b/compiler-rt/lib/builtins/multf3.cpp
index bafc7016bddfb..e8324ca302c6e 100644
--- a/compiler-rt/lib/builtins/multf3.cpp
+++ b/compiler-rt/lib/builtins/multf3.cpp
@@ -1,4 +1,4 @@
-//===-- lib/multf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//===-- lib/multf3.cpp - quad-precision multiplication ----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/compiler-rt/lib/builtins/negdf2.cpp b/compiler-rt/lib/builtins/negdf2.cpp
new file mode 100644
index 0000000000000..cc9f190845cf3
--- /dev/null
+++ b/compiler-rt/lib/builtins/negdf2.cpp
@@ -0,0 +1,21 @@
+//===-- lib/negdf2.cpp - double-precision negation --------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __negdf2 implemented on top of LLVM-libc's shared::negdf2 instruction.
+//
+//===----------------------------------------------------------------------===//
+
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/negdf2.h"
+
+extern "C" COMPILER_RT_ABI fp_t __negdf2(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::negdf2(a, b);
+}
diff --git a/compiler-rt/lib/builtins/negsf2.cpp b/compiler-rt/lib/builtins/negsf2.cpp
new file mode 100644
index 0000000000000..2f23bf64b6b57
--- /dev/null
+++ b/compiler-rt/lib/builtins/negsf2.cpp
@@ -0,0 +1,22 @@
+//===-- lib/negsf2.cpp - single-precision negation --------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __negsf2 implemented on top of LLVM-libc's shared::negsf2 instruction.
+//
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/negsf2.h"
+
+extern "C" COMPILER_RT_ABI fp_t __negsf2(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::negsf2(a, b);
+}
diff --git a/compiler-rt/lib/builtins/subdf3.cpp b/compiler-rt/lib/builtins/subdf3.cpp
index c688d7dcab4c9..8ff5e0dc69976 100644
--- a/compiler-rt/lib/builtins/subdf3.cpp
+++ b/compiler-rt/lib/builtins/subdf3.cpp
@@ -1,4 +1,4 @@
-//===-- lib/subdf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//===-- lib/subdf3.cpp - double-precision subtraction -----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,7 +10,6 @@
//
//===----------------------------------------------------------------------===//
-#define QUAD_PRECISION
#include "fp_lib.h"
#include "fp_libc_config.h"
diff --git a/compiler-rt/lib/builtins/subtf3.cpp b/compiler-rt/lib/builtins/subtf3.cpp
index 6868293f4043f..0880d12ddc50d 100644
--- a/compiler-rt/lib/builtins/subtf3.cpp
+++ b/compiler-rt/lib/builtins/subtf3.cpp
@@ -1,4 +1,4 @@
-//===-- lib/subtf3.cpp - Quad-precision addition (libc-backed) --*- C++ -*-===//
+//===-- lib/subtf3.cpp - quad-precision subtraction -------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/libc/shared/builtins.h b/libc/shared/builtins.h
index 7415f7eec4473..457599a22d95b 100644
--- a/libc/shared/builtins.h
+++ b/libc/shared/builtins.h
@@ -25,6 +25,8 @@
#include "builtins/muldf3.h"
#include "builtins/mulsf3.h"
#include "builtins/multf3.h"
+#include "builtins/negdf2.h"
+#include "builtins/negsf2.h"
#include "builtins/subdf3.h"
#include "builtins/subsf3.h"
#include "builtins/subtf3.h"
diff --git a/libc/shared/builtins/negdf2.h b/libc/shared/builtins/negdf2.h
new file mode 100644
index 0000000000000..3322730f39dc6
--- /dev/null
+++ b/libc/shared/builtins/negdf2.h
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This header exposes LLVM-libc's __negdf2 implementation as shared::negdf2 so
+/// that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_NEGDF2_H
+#define LLVM_LIBC_SHARED_BUILTINS_NEGDF2_H
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/negdf2.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::negdf2;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_NEGDF2_H
diff --git a/libc/shared/builtins/negsf2.h b/libc/shared/builtins/negsf2.h
new file mode 100644
index 0000000000000..f8919935d8e84
--- /dev/null
+++ b/libc/shared/builtins/negsf2.h
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This header exposes LLVM-libc's __negsf2 implementation as shared::negsf2 so
+/// that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_NEGSF2_H
+#define LLVM_LIBC_SHARED_BUILTINS_NEGSF2_H
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/negsf2.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::negsf2;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_NEGSF2_H
diff --git a/libc/src/__support/builtins/CMakeLists.txt b/libc/src/__support/builtins/CMakeLists.txt
index a97265e5028d8..d038ebaec9098 100644
--- a/libc/src/__support/builtins/CMakeLists.txt
+++ b/libc/src/__support/builtins/CMakeLists.txt
@@ -81,6 +81,22 @@ add_header_library(
DEPENDS
libc.src.__support.FPUtil.generic.add_sub
libc.src.__support.macros.config
+add_header_library(
+ negsf2
+ HDRS
+ negsf2.h
+ DEPENDS
+ libc.src.__support.macros.config
+ libc.src.__support.FPUtil.fp_bits
+)
+
+add_header_library(
+ negdf2
+ HDRS
+ negdf2.h
+ DEPENDS
+ libc.src.__support.macros.config
+ libc.src.__support.FPUtil.fp_bits
)
add_header_library(
diff --git a/libc/src/__support/builtins/negdf2.h b/libc/src/__support/builtins/negdf2.h
new file mode 100644
index 0000000000000..5e9752509a3d7
--- /dev/null
+++ b/libc/src/__support/builtins/negdf2.h
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This header exposes LLVM-libc's __negdf2 implementation as builtins::negdf2
+/// so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_NEGDF2_H
+#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_NEGDF2_H
+
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace builtins {
+
+// Double-precision negation
+// Mirrors compiler-rt's __negdf2.
+LIBC_INLINE double negdf2(double x) {
+ using FPBits = fputil::FPBits<double>;
+
+ FPBits bits(x);
+ bits.set_sign(bits.sign().negate());
+ return bits.get_val();
+}
+
+} // namespace builtins
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_NEGDF2_H
diff --git a/libc/src/__support/builtins/negsf2.h b/libc/src/__support/builtins/negsf2.h
new file mode 100644
index 0000000000000..81ab53ca7750c
--- /dev/null
+++ b/libc/src/__support/builtins/negsf2.h
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This header exposes LLVM-libc's __negsf2 implementation as builtins::negsf2
+/// so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_NEGSF2_H
+#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_NEGSF2_H
+
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace builtins {
+
+// Single-precision negation
+// Mirrors compiler-rt's __negsf2.
+LIBC_INLINE float negsf2(float x) {
+ using FPBits = fputil::FPBits<float>;
+
+ FPBits bits(x);
+ bits.set_sign(bits.sign().negate());
+ return bits.get_val();
+}
+
+} // namespace builtins
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_NEGSF2_H
diff --git a/libc/test/shared/CMakeLists.txt b/libc/test/shared/CMakeLists.txt
index 0489bd2efaf79..2429f066cfcd3 100644
--- a/libc/test/shared/CMakeLists.txt
+++ b/libc/test/shared/CMakeLists.txt
@@ -835,6 +835,8 @@ add_fp_unittest(
libc.src.__support.builtins.muldf3
libc.src.__support.builtins.mulsf3
libc.src.__support.builtins.multf3
+ libc.src.__support.builtins.negdf3
+ libc.src.__support.builtins.negsf3
libc.src.__support.builtins.subdf3
libc.src.__support.builtins.subsf3
libc.src.__support.builtins.subtf3
diff --git a/libc/test/shared/shared_builtins_test.cpp b/libc/test/shared/shared_builtins_test.cpp
index 3e455f27b42c8..f60774f361c3a 100644
--- a/libc/test/shared/shared_builtins_test.cpp
+++ b/libc/test/shared/shared_builtins_test.cpp
@@ -14,12 +14,14 @@ TEST(LlvmLibcSharedBuiltinsTest, AllFloat) {
EXPECT_FP_EQ(3.0f, LIBC_NAMESPACE::shared::addsf3(1.0f, 2.0f));
EXPECT_FP_EQ(6.0f, LIBC_NAMESPACE::shared::mulsf3(2.0f, 3.0f));
EXPECT_FP_EQ(2.0f, LIBC_NAMESPACE::shared::subsf3(5.0f, 3.0f));
+ EXPECT_FP_EQ(-5.0, LIBC_NAMESPACE::shared::negsf2(5.0));
}
TEST(LlvmLibcSharedBuiltinsTest, AllDouble) {
EXPECT_FP_EQ(3.0, LIBC_NAMESPACE::shared::adddf3(1.0, 2.0));
EXPECT_FP_EQ(3.0, LIBC_NAMESPACE::shared::divdf3(6.0, 2.0));
EXPECT_FP_EQ(6.0, LIBC_NAMESPACE::shared::muldf3(2.0, 3.0));
+ EXPECT_FP_EQ(5.0, LIBC_NAMESPACE::shared::negdf2(-5.0));
EXPECT_FP_EQ(2.0, LIBC_NAMESPACE::shared::subdf3(5.0, 3.0));
}
>From 196fbd027e6ff0e404ba249d5c392b0677fc6ae3 Mon Sep 17 00:00:00 2001
From: hulxv <hulxxv at gmail.com>
Date: Sun, 5 Jul 2026 00:04:42 +0300
Subject: [PATCH 8/9] fix format
---
libc/src/__support/builtins/CMakeLists.txt | 2 ++
libc/src/__support/builtins/negdf2.h | 10 +++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/libc/src/__support/builtins/CMakeLists.txt b/libc/src/__support/builtins/CMakeLists.txt
index d038ebaec9098..fb0de877e33a8 100644
--- a/libc/src/__support/builtins/CMakeLists.txt
+++ b/libc/src/__support/builtins/CMakeLists.txt
@@ -81,6 +81,8 @@ add_header_library(
DEPENDS
libc.src.__support.FPUtil.generic.add_sub
libc.src.__support.macros.config
+)
+
add_header_library(
negsf2
HDRS
diff --git a/libc/src/__support/builtins/negdf2.h b/libc/src/__support/builtins/negdf2.h
index 5e9752509a3d7..9d290fc7750e3 100644
--- a/libc/src/__support/builtins/negdf2.h
+++ b/libc/src/__support/builtins/negdf2.h
@@ -21,14 +21,14 @@
namespace LIBC_NAMESPACE_DECL {
namespace builtins {
-// Double-precision negation
+// Double-precision negation
// Mirrors compiler-rt's __negdf2.
LIBC_INLINE double negdf2(double x) {
- using FPBits = fputil::FPBits<double>;
+ using FPBits = fputil::FPBits<double>;
- FPBits bits(x);
- bits.set_sign(bits.sign().negate());
- return bits.get_val();
+ FPBits bits(x);
+ bits.set_sign(bits.sign().negate());
+ return bits.get_val();
}
} // namespace builtins
>From 42d61081b9c813cc8e6a49be4ad9edc7f28e8108 Mon Sep 17 00:00:00 2001
From: hulxv <hulxxv at gmail.com>
Date: Wed, 8 Jul 2026 03:33:56 +0300
Subject: [PATCH 9/9] add single-precision arithmtics
---
compiler-rt/lib/builtins/CMakeLists.txt | 3 +++
compiler-rt/lib/builtins/addsf3.cpp | 22 ++++++++++++++++++++++
compiler-rt/lib/builtins/mulsf3.cpp | 22 ++++++++++++++++++++++
compiler-rt/lib/builtins/subsf3.cpp | 22 ++++++++++++++++++++++
libc/test/shared/shared_builtins_test.cpp | 1 +
5 files changed, 70 insertions(+)
create mode 100644 compiler-rt/lib/builtins/addsf3.cpp
create mode 100644 compiler-rt/lib/builtins/mulsf3.cpp
create mode 100644 compiler-rt/lib/builtins/subsf3.cpp
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 3a7751425d73f..4c0d4cbc8e796 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -265,14 +265,17 @@ if(COMPILER_RT_USE_LIBC_MATH)
add_definitions(-DCOMPILER_RT_USE_LIBC_MATH)
use_libc_builtin(GENERIC_SOURCES adddf3)
+ use_libc_builtin(GENERIC_SOURCES addsf3)
use_libc_builtin(GENERIC_TF_SOURCES addtf3)
use_libc_builtin(GENERIC_SOURCES divdf3)
use_libc_builtin(GENERIC_TF_SOURCES divtf3)
use_libc_builtin(GENERIC_SOURCES muldf3)
+ use_libc_builtin(GENERIC_SOURCES mulsf3)
use_libc_builtin(GENERIC_TF_SOURCES multf3)
use_libc_builtin(GENERIC_SOURCES negdf2)
use_libc_builtin(GENERIC_SOURCES negsf2)
use_libc_builtin(GENERIC_SOURCES subdf3)
+ use_libc_builtin(GENERIC_SOURCES subsf3)
use_libc_builtin(GENERIC_TF_SOURCES subtf3)
endif()
diff --git a/compiler-rt/lib/builtins/addsf3.cpp b/compiler-rt/lib/builtins/addsf3.cpp
new file mode 100644
index 0000000000000..bb8704334e6f0
--- /dev/null
+++ b/compiler-rt/lib/builtins/addsf3.cpp
@@ -0,0 +1,22 @@
+//===-- lib/addsf3.cpp - libc-backed __addsf3 -------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __addsf3 implemented on top of LLVM-libc's shared::addsf3.
+//
+//===----------------------------------------------------------------------===//
+
+#define SINGLE_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/addsf3.h"
+
+extern "C" COMPILER_RT_ABI fp_t __addsf3(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::addsf3(a, b);
+}
diff --git a/compiler-rt/lib/builtins/mulsf3.cpp b/compiler-rt/lib/builtins/mulsf3.cpp
new file mode 100644
index 0000000000000..d88c8b72078e2
--- /dev/null
+++ b/compiler-rt/lib/builtins/mulsf3.cpp
@@ -0,0 +1,22 @@
+//===-- lib/mulsf3.cpp - libc-backed __mulsf3 -------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __mulsf3 implemented on top of LLVM-libc's shared::mulsf3.
+//
+//===----------------------------------------------------------------------===//
+
+#define SINGLE_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/mulsf3.h"
+
+extern "C" COMPILER_RT_ABI fp_t __mulsf3(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::mulsf3(a, b);
+}
diff --git a/compiler-rt/lib/builtins/subsf3.cpp b/compiler-rt/lib/builtins/subsf3.cpp
new file mode 100644
index 0000000000000..d1cdebc78ff09
--- /dev/null
+++ b/compiler-rt/lib/builtins/subsf3.cpp
@@ -0,0 +1,22 @@
+//===-- lib/subsf3.cpp - libc-backed __subsf3 -------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// __subsf3 implemented on top of LLVM-libc's shared::subsf3.
+//
+//===----------------------------------------------------------------------===//
+
+#define SINGLE_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/subsf3.h"
+
+extern "C" COMPILER_RT_ABI fp_t __subsf3(fp_t a, fp_t b) {
+ return LIBC_NAMESPACE::shared::subsf3(a, b);
+}
diff --git a/libc/test/shared/shared_builtins_test.cpp b/libc/test/shared/shared_builtins_test.cpp
index f60774f361c3a..06657fbda75ae 100644
--- a/libc/test/shared/shared_builtins_test.cpp
+++ b/libc/test/shared/shared_builtins_test.cpp
@@ -15,6 +15,7 @@ TEST(LlvmLibcSharedBuiltinsTest, AllFloat) {
EXPECT_FP_EQ(6.0f, LIBC_NAMESPACE::shared::mulsf3(2.0f, 3.0f));
EXPECT_FP_EQ(2.0f, LIBC_NAMESPACE::shared::subsf3(5.0f, 3.0f));
EXPECT_FP_EQ(-5.0, LIBC_NAMESPACE::shared::negsf2(5.0));
+ EXPECT_FP_EQ(2.0f, LIBC_NAMESPACE::shared::subsf3(5.0f, 3.0f));
}
TEST(LlvmLibcSharedBuiltinsTest, AllDouble) {
More information about the libc-commits
mailing list