Skip to content
Snippets Groups Projects
Commit 755f7a80 authored by Raymond Toy's avatar Raymond Toy
Browse files

Fix #98: Use FSTP instruction with appropriate size

Instead of printing `FSTP` and `FSTPD`, print `FSTP DWORD PTR` and
`FSTP QWORD PTR` to store a single-float and double-float value to
memory.

Clang likes this form better than the original, but gcc accepts both.
parent 5e87a39a
No related branches found
No related tags found
No related merge requests found
...@@ -2636,7 +2636,8 @@ ...@@ -2636,7 +2636,8 @@
;;; store single from st(0) and pop ;;; store single from st(0) and pop
;;; ;;;
(define-instruction fstp (segment dest) (define-instruction fstp (segment dest)
(:printer floating-point ((op '(#b001 #b011)))) (:printer floating-point ((op '(#b001 #b011)))
'('fstp :tab 'dword " " 'ptr " " reg/mem))
(:emitter (:emitter
(cond ((fp-reg-tn-p dest) (cond ((fp-reg-tn-p dest)
(emit-byte segment #b11011101) (emit-byte segment #b11011101)
...@@ -2648,7 +2649,8 @@ ...@@ -2648,7 +2649,8 @@
;;; store double from st(0) and pop ;;; store double from st(0) and pop
;;; ;;;
(define-instruction fstpd (segment dest) (define-instruction fstpd (segment dest)
(:printer floating-point ((op '(#b101 #b011)))) (:printer floating-point ((op '(#b101 #b011)))
'('fstp :tab 'qword " " 'ptr " " reg/mem))
(:printer floating-point-fp ((op '(#b101 #b011)))) (:printer floating-point-fp ((op '(#b101 #b011))))
(:emitter (:emitter
(cond ((fp-reg-tn-p dest) (cond ((fp-reg-tn-p dest)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment