Commit Graph

251 Commits (e33857a0c33519052a4f293184cb3a225b6fa0bf)

Author SHA1 Message Date
Slava Pestov aeb6a01710 compiler.tree.propagation: fix unary-op type functions with complex number inputs 2009-09-15 14:30:20 -07:00
Slava Pestov 427bfb4ab8 math: add unordered comparison operators u< u<= u> u>= which behave exactly like < <= > >= except no floating point exceptions are set if one or both inputs are NaNs; also add efficient intrinsic for unordered? predicate, and fix propagation type functions for abs, absq, and bitnot 2009-09-12 22:20:13 -05:00
Slava Pestov 10423e0d56 compiler.tree.propagation: convert /i of a positive integer by a power of two into a shift 2009-09-11 21:03:11 -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 88b4780096 Merge branch 'master' of git://factorcode.org/git/factor 2009-09-08 14:22:52 -05:00
Slava Pestov 8eeeeb5c5b inline alien-vector and set-alien-vector if SIMD is not available for a small speedup 2009-09-08 13:56:17 -05:00
Doug Coleman 551c06db2d Merge branch 'master' of git://factorcode.org/git/factor 2009-09-08 13:22:52 -05:00
Slava Pestov 17821626c3 Fix conflicts 2009-09-07 23:51:25 -05:00
Slava Pestov b279c5751c compiler.tree.propagation: type check inputs to unsafe foldable words manually, so that stuff like [ "Hi" { } fixnum+fast ] doesn't crash in the compiler 2009-09-07 23:40:23 -05:00
Slava Pestov 0b35d79aee compiler.tree.propagation.call-effect: stronger call( inlining; now can inline 'a [ b ] curry call(' where 'a' is literal, [ b ] doesn't infer, but [ a b ] does infer. This simplifies classes.struct:memory>struct 2009-09-07 17:45:03 -05:00
Slava Pestov 1f5193198b compiler: clean up code generation for alien boxing/unboxing a bit 2009-09-03 21:22:43 -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 11aadb74af compiler.tree.propagation: type function for clone had an issue, sometimes clone would get optimized out because of incorrect constant folding 2009-09-03 02:40:18 -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 f30aa5d20e compiler: add fixnum-min/max intrinsics; ~10% speedup on benchmark.yuv-to-rgb 2009-08-28 19:02:59 -05:00
Slava Pestov 99bf9fadfb Performance improvements to make struct-arrays benchmark faster
- improved optimization of ##unbox-any-c-ptr on ##box-displaced-alien; convert it to ##unbox-c-ptr where possible using class info stored in the ##bda instruction
- make fcos, fsin, etc inline again; everything in math.libm inline again, except for fsqrt which is an intrinsic
- convert min and max on floats to float-min and float-max
- make min and max not inline, so that the above can work
- struct-arrays: rice a bit so that more fixnums come up
2009-08-28 05:21:16 -05:00
Slava Pestov 5f33f7306f compiler.tree.propagation.transforms: don't fail to compile if 'at' called on something that's not an assoc 2009-08-27 18:57:56 -05:00
Slava Pestov 4fe0257169 cpu.x86: use SQRTSD instruction for math.libm:fsqrt word 2009-08-25 23:22:15 -05:00
Slava Pestov 0bfbcd2108 compiler.tree.modular-arithmetic: fix regression; set-alien-*-1 was not always open-coded 2009-08-20 17:56:49 -05:00
Slava Pestov 78f8d02ed4 compiler.tree.modular-arithmetic: eliminate >bignum calls where possible, convert fixnum-shift to fixnum-shift-fast if shift count is positive, don't run if there are no modular values 2009-08-20 03:47:45 -05:00
Slava Pestov b57894a78c compiler.tree.propagation: bitand custom inlining was wrong if the second input was a bignum 2009-08-20 03:47:07 -05:00
Slava Pestov c9cc1fa6a9 Fix interval inference of abs, absq when input is a complex number 2009-08-19 16:06:37 -05:00
Slava Pestov 75137bafb1 compiler.tree.propagation: improved interval inference for absq eliminates a conditional from math.vectors:distance. Type inference for rational math also a bit sharper now 2009-08-19 02:33:41 -05:00
Slava Pestov 79a3f6b0d5 compiler: inline singleton predicates, and optimize predicate engines, reduces terrain demo deployed size by ~20kb 2009-08-17 23:59:24 -05:00
Slava Pestov b3693e3c3b compiler.tree.propagation: remove method inlining heuristic 2009-08-17 22:29:05 -05:00
Slava Pestov a742145fd9 compiler.tree.modular-arithmetic: >fixnum elimination and value info annotations were too aggressive 2009-08-17 01:20:25 -05:00
Slava Pestov aeb33f5f15 compiler.tree.modular-arithmetic: stronger optimization handles > 1 usages case as well as values defined and used in loops. Eliminates 5 out of 8 >fixnum calls in benchmark.yuv-to-rgb 2009-08-15 18:42:41 -05:00
Doug Coleman 7c3824639e move if-zero etc to math, remove 1-/1+ from math 2009-08-14 14:27:23 -05:00
Doug Coleman d1ce837569 Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places, minor refactoring 2009-08-13 19:21:44 -05:00
Slava Pestov 6f2170eb02 More accurate wrap-interval in compiler.tree.propagation.info fixes test regression; constructing an interval with endpoints at infinity now outputs full-interval 2009-08-12 03:25:53 -05:00
Slava Pestov 5f0390d83b alien.complex: fix tests 2009-08-11 14:07:33 -05:00
Philipp Brüschweiler 3dc33b67a9 various doc fixes 2009-08-11 16:58:47 +02:00
Slava Pestov 7956e63fc2 compiler.tree.propagation: be more careful with intervals, ensuring that the inferred interval of a value is a subset of the value class's interval. This improves accuracy, for example [ >fixnum 1 + >fixnum most-positive-fixnum <= ] constant-folds to true 2009-08-10 01:16:49 -05:00
Slava Pestov 55d1b76ad7 compiler.tree.escape-analysis: if the output of an #introduce node has an immutable tuple class type declaration, and it is not passed to any subroutine calls, or returned from the word, then unbox it. This speeds up vector arithmetic words on specialized arrays, because the specialized array is unboxed up-front, eliminating an indirection on every loop iteration 2009-08-09 16:29:21 -05:00
Slava Pestov 638f5b6579 More accurate interval inference for mod, rem, and propagation can now infer intervals in the case where a value might be f. so, [ [ 127 bitand ] [ drop f ] if dup [ 0 >= ] [ not ] if ] now constant-folds down to 't'! 2009-08-08 23:03:45 -05:00
Slava Pestov 26531ddf8b More accurate interval-mod and interval-rem 2009-08-08 22:01:12 -05:00
Slava Pestov 6ce9bcc658 compiler.graphviz: add high-level IR call graph rendering 2009-08-05 03:33:06 -05:00
Slava Pestov b22a530511 compiler.tree.recursive: have to check tail call flag of call tree edges too 2009-08-05 02:14:49 -05:00
Slava Pestov a2f52c1e41 compiler.tree.recursive: more accurate loop detection 2009-08-04 19:18:40 -05:00
Slava Pestov 4b87ee4ebd compiler.tree.recursive: add some more more loop detection tests 2009-08-04 16:23:14 -05:00
Slava Pestov 00254d1bde compiler.cfg.ssa.destruction: new implementation: simpler and more correct 2009-08-02 10:26:52 -05:00
Slava Pestov 49ac00097e compiler.tree.propagation.call-effect: fix case where quotation inlining could enter an infinite loop: [ dup call( quot -- ) ] dup call( quot -- ) etc 2009-08-01 23:34:14 -05:00
Slava Pestov 420e28b8bd compiler.tree.propagation.info: fix load error 2009-07-27 00:30:24 -05:00
Slava Pestov 99601d34fa compiler.cfg.utilities: move value-info utilities to compiler.tree.propagation.info 2009-07-26 21:10:33 -05:00
Slava Pestov df874c3b50 compiler.tree.finalization: undo a change that resulted in a compile time regression 2009-07-18 03:33:24 -05:00
Slava Pestov 9e6e61edfa compiler.cfg: Move tail call optimization to the end, compiler.tree: simplify finalization pass because of this 2009-07-17 22:57:28 -05:00
Slava Pestov d053f88431 compiler.tree.propagation.transforms: fix shift transform 2009-07-17 00:02:57 -05:00
Slava Pestov 39a70db831 Improve code generation for shift word: add intrinsics for fixnum-shift-fast in the case where the shift count is not constant, transform 1 swap shift into a more overflow check with open-coded fast case, transform bitand into fixnum-bitand in more cases 2009-07-16 23:50:48 -05:00
Slava Pestov 99faf3c79f Overflowing fixnum intrinsics now expand into several CFG nodes. This speeds up the common case since only the uncommon case is now a stack syncpoint 2009-07-16 18:29:40 -05:00