+(define-vop (%%pop-dx)
+ (:args (ptr :scs (any-reg)))
+ (:ignore ptr)
+ (:generator 1
+ (bug "VOP %%POP-DX is not implemented.")))
+
+(define-vop (%%nip-dx)
+ (:args (last-nipped-ptr :scs (any-reg) :target dest)
+ (last-preserved-ptr :scs (any-reg) :target src)
+ (moved-ptrs :scs (any-reg) :more t))
+ (:results (r-moved-ptrs :scs (any-reg) :more t))
+ (:temporary (:sc any-reg) src)
+ (:temporary (:sc any-reg) dest)
+ (:temporary (:sc non-descriptor-reg) temp)
+ (:ignore r-moved-ptrs
+ last-nipped-ptr last-preserved-ptr moved-ptrs
+ src dest temp)
+ (:generator 1
+ (bug "VOP %%NIP-DX is not implemented.")))
+
+(define-vop (%%nip-values)
+ (:args (last-nipped-ptr :scs (any-reg) :target dest)
+ (last-preserved-ptr :scs (any-reg) :target src)
+ (moved-ptrs :scs (any-reg) :more t))
+ (:results (r-moved-ptrs :scs (any-reg) :more t))
+ (:temporary (:sc any-reg) src)
+ (:temporary (:sc any-reg) dest)
+ (:temporary (:sc non-descriptor-reg) temp)
+ (:ignore r-moved-ptrs)
+ (:generator 1
+ (move last-preserved-ptr src)
+ (move last-nipped-ptr dest)
+ (inst comb :>= src csp-tn DONE :nullify t)
+ LOOP
+ (inst ldwm n-word-bytes src temp)
+ (inst addi n-word-bytes dest dest)
+ (storew temp dest -1)
+ (inst comb :> csp-tn src LOOP)
+ (inst nop)
+ DONE
+ (move dest csp-tn)
+ (inst sub src dest src)
+ (loop for moved = moved-ptrs then (tn-ref-across moved)
+ while moved do
+ (sc-case (tn-ref-tn moved)
+ ((descriptor-reg any-reg)
+ (inst sub (tn-ref-tn moved) src (tn-ref-tn moved)))
+ ((control-stack)
+ (load-stack-tn temp (tn-ref-tn moved))
+ (inst sub temp src temp)
+ (store-stack-tn (tn-ref-tn moved) temp))))))