#126 sqrt~ giving only -inf/inf

v0.39.2
closed-postponed
nobody
5
2007-06-17
2007-04-02
No

For the G4 and Intel optimized builds of Pd-0.39.2-extended-test7 on Mac OS X, sqrt~ only returns -inf or inf. (Does this affect other platforms?) This is probably related to the auto-vectorization. This is not a problem on Pd-0.39.2-extended-test7 that was built for G3s.

Check the sqrt~-help.pd file for a test patch.

sqrt~ of the signal 9 returns -\infty, hence not 3 as expected. All tried int signals greater then zero returns -\infty. To test this, see either the attached patch (which is very close to the help-patch for [sqrt~]) or the help-patch for [sqrt~].

See also:
http://lists.puredata.info/pipermail/pd-list/2007-01/046266.html

Discussion

  • Hans-Christoph Steiner

    Logged In: YES
    user_id=27104
    Originator: YES

    d_math.c, where sqrt.c isn't auto-vectorized, so this is probably caused by a different optimization flag. Or maybe it's related to these warnings:

    d_math.c: In function 'init_rsqrt':
    d_math.c:79: warning: dereferencing type-punned pointer will break strict-aliasing rules
    d_math.c: In function 'q8_rsqrt':
    d_math.c:93: warning: dereferencing type-punned pointer will break strict-aliasing rules
    d_math.c: In function 'q8_sqrt':
    d_math.c:101: warning: dereferencing type-punned pointer will break strict-aliasing rules

     
  • frey

    frey - 2007-04-18

    Logged In: YES
    user_id=1772500
    Originator: NO

    I have this same problem with pd-0.39.2-extended-rc2 on my Intel MacBook.

    It doesn't appear in Miller's vanilla pd-0.40-2, on the same machine.

     
  • stffn

    stffn - 2007-05-05

    Logged In: YES
    user_id=1658640
    Originator: NO

    Still present in the nightly build of RC2 from 5th of May. It does however work in the test build of .040.2-extended of the same date.

     
  • Hans-Christoph Steiner

    • status: open --> pending-postponed
     
  • Hans-Christoph Steiner

    Logged In: YES
    user_id=27104
    Originator: YES

    I removed these from the compiler flags and it seems to have fixed the problem on Intel Macs:

    -ftree-vectorize -ftree-vectorizer-verbose=2

    Please confirm that this is fixed in both Intel and PowerPC.

    This thread discusses the root causes of why the auto-vectorization causes this problem:

    http://lists.puredata.info/pipermail/pd-dev/2007-04/008689.html

    Ideally the root of the problem would be fixed so that we can use auto-vectorization.

     
  • stffn

    stffn - 2007-06-12

    Logged In: YES
    user_id=1658640
    Originator: NO

    In the autobuild from 12th of june it now works on mac-intel (macbook core duo), but - sadly - not on powerpc (ibook G4). Both running Mac OS 10.4.9.

     
  • Hans-Christoph Steiner

    • status: pending-postponed --> open-postponed
     
  • stffn

    stffn - 2007-06-16

    Logged In: YES
    user_id=1658640
    Originator: NO

    Same thing for RC3.

     
  • Hans-Christoph Steiner

    • assigned_to: eighthave --> nobody
    • status: open-postponed --> closed-postponed
     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks