-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationA-floating-pointArea: Floating point numbers and arithmeticArea: Floating point numbers and arithmeticC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
In release mode, this code can break:
/// Converts these packed floats to integers via the floor function.
#[inline]
pub fn floor_to_i32x4(self) -> I32x4 {
unsafe {
x86::_MM_SET_ROUNDING_MODE(x86::_MM_ROUND_DOWN);
let value = I32x4(x86::_mm_cvtps_epi32(self.0));
x86::_MM_SET_ROUNDING_MODE(x86::_MM_ROUND_NEAREST);
value
}
}
Because value
can get reordered after all the rounding mode switches. I'm not sure what the right thing to do here is.
AlphaHot and Tastaturtaste
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationA-floating-pointArea: Floating point numbers and arithmeticArea: Floating point numbers and arithmeticC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.