{"action":"created","issue":{"url":"https://api.github.com/repos/jfalcou/nt2/issues/964","labels_url":"https://api.github.com/repos/jfalcou/nt2/issues/964/labels{/name}","comments_url":"https://api.github.com/repos/jfalcou/nt2/issues/964/comments","events_url":"https://api.github.com/repos/jfalcou/nt2/issues/964/events","html_url":"https://github.com/jfalcou/nt2/issues/964","id":111275650,"number":964,"title":"expression template optimization issue?","user":{"login":"timblechmann","id":792880,"avatar_url":"https://avatars.githubusercontent.com/u/792880?v=3","gravatar_id":"","url":"https://api.github.com/users/timblechmann","html_url":"https://github.com/timblechmann","followers_url":"https://api.github.com/users/timblechmann/followers","following_url":"https://api.github.com/users/timblechmann/following{/other_user}","gists_url":"https://api.github.com/users/timblechmann/gists{/gist_id}","starred_url":"https://api.github.com/users/timblechmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timblechmann/subscriptions","organizations_url":"https://api.github.com/users/timblechmann/orgs","repos_url":"https://api.github.com/users/timblechmann/repos","events_url":"https://api.github.com/users/timblechmann/events{/privacy}","received_events_url":"https://api.github.com/users/timblechmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-13T21:31:48Z","updated_at":"2015-10-15T11:00:27Z","closed_at":null,"body":"the following little function has quite a weird behaviour:\r\n```\r\ntemplate< typename Arg0, typename Arg1 >\r\nauto doPow ( Arg0 sig, Arg1 level )\r\n{\r\n\treturn boost::simd::copysign( nt2::pow_abs( sig, level ), sig );\r\n}\r\n```\r\n\r\nfor some reasons, the copysign seems to be optimized away, when using the function.\r\n\r\n```\r\n    template <typename SampleType, typename LevelType>\r\n    static SampleType doDistort(SampleType sig, LevelType level)\r\n    {\r\n        // this yields the correct result:\r\n        std::cout << boost::simd::copysign( nt2::pow_abs( sig, level ), sig ) << std::endl;\r\n\r\n        // this always yields the positive result\r\n        std::cout << doPow( sig, level ) << std::endl;\r\n\r\n        return doPow( sig, level );\r\n    }\r\n```\r\n\r\ni'm not totally sure what causes this issue, could simply be a compiler bug in gcc's c++14 support ... but maybe it isn't ...\r\n"},"comment":{"url":"https://api.github.com/repos/jfalcou/nt2/issues/comments/148351768","html_url":"https://github.com/jfalcou/nt2/issues/964#issuecomment-148351768","issue_url":"https://api.github.com/repos/jfalcou/nt2/issues/964","id":148351768,"user":{"login":"timblechmann","id":792880,"avatar_url":"https://avatars.githubusercontent.com/u/792880?v=3","gravatar_id":"","url":"https://api.github.com/users/timblechmann","html_url":"https://github.com/timblechmann","followers_url":"https://api.github.com/users/timblechmann/followers","following_url":"https://api.github.com/users/timblechmann/following{/other_user}","gists_url":"https://api.github.com/users/timblechmann/gists{/gist_id}","starred_url":"https://api.github.com/users/timblechmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timblechmann/subscriptions","organizations_url":"https://api.github.com/users/timblechmann/orgs","repos_url":"https://api.github.com/users/timblechmann/repos","events_url":"https://api.github.com/users/timblechmann/events{/privacy}","received_events_url":"https://api.github.com/users/timblechmann/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T11:00:27Z","updated_at":"2015-10-15T11:00:27Z","body":"actually i am: \"-ffast-math -fno-finite-math-only\", compare https://github.com/timblechmann/nova-nt2-ugens/blob/master/sc-plugin-builder.cmake.\r\n\r\ni had this issue with gcc-5, as no other compiler is able to compile my c++14 code, clang++-3.7 and ubuntu's g++-6 snapshot both have compile failures in nt2/boost.simd"}}