Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (13 sloc) 442 Bytes
;;; -*- mode:lisp; indent-tabs-mode: nil; -*-
(in-package fast-compute)
(ffi:clines "#include <xmmintrin.h>")
(defun allow-denormalized-floats (&optional (enable-p t))
(= 0
(ffi:c-inline ((if enable-p 1 0)) (:int) :int
"{ unsigned status = _mm_getcsr();
@(return) = (status & 0x8040);
if (#0)
status &= ~0x8040;
else
status |= 0x8040;
_mm_setcsr(status); }")))