[compiler-rt] [builtins] Start to refactor int to fp conversion functions to use a common implementation (PR #66903)

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 2 06:04:34 PDT 2023


asb wrote:

It turns out it's rather easy to confirm that the old and new implementations are equivalent - clang produces identical IR for the old and new (e.g. `clang -D__SOFTFP__ -I $HOME/repos/llvm-project/compiler-rt/lib/builtins     $HOME/repos/llvm-project/compiler-rt/lib/builtins/floatundidf.c -O3 -emit-llvm -S -o - > newun.s` and similar command lines for other files)

```
$ diff -u oldun.s newun.s 
--- oldun.s	2023-10-02 13:57:32.365216771 +0100
+++ newun.s	2023-10-02 13:57:28.781883109 +0100
@@ -1,5 +1,5 @@
-; ModuleID = 'oldfloatundidf.c'
-source_filename = "oldfloatundidf.c"
+; ModuleID = '/home/asb/repos/llvm-project/compiler-rt/lib/builtins/floatundidf.c'
+source_filename = "/home/asb/repos/llvm-project/compiler-rt/lib/builtins/floatundidf.c"
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-linux-gnu"
```

```
$ diff -u old.s new.s 
--- old.s	2023-10-02 13:53:53.891863432 +0100
+++ new.s	2023-10-02 13:53:43.871862518 +0100
@@ -1,5 +1,5 @@
-; ModuleID = 'oldfloatdidf.c'
-source_filename = "oldfloatdidf.c"
+; ModuleID = '/home/asb/repos/llvm-project/compiler-rt/lib/builtins/floatdidf.c'
+source_filename = "/home/asb/repos/llvm-project/compiler-rt/lib/builtins/floatdidf.c"
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-linux-gnu"
```

https://github.com/llvm/llvm-project/pull/66903


More information about the llvm-commits mailing list