Changeset 15112


Ignore:
Timestamp:
Dec 5, 2011, 10:54:48 PM (8 years ago)
Author:
rme
Message:

Use %imm2 instead of the MMX register %mm0 to save an unboxed value
around the consing of a uvector in the following x8664 vinsns:

setup-macptr-allocation
%set-new-macptr-value

setup-bignum-alloc-for-s64-overflow
setup-bignum-alloc-for-u64-overflow
set-bigits-after-fixnum-overflow

handle-fixnum-overflow-inline

In the vinsn handle-fixnum-overflow-inline, in addition to using %imm2
instead of %mm0, tweak the code to be a little smaller.

Remove obsolete vinsn set-bigits-and-header-for-fixnum-overflow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/X8664/x8664-vinsns.lisp

    r15024 r15112  
    12581258     ((header (:u64 #.x8664::imm0))
    12591259      (scaled-size (:u64 #.x8664::imm1))
     1260      (bigits (:u64 #.x8664::imm2))
    12601261      (freeptr (:lisp #.x8664::allocptr))))
    12611262  (jo :overflow)
    12621263  (:uuo-section)
    12631264  :overflow
    1264   (movq (:%q val) (:%q scaled-size))
    1265   (btcq (:$ub 63) (:%q scaled-size))
    1266   (sarq (:$ub x8664::fixnumshift) (:%q scaled-size))
    1267   (btcq (:$ub 60) (:%q scaled-size))
    1268   (movd (:%q scaled-size) (:%mmx x8664::mm0))
    1269   (movq (:$l x8664::two-digit-bignum-header) (:%q header))
    1270   (movq (:$l (- 16 x8664::fulltag-misc)) (:%q scaled-size))
     1265  (movq (:%q val) (:%q bigits))
     1266  (btcq (:$ub 63) (:%q bigits))
     1267  (sarq (:$ub x8664::fixnumshift) (:%q bigits))
     1268  (btcq (:$ub 60) (:%q bigits))
     1269  (movl (:$l x8664::two-digit-bignum-header) (:%l header))
     1270  (xorl (:%l scaled-size) (:%l scaled-size))
     1271  (movb (:$b (- 16 x8664::fulltag-misc)) (:%b scaled-size))
    12711272  (subq (:%q scaled-size) (:rcontext x8664::tcr.save-allocptr))
    12721273  (movq (:rcontext x8664::tcr.save-allocptr) (:%q freeptr))
     
    12801281                (:apply %hard-regspec-value val)))
    12811282   (movq (:%q freeptr) (:%q val)))
    1282   (movq (:%mmx x8664::mm0) (:@ x8664::misc-data-offset (:%q val)))
     1283  (movq (:%q bigits) (:@ x8664::misc-data-offset (:%q val)))
    12831284  (jmp no-overflow))
    1284 
    1285    
    1286 ;;; This handles the 1-bit overflow from addition/subtraction/unary negation
    1287 (define-x8664-vinsn set-bigits-and-header-for-fixnum-overflow
    1288     (()
    1289      ((val :lisp)
    1290       (no-overflow
    1291        :label))
    1292      ((header (:u64 #.x8664::imm0))
    1293       (scaled-size (:u64 #.x8664::imm1))))
    1294   (jno no-overflow)
    1295   (movq (:%q val) (:%q scaled-size))
    1296   (sarq (:$ub x8664::fixnumshift) (:%q scaled-size))
    1297   (movq (:$q #xe000000000000000) (:%q header))
    1298   (xorq (:%q header) (:%q scaled-size))
    1299   (movd (:%q scaled-size) (:%mmx x8664::mm0))
    1300   (movq (:$l x8664::two-digit-bignum-header) (:%q header))
    1301   (movq (:$l (- 16 x8664::fulltag-misc)) (:%q scaled-size)))
    13021285
    13031286(define-x8664-vinsn %set-z-flag-if-s64-fits-in-fixnum (((dest :imm))
     
    13241307(define-x8664-vinsn setup-bignum-alloc-for-s64-overflow (()
    13251308                                                         ((src :s64)))
    1326   (movd (:%q src) (:%mmx x8664::mm0))
     1309  (movq (:%q src) (:%q x8664::imm2))
    13271310  (movl (:$l x8664::two-digit-bignum-header) (:%l x8664::imm0.l))
    13281311  (movl (:$l (- 16 x8664::fulltag-misc)) (:%l x8664::imm1.l)))
     
    13341317                                                         ((src :s64)))
    13351318  (testq (:%q src) (:%q src))
    1336   (movd (:%q src) (:%mmx x8664::mm0))
     1319  (movq (:%q src) (:%q x8664::imm2))
    13371320  (movl (:$l x8664::two-digit-bignum-header) (:%l x8664::imm0.l))
    13381321  (movl (:$l (- 16 x8664::fulltag-misc)) (:%l x8664::imm1.l))
     
    13621345(define-x8664-vinsn set-bigits-after-fixnum-overflow (()
    13631346                                                      ((bignum :lisp)))
    1364   (movq (:%mmx x8664::mm0) (:@ x8664::misc-data-offset (:%q bignum))))
     1347  (movq (:%q x8664::imm2) (:@ x8664::misc-data-offset (:%q bignum))))
    13651348 
    13661349                                                       
     
    24432426(define-x8664-vinsn setup-macptr-allocation (()
    24442427                                             ((src :address)))
    2445   (movd (:%q src) (:%mmx x8664::mm0))
     2428  (movq (:%q src) (:%q x8664::imm2))
    24462429  (movl (:$l x8664::macptr-header) (:%l x8664::imm0.l))
    24472430  (movl (:$l (- x8664::macptr.size x8664::fulltag-misc)) (:%l x8664::imm1.l)))
     
    24492432(define-x8664-vinsn %set-new-macptr-value (()
    24502433                                           ((ptr :lisp)))
    2451   (movq (:%mmx x8664::mm0) (:@ x8664::macptr.address (:%q ptr))))
     2434  (movq (:%q x8664::imm2) (:@ x8664::macptr.address (:%q ptr))))
    24522435
    24532436(define-x8664-vinsn mem-ref-c-fullword (((dest :u32))
Note: See TracChangeset for help on using the changeset viewer.