Skip to content

Fix floating point fast-math intrinsics #32362

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

Merged
merged 2 commits into from
Mar 20, 2016
Merged

Conversation

bluss
Copy link
Member

@bluss bluss commented Mar 19, 2016

The implementation did not handle the case where both operands were constants, which caused an llvm assertion:

rustc: //buildslave//rust-buildbot//slave//nightly-dist-rustc-musl-linux//build//src//llvm//include/llvm/Support/Casting.h:237:
typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::Instruction; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::Instruction*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

@rust-highfive
Copy link
Contributor

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

extern "C" void LLVMRustSetHasUnsafeAlgebra(LLVMValueRef Instr) {
unwrap<Instruction>(Instr)->setHasUnsafeAlgebra(true);
extern "C" void LLVMRustSetHasUnsafeAlgebra(LLVMValueRef V) {
if(auto O = dyn_cast<Instruction>(unwrap<Value>(V))) O->setHasUnsafeAlgebra(true);
Copy link
Member

Choose a reason for hiding this comment

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

Can you put the body on a second line, and call the variable I instead of O? (because it's not an operator, sadly)

@eddyb
Copy link
Member

eddyb commented Mar 19, 2016

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned brson Mar 19, 2016
@bluss bluss force-pushed the float-fast-math branch from 45bce4b to ba89b25 Compare March 19, 2016 21:35
@eddyb
Copy link
Member

eddyb commented Mar 19, 2016

@bors r+ p=1 This is blocking nightlies.

@bors
Copy link
Collaborator

bors commented Mar 19, 2016

📌 Commit ba89b25 has been approved by eddyb

@bors
Copy link
Collaborator

bors commented Mar 19, 2016

⌛ Testing commit ba89b25 with merge 02310fd...

bors added a commit that referenced this pull request Mar 19, 2016
Fix floating point fast-math intrinsics

The implementation did not handle the case where both operands were constants, which caused an llvm assertion:

```
rustc: //buildslave//rust-buildbot//slave//nightly-dist-rustc-musl-linux//build//src//llvm//include/llvm/Support/Casting.h:237:
typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::Instruction; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::Instruction*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
```
@bors bors merged commit ba89b25 into rust-lang:master Mar 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants