Skip to content
Snippets Groups Projects
Commit 650e76e6 authored by Carl Shapiro's avatar Carl Shapiro
Browse files

compiler/x86: load byte and word values through a sap without a temporary

parent db374f49
No related branches found
No related tags found
No related merge requests found
......@@ -186,34 +186,24 @@
(:args (sap :scs (sap-reg))
(offset :scs (signed-reg)))
(:arg-types system-area-pointer signed-num)
,@(unless (eq size :dword)
`((:temporary (:sc ,temp-sc :from (:eval 0) :to (:eval 1))
temp)))
(:results (result :scs (,sc)))
(:result-types ,type)
(:generator 5
(inst mov ,(if (eq size :dword) 'result 'temp)
(make-ea ,size :base sap :index offset))
,@(unless (eq size :dword)
`((inst ,(if signed 'movsx 'movzx)
result temp)))))
(inst ,(if (eq size :dword) 'mov (if signed 'movsx 'movzx))
result
(make-ea ,size :base sap :index offset))))
(define-vop (,ref-name-c)
(:translate ,ref-name)
(:policy :fast-safe)
(:args (sap :scs (sap-reg)))
(:arg-types system-area-pointer (:constant (signed-byte 32)))
(:info offset)
,@(unless (eq size :dword)
`((:temporary (:sc ,temp-sc :from (:eval 0) :to (:eval 1))
temp)))
(:results (result :scs (,sc)))
(:result-types ,type)
(:generator 4
(inst mov ,(if (eq size :dword) 'result 'temp)
(make-ea ,size :base sap :disp offset))
,@(unless (eq size :dword)
`((inst ,(if signed 'movsx 'movzx)
result temp)))))
(inst ,(if (eq size :dword) 'mov (if signed 'movsx 'movzx))
result
(make-ea ,size :base sap :disp offset))))
(define-vop (,set-name)
(:translate ,set-name)
(:policy :fast-safe)
......
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