Commit Graph

106 Commits

Author SHA1 Message Date
Dmitry Babokin
8f8a9d89ef Removing trailing spaces in stdlib.ispc 2014-03-12 19:43:30 +04:00
Dmitry Babokin
1c0729df59 Clarifying comment on new functions with saturated arithmetics 2014-03-12 19:40:52 +04:00
Vsevolod Livinskij
dc00b4dd64 Undefined operation -INT64_MIN was fixed. 2014-03-08 20:11:04 +04:00
Vsevolod Livinskij
c2e05e2231 Algorithm was modified and division was changed to bit operations. 2014-02-28 20:06:46 +04:00
Vsevolod Livinskij
af836cda27 Saturating multiplication for int64 was added. 2014-02-23 19:48:03 +04:00
Dmitry Babokin
e8680760bf Merge pull request #741 from Vsevolod-Livinskij/master
Saturation arithmetic.
2014-02-21 12:30:58 +03:00
Dmitry Babokin
f280b32fa4 Merge pull request #736 from egaburov/native_trigonometry
Native trigonometry
2014-02-20 19:18:35 +03:00
Vsevolod Livinskij
735e6a8ab3 Saturation arithmetic mul and div for int8/int16/int32 and div for int64 was added 2014-02-18 02:07:13 +04:00
Vsevolod Livinskij
f5508db24f Saturation arithmetic (sub and add) was added for int32/int64. 2014-02-17 18:55:40 +04:00
Vsevolod Livinskij
cef5b2eb04 Some changes in saturation arithmetic 2014-02-10 12:40:53 +04:00
Vsevolod Livinskij
1c1614d207 Some errors in comments and code were fixed 2014-02-09 21:39:42 +04:00
Evghenii
70a9b286e5 added support for native and double precision trigonometry/transendentals 2014-02-07 15:28:39 +01:00
Evghenii
81aa19a8f0 added use of native_transendentals, need to add IR 2014-02-07 11:49:24 +01:00
evghenii
732a315a4b removed __declspec(safe) duplicate 2014-02-05 13:04:45 +01:00
Evghenii
d3a6693eef adding __have_native_{rsqrtd,rcpd} to select between native support for double precision reciprocals and using slower but safe version in stdlib 2014-02-04 16:29:23 +01:00
Evghenii
fe98fe8cdc added fast approximate rcp(double) accurate to 15 digits 2014-02-04 15:23:34 +01:00
Evghenii
eb1a495a7a added support for fast approximate rsqrt(double). Provide 16 digit accurancy but is over 3x faster than 1/sqrt(double) 2014-02-04 14:44:54 +01:00
Evghenii
b0753dc93d added double-version for rcp 2014-02-02 18:20:05 +01:00
evghenii
3a72e05c3e +1 2014-02-02 18:16:48 +01:00
Vsevolod Livinskij
da02236b3a Scalar realization of no-vec functions was replaced from builtins to stdlib.ispc. 2014-01-20 16:06:34 +04:00
Ilia Filippov
473f1cb4d2 packed_store_active2 2013-12-17 21:14:29 +04:00
Vsevolod Livinskij
9a135c48d9 Functions name change 2013-12-09 00:20:52 +04:00
Vsevolod Livinskij
65768c20ae Added tests for saturation and some fixes for generic and avx target 2013-12-05 00:34:14 +04:00
Vsevolod Livinskij
35a4d1b3a2 Add some AVX2 intrinsics 2013-11-27 00:55:57 +04:00
Vsevolod Livinskij
19f73b2ede uniform signed/unsigned int8/16 2013-11-25 19:16:02 +04:00
james.brodman
4d289b16c2 Redesign after being hit with the KISS bat. 2013-10-23 14:25:43 -04:00
james.brodman
899f85ce9c Initial Support for new stdlib shift operator 2013-10-22 18:06:54 -04:00
Evghenii
6fd21d988d fixed lexer to properly read fortran-notation double constants 2013-09-16 17:15:02 +02:00
egaburov
e2a91e6de5 added support for "d"-suffix 2013-09-16 15:54:32 +02:00
Evghenii
36886971e3 revert lex.ll parse.yy stdlib.ispc to state when all constants are floats 2013-09-13 16:02:53 +02:00
Evghenii
a97eb7b7cb added clamp in double precision 2013-09-13 09:32:59 +02:00
egaburov
7364e06387 added mask64 2013-09-12 12:02:42 +02:00
egaburov
320c41ffcf added svml support. experimental. for some reason all sybmols are visible.. 2013-09-11 15:16:50 +02:00
james.brodman
8db378b265 Revert "Remove support for using SVML for math lib routines."
This reverts commit d9c38b5c1f.
2013-09-04 16:01:58 -04:00
Dmitry Babokin
e06267ef1b Fix for incorrect implementation of reduce_[min|max]_[float|double], it showed up as -O0 2013-08-29 16:16:02 +04:00
Matt Pharr
5b20b06bd9 Add avg_{up,down}_int{8,16} routines to stdlib
These compute the average of two given values, rounding up and down,
respectively, if the result isn't exact.  When possible, these are
mapped to target-specific intrinsics (PADD[BW] on IA and VH[R]ADD[US]
on NEON.)

A subsequent commit will add pattern-matching to generate calls to
these intrinsincs when the corresponding patterns are detected in the
IR.)
2013-08-06 08:41:12 -07:00
Matt Pharr
d9c38b5c1f Remove support for using SVML for math lib routines.
This path was poorly maintained and wasn't actually available on most
targets.
2013-07-31 06:56:48 -07:00
Matt Pharr
b6df447b55 Add reduce_add() for int8 and int16 types.
This maps to specialized instructions (e.g. PSADBW) when available.
2013-07-25 09:46:01 -07:00
Matt Pharr
f7f281a256 Choose type for integer literals to match the target mask size (if possible).
On a target with a 16-bit mask (for example), we would choose the type
of an integer literal "1024" to be an int16.  Previously, we used an int32,
which is a worse fit and leads to less efficient code than an int16
on a 16-bit mask target.  (However, we'd still give an integer literal
1000000 the type int32, even in a 16-bit target.)

Updated the tests to still pass with 8 and 16-bit targets, given this
change.
2013-07-23 17:24:50 -07:00
Matt Pharr
9ba49eabb2 Reduce estimated costs for 8 and 16-bit min() and max() in stdlib.
These actually compile to a single instruction.
2013-07-23 16:52:43 -07:00
Matt Pharr
e7abf3f2ea Add support for mask vectors of 8 and 16-bit element types.
There were a number of places throughout the system that assumed that the
execution mask would only have either 32-bit or 1-bit elements.  This
commit makes it possible to have a target with an 8- or 16-bit mask.
2013-07-23 16:50:11 -07:00
Matt Pharr
83e1630fbc Add support for fast division of varying int values by small constants.
For varying int8/16/32 types, divides by small constants can be
implemented efficiently through multiplies and shifts with integer
types of twice the bit-width; this commit adds this optimization.
    
(Implementation is based on Halide.)
2013-07-23 16:49:56 -07:00
Jean-Luc Duprat
6326924de7 Fixes to the implementations of any() and none() in the stdlib.
These make sure that inactive vector lanes do not interfere with the results
2013-01-18 11:19:54 -08:00
Jean-Luc Duprat
24087ff3cc Expose none() in the ISPC standard library.
On KNC: all(), any() and none() do not generate a redundant movmsk instruction.
2012-11-27 13:38:28 -08:00
Matt Pharr
6412876f64 Remove unused __reduce_add_uint{32,64} target functions.
The stdilb code just calls the signed int{32,64} functions,
which gives the right result for the unsigned case anyway.
The various targets didn't consistently define the unsigned
variants in any case.
2012-09-28 05:55:41 -07:00
Matt Pharr
2c640f7e52 Add support for RDRAND in IvyBridge.
The standard library now provides a variety of rdrand() functions
that call out to RDRAND, when available.

Issue #263.
2012-07-12 06:07:07 -07:00
Matt Pharr
b4a078e2f6 Add foreach_active iteration statement.
Issue #298.
2012-06-22 10:35:43 -07:00
Matt Pharr
46716aada3 Switch to unordered floating point compares.
In particular, this gives us desired behavior for NaNs (all compares
involving a NaN evaluate to true).  This in turn allows writing the
canonical isnan() function as "v != v".

Added isnan() to the standard library as well.
2012-06-20 13:25:53 -07:00
Matt Pharr
fae47e0dfc Update stdlib to not use "in" as a variable name.
Preparation for foreach_unique, which uses that as a keyword.
2012-06-20 10:04:24 -07:00
Matt Pharr
8fd9b84a80 Update seed_rng() in stdlib to take a varying seed.
Previously, we were trying to take a uniform seed and then shuffle that
around to initialize the state for each of the program instances.  This
was becoming increasingly untenable and brittle.

Now a varying seed is expected and used.
2012-05-30 10:35:41 -07:00