core: Remove trunc
The behavior of trunc is already implemented by casts and is therefore redundant.
This commit is contained in:
parent
4dbe07a0c0
commit
fd787ca3f5
@ -1525,14 +1525,6 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
|
|||||||
&[(float, "x")],
|
&[(float, "x")],
|
||||||
"llvm.fabs.f64",
|
"llvm.fabs.f64",
|
||||||
),
|
),
|
||||||
create_fn_by_intrinsic(
|
|
||||||
primitives,
|
|
||||||
&var_map,
|
|
||||||
"trunc",
|
|
||||||
float,
|
|
||||||
&[(float, "x")],
|
|
||||||
"llvm.trunc.f64",
|
|
||||||
),
|
|
||||||
create_fn_by_intrinsic(
|
create_fn_by_intrinsic(
|
||||||
primitives,
|
primitives,
|
||||||
&var_map,
|
&var_map,
|
||||||
@ -2002,7 +1994,6 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
|
|||||||
"log10",
|
"log10",
|
||||||
"log2",
|
"log2",
|
||||||
"fabs",
|
"fabs",
|
||||||
"trunc",
|
|
||||||
"sqrt",
|
"sqrt",
|
||||||
"rint",
|
"rint",
|
||||||
"tan",
|
"tan",
|
||||||
|
@ -95,10 +95,6 @@ def test_ceil64():
|
|||||||
for x in [-1.5, -0.5, 0.5, 1.5]:
|
for x in [-1.5, -0.5, 0.5, 1.5]:
|
||||||
output_int64(ceil64(x))
|
output_int64(ceil64(x))
|
||||||
|
|
||||||
def test_trunc():
|
|
||||||
for x in [-1.5, -0.5, 0.5, 1.5, dbl_inf(), -dbl_inf(), dbl_nan()]:
|
|
||||||
output_float64(trunc(x))
|
|
||||||
|
|
||||||
def test_sqrt():
|
def test_sqrt():
|
||||||
for x in [1.0, 2.0, 4.0, dbl_inf(), -dbl_inf(), dbl_nan()]:
|
for x in [1.0, 2.0, 4.0, dbl_inf(), -dbl_inf(), dbl_nan()]:
|
||||||
output_float64(sqrt(x))
|
output_float64(sqrt(x))
|
||||||
@ -232,7 +228,6 @@ def run() -> int32:
|
|||||||
test_floor64()
|
test_floor64()
|
||||||
test_ceil()
|
test_ceil()
|
||||||
test_ceil64()
|
test_ceil64()
|
||||||
test_trunc()
|
|
||||||
test_sqrt()
|
test_sqrt()
|
||||||
test_rint()
|
test_rint()
|
||||||
test_tan()
|
test_tan()
|
||||||
|
Loading…
Reference in New Issue
Block a user