Professional Web Applications Themes

vsub (AltiVec subtraction) in vDSP.h - operand reversal in G4/G5 - Mac Programming

I have encountered some strange behaviour using Apple's vector subtraction function vsub() from vDSP.h extern void vsub( const float input1[], SInt32 stride1, const float input2[], SInt32 stride2, float result[], SInt32 strideResult, According to the pdf file provided by Apple, input2 should be subtracted * from* input1. However on my G4 system, the function stored the opposite subtraction. I assumed this was a typo in the doentation, and used the function with arguments ordered 'backwards' with respect to the doentation. Everything worked fine - the function is used in several places in my code. However when I built the same source ...

  1. #1

    Default vsub (AltiVec subtraction) in vDSP.h - operand reversal in G4/G5

    I have encountered some strange behaviour using Apple's vector
    subtraction function vsub() from vDSP.h

    extern void
    vsub(
    const float input1[],
    SInt32 stride1,
    const float input2[],
    SInt32 stride2,
    float result[],
    SInt32 strideResult,

    According to the pdf file provided by Apple, input2 should be subtracted *
    from* input1. However on my G4 system, the function stored the opposite
    subtraction. I assumed this was a typo in the doentation, and used
    the function with arguments ordered 'backwards' with respect to the
    doentation. Everything worked fine - the function is used in several
    places in my code.

    However when I built the same source code on my dual G5, the vsub result
    was as predicted in the doentation and I had erroneous sign reversals
    in my code.

    Of course this is solved with a simple #ifdef, but I am wondering if
    this is a known issue. It seems like the doentation is wrong for the
    G4.

    As I've noted before, there is amazingly little on these vDSP functions
    on UseNet - searching Google groups for vdsp and vsub returns zero hits!
    Who uses this stuff?

    ER
    Eric Guest

  2. #2

    Default Re: vsub (AltiVec subtraction) in vDSP.h - operand reversal in G4/G5

    Eric Raas wrote: 

    Maybe the difference isn't G4 vs G5, but different OS versions on the
    two machines (i.e. perhaps a bug in whatever OS version you're running
    on the G4 got fixed in OS X 10.2.7) ?
     

    A good place to ask questions of this sort is on the AltiVec mailing
    list hosted at simdtech.org:

    List-Post: <mailto:org>
    List-Help: <mailto:org>
    List-Unsubscribe: <mailto:org>
    List-Subscribe: <mailto:org>

    Paul

    Paul Guest

  3. #3

    Default Re: vsub (AltiVec subtraction) in vDSP.h - operand reversal in G4/G5

    ... 

    Both machines are running their respective versions of 10.2.8 (with or
    without the G5 tag). I guess they are not _exactly_ the same OS
    versions...
     
    >
    > A good place to ask questions of this sort is on the AltiVec mailing
    > list hosted at simdtech.org:[/ref]

    Thanks for the tip - maybe I'll subscribe. I've been burned before on
    mailing lists when spammers got on (e.g. PyOpenGL...)
     
    Eric Guest

  4. #4

    Default Re: vsub (AltiVec subtraction) in vDSP.h - operand reversal in G4/G5

    Eric Raas wrote: 
    >
    >
    > Thanks for the tip - maybe I'll subscribe. I've been burned before on
    > mailing lists when spammers got on (e.g. PyOpenGL...)
    >[/ref]

    It's a very civilised list - low volume (a few posts a day), high SNR,
    with some very knowledgeable and helpful contributors (and I'm on there
    too ;-)). And it's been spam free, so far.

    Paul

    Paul Guest

Similar Threads

  1. string reversal
    By Jeremy Watts in forum PHP Development
    Replies: 3
    Last Post: April 22nd, 12:02 PM
  2. Array subtraction, like sets
    By Robin Sheat in forum PERL Beginners
    Replies: 7
    Last Post: February 1st, 04:18 AM
  3. altivec, no apparant speedup
    By Keith in forum Mac Programming
    Replies: 3
    Last Post: October 7th, 02:13 AM
  4. Split complex vectors and AltiVec FFT's
    By Eric Raas in forum Mac Programming
    Replies: 4
    Last Post: September 21st, 05:18 PM
  5. Info on Altivec convolution function (conv) in vDSP.h
    By Eric Raas in forum Mac Programming
    Replies: 2
    Last Post: September 12th, 09:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139