Skip to content

Commit

Permalink
Ignore deprecation of _mm_getcsr() and _mm_setcsr()
Browse files Browse the repository at this point in the history
Using inline assembly would require 1.75 as MSRV.
  • Loading branch information
sdroege committed Jun 3, 2024
1 parent 233462a commit 2e2ac55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,16 @@ impl Filter {
))]
mod ftz {
#[cfg(target_arch = "x86")]
#[allow(deprecated)]
use std::arch::x86::{_mm_getcsr, _mm_setcsr, _MM_FLUSH_ZERO_ON};
#[cfg(target_arch = "x86_64")]
#[allow(deprecated)]
use std::arch::x86_64::{_mm_getcsr, _mm_setcsr, _MM_FLUSH_ZERO_ON};

pub struct Ftz(u32);

impl Ftz {
#[allow(deprecated)]
unsafe fn new() -> Self {
let csr = _mm_getcsr();
_mm_setcsr(csr | _MM_FLUSH_ZERO_ON);
Expand All @@ -403,6 +406,7 @@ mod ftz {
}

impl Drop for Ftz {
#[allow(deprecated)]
fn drop(&mut self) {
unsafe {
_mm_setcsr(self.0);
Expand Down

0 comments on commit 2e2ac55

Please sign in to comment.