Commit Graph

207 Commits (a3e5e64eab9946a08fec30b65f78d6a9d03f5220)

Author SHA1 Message Date
Joe Groff 96cb1d5038 glue conversion intrinsics to instructions 2009-10-06 20:13:38 -05:00
Joe Groff f103018580 assert that vconvert's inputs are of the right type 2009-10-06 17:42:36 -05:00
Joe Groff 0cbae3362f math.vectors.conversion vocab with primitive words (to be mapped to intrinsics soon) and a super all-in-one "vconvert" macro wrapping the whole thing 2009-10-06 14:37:16 -05:00
Joe Groff 3e44e0bb02 rename SIMD vmerge and kids to (vmerge), make new vmerge more generally useful 2009-10-05 17:55:39 -05:00
Joe Groff 2d13aa8e6f typo in vmerge-head, vmerge-tail docs 2009-10-05 11:14:14 -05:00
Joe Groff f8a4469c5f go back to using random instead of uniform-random-float in math.vectors.simd tests because the software and SIMD implementations of norm and v. can sporadically diverge when their different operation orders lead to cancellation of catastrophically small inputs 2009-10-03 22:57:04 -05:00
Joe Groff c5993dbb39 fix v? software fallback 2009-10-03 22:37:45 -05:00
Joe Groff dca9d3e535 add %merge-vector-head and %merge-vector-tail instructions to back vmerge 2009-10-03 21:48:53 -05:00
Joe Groff 398b460263 link vmerge into math.vectors docs 2009-10-03 21:48:16 -05:00
Joe Groff a233acf1b2 software version of vmerge word (to be backed by UNPCK instructions on x86 and VMRG instructions on ppc) 2009-10-03 20:22:37 -05:00
Joe Groff 16cccffb71 sprinkle some NaNs onto math.vectors.simd fuzz tests to improve flavor 2009-10-03 11:47:02 -05:00
Joe Groff 335df20713 add intrinsics for v<=, v<, v=, v>, v>=, vunordered? 2009-10-03 11:29:34 -05:00
Joe Groff e2e75c6b3a add intrinsic for vnot/vbitnot 2009-10-02 20:04:28 -05:00
Doug Coleman 4b1b3ffbc7 i messed up a merge. weird 2009-10-02 16:05:00 -05:00
Doug Coleman ff3ed1a3de Merge branch 'master' of git://factorcode.org/git/factor into klazuka
Conflicts:
	basis/math/vectors/vectors-docs.factor
2009-10-02 15:59:19 -05:00
Doug Coleman c10b6d4ba7 Merge branch 'docs' of git://github.com/klazuka/factor into klazuka
Conflicts:
	basis/math/vectors/vectors-docs.factor
2009-10-02 15:58:45 -05:00
Joe Groff 271e6ddde5 give math.vectors shuffle words their own docs subsection in anticipation of having more ops in there 2009-10-02 15:37:49 -05:00
Joe Groff 147a73441f proofreading math.vectors docs 2009-10-02 15:18:42 -05:00
Joe Groff a4f8f87a21 add notes to math.vectors docs about simd booleans 2009-10-02 15:11:06 -05:00
Joe Groff e153d544eb implement vand, vor, vandn, and vxor as bitwise intrinsics for simd types 2009-10-02 14:17:01 -05:00
Keith Lazuka 8f79ea91ba docs: change $subsection to $subsections 2009-10-02 12:15:48 -04:00
Joe Groff 34eb7a9286 change vector logical words to reuse the input sequence types so that they work as simd fallbacks 2009-10-01 23:49:53 -05:00
Joe Groff 0bc690e749 define simd equal? methods as v= vall? 2009-10-01 23:46:37 -05:00
Joe Groff 9d424a1092 Merge branch 'master' of git://factorcode.org/git/factor
Conflicts:
	basis/compiler/codegen/codegen.factor
2009-10-01 23:14:16 -05:00
Joe Groff c08cc860bf create special intrinsic wrappers for 256-vector>scalar operations so that vall?, vany?, vnone? work on 256-vectors 2009-10-01 23:07:10 -05:00
Joe Groff aaeaa9c506 add tests for v=, vany?, vall?, vnone? 2009-10-01 21:24:14 -05:00
Joe Groff 228ad950bb %test-vector instruction for vany?, vall?, vnone? 2009-10-01 15:35:38 -05:00
Joe Groff 94070c11aa %compare-vector instruction (only does v= for now) 2009-10-01 14:31:37 -05:00
Joe Groff 2303c0107e add software vall?, vany?, vnone? words 2009-10-01 13:21:10 -05:00
Slava Pestov 16d08c01e3 math.vectors.simd.functor: don't open-code simd-nth and simd-with if we cannot generate double precision FP code. Should fix illegal instruction trap on CPUs with only SSE1 2009-10-01 07:36:50 -05:00
Joe Groff ef9abec15a write v? and vmask in terms of bitwise ops 2009-10-01 00:09:25 -05:00
Joe Groff 3ba79be651 Revert "add a %blend-vector intrinsic for v?"
This reverts commit 21e4b28b67.
2009-09-30 23:40:37 -05:00
Joe Groff 37a091a188 Merge branch 'master' of git://factorcode.org/git/factor 2009-09-30 23:04:04 -05:00
Joe Groff 21e4b28b67 add a %blend-vector intrinsic for v? 2009-09-30 23:03:59 -05:00
Slava Pestov 65421b111b math.vectors.simd: use fallbacks for hlshift, hrshift, vshuffle if parameter is not a literal;al; element access in int-4 on x86-64 now sign-extends the value; don't throw error at compile time if parameter for vshuffle does not have enough elements 2009-09-30 20:04:37 -05:00
Joe Groff 36918a03d9 accept f and t as elements of literal simd vectors, storing binary all-zeroes or all-ones 2009-09-30 19:04:02 -05:00
Joe Groff d065203df4 break math.vectors docs into subsections 2009-09-30 13:21:25 -05:00
Joe Groff ddcbdae778 Merge branch 'master' of git://factorcode.org/git/factor 2009-09-30 00:07:45 -05:00
Joe Groff f38107c4cd docs for new math.vectors logical ops 2009-09-30 00:07:37 -05:00
Slava Pestov 14e82bcd7a math.vectors.simd: fix bad comparison logic in unit tests 2009-09-29 23:46:21 -05:00
Slava Pestov 1c8662ce4a math.vectors.simd: add vbroadcast intrinsic, fix integer overflow issues 2009-09-29 22:58:20 -05:00
Joe Groff 3c497cd2b8 add a "vmask" vector op to selectively zero out elements 2009-09-29 18:10:36 -05:00
Slava Pestov 2b13245704 math.vectors.simd: add fast intrinsic for 'nth', replace broadcast primitive with shuffles 2009-09-29 04:48:11 -05:00
Slava Pestov a6e8277b2c math.vectors.simd: add vshuffle intrinsic 2009-09-28 23:12:13 -05:00
Slava Pestov db217295b0 Work in progress 2009-09-28 17:31:34 -05:00
Slava Pestov e8243f7504 Fix some load errors in various places 2009-09-28 16:33:39 -05:00
Slava Pestov f08521bf83 Fixing various test failures caused by C type parser change, and clarify C type docs some more 2009-09-28 08:48:39 -05:00
Slava Pestov 1109fb5725 math.vectors.simd: add intrinsic for int-4-boa, uint-4-boa, fix tests for C type parser change, fix software fallback for horizontal shifts 2009-09-28 06:34:22 -05:00
Slava Pestov 10c5fe5933 math.vectors.simd: add hlshift, hrshift (128-bit shift), vbitandn intrinsics 2009-09-28 02:17:46 -05:00
Slava Pestov 23ec1b85e8 Merge branch 'master' of git://factorcode.org/git/factor 2009-09-27 17:18:16 -05:00
Slava Pestov 31cb338fc9 math.vectors.simd: add *-cast words for converting between representations 2009-09-27 17:18:02 -05:00
Joe Groff 4035bf88a1 software implementations of vector logical ops (vand, vor, vxor, vnot, v</=/>, vunordered?, v?) 2009-09-27 13:19:22 -05:00
Slava Pestov be214f9142 math.vectors: remove special handling for negative shifts, now we just say the behavior of vlshift and vrshift with negative shifts is undefined 2009-09-26 02:26:31 -05:00
Slava Pestov 26c83d262c math.vectors: fix SIMD unit tests 2009-09-25 21:44:14 -05:00
Slava Pestov d518bed6b7 math.vectors: change vlshift and vrshift to mask the shift count by HEX: ff, to make them behave consistently with their SIMD counterparts 2009-09-25 18:50:44 -05:00
Slava Pestov e5b94b11d7 Some fixes and cleanups in math.vectors
- Tighten up type inference for operations on complex float arrays
- Fix v. to have correct behavior with complex numbers
- Rename v<< and v>> to vlshift and vrshift to avoid clashing with v>> accessor
2009-09-24 06:58:33 -05:00
Slava Pestov 24039cb56a math.vectors.simd: add v<< and v>> intrinsics for bitwise shifts on elements 2009-09-24 03:32:39 -05:00
Slava Pestov 165496d2f2 Add longlong-2, ulonglong-2, longlong-4, ulonglong-4 SIMD types, fix int-4 multiplication on SSE2 2009-09-23 20:23:25 -05:00
Doug Coleman ebbcfd7ffc fix using 2009-09-23 12:47:20 -05:00
Doug Coleman abb8a221db Merge branch 'master' of git://factorcode.org/git/factor
Conflicts:
	basis/math/vectors/simd/simd-docs.factor
2009-09-23 10:11:49 -05:00
Slava Pestov 7cc383614c math.vectors.simd: Improved documentation 2009-09-23 03:14:06 -05:00
Slava Pestov 8d84bcb61a math and math.vectors: improved documentation 2009-09-23 03:08:45 -05:00
Slava Pestov abac963882 math.vectors.simd: new operations: vabs vsqrt vbitand vbitor vbitxor 2009-09-23 02:47:14 -05:00
Slava Pestov 863ccb61d6 math.vectors.simd: fix all tests 2009-09-23 01:05:19 -05:00
Slava Pestov 66871995c9 math.vectors.simd: add saturated arithmetic operations 2009-09-20 23:16:02 -05:00
Doug Coleman 026761ed62 Merge branch 'master' of git://factorcode.org/git/factor
Conflicts:
	basis/classes/struct/struct-tests.factor
	basis/functors/functors-tests.factor
	basis/specialized-arrays/specialized-arrays-tests.factor
2009-09-20 23:02:49 -05:00
Doug Coleman 47fab85a00 replace usages of <" with """ 2009-09-20 22:42:40 -05:00
Slava Pestov 78c949b9b7 math.vectors: add v+- word which is accelerated by SSE3 2009-09-20 17:43:16 -05:00
Slava Pestov dfb43bd2ca More integer SIMD work
- move generated vocab support from specialized-arrays to vocabs.generated
- add fuzz testing to math.vectors.simd
- add alien type support for integer SIMD vectors
- SIMD: parsing word generates a SIMD type, instead of pre-generating them all in math.vectors.simd
2009-09-20 16:48:17 -05:00
Slava Pestov ea2bcd69c7 math.vectors.simd: redesign to be more flexible, integer SIMD work in progress 2009-09-20 02:08:32 -05:00
Joe Groff 4a1422e7fe move some allocation words that don't really have much to do with c types out of alien.c-types into a new alien.data vocab 2009-09-17 22:36:05 -05:00
Joe Groff 21a0722752 fix more ambiguities 2009-09-17 09:29:23 -05:00
Slava Pestov 18cb09a115 math.vectors.simd: don't run x86-specific tests on PPC 2009-09-11 21:38:40 -05:00
Slava Pestov 527db8995a Specialized array overhaul
- Replace hand-written specialized-arrays.* subvocabularies with new system; instead of USE:ing specialized-arrays.T, do SPECIALIZED-ARRAY: T
- Ditto for specialized-vectors; use SPECIALIZED-VECTOR:
- io.mmap.functor: removed entirely, use <mapped-array> instead
- struct-arrays and struct-vectors have been removed because specialized arrays and vectors subsume them entirely
2009-09-09 22:33:34 -05:00
Slava Pestov 3e90786bc1 Fix various test failures 2009-09-08 19:18:56 -05:00
Slava Pestov 0d01371baf math.vectors.simd: fix help rendering 2009-09-08 14:49:27 -05:00
Slava Pestov c23e1dc1de math.vectors.simd: remove useless dependency 2009-09-08 13:55:56 -05:00
Slava Pestov ab64d187c9 Merge branch 'master' into simd 2009-09-08 13:38:14 -05:00
Slava Pestov 1e9f870e66 math.vectors.specialization: specialized vector words are now subwords of the generic vector word. This ensures that specializations get compiled correctly in all cases 2009-09-08 13:37:25 -05:00
Slava Pestov ef09991500 Fixes 2009-09-08 00:13:18 -05:00
Slava Pestov 1c87486320 math.vectors.simd: allow punning SIMD vectors between types 2009-09-04 02:35:58 -05:00
Slava Pestov 136d6a42f3 math.vectors.simd: slightly faster 'sum' on 256-bit vectors: add the two components then do horizontal add, instead of doing a horizontal add on each one and adding the results 2009-09-04 02:23:25 -05:00
Slava Pestov af14fd78dd math.vectors.simd: docs 2009-09-04 01:22:18 -05:00
Slava Pestov fc195f33f1 functors: support private words with DEFINES-PRIVATE; use this to make some words generated by math.vectors.simd.functor private 2009-09-04 01:21:59 -05:00
Slava Pestov 698f32c4a1 math.vectors.simd: define fallbacks for all vector constructors so that code can still work even if SIMD is not available 2009-09-03 21:37:55 -05:00
Slava Pestov 20dfbf7ac8 More SIMD work
- Rename SIMD types and register representations: <type>-<count> rather than <count><type>-array
- Make a functor to define 256-bit vector types, use it to define float-8 type
- Make SIMD instructions pure-insns so that they participate in value numbering
2009-09-03 20:58:56 -05:00
Slava Pestov 9cc705f6ba math.vectors.simd: split off intrinsics into a sub-vocabulary, to avoid loading most of the SIMD code on bootstrap 2009-09-03 03:43:43 -05:00
Slava Pestov f811208271 Detect SSE version and enable the correct set of SIMD intrinsics 2009-09-03 03:28:38 -05:00
Slava Pestov 52b99c050e Initial implementation of SSE vector intrinsics:
- cpu.architecture: add SSE vector representations
- compiler.cfg.intrinsics.alien: remove an attempt at optimization that value numbering handles now
- compiler.cfg.representations: support instructions where the representation is set in the 'rep' slot, and support conversions between single and double floats
- alien-float, set-alien-float now use the single float representation, and the conversion is implicit; this fixes a long-standing bug where a register could get clobbered because of how %set-alien-float was defined on x86
- math.vectors.specialization: add support for SIMD specialization (where the vector word's body is replaced by another quotation), also specialize the 'sum' word
- math.vectors.simd: 4float-array, 2double-array, 4double-array types, and specializers for the math.vectors words
2009-09-03 02:33:07 -05:00
Slava Pestov f45d80374c alien.structs: struct-type now has a class slot; fix specialized complex-float/double arrays 2009-08-09 16:10:11 -05:00
Slava Pestov 9b4ffd65d3 math.vectors.specialization: first attempt at some call site splitting for vector ops. Specialized array types generate customized variants of all vector words, if input types are known at compile time, a call to the specialized version is inserted 2009-08-09 03:07:33 -05:00
Slava Pestov 189043eae7 compiler.cfg.linear-scan.assignment: insert-copy did the wrong thing if the second interval had been split. Fixes compilation of 'trilerp' 2009-06-30 21:07:39 -05:00
Joe Groff 23ae3f4ab6 homogeneous coordinates coated in nurbsauce 2009-05-21 20:55:44 -05:00
Joe Groff 4dba6979da vector bilerp word 2009-05-20 10:26:55 -05:00
Joe Groff 1216ea2fd8 cut perlin-noise time in half 2009-05-10 10:41:50 -05:00
Joe Groff 1d58b94bf7 send bilerp upstream to spawn 2009-05-09 11:43:04 -05:00
Joe Groff e4c84a91f6 more vector operations; perlin noise vocab 2009-05-05 22:17:04 -05:00
Joe Groff ca0c8937ca lerp functions 2009-05-05 13:55:00 -05:00
Slava Pestov ae0da1cf98 Fix conflict 2009-02-05 22:29:15 -06:00
Joe Groff ccdd8999e1 swizzle word to swizzle sequences 2009-02-04 19:46:19 -06:00
Slava Pestov f79041545a New distance word in math.vectors, replaces distance in math.points, more efficient 2008-11-29 10:19:23 -06:00
Aaron Schaefer e17f519480 Minor documentation fixes 2008-11-17 22:51:57 -05:00
Aaron Schaefer 9c27e9d61b Replace >r r> usage with dip in math.vectors 2008-11-17 18:17:14 -05:00
Slava Pestov c19f2257f4 Fix permission bits 2008-10-02 08:34:49 -05:00
Slava Pestov d5140cf248 Fix math.vectors unit tests 2008-09-12 15:52:43 -05:00
Slava Pestov f497c7e151 Move map-reduce combinator to core, re-implement norm-sq and v. for better performance 2008-09-12 11:29:12 -05:00
Slava Pestov d66f887736 Create basis vocab root 2008-07-28 22:03:13 -05:00