Skip to content

fix vector fmin/fmax non-fast/fast intrinsics NaN handling #49231

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 1 commit into from
Mar 22, 2018
Merged
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
fix vector fmin/fmax non-fast/fast intrinsics NaN handling
  • Loading branch information
gnzlbg committed Mar 21, 2018
commit e0165af94b034dacde7f9a598c5e72b9c1a1898c
8 changes: 4 additions & 4 deletions src/librustc_trans/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
pub fn vector_reduce_fmin(&self, src: ValueRef) -> ValueRef {
self.count_insn("vector.reduce.fmin");
unsafe {
let instr = llvm::LLVMRustBuildVectorReduceFMin(self.llbuilder, src, true);
let instr = llvm::LLVMRustBuildVectorReduceFMin(self.llbuilder, src, /*NoNaNs:*/ false);
if instr.is_null() {
bug!("LLVMRustBuildVectorReduceFMin is not available in LLVM version < 5.0");
}
Expand All @@ -1046,7 +1046,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
pub fn vector_reduce_fmax(&self, src: ValueRef) -> ValueRef {
self.count_insn("vector.reduce.fmax");
unsafe {
let instr = llvm::LLVMRustBuildVectorReduceFMax(self.llbuilder, src, true);
let instr = llvm::LLVMRustBuildVectorReduceFMax(self.llbuilder, src, /*NoNaNs:*/ false);
if instr.is_null() {
bug!("LLVMRustBuildVectorReduceFMax is not available in LLVM version < 5.0");
}
Expand All @@ -1056,7 +1056,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
pub fn vector_reduce_fmin_fast(&self, src: ValueRef) -> ValueRef {
self.count_insn("vector.reduce.fmin_fast");
unsafe {
let instr = llvm::LLVMRustBuildVectorReduceFMin(self.llbuilder, src, false);
let instr = llvm::LLVMRustBuildVectorReduceFMin(self.llbuilder, src, /*NoNaNs:*/ true);
if instr.is_null() {
bug!("LLVMRustBuildVectorReduceFMin is not available in LLVM version < 5.0");
}
Expand All @@ -1067,7 +1067,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
pub fn vector_reduce_fmax_fast(&self, src: ValueRef) -> ValueRef {
self.count_insn("vector.reduce.fmax_fast");
unsafe {
let instr = llvm::LLVMRustBuildVectorReduceFMax(self.llbuilder, src, false);
let instr = llvm::LLVMRustBuildVectorReduceFMax(self.llbuilder, src, /*NoNaNs:*/ true);
if instr.is_null() {
bug!("LLVMRustBuildVectorReduceFMax is not available in LLVM version < 5.0");
}
Expand Down