Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the new floating point intrinsics #9997

Merged
merged 1 commit into from
Oct 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2797,8 +2797,8 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {

ifn!(intrinsics, "llvm.fabs.f32", [Type::f32()], Type::f32());
ifn!(intrinsics, "llvm.fabs.f64", [Type::f64()], Type::f64());
ifn!(intrinsics, "llvm.copysign.f32", [Type::f32()], Type::f32());
ifn!(intrinsics, "llvm.copysign.f64", [Type::f64()], Type::f64());
ifn!(intrinsics, "llvm.copysign.f32", [Type::f32(), Type::f32()], Type::f32());
ifn!(intrinsics, "llvm.copysign.f64", [Type::f64(), Type::f64()], Type::f64());

ifn!(intrinsics, "llvm.floor.f32",[Type::f32()], Type::f32());
ifn!(intrinsics, "llvm.floor.f64",[Type::f64()], Type::f64());
Expand All @@ -2807,12 +2807,12 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
ifn!(intrinsics, "llvm.trunc.f32",[Type::f32()], Type::f32());
ifn!(intrinsics, "llvm.trunc.f64",[Type::f64()], Type::f64());

ifn!(intrinsics, "llvm.rint.f32",[Type::f64()], Type::f64());
ifn!(intrinsics, "llvm.rint.f64",[Type::f64()], Type::f64());
ifn!(intrinsics, "llvm.nearbyint.f32",[Type::f64()], Type::f64());
ifn!(intrinsics, "llvm.nearbyint.f64",[Type::f64()], Type::f64());
ifn!(intrinsics, "llvm.round.f32",[Type::f64()], Type::f64());
ifn!(intrinsics, "llvm.round.f64",[Type::f64()], Type::f64());
ifn!(intrinsics, "llvm.rint.f32", [Type::f32()], Type::f32());
ifn!(intrinsics, "llvm.rint.f64", [Type::f64()], Type::f64());
ifn!(intrinsics, "llvm.nearbyint.f32", [Type::f32()], Type::f32());
ifn!(intrinsics, "llvm.nearbyint.f64", [Type::f64()], Type::f64());
ifn!(intrinsics, "llvm.round.f32", [Type::f32()], Type::f32());
ifn!(intrinsics, "llvm.round.f64", [Type::f64()], Type::f64());

ifn!(intrinsics, "llvm.ctpop.i8", [Type::i8()], Type::i8());
ifn!(intrinsics, "llvm.ctpop.i16",[Type::i16()], Type::i16());
Expand Down
14 changes: 7 additions & 7 deletions src/librustc/middle/trans/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,20 +460,20 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
"fmaf64" => simple_llvm_intrinsic(bcx, "llvm.fma.f64", 3),
"fabsf32" => simple_llvm_intrinsic(bcx, "llvm.fabs.f32", 1),
"fabsf64" => simple_llvm_intrinsic(bcx, "llvm.fabs.f64", 1),
"copysignf32" => simple_llvm_intrinsic(bcx, "llvm.copysign.f32", 1),
"copysignf64" => simple_llvm_intrinsic(bcx, "llvm.copysign.f64", 1),
"copysignf32" => simple_llvm_intrinsic(bcx, "llvm.copysign.f32", 2),
"copysignf64" => simple_llvm_intrinsic(bcx, "llvm.copysign.f64", 2),
"floorf32" => simple_llvm_intrinsic(bcx, "llvm.floor.f32", 1),
"floorf64" => simple_llvm_intrinsic(bcx, "llvm.floor.f64", 1),
"ceilf32" => simple_llvm_intrinsic(bcx, "llvm.ceil.f32", 1),
"ceilf64" => simple_llvm_intrinsic(bcx, "llvm.ceil.f64", 1),
"truncf32" => simple_llvm_intrinsic(bcx, "llvm.trunc.f32", 1),
"truncf64" => simple_llvm_intrinsic(bcx, "llvm.trunc.f64", 1),
"rintf64" => simple_llvm_intrinsic(bcx, "llvm.rint.f64", 1),
"rintf32" => simple_llvm_intrinsic(bcx, "llvm.rint.f32", 1),
"nearbyintf32" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f64", 1),
"nearbyintf64" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f32", 1),
"roundf32" => simple_llvm_intrinsic(bcx, "llvm.round.f64", 1),
"roundf64" => simple_llvm_intrinsic(bcx, "llvm.round.f32", 1),
"rintf64" => simple_llvm_intrinsic(bcx, "llvm.rint.f64", 1),
"nearbyintf32" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f32", 1),
"nearbyintf64" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f64", 1),
"roundf32" => simple_llvm_intrinsic(bcx, "llvm.round.f32", 1),
"roundf64" => simple_llvm_intrinsic(bcx, "llvm.round.f64", 1),
"ctpop8" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i8", 1),
"ctpop16" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i16", 1),
"ctpop32" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i32", 1),
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3809,8 +3809,8 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
}
"fabsf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
"fabsf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
"copysignf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
"copysignf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
"copysignf32" => (0, ~[ ty::mk_f32(), ty::mk_f32() ], ty::mk_f32()),
"copysignf64" => (0, ~[ ty::mk_f64(), ty::mk_f64() ], ty::mk_f64()),
"floorf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
"floorf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
"ceilf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/unstable/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ extern "rust-intrinsic" {
pub fn fabsf64(x: f64) -> f64;

#[cfg(not(stage0))]
pub fn copysignf32(x: f32) -> f32;
pub fn copysignf32(x: f32, y: f32) -> f32;
#[cfg(not(stage0))]
pub fn copysignf64(x: f64) -> f64;
pub fn copysignf64(x: f64, y: f64) -> f64;

pub fn floorf32(x: f32) -> f32;
pub fn floorf64(x: f64) -> f64;
Expand Down