Slava Pestov
c677c35de4
compiler.cfg: fix major facepalm with write barrier elimination
2010-09-05 21:39:45 -07:00
Slava Pestov
3323284db4
stack-checker.alien: get a bit more inlining going with callbacks, to expose another bug
2010-09-05 21:27:39 -07:00
Slava Pestov
25ed4dd298
compiler.tests: forgot to check in x87-regression test way back
2010-08-20 18:36:26 -07:00
Slava Pestov
3384fcd96d
compiler: update tests for void being parsed like a real word
2010-08-15 13:01:42 -07:00
Slava Pestov
1985705413
compiler: now that FFI has been deconcatenatized, we no longer need the special ##unary-float-function and ##binary-float-function fastpaths
2010-08-13 23:59:19 -07:00
Slava Pestov
b5fc39c198
compiler.cfg: Reading the return value of a float-returning function on x86-32 had a side effect of popping the x87 stack, so it was not correct for DCE to just eliminate this if the return value was not used. Fix this by adding a new dead-outputs slot to alien-call-insns and having DCE move dead returns there
2010-08-13 23:19:56 -07:00
Slava Pestov
42b858b3f0
math.libm: fix regression: fsqrt intrinsic was not working ever since change was made to inline FUNCTION: bodies
2010-08-12 21:41:57 -07:00
Slava Pestov
723d780703
stack-checker.alien: generate a declaration for input parameter types
2010-07-30 15:50:05 -04:00
Slava Pestov
94f6ac98de
compiler.cfg.linear-scan: fix bad interaction between inactive intervals and sync points
2010-07-29 21:06:48 -04:00
Slava Pestov
0f4c5d2bff
classes.algebra: make it work better to fix bug reported by Sascha Matzke
2010-07-29 19:57:23 -04:00
Slava Pestov
168dd1f825
FFI rewrite part 7: compile callback bodies with the optimizing compiler
2010-07-28 00:49:26 -04:00
Slava Pestov
5fc9aa05b0
Revert "compiler.cfg: change linear ordering to place GC call blocks at the end"
...
This reverts commit 544a288192
.
2010-07-27 23:58:41 -04:00
Slava Pestov
8adde5360a
compiler.cfg: change linear ordering to place GC call blocks at the end
2010-07-27 13:00:28 -04:00
Slava Pestov
355d89e8e8
compiler.cfg: now that kill-blocks cannot contain instructions that define vregs we can skip them all
2010-07-27 12:40:31 -04:00
Slava Pestov
c04de94b96
compiler.tree.finalization: record dependencies on inlined predicates
2010-07-23 16:31:15 -07:00
Slava Pestov
b6fe62299e
compiler.cfg.alias-analysis: factor-call-insns which defined values were not handled properly
2010-07-19 19:56:00 -04:00
Slava Pestov
b23aac1beb
compiler.cfg: open-code parameter boxing and unboxing for certain C types
2010-07-19 10:25:13 -04:00
Slava Pestov
8e46305288
compiler.cfg.save-contexts: don't insert ##save-context in front of ##phi
2010-07-19 09:27:10 -04:00
Slava Pestov
adc9db3ea8
compiler.cfg.linear-scan.allocation: fix wrong order
2010-07-19 06:46:50 -04:00
Slava Pestov
b776a92546
compiler.cfg.linear-scan: fix bad interaction between split position calculation and register-clobbering instructions
2010-07-18 17:38:52 -04:00
Slava Pestov
e2ceb11337
stack-checker: calling 'boa' on a non-tuple would compile as a no-op rather than an error (reported by Joe Groff); clean up some other error reporting code too
2010-07-17 15:57:44 -04:00
Slava Pestov
e3edb2653d
compiler.cfg.intrinsics.allot: clean up
2010-07-16 20:04:03 -04:00
Slava Pestov
e5dd21b0b9
compiler.cfg: nuke ##allot-byte-array instruction
2010-07-16 19:57:45 -04:00
Slava Pestov
446ee6896d
alien.data: remove second quotation parameter from with-out-parameters, now all values are copied properly and calling 'clone' on structs in this quotation is not necessary
2010-07-16 17:32:05 -04:00
Slava Pestov
5b31cbcb3c
alien.data: document with-scoped-allocation and with-out-parameters, and add initial: syntax
2010-07-16 17:13:38 -04:00
Slava Pestov
60ddbd9d9b
compiler.cfg.scheduling: ##dispatch must go at the end since its a control flow transfer
2010-07-15 20:55:31 -04:00
Slava Pestov
0fd636b4b9
compiler.cfg: ##unbox-long-long can have multiple outputs now, clean up long long parameter passing code using this
2010-07-15 19:49:29 -04:00
Slava Pestov
48e96ef032
compiler.cfg.scheduling: update to support multiple-output instructions
2010-07-15 17:38:34 -04:00
Slava Pestov
e27adb2830
compiler: re-architect low-level optimizer to allow more than one output value per instruction
2010-07-13 07:40:14 -04:00
Slava Pestov
1f4bd3e293
compiler.tree.propagation.known-words: don't want a type function on clone, all the methods are inline and it was wrong (reported by Joe Groff)
2010-07-07 17:25:32 -04:00
Slava Pestov
a55c8ee671
FFI rewrite part 6: deconcatenatize
2010-07-02 15:44:12 -04:00
Slava Pestov
ae2c2909af
Revert guarded method inlining
...
This reverts commit 44a835e3fc
, reversing
changes made to d45926bda0
.
2010-06-24 12:35:21 -04:00
Daniel Ehrenberg
7599841221
Merge branch 'master' of git://factorcode.org/git/factor into propagation
2010-06-23 12:17:24 -04:00
Slava Pestov
7e24994db5
Whitespace fix
2010-06-23 03:56:17 -04:00
Slava Pestov
68cd067f31
compiler.cfg.builder: if there is a conditional where every branch is known to throw an error, don't process any of the (unreachable) code after the conditional, since this can confuse analysis (reported by Daniel Ehrenberg)
2010-06-23 03:33:15 -04:00
Daniel Ehrenberg
12b0e16232
Unit tests for a couple of serious compiler bugs
2010-06-22 16:41:14 -04:00
Daniel Ehrenberg
2c8897c56b
Merge branch 'master' of git://factorcode.org/git/factor into propagation
2010-06-22 14:47:57 -04:00
Slava Pestov
167aff1b57
compiler.cfg.height: clean it up a bit
2010-06-22 04:14:03 -04:00
Slava Pestov
5d6816d364
compiler.cfg.ssa: fixing test failures
2010-06-15 17:18:51 -04:00
Daniel Ehrenberg
970f96c8b8
Fixing typo in modular arithmetic unit test (should use iota, not integer sequences, and just happened to work still)
2010-06-15 16:15:49 -04:00
Daniel Ehrenberg
30cfbc8512
Merge branch 'master' into propagation
2010-06-15 13:26:01 -04:00
Slava Pestov
e86f434f26
Add GC maps to ##box, ##box-long-long, ##alien-invoke, ##alien-indirect and ##call-gc; remove ##gc-map instruction
2010-06-14 19:39:46 -04:00
Slava Pestov
806e54630a
GC maps for more compact inline GC checks
2010-06-11 20:06:00 -04:00
Joe Groff
7fe04fa8ee
compiler.cfg.intrinsics.simd: intrinsic support for double-2>float-4 conversion
2010-06-01 00:34:50 -07:00
Slava Pestov
c9ad0856d5
cpu.x86.64: callback prologue was clobbering 5th parameter register on x86-64
2010-05-23 03:00:53 -04:00
Slava Pestov
ba7cb61133
Stack allocation improvements
...
- New with-out-parameters combinator
- Inhibit tail call optimization in frames with local allocation, to ensure that passing a stack allocated value to the last word in the quotation works
- local allocations are now aligned properly
- spill slots are now aligned properly aligned in frames which have parameter and local allocation areas
2010-05-22 02:37:00 -04:00
Slava Pestov
9e59192c73
compiler.cfg.builder.alien: use ##local-allot to fix value struct passing on Win64
2010-05-19 01:53:32 -04:00
Slava Pestov
91cd3b854d
Use ##local-allot to simplify longlong unboxing
2010-05-19 01:07:22 -04:00
Slava Pestov
0a0ebcd71d
compiler.tree.propagation.known-words: fix load error
2010-05-19 00:51:03 -04:00
Slava Pestov
86358b1dc3
alien.data: add with-scoped-allocation combinator for stack-allocating C data
2010-05-19 00:33:36 -04:00
Slava Pestov
77516c6932
compiler.cfg: generalize ##prepare-struct-caller instruction to alloca()-like ##local-allot
2010-05-19 00:33:15 -04:00
Slava Pestov
4dd58ce40e
compiler.tests: fix test for generalizations change
2010-05-18 23:08:37 -04:00
Slava Pestov
11511167e2
cpu.x86.x87: compares were clobbering ST0
2010-05-18 19:18:53 -04:00
Slava Pestov
1834241e5a
alien.libraries, stack-checker.alien: check user inputs more carefully to ensure that invalid ABI descriptors don't slip through and break random stuff (reported by prunedtree)
2010-05-18 18:46:31 -04:00
Slava Pestov
ea726f5680
Move remaining sequence operations from generalizations to sequences.generalizations where they belong
2010-05-18 18:36:47 -04:00
Slava Pestov
be733cd797
compiler.cfg.value-numbering: constant folding for ##shuffle-vector
2010-05-18 04:22:21 -04:00
Slava Pestov
53a51957df
compiler.cfg.value-numbering: add constant folding for ##gather-vector instructions, and fix ##scalar>vector constant folding for integers
2010-05-18 03:56:07 -04:00
Slava Pestov
6eaf2d7534
cpu.x86: add x87 codegen for Model T enthusiasts
2010-05-17 11:35:47 -04:00
Slava Pestov
41d929a201
compiler.cfg.ssa.interference: implement linear-time interference test
2010-05-17 05:50:13 -04:00
Slava Pestov
6b7260a4a7
compiler.cfg.ssa.interference.live-ranges: compute correct live ranges for ##phi instructions
2010-05-17 05:50:13 -04:00
Slava Pestov
0955f2c7eb
compiler.cfg.linear-scan: fix typo
2010-05-17 05:50:13 -04:00
Slava Pestov
7ff309d50e
cpu.x86: get rid of this extra-stack-space nonsense
2010-05-17 02:14:44 -04:00
Slava Pestov
3f8e13bf66
compiler.cfg: refactor stack frame code and fix frame pointer usage in callbacks
2010-05-16 21:04:40 -04:00
Slava Pestov
a7b5957f6d
compiler: hack to make XCreateIC() work on x86-64
2010-05-16 04:49:53 -04:00
Slava Pestov
8ebecac4d2
Merge branch 'master' of git://factorcode.org/git/factor
2010-05-16 04:10:03 -04:00
Slava Pestov
e6abc0be15
Fixes for FFI changes
2010-05-16 04:09:47 -04:00
Joe Groff
67ea40ade3
compiler.cfg.intrinsics.simd: use ^^select-vector for simd constant nth when available
2010-05-16 00:50:20 -07:00
Joe Groff
645164188d
compiler.cfg.instructions: ##select-vector instruction mapping to SSE4 PEXTR*
2010-05-16 00:50:19 -07:00
Slava Pestov
5b48cd2a63
FFI rewrite part 5: return value boxing and callback parameter boxing now uses vregs; simplify return value unboxing
2010-05-16 03:43:23 -04:00
Joe Groff
0c27f30475
compiler.cfg.intrinsics.simd: use new ##gather-int-vector insns to construct int vectors when available
2010-05-15 23:59:27 -07:00
Joe Groff
8c878ada17
compiler.cfg.instructions: ##gather-int-vector-2/4 instructions that map to SSE4 PINSR/PEXTR
2010-05-15 23:48:22 -07:00
Joe Groff
5d35917061
compiler.cfg.intrinsics: intrinsic for fixnum-bit-count
2010-05-15 13:59:47 -07:00
Joe Groff
7fec53b509
compiler.cfg.instructions: ##bit-count insn
2010-05-15 13:57:35 -07:00
Slava Pestov
5c0c87fcaa
compiler.cfg.value-numbering.comparisons: ##test-imm rewrite rule must check that the immediate fits
2010-05-15 03:19:24 -04:00
Daniel Ehrenberg
fbaa8d153f
Inlining no-method when a generic word has no method
2010-05-14 20:28:09 -05:00
Daniel Ehrenberg
05290ee1b1
Merge branch 'master' of git://factorcode.org/git/factor into propagation
...
Conflicts:
basis/compiler/tree/propagation/propagation-tests.factor
2010-05-14 18:59:39 -05:00
Slava Pestov
ad7636045f
compiler: fix bad unit test
2010-05-14 18:37:11 -04:00
Slava Pestov
5ecd2b61c7
compiler.cfg: more silly optimizations
2010-05-14 18:37:09 -04:00
Slava Pestov
1a61c50896
compiler.cfg.instructions: change vreg-insn from a mixin into a superclass
2010-05-14 18:37:09 -04:00
Slava Pestov
6d30bb8bf4
compiler.cfg.linear-scan: pointless optimizations
2010-05-14 18:37:08 -04:00
Slava Pestov
291543c300
compiler.cfg.ssa.live-ranges: clean up
2010-05-14 18:37:08 -04:00
Slava Pestov
d1e422c981
compiler.cfg.alias-analysis: simplify and speed up
2010-05-14 18:37:07 -04:00
Slava Pestov
5a67711bfd
compiler.cfg: use x86 TEST instruction to optimize 'bitand 0 ='
2010-05-14 18:37:06 -04:00
Joe Groff
8f1751cd54
math.vectors.simd.intrinsics: fix scalar fallback for (simd-vshuffle2-elements)
2010-05-14 02:47:39 -07:00
Joe Groff
465a1673eb
compiler.cfg.intrinsics.simd: mod shuffle indices for shuffle-2-vectors-imm intrinsic so they wrap like a real instruction would
2010-05-14 01:20:05 -07:00
Joe Groff
9f9e145819
math.vectors.simd.intrinsics: (simd-vshuffle2-elements) intrinsic that creates a vector by selecting elements from two input vectors. use ##shuffle-vector-halves-imm to implement for double-2s with SSE
2010-05-14 01:16:29 -07:00
Joe Groff
3766abd65e
compiler.cfg.instructions: ##shuffle-vector-halves-imm insn to map to SSE's two-input SHUFPS/SHUFPD
2010-05-14 00:20:21 -07:00
Slava Pestov
bb87d124c1
compiler: small fixes and cleanups
2010-05-13 02:48:20 -04:00
Slava Pestov
db2db6a1a6
compiler.cfg.builder.alien: fix for x86-32
2010-05-12 18:07:11 -04:00
Slava Pestov
42b0d456cd
Refactor x86-32 stack cleanup logic
2010-05-12 02:09:11 -04:00
Slava Pestov
f89b85db7b
Temporary fixes for x86-32 until FFI boxing is rewritten
2010-05-12 01:41:49 -04:00
Slava Pestov
0cde5c8fb5
Eliminate compiler.alien
2010-05-11 23:24:47 -04:00
Slava Pestov
ee0640f176
Move flatten-c-type to death row so that it can be executed in part 5
2010-05-11 22:26:31 -04:00
Slava Pestov
eb802208d1
FFI rewrite part 4: parameter and return value unboxing redesign
2010-05-11 19:11:44 -04:00
Slava Pestov
45689dbfe6
compiler: simplify ##unbox-small/large-struct by emitting an ##unbox-any-c-ptr first
2010-05-10 01:38:34 -04:00
Slava Pestov
4478c3a51a
FFI rewrite part 3: eliminate ##push-context-stack and ##pop-context-stack
2010-05-10 00:46:29 -04:00
Slava Pestov
acfbea3865
compiler.codegen.fixup: remove unused variable
2010-05-10 00:45:48 -04:00
Slava Pestov
7316d41226
FFI rewrite part 2: use ##peek and ##replace instructions to access stack
2010-05-09 23:26:43 -04:00
Slava Pestov
c211c3e84e
FFI rewrite part 1: split up ##alien-invoke and friends into smaller instructions
2010-05-09 21:36:52 -04:00
Slava Pestov
f988dad79c
compiler.cfg: add ##load-float instruction for single precision floating point constants
2010-05-07 18:26:00 -04:00
Slava Pestov
982e704626
compiler.cfg.linear-scan: clean up clobber-insn handling
2010-05-07 18:22:35 -04:00
Slava Pestov
627295f094
Language change: tuple slot setter words with stack effect ( value object -- ) are now named FOO<< instead of (>>FOO)
2010-05-06 17:21:02 -04:00
Slava Pestov
32ab6ca8d8
compiler.cfg.intrinsics: may as well use cell-size stores instead of 32-bit stores when initializing byte arrays
2010-05-05 13:23:00 -04:00
Slava Pestov
07092df20b
compiler.cfg.intrinsics.allot: fix <byte-array> intrinsic for real. Don't ever check in code without testing it
2010-05-05 13:17:20 -04:00
Daniel Ehrenberg
ea69bd68ac
Merge branch 'master' of git://factorcode.org/git/factor into propagation
2010-05-05 08:54:47 -05:00
Slava Pestov
0dab9c7f9d
compiler.cfg.intrinsics.allot: <byte-array> intrinsic was writing past the end of the array and this was causing problems for scheduling
2010-05-05 02:17:57 -04:00
Slava Pestov
e763c74096
More FFI cleanups
2010-05-05 01:13:45 -04:00
Daniel Ehrenberg
4d5b7fe883
Fixing bug in dependency tracking for guarded method inlining
2010-05-04 16:47:00 -05:00
Daniel Ehrenberg
0d055060ad
Bug fix in method inlining
2010-05-04 16:46:39 -05:00
Daniel Ehrenberg
23e78b8380
Removing hack with >fixnum, now subsumed by a more general optimization
2010-05-04 16:46:39 -05:00
Daniel Ehrenberg
0f0b56f1ef
Adding dependency checking and proper handing of dispatch# to the new method inlining
2010-05-04 16:46:38 -05:00
Daniel Ehrenberg
f1d7a4e663
Improving method inlining change, but there's still a bug
2010-05-04 16:46:08 -05:00
Daniel Ehrenberg
19a44d65df
Changes to compiler.tree.propagation.inlining
2010-05-04 16:46:08 -05:00
Daniel Ehrenberg
3ed4a82475
Fixing another bug in the method inlining improvement
2010-05-04 16:46:08 -05:00
Daniel Ehrenberg
416707f327
Fixing optimization for improved method inlining
2010-05-04 16:46:07 -05:00
Daniel Ehrenberg
02bd3d7142
splitting generic word callsites when only one method is applicable
2010-05-04 16:46:07 -05:00
Daniel Ehrenberg
750a96935f
instance? optimizes null checks
2010-05-04 16:46:07 -05:00
Daniel Ehrenberg
24ad579631
Merge branch 'master' of git://factorcode.org/git/factor
2010-05-04 09:52:34 -05:00
Daniel Ehrenberg
4f66732c36
Fixing scheduling for compiler changes
2010-05-04 09:48:16 -05:00
Slava Pestov
035a2e9b63
compiler: more tests
2010-05-04 05:46:45 -05:00
Slava Pestov
572d7f77f8
compiler.cfg.value-numbering: don't use complex addressing modes unless architecture supports it
2010-05-04 05:46:21 -05:00
Slava Pestov
dd2a4c2c77
cpu.x86: GC root offsets were computed wrong in words containing alien calls
2010-05-04 02:53:53 -04:00
Slava Pestov
ea4ee4ff60
compiler.tests: remove useless test from float tests; min and max are generic now, with methods on floats, so any potential inconsistency is gone
2010-05-04 00:07:53 -04:00
Slava Pestov
ad69052a1a
compiler.cfg.value-numbering: fix typo in unit test
2010-05-03 22:11:29 -04:00
Daniel Ehrenberg
b02208ceb2
Some fixes to merge scheduling
2010-05-03 17:54:46 -05:00
Daniel Ehrenberg
277705345f
Merge branch 'master' of git://factorcode.org/git/factor into s3
...
Conflicts:
basis/compiler/cfg/finalization/finalization.factor
2010-05-03 17:29:03 -05:00
Slava Pestov
4352902bb6
compiler.cfg.empty-blocks: remove unused pass
2010-05-03 18:23:54 -04:00
Slava Pestov
ca4f442eaa
compiler.cfg.alias-analysis: storing a reference into an object now merges the reference's alias class with the heap alias class
2010-05-03 18:20:28 -04:00
Daniel Ehrenberg
5509604ffe
Merge branch 'master' into s3
...
Conflicts:
basis/compiler/cfg/optimizer/optimizer.factor
2010-05-03 17:19:28 -05:00
Slava Pestov
58e4381eb1
compiler: new "binary literal area" at the end of a word's machine code stores constant floats and SIMD vectors; this allows ##load-reference/##load-memory fusion to be performed on x86-64, with a RIP-relative address reaching the data; also simplifies VM since custom relocation types used by the previous 32-bit-only optimization are no longer needed
2010-05-03 17:34:35 -04:00
Slava Pestov
9b4135713e
compiler.cfg.representations: make sure that immediate operands fit
2010-05-03 17:34:34 -04:00
Slava Pestov
86548320eb
compiler.cfg.value-numbering: fix unit test for 64-bit
2010-05-03 17:34:33 -04:00
Slava Pestov
f5c5d8b44c
compiler: remove flat machine representation and generate code directly from the CFG
2010-05-03 17:34:32 -04:00
Slava Pestov
5236f327ba
compiler.cfg.debugger: add ssa. word to print IR before representation selection runs
2010-05-03 17:34:31 -04:00
Slava Pestov
0fbf454b18
compiler.tree.propagation: fix both-fixnums? trick
2010-05-03 17:34:30 -04:00
Slava Pestov
7f6ae34d72
Updating tests for recent compiler changes
2010-05-03 17:34:30 -04:00
Slava Pestov
38bafd2be8
compiler.cfg.linear-scan.assignment: spill slot representation logic was backwards, just like Factor
2010-05-03 17:34:29 -04:00
Slava Pestov
428ba9fd0f
compiler.cfg: fuse ##load-integer/##load-reference into ##replace to form ##replace-imm
2010-05-03 17:34:28 -04:00
Slava Pestov
9788323d25
compiler: add ##load-vector instruction to avoid wasting a temporary register on x86-32
2010-05-03 17:34:28 -04:00
Slava Pestov
5979fe7f41
compiler.cfg.copy-prop: optimistic copy propagation
2010-05-03 17:34:26 -04:00
Slava Pestov
e90712b1ed
compiler.cfg: cleanup
2010-05-03 17:34:26 -04:00
Slava Pestov
df86d1341f
compiler.cfg: clean up ##phi literals in tests
2010-05-03 17:34:24 -04:00
Slava Pestov
ffd1844d52
compiler.cfg.linear-scan: clean up spill slot assignment
2010-05-03 17:34:24 -04:00
Slava Pestov
65f86bfce7
compiler.cfg.ssa.detruction: coalesce different representations in more cases
2010-05-03 17:34:22 -04:00
Slava Pestov
ce73031ec3
compiler.cfg.alias-analysis: write unit tests and fix redundant store elimination
2010-05-03 17:34:22 -04:00
Slava Pestov
33eb15bf44
compiler.cfg.debugger: clean up and make it more flexible
2010-05-03 17:34:22 -04:00
Slava Pestov
43f269e4eb
Register allocation now uses SSA properties to coalesce values with different representations
2010-05-03 17:34:20 -04:00
Slava Pestov
9b34a4a054
compiler.cfg: remove unused 'reps' slot from compiler.cfg, and re-organize things in preparation for SSA register allocation
2010-05-03 17:34:18 -04:00
Slava Pestov
43fc230c69
compiler.cfg.linear-scan: cleanups
2010-05-03 17:34:18 -04:00
Slava Pestov
d23bb19b55
Code cleanups
2010-05-03 17:34:17 -04:00