Commit Graph

236 Commits (6b337d8bc6eb848fd1b02caa6270eeeb4f56ffca)

Author SHA1 Message Date
Joe Groff f780bbddc3 deprimitivize tuck and put it to pasture 2009-11-05 22:47:05 -06:00
Daniel Ehrenberg d860a2febb custom inlining for diff and intersect, when given a literal sequence. this cuts off 1/3 of the running time of a microbenchmark 2009-11-05 13:13:27 -06:00
Joe Groff a279b360eb Merge branch 'master' into simd-cleanup
Conflicts:
	basis/math/vectors/simd/functor/functor.factor
2009-11-05 11:27:08 -06:00
Joe Groff 6cf6252753 update compiler.tree.propagation.simd, and don't load it till math.vectors.simd is loaded 2009-11-02 15:09:16 -06:00
Slava Pestov d65296b334 vm: 4 bit tags, new representation of alien objects makes unbox-any-c-ptr more efficient (work in progress) 2009-11-02 04:25:54 -06:00
Joe Groff c6761710a6 Merge branch 'master' of http://factorcode.org/git/factor
Conflicts:
	basis/locals/locals.factor
	basis/peg/peg.factor
	extra/infix/infix.factor
2009-10-28 16:17:24 -05:00
Doug Coleman b5fd809209 memq? -> member-eq?, sorted-memq? -> sorted-member-eq? 2009-10-28 15:02:00 -05:00
Joe Groff 8b6665c57e update existing code for [let change 2009-10-27 22:05:37 -05:00
Slava Pestov 496d8a990e compiler.tree.propagation: fix broken corner cases in bitand and shift transforms, exposed by Hugh Aguilar's LC53 benchmark 2009-10-24 01:09:32 -05:00
Slava Pestov 47d6507548 compiler.tree.propagation.transforms: fix problem with 'shift' transform when input was a bignum 2009-10-23 07:50:56 -05:00
Slava Pestov 0a3029d9f2 compiler: on PPC, ANDI, ORI and XORI instructions take an unsigned 16-bit immediate, unlike ADDI, SUBI and MULLI which take a signed 16-bit immediate. The code generator was not aware of this, and so for example '[ >fixnum -16 bitand ]' would generate incorrect code. Split up small-enough? hook into immediate-arithmetic? and immediate-bitwise? and update value numbering to be aware of this. Fixes classes.struct bitfields test failure 2009-10-19 04:58:29 -05:00
Joe Groff 61befc8bb1 have vshuffle accept simd-128 variable byte shuffles 2009-10-10 11:30:11 -05:00
Slava Pestov 09fac95fad compiler.tree.propagation.branches: fix live-branches computation for #dispatch nodes 2009-10-10 00:23:50 -05:00
Joe Groff 2bfcd7ed81 generate better code for vabs when instruction isn't available instead of using software fallback (-0.0 andn for floats, x > 0 ? x : -x for signed ints, nop for unsigned ints) 2009-10-09 14:24:55 -05:00
Joe Groff 4972fbcbc9 implement vneg as an intrinsic in terms of load -0, subtract 2009-10-09 13:16:39 -05:00
Daniel Ehrenberg 373f4420e9 Another identity in value numbering for bitfields 2009-10-08 15:20:42 -05:00
Daniel Ehrenberg 316895e6bf Adding identity to propagation to remove some redundant bitands 2009-10-08 00:59:15 -05:00
Joe Groff 96cb1d5038 glue conversion intrinsics to instructions 2009-10-06 20:13:38 -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 dca9d3e535 add %merge-vector-head and %merge-vector-tail instructions to back vmerge 2009-10-03 21:48:53 -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
Joe Groff e153d544eb implement vand, vor, vandn, and vxor as bitwise intrinsics for simd types 2009-10-02 14:17:01 -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 3ba79be651 Revert "add a %blend-vector intrinsic for v?"
This reverts commit 21e4b28b67.
2009-09-30 23:40:37 -05:00
Joe Groff 21e4b28b67 add a %blend-vector intrinsic for v? 2009-09-30 23:03:59 -05:00
Slava Pestov 1c8662ce4a math.vectors.simd: add vbroadcast intrinsic, fix integer overflow issues 2009-09-29 22:58:20 -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 ba029a88ff io.mmap: fix obsolete tests and get code to inline better 2009-09-28 03:18:27 -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 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 a4e1d5511e Tweaks to reduce deployed image size 2009-09-24 06:24:43 -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 abac963882 math.vectors.simd: new operations: vabs vsqrt vbitand vbitor vbitxor 2009-09-23 02:47:14 -05:00
Slava Pestov fda8870848 Merge branch 'master' into integer-simd 2009-09-22 20:21:40 -05:00
Slava Pestov f03b54287e compiler.tree.propagation.branches: M: #phi propagate-around was unnecessary 2009-09-22 17:56:50 -05:00
Daniel Ehrenberg 2019c0a747 Merge branch 'master' of git://factorcode.org/git/factor into constraints 2009-09-22 16:09:33 -05:00
Daniel Ehrenberg 198fdc82ab Fixing failing unit tests in compiler.tree.propagation due to constraints 2009-09-22 16:01:14 -05:00
Slava Pestov e6cddf1fa7 Merge branch 'master' of git://factorcode.org/git/factor into integer-simd 2009-09-21 17:58:24 -05:00
Slava Pestov 85c916fedc Rename specific-method to method-for-class, rename (effective-method) to method-for-object, and make both much faster 2009-09-21 17:42:20 -05:00
Slava Pestov 66871995c9 math.vectors.simd: add saturated arithmetic operations 2009-09-20 23:16:02 -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
Joe Groff ac5ea1769b get compiler tests loading 2009-09-16 09:20:47 -05:00
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 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
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 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 b3693e3c3b compiler.tree.propagation: remove method inlining heuristic 2009-08-17 22:29:05 -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 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 a2f52c1e41 compiler.tree.recursive: more accurate loop detection 2009-08-04 19:18:40 -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 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
Daniel Ehrenberg 5a5a6a34b9 fixing stupid bug in propagation 2009-07-16 00:43:54 -05:00
Daniel Ehrenberg a295b28652 define-partial-eval framework in propagation pass makes it easy to add transforms; moving some transforms from stack checker to propagation, making them stronger 2009-07-16 00:34:50 -05:00
Daniel Ehrenberg ad301b07ae new is inlined in the propagation pass when the class is known 2009-07-14 14:16:39 -05:00
Daniel Ehrenberg c6c5be4eb0 call( and execute( inline known quotations/words in the propagation pass 2009-07-14 01:12:45 -05:00
Slava Pestov 511ca9dea0 compiler.tree.propagation: better length propagation 2009-07-09 02:28:30 -05:00
Doug Coleman 8da9d0f203 rename peek -> last and update all usages 2009-05-25 16:38:33 -05:00
Doug Coleman 34e1d60578 add a clamp word to math.order, use clamp word throughout libraries 2009-05-24 21:35:50 -05:00
Slava Pestov ba04d5af1e Update documentation for stricter vocabulary search path semantics 2009-05-16 00:29:21 -05:00
Slava Pestov d7db5edadc Cleaning up USING: lists for new strict semantics 2009-05-14 16:54:16 -05:00
Slava Pestov 302d829ea9 Fix compiler breakage if a GENERIC# has an incorrect stack effect declaration 2009-05-12 21:23:52 -05:00
Slava Pestov 3c19ec1cbb Fix overly-eager strength reduction for mod, and add a type function for >integer (reported by Joe Groff) 2009-05-07 12:32:06 -05:00
Slava Pestov 1e2561f863 Make walker work better with call( and breakpoints which are nested inside combinators 2009-05-05 09:12:32 -05:00
Slava Pestov 2c78b77f36 Fix infinite loop when compiling a word containing a tuple literal with circular structure in it. This was triggered by call( inline caching in core-foundation.fsevents on Mac OS X 2009-05-01 09:36:53 -05:00
Slava Pestov e5cdb7ac2d call( fast-path now supports curry and compose 2009-04-30 21:08:29 -05:00
Slava Pestov 964fbd0a24 Fix test failures from ratio/complex built-in removal 2009-04-30 00:38:55 -05:00
Slava Pestov fc4894fbdf Replace ratio and complex built-in types with tuples defined in the library. This frees up two lo-tags, so move array and quotation over to these tags and update compiler for new tags 2009-04-30 00:27:35 -05:00
Slava Pestov 3dc9fdf9db Fleshed out new dispatch code 2009-04-24 20:43:01 -05:00
Slava Pestov 057f75e9a1 Refactor compiler.tree.builder to fix various regressions 2009-04-21 23:02:00 -05:00
Slava Pestov 469c9ee21d Debugging stack checking 2009-04-21 16:09:53 -05:00