Add "trunc" function

Implemented using
- LLVM intrinsics on POSIX (available since at least LLVM 3.3)
- direct calls to trunc/truncf on NaCl
- custom implementation on Windows, which I believe should work on
  all reasonable versions of VC++

I tested the three implementations on Linux, so they work in theory...
Improve implementation of round_f64 on Windows

It now also works for negative numbers, and adding 0.49999999999999994 instead
of 0.5 should guard rounding errors for numbers (almost) halfway between
integers. See http://blog.frama-c.com/index.php?post/2013/05/02/nearbyintf1

Note that this implementation still rounds incorrectly for extremely large
values (>2^52), where it uses the current rounding mode of the CPU instead of
rounding away from zero.
Actually change constant from 0.5

see explanation in 6a0e568de2ab0
Add SSE4.1 and AVX implementations of trunc
Add trunc for OpenCL
Add trunc for PTX
Add fract function
Merge branch 'master' into trunc
Fix typo in definition of fract
Change round intrinsics to round-to-even on ties
Add unit test for rounding functions

Tests scalar and vector functions for float and double arguments for a range
of values that are easy to get wrong in rounding algorithms.
Add test case for 2x vectorization
Fix function attributes
Merge branch 'master' into trunc
Document algorithm for custom round function
Turns out trunc and round llvm intrinsics work fine on win32
Merge pull request #484 from halide/trunc

Add trunc and fract operators, unify rounding behavior