| ... |
... |
@@ -1380,7 +1380,7 @@ |
|
1380
|
1380
|
float-modes)
|
|
1381
|
1381
|
|
|
1382
|
1382
|
;; Extract the control and status words from the FPU. The low 16 bits
|
|
1383
|
|
-;; contain the control word, and the high 16 bits contain the status.
|
|
|
1383
|
+;; contain the status word, and the high 16 bits contain the control.
|
|
1384
|
1384
|
(define-vop (x87-floating-point-modes)
|
|
1385
|
1385
|
(:results (res :scs (unsigned-reg)))
|
|
1386
|
1386
|
(:result-types unsigned-num)
|
| ... |
... |
@@ -1396,12 +1396,16 @@ |
|
1396
|
1396
|
(inst byte #x66) ; operand size prefix
|
|
1397
|
1397
|
(inst or sw-reg cw-stack)
|
|
1398
|
1398
|
(inst xor sw-reg #x3f) ; invert exception mask
|
|
1399
|
|
- (move res sw-reg)))
|
|
|
1399
|
+ (move res sw-reg)
|
|
|
1400
|
+ ;; Put status word in the low 16 bits and the control word in the
|
|
|
1401
|
+ ;; high 16 bits. This is to match the SSE2 mxcsr register that has
|
|
|
1402
|
+ ;; the status bits (sticky bits) in lowest part of the word.
|
|
|
1403
|
+ (inst rol res 16)))
|
|
1400
|
1404
|
|
|
1401
|
1405
|
;; Set the control and status words from the FPU. The low 16 bits
|
|
1402
|
|
-;; contain the control word, and the high 16 bits contain the status.
|
|
|
1406
|
+;; contain the status word, and the high 16 bits contain the control.
|
|
1403
|
1407
|
(define-vop (x87-set-floating-point-modes)
|
|
1404
|
|
- (:args (new :scs (unsigned-reg) :to :result :target res))
|
|
|
1408
|
+ (:args (new-modes :scs (unsigned-reg) :to :result :target res))
|
|
1405
|
1409
|
(:results (res :scs (unsigned-reg)))
|
|
1406
|
1410
|
(:arg-types unsigned-num)
|
|
1407
|
1411
|
(:result-types unsigned-num)
|
| ... |
... |
@@ -1410,7 +1414,12 @@ |
|
1410
|
1414
|
(:temporary (:sc unsigned-stack) cw-stack)
|
|
1411
|
1415
|
(:temporary (:sc byte-reg :offset al-offset) sw-reg)
|
|
1412
|
1416
|
(:temporary (:sc unsigned-reg :offset ecx-offset) old)
|
|
|
1417
|
+ (:temporary (:sc unsigned-reg) new)
|
|
1413
|
1418
|
(:generator 6
|
|
|
1419
|
+ (move new new-modes)
|
|
|
1420
|
+ ;; Put the status word in the high 16 bits and the control word in
|
|
|
1421
|
+ ;; the low 16 bits.
|
|
|
1422
|
+ (inst rol new 16)
|
|
1414
|
1423
|
(inst mov cw-stack new)
|
|
1415
|
1424
|
(inst xor cw-stack #x3f) ; invert exception mask
|
|
1416
|
1425
|
(inst fnstsw)
|
| ... |
... |
@@ -1425,7 +1434,7 @@ |
|
1425
|
1434
|
(inst fldenv (make-ea :dword :base esp-tn))
|
|
1426
|
1435
|
(inst add esp-tn 28)
|
|
1427
|
1436
|
DONE
|
|
1428
|
|
- (move res new)))
|
|
|
1437
|
+ (move res new-modes)))
|
|
1429
|
1438
|
|
|
1430
|
1439
|
|
|
1431
|
1440
|
(defun sse2-floating-point-modes ()
|