Gábor Spaits
28dd55b973
[RISCV][GISel] Do libcall for G_FPTOSI, G_FPTOUI when no D or F support ( #94613 )
...
When compiling the following code:
```cpp
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdbool.h>
int main() {
int a;
float f;
scanf("%d", &a);
scanf("%f", &f);
a += (int)f;
return a;
}
```
for `-march=rv32ima_zbb` we get a libcall:
```
call scanf
lw a0, -20(s0)
call __fixsfsi
mv a1, a0
```
When we try to use GlobalISel we get this error:
```
error in backend: unable to legalize instruction: %9:_(s32) = G_FPTOSI %8:_(s32) (in function: main)
```
(Here is a link to a reproducer in Godblot:
https://godbolt.org/z/f67vEEb41 )
The goal of this PR is to do a libcall for the legalization of
`G_FPTOSI` and `G_FPTOUI` instead of doing a fallback to Selection DAG
to do the same libcall later.
2024-06-07 21:27:49 +02:00
..
2024-06-07 21:45:49 +08:00
2024-04-29 10:11:28 -07:00
2024-06-07 21:27:49 +02:00
2024-04-24 09:29:20 -07:00
2024-05-29 13:00:15 -07:00
2024-02-26 12:12:31 +00:00
2024-06-04 08:10:58 +08:00
2024-04-28 11:32:37 +08:00
2024-04-23 15:12:36 -07:00
2024-03-27 23:03:13 +08:00
2024-01-19 14:44:47 -08:00
2024-05-15 23:37:31 +08:00
2024-04-16 15:40:32 -07:00
2024-06-03 17:27:02 +08:00
2024-03-21 15:38:43 +08:00
2024-05-14 08:06:10 -07:00
2024-04-17 10:42:40 +08:00
2024-06-03 11:12:27 +01:00
2024-04-24 14:24:14 +01:00
2024-06-06 13:21:04 -07:00
2024-04-24 14:24:14 +01:00
2024-04-05 17:02:03 -07:00
2024-04-03 15:27:15 -07:00
2024-05-08 11:22:16 +08:00
2024-05-08 11:22:16 +08:00
2024-06-07 10:07:47 -07:00
2024-04-12 08:45:47 -07:00
2024-06-07 10:07:47 -07:00
2024-03-20 08:44:24 -07:00
2024-02-08 23:38:19 -08:00
2024-03-07 14:03:58 -08:00
2024-02-07 16:03:30 +08:00
2024-05-23 12:10:46 -04:00
2024-06-07 15:55:16 +08:00
2024-06-07 15:55:16 +08:00
2024-06-07 15:55:16 +08:00
2024-06-07 21:45:49 +08:00
2024-04-16 13:55:45 +08:00
2024-05-08 10:13:01 -07:00
2024-02-16 15:35:09 +08:00
2024-02-01 10:58:21 -08:00
2024-05-08 10:13:01 -07:00
2024-03-28 08:38:18 -07:00
2024-04-15 22:33:14 -07:00
2024-02-08 23:38:19 -08:00
2023-12-30 15:40:20 +08:00
2024-01-29 15:58:54 +00:00
2024-04-08 16:40:02 +08:00
2024-05-03 11:11:29 -04:00
2024-06-07 21:45:49 +08:00
2024-06-07 21:45:49 +08:00
2024-06-07 09:57:03 -07:00
2024-05-29 13:00:15 -07:00
2024-01-25 17:10:49 +08:00
2024-03-27 13:40:38 +08:00
2024-05-28 15:05:23 -07:00
2023-12-07 18:21:38 -08:00
2024-04-24 14:24:14 +01:00
2024-05-28 15:05:23 -07:00
2024-05-24 14:31:14 -04:00
2024-05-15 21:09:43 +01:00
2024-02-07 14:30:45 -08:00
2024-05-08 11:22:16 +08:00
2024-05-13 16:04:09 -07:00
2024-04-08 13:35:37 +08:00
2024-05-14 14:44:25 +08:00
2024-05-03 11:11:29 -04:00
2024-05-24 14:31:14 -04:00
2024-05-30 08:47:27 -07:00
2024-05-30 08:47:27 -07:00
2024-05-03 11:11:29 -04:00
2024-05-03 11:11:29 -04:00
2024-05-23 12:10:46 -04:00
2024-04-16 13:55:45 +08:00
2024-03-14 06:02:42 -07:00
2024-05-03 11:11:29 -04:00
2024-05-03 11:11:29 -04:00
2024-01-25 17:10:49 +08:00
2024-05-24 14:31:14 -04:00
2024-03-19 21:27:25 -07:00
2024-06-04 08:10:58 +08:00
2024-03-11 13:57:06 +08:00
2024-03-11 13:57:06 +08:00
2024-05-22 13:38:39 -07:00
2024-04-24 10:51:18 +01:00