zoav1602
6/14/2015 10:19:00 AM
Hello, group!
Just out of curiousity, when does SBCL generate a CMOV assembler instruction? I expected to see it in the disiassembly of the following function:
(lambda (x)
(declare (type (simple-array fixnum (10)) x)
(optimize speed (debug 0) (safety 0)))
(let ((v (aref x 9)))
(declare (type fixnum v))
(dotimes (i 9 v)
(declare (type fixnum i))
(if (< v (aref x i))
(setf v (aref x i)))))
But I see only ordinary MOV instructions in the output:
; disassembly for (LAMBDA (X))
; Size: 48 bytes. Origin: #x100935F0C2
; C2: 488B4B49 MOV RCX, [RBX+73] ; no-arg-parsing entry point
; C6: 31C0 XOR EAX, EAX
; C8: EB19 JMP L2
; CA: 660F1F440000 NOP
; D0: L0: 488B548301 MOV RDX, [RBX+RAX*4+1]
; D5: 4839D1 CMP RCX, RDX
; D8: 7D05 JNL L1
; DA: 488B4C8301 MOV RCX, [RBX+RAX*4+1]
; DF: L1: 4883C002 ADD RAX, 2
; E3: L2: 4883F812 CMP RAX, 18
; E7: 7CE7 JL L0
; E9: 488BD1 MOV RDX, RCX
; EC: 488BE5 MOV RSP, RBP
; EF: F8 CLC
; F0: 5D POP RBP
; F1: C3 RET
My platform is x86-64. What should I change in the code to obtain CMOV?
Sincerely yours,
A.Z.