Skip to content

Commit

Permalink
fix the new floating point intrinsics
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Oct 21, 2013
1 parent ebb9b46 commit 462a28d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
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

5 comments on commit 462a28d

@bors
Copy link
Contributor

@bors bors commented on 462a28d Oct 21, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 462a28d Oct 21, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging thestinger/rust/float = 462a28d into auto

@bors
Copy link
Contributor

@bors bors commented on 462a28d Oct 21, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thestinger/rust/float = 462a28d merged ok, testing candidate = d65dbe2

@bors
Copy link
Contributor

@bors bors commented on 462a28d Oct 21, 2013

@bors
Copy link
Contributor

@bors bors commented on 462a28d Oct 21, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = d65dbe2

Please sign in to comment.