Changeset 13418


Ignore:
Timestamp:
Jan 29, 2010, 12:52:30 AM (10 years ago)
Author:
gb
Message:

Add (prototype) LAP functions %BIGNUM-LOGIOR, %BIGNUM-LOGAND for PPC64.
We can't assume AltiVec? (POWER3 and other IBM hardware may not support
it), but can at least do 64-bit operations here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/PPC/PPC64/ppc64-bignum.lisp

    r13067 r13418  
    339339
    340340
     341;;; Do LOGIOR on the N 32-bit words in A and B, storing the result in
     342;;; C.  (It's legal and desirable to do this more than 32 bits at a time.)
     343
     344(defppclapfunction %bignum-logior ((n 0) #|ra 0|# (a arg_x) (b arg_y) (c arg_z))
     345  (vpop imm0)
     346  (srwi. imm0 imm0 1)
     347  (la imm2 ppc64::misc-data-offset imm0)
     348  (b @test)
     349  @loop
     350  (cmpwi imm0 4)
     351  (lwzx imm1 a imm3)
     352  (lwzx imm2 b imm3)
     353  (or imm1 imm1 imm2)
     354  (stwx imm1 c imm3)
     355  (subi imm0 imm0 4)
     356  @test
     357  (bne @loop)
     358  (blr))
     359
     360
     361
     362;;; Do LOGAND on the N 32-bit words in A and B, storing the result in
     363;;; C.  (It's legal and desirable to do this more than 32 bits at a time.)
     364
     365(defppclapfunction %bignum-logand ((n 0) #|ra 0|# (a arg_x) (b arg_y) (c arg_z))
     366  (vpop imm0)
     367  (srwi. imm0 imm0 1)
     368  (la imm2 ppc64::misc-data-offset imm0)
     369  (b @test)
     370  @loop
     371  (cmpwi imm0 4)
     372  (lwzx imm1 a imm3)
     373  (lwzx imm2 b imm3)
     374  (and imm1 imm1 imm2)
     375  (stwx imm1 c imm3)
     376  (subi imm0 imm0 4)
     377  @test
     378  (bne @loop)
     379  (blr))
Note: See TracChangeset for help on using the changeset viewer.