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
66dc030741
Merge branch 'master' of git://factorcode.org/git/factor
2009-09-30 11:35:40 -05:00
Joe Groff
409bdadfb8
add a "test-mr." word to compiler.cfg.debugger equivalent to "test-mr mr."
2009-09-30 11:34:19 -05:00
Slava Pestov
785b9f2d43
compiler.cfg.value-numbering: fix overly-zealous ##compare-imm conversion
2009-09-30 05:09:20 -05:00
Slava Pestov
8e201ca4b7
Various minor compiler tweaks: Combine address calculation with dereferencing in alien accessors; convert SIMD XOR of a vector with itself into an XOR of the destination with itself; convert SIMD unbox of zero vector into XOR of the destination with itself; fix SIMD indexing on x86-64
2009-09-30 05:00:36 -05:00
Slava Pestov
ba3a06b745
compiler.cfg.value-numbering: add some more rewrite rules, neg/neg, not/not, and a few for SIMD
2009-09-30 02:18:29 -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
2cdac6059f
compiler.cfg.ssa.destruction: don't coalesce registers with different representations, even if they're in the same register class, since this messes up spilling
2009-09-29 22:28: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
db217295b0
Work in progress
2009-09-28 17:31:34 -05:00
Slava Pestov
dc1b6043dc
cpu.x86: shifts didn't work if dst != src1; re-organize file a bit
2009-09-28 05:39:53 -05:00
Slava Pestov
d9c496c4e4
compiler.cfg.ssa.destruction: we can coalesce two registers with different representations as long as they both belong to the same register class
2009-09-28 03:24:54 -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
f213a67295
compiler.cfg.linear-scan: fix tests for hash order
2009-09-27 23:35:56 -05:00
Slava Pestov
8c9ccdd906
compiler.cfg.linear-scan: tweak it so that register allocation does not depend on hashing order
2009-09-27 23:29:48 -05:00
Slava Pestov
e8cfaccef0
compiler.cfg: nuke ##bignum>integer and ##integer>bignum since they were unused
2009-09-27 20:36:05 -05:00
Slava Pestov
8617ac798e
Add a couple more def-is-use instructions
2009-09-27 20:34:20 -05:00
Slava Pestov
6dd8e4657e
Merge branch 'master' into more_aggressive_coalescing
2009-09-27 19:29:50 -05:00
Slava Pestov
6f2a4eba51
compiler.cfg.linear-scan: fix partial sync point logic in case where dst == src, and clean up spilling code
2009-09-27 19:28:20 -05:00
Slava Pestov
a267100781
compiler.cfg.ssa.destruction: more aggressive coalescing work in progress
2009-09-27 17:17:26 -05:00
sheeple
2b35f52ed2
Merge branch 'slots' of git://factorcode.org/git/factor into slots
...
Conflicts:
basis/cpu/x86/x86.factor
2009-09-26 03:12:42 -05:00
Daniel Ehrenberg
364332bd70
Completing slot and set-slot changes on x86
2009-09-26 01:39:48 -05:00
Daniel Ehrenberg
fb7f6ab455
Making ##slot and ##set-slot not have a temporary parameter
2009-09-26 00:28:14 -05:00
Slava Pestov
6079711ecb
hints: fix regression with declarations
2009-09-25 18:50:08 -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
2ea0b9da1d
Merge branch 'vm_cleanup' of git://github.com/phildawes/factor
2009-09-24 04:31:55 -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
Phil Dawes
67aec74439
cleaned up vm-field-ptr compiler code
2009-09-24 08:16:57 +01:00
Slava Pestov
17bf0c721d
Merge branch 'master' into integer-simd
2009-09-23 02:48:38 -05:00
Slava Pestov
b136ad44d0
compiler.cfg.ssa.cssa: correctly handle overflowing fixnum instructions
2009-09-23 02:47:56 -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
9a7577a58b
Fix test failures in compiler.cfg.linearization.order, compiler.tests.low-level-ir and compiler.graphviz
2009-09-22 05:07:52 -05:00
Slava Pestov
8c2f5543cc
Merge branch 'master' into integer-simd
2009-09-22 03:24:52 -05:00
Slava Pestov
0778c20722
compiler.cfg.linearization.order: basic blocks were being inserted twice if some blocks had repeated successors, causing problems for register allocation
2009-09-22 03:19:23 -05:00
Slava Pestov
e04fba6bc7
Fix conflict
2009-09-20 23:18:07 -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
Phil Dawes
2a1a4ccf27
fixed up getenv compiler intrinsic to use vm struct userenv
2009-09-16 08:16:32 +01:00
Joe Groff
02b797f11b
struct classes now make their own C type without help from alien.structs. remove alien.structs dependencies from everywhere outside of alien and compiler, and have the FFI handle both alien.structs and classes.struct c-types
2009-09-15 17:38:49 -05:00
Slava Pestov
1b5614f974
math.functions: more accurate log10 (fixes problem reported by OneEyed)
2009-09-14 16:19:58 -05:00
Slava Pestov
8c46388272
compiler.cfg.builder: don't run certain tests if float intrinsics are not available
2009-09-13 23:12:47 -05: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
89d6096130
compiler.cfg.intrinsics: compile float-mod as a ##binary-float-function instead of a primitive call
2009-09-11 21:00:17 -05:00
Slava Pestov
66f500bdd7
Fix the build
2009-09-09 13:44:54 -05:00
Slava Pestov
72eec2c53e
compiler.cfg.save-contexts: add new pass
2009-09-08 21:56:28 -05:00
Slava Pestov
092b31910d
compiler: separate ##save-context instruction from ##alien-invoke, generate a ##save-context for libm calls, and add a pass to combine multiple context saves within a basic block. Fixes crashes with FP traps thrown by libm functions on x86-32
2009-09-08 21:50:55 -05:00
Joe Groff
025a5b7b15
split unordered and ordered float comparison intrinsics in compiler; generate only unordered comparisons for now
2009-09-08 17:04:26 -05:00
Slava Pestov
17821626c3
Fix conflicts
2009-09-07 23:51:25 -05:00
Slava Pestov
e20e9008ea
compiler.cfg.value-numbering: update tests for Joe's condition code changes
2009-09-04 03:11:56 -05:00
Slava Pestov
555543faae
compiler: tweak generated code
2009-09-04 03:01: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
8223715a07
compiler.cfg.intrinsics: fix type detection on the alien type for vector accessors
2009-09-04 02:22:54 -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
Joe Groff
0b9e5c034a
add compiler comparison codes for floating-point unordered comparisons; update x86 backend to generate proper code for all floating-point comparisons
2009-09-03 20:32:05 -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
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
775b9af2f7
compiler: eliminate boilerplate by centralizing info in declarative INSN: syntax
2009-09-02 06:22:37 -05:00
Slava Pestov
14a063dd92
cpu.ppc: implement fast float function calls; 3x speedup on benchmark.struct-arrays on PowerPC
2009-09-01 15:19:26 -05:00
Slava Pestov
0cf3151216
compiler.cfg.intrinsics: cleanup: the "intrinsic" word property is now a quotation, not a boolean, making this mechanism more extensible
2009-08-30 22:20:49 -05:00
Slava Pestov
43af9b06a4
compiler.cfg.linear-scan.live-intervals: dead-value-error is never thrown anymore
2009-08-30 05:15:18 -05:00
Slava Pestov
b35a01879e
%box-displaced-alien: fix clobberage found by Doug
2009-08-30 05:11:08 -05:00
Slava Pestov
f6a836d1e9
compiler.cfg.linear-scan now supports partial sync-points where all registers are spilled; taking advantage of this, there are new trigonometric intrinsics which yield a 2x performance boost on benchmark.struct-arrays and a 25% boost on benchmark.partial-sums
2009-08-30 04:52:01 -05:00
Slava Pestov
fa64522421
compiler.cfg.value-numbering: fix ##box-displaced-alien simplification
2009-08-28 19:05:49 -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
c9cba1cc00
compiler.cfg.instructions: forgot that ##box-displaced-alien needs a GC check; fixes segfault in benchmark.mandel
2009-08-27 04:09:35 -05:00
Slava Pestov
9caf3f9248
compiler: new inline intrinsic for <displaced-alien> where the inputs have known types; value numbering now eliminates unnecessary allocation of displaced aliens if the result is immediately unboxed again
2009-08-27 00:06:19 -05:00
Slava Pestov
40b522c9d0
compiler.cfg.linear-scan: fix unit tests for new fake-representations
2009-08-26 08:58:00 -05:00
Slava Pestov
d5fb53d417
compiler.cfg.debugger: fix fake-representations so that low-level-ir tests can pass on x86
2009-08-25 23:44:01 -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
009d3a87f6
Add some unit tests
2009-08-22 17:15:10 -05:00
Slava Pestov
c15555056e
compiler.cfg.dataflow-analysis: when intersecting sets, treat uninitialized sets as universal rather than empty; reduces number of stack instructions generated by 1%
2009-08-20 18:15:41 -05:00
Slava Pestov
54ee3c3d01
compiler.cfg.stacks.local: more accurate local replace set computation; optimizes out 'swap swap'
2009-08-19 22:00:21 -05:00
Slava Pestov
552d069e9f
compiler: add unit tests for new bugs
2009-08-19 16:56:26 -05:00
Daniel Ehrenberg
d93f6ed1f3
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-14 20:11:54 -05:00
Daniel Ehrenberg
595e3b96cd
Improving write barrier elimination; change to compiler.cfg.utilities to support this
2009-08-14 19:41:41 -05:00
Daniel Ehrenberg
54389b5e5c
Write barriers are hoisted out of loops when their target is slot-available
2009-08-13 20:26:44 -05:00
Doug Coleman
9f1030030d
Merge branch 'master' of git://factorcode.org/git/factor
...
Conflicts:
basis/calendar/calendar.factor
2009-08-13 19:40:02 -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
Daniel Ehrenberg
25fad6550f
Global write barrier elimination tracks newly allocated objects
2009-08-13 15:18:47 -05:00
Daniel Ehrenberg
f80416b40e
Fixing write-barrier elimination; adding bb as a parameter to join-sets in dataflow analysis
2009-08-12 23:52:29 -05:00
Daniel Ehrenberg
82d20d292c
Making write barrier elimination global
2009-08-11 21:21:21 -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
12ab2b9e9d
_gc instruction doesn't need slot to hold GC root area size, since that's just tagged-values>> length
2009-08-09 03:08:13 -05:00
Slava Pestov
ca2d989547
compiler.cfg.linearization: change order to fit older unit tests
2009-08-08 23:06:57 -05:00
Slava Pestov
f3903e2ac3
compiler.cfg.two-operand: sometimes we can eliminate a copy in the x = y <op> y case
2009-08-08 20:03:42 -05:00
Slava Pestov
38ef8adde0
compiler.cfg.representation: OK to unbox output of ##load-reference globally
2009-08-08 20:03:13 -05:00
Slava Pestov
88d15dfbea
compiler.cfg: new system to track when results of analyses need to be recomputed (reverse post order, linear order, predecessors, dominance, loops). Passes can now call needs-predecessors, needs-dominance, needs-loops at the beginning, and cfg-changed, predecessors-changd at the end. Linearization order now takes loop nesting into account, and linear scan now uses linearization order instead of RPO.
2009-08-08 20:02:56 -05:00
Slava Pestov
0eebb20780
compiler.cfg.ssa.liveness: fix tests
2009-08-08 16:15:45 -05:00
Slava Pestov
4d289e0844
compiler.cfg.representations: emit-conversion should not be private since CSSA construction uses it
2009-08-08 04:13:30 -05:00
Slava Pestov
2d575d7ec9
compiler.cfg: virtual registers are integers now, and representations are stored off to the side. Fix bug in representation selection that would manifest if a value was used as a float and a fixnum in different branches; cannot globally unbox float in this case
2009-08-08 04:02:18 -05:00
Slava Pestov
4921b819e0
compiler.cfg.representations: new pass to make global unboxing decisions, relies on new compiler.cfg.loop-detection pass for loop nesting information
2009-08-08 00:24:46 -05:00
Slava Pestov
4d2160799f
Split off the notion of a register representation from a register class
2009-08-07 17:44:50 -05:00
Slava Pestov
8b887630a0
compiler.cfg: convert code into two-operand form before SSA destruction; SSA destruction now operates on a relaxed SSA form where multiple defs of the same vreg are allowed, but only within a single basic block. This makes linear scan's coalescing redundant, allowing it to be removed completely
2009-08-05 18:57:46 -05:00
Slava Pestov
7c3d65af21
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-03 10:31:27 -05:00