Skip to content

Commit

Permalink
Fix for issue JuliaLang#7687, by using bitcast instead of volatile st…
Browse files Browse the repository at this point in the history
…ore/load to remove extra bits.
  • Loading branch information
Arch D. Robison committed Jul 22, 2014
1 parent c5acc8d commit 698aa38
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,7 @@ static Value *emit_intrinsic(intrinsic f, jl_value_t **args, size_t nargs,
// but if we start looking at more bits we need to actually do the
// rounding first instead of carrying around incorrect low bits.
Value *x = auto_unbox(args[2],ctx);
builder.CreateStore(FP(x), builder.CreateBitCast(prepare_global(jlfloattemp_var),FT(x->getType())->getPointerTo()), true);
return builder.CreateFPExt(builder.CreateLoad(builder.CreateBitCast(prepare_global(jlfloattemp_var),FT(x->getType())->getPointerTo()), true),
return builder.CreateFPExt(builder.CreateBitCast(x,x->getType()),
FTnbits(try_to_determine_bitstype_nbits(args[1],ctx)));
}
HANDLE(select_value,3) {
Expand Down

1 comment on commit 698aa38

@ArchRobison
Copy link
Owner

Choose a reason for hiding this comment

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

Sigh. On i386 platform, this change causes a regression on the test that @JeffBezanson added.

Please sign in to comment.