Raymond Toy pushed to branch issue-425-correctly-rounded-math-functions at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/compiler/x86/sse2-c-call.lisp
    ... ... @@ -36,33 +36,12 @@
    36 36
     		   :from :eval :to :result) edx)
    
    37 37
       (:temporary (:sc single-stack) temp-single)
    
    38 38
       (:temporary (:sc double-stack) temp-double)
    
    39
    -  #+core-math
    
    40
    -  (:temporary (:sc unsigned-stack) save-fpu-cw)
    
    41
    -  #+core-math
    
    42
    -  (:temporary (:sc unsigned-stack) fpu-cw)
    
    43
    -  #+core-math
    
    44
    -  (:temporary (:sc unsigned-reg :offset esi-offset) temp-cw)
    
    45 39
       (:node-var node)
    
    46 40
       (:vop-var vop)
    
    47 41
       (:save-p t)
    
    48 42
       (:ignore args ecx edx)
    
    49 43
       (:guard (backend-featurep :sse2))
    
    50 44
       (:generator 0
    
    51
    -    #+core-math
    
    52
    -    (progn
    
    53
    -      ;; Save the x87 FPU control word.  Then modify it to set the
    
    54
    -      ;; precision bits to 3 for 64-bit mantissas for 80-bit
    
    55
    -      ;; arithmetic.  If we don't some of some special functions
    
    56
    -      ;; return incorrect values because the x87 precision was set to
    
    57
    -      ;; single.
    
    58
    -      (inst fnstcw save-fpu-cw)
    
    59
    -      (move temp-cw save-fpu-cw)
    
    60
    -      (inst and temp-cw (dpb 0 (byte 2 8) #xffff)) ; Zap the precision control bits
    
    61
    -      (inst or temp-cw (dpb 3 (byte 3 8) 0)) ; Set precision control bits
    
    62
    -      (move fpu-cw temp-cw)
    
    63
    -      (inst fldcw fpu-cw)		; New CW
    
    64
    -      )
    
    65
    -
    
    66 45
         (cond ((policy node (> space speed))
    
    67 46
     	   (move eax function)
    
    68 47
     	   (inst call (make-fixup (extern-alien-name "call_into_c") :foreign)))
    
    ... ... @@ -84,10 +63,7 @@
    84 63
     	 (inst movss xmm0-tn (ea-for-sf-stack temp-single)))
    
    85 64
     	(double-reg
    
    86 65
     	 (inst fstpd (ea-for-df-stack temp-double))
    
    87
    -	 (inst movsd xmm0-tn (ea-for-df-stack temp-double)))))
    
    88
    -    ;; Restore the x87 FPU control settings
    
    89
    -    #+core-math
    
    90
    -    (inst fldcw save-fpu-cw)))
    
    66
    +	 (inst movsd xmm0-tn (ea-for-df-stack temp-double)))))))
    
    91 67
     
    
    92 68
     (define-vop (alloc-number-stack-space)
    
    93 69
       (:info amount)