Merge lp://staging/~schnetter/pocl/main into lp://staging/~pocl/pocl/trunk

Proposed by Erik Schnetter
Status: Merged
Merged at revision: 236
Proposed branch: lp://staging/~schnetter/pocl/main
Merge into: lp://staging/~pocl/pocl/trunk
Diff against target: 547 lines (+420/-46)
6 files modified
examples/kernel/test_bitselect.cl (+56/-1)
lib/kernel/clz.cl (+0/-42)
lib/kernel/popcount.cl (+0/-2)
lib/kernel/x86_64/abs.cl (+191/-0)
lib/kernel/x86_64/copysign.cl (+172/-0)
tests/testsuite.at (+1/-1)
To merge this branch: bzr merge lp://staging/~schnetter/pocl/main
Reviewer Review Type Date Requested Status
Erik Schnetter Needs Resubmitting
pocl maintaners Pending
Review via email: mp+101128@code.staging.launchpad.net

Description of the change

I have implemented x86-64 optimized (vectorized) versions of copysign and abs.

To post a comment you must log in.
Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

'make check' fails (11: Kernel functions abs bitselect clz max min popcount FAILED (testsuite.at:175) due to a warning:
pocl643LiL//program.cl:126:461386: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] ...
oid test_bitselect_char() { typedef char gtype; typedef char sgtype; typedef uchar ugtype; typedef uchar sugtype; char const *const typename = "char"; ({ typedef int aisgtype[(!((sgtype)0.1 > ...

Revision history for this message
Erik Schnetter (schnetter) wrote :

This compiler warning is there since the code is type-generic and works for both signed and unsigned types. abs() is indeed a superfluous operation for unsigned types. Since OpenCL does not have templates, we need to use if statements instead.

The code now checks the sign bit explicitly instead of comparing to zero. This silences the warning (until the optimizer catches up). The real solution would be to switch off this warning for this code.

review: Needs Resubmitting
lp://staging/~schnetter/pocl/main updated
197. By Erik Schnetter

Check sign bit explicitly to avoid compiler warning

198. By Erik Schnetter

Merge from trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.