mirror of
https://github.com/TinyCC/tinycc.git
synced 2025-11-16 12:34:45 +00:00
Fix float conversion in arm64 backend
This commit is contained in:
@@ -1775,7 +1775,7 @@ ST_FUNC void gen_cvt_ftoi(int t)
|
||||
|
||||
ST_FUNC void gen_cvt_ftof(int t)
|
||||
{
|
||||
int f = vtop[0].type.t;
|
||||
int f = vtop[0].type.t & VT_BTYPE;
|
||||
assert(t == VT_FLOAT || t == VT_DOUBLE || t == VT_LDOUBLE);
|
||||
assert(f == VT_FLOAT || f == VT_DOUBLE || f == VT_LDOUBLE);
|
||||
if (t == f)
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
float fd;
|
||||
|
||||
int
|
||||
test()
|
||||
{
|
||||
// was an internal tcc compiler error with arm64 backend until 2019-11-08
|
||||
if (fd < 5.5) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
// variables
|
||||
|
||||
Reference in New Issue
Block a user