Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Address arithmetic in Altivec?



Title: Address arithmetic in Altivec?

Hi All,

  Met preface this by saying that this is perhaps the most ridiculous question I've ever asked, I know what I am going to ask isn't ideal or a wise thing to do or try.

  OK. 

  Is it possible to use Altivec to perform address addition and/or multiplication.  An example scalar version:

void myfunc(float *array){

  int arrayAddition[] = {1,2,6,8};

  for(i=0;i<4;i++){
     float *newAddress = array + arrayAddition[i];
  }
}

  Obviously this is out of context and not complete but hopefully the idea of what I was asking is clear.  So if you could load a vector with the address of 'array' and then add to that address simultaneously the values of 'arrayAddition'...?

    I'm missing something here, and I've tried figuring it out and looking at the AltivecPIM.  To help put this in context, the question arose after a discussion with a collegue about vectorizing a piece of code that calculates 2D projections of 3D electron density maps in polar coordinates.  He has already written the scalar version.  If the above is possible then we could do this, but if not, then I'll have to try another route.  Again, I know it's not ideal, but is it possible?

  Any help would be greatly appreciated.

  Dave

David W. Gohara, Ph.D.
Harvard Medical School
http://www.scianafilms.com
617-432-1216 (p)
617-432-4360 (f)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.