Slava Pestov
ff8c70dbe0
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
bd629c1262
compiler/tests/codegen.factor: don't do exact float comparison
2009-08-30 18:57:45 -05:00
Slava Pestov
9595be4bf9
%box-displaced-alien: fix clobberage found by Doug
2009-08-30 05:11:08 -05:00
Slava Pestov
0db01f6d5f
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
2bb6293217
compiler: add fixnum-min/max intrinsics; ~10% speedup on benchmark.yuv-to-rgb
2009-08-28 19:02:59 -05:00
Slava Pestov
d957ae4e44
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
8f19f14c1f
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
f662e6403a
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
Doug Coleman
1b77718625
use structs
2009-08-26 11:01:39 -05:00
Doug Coleman
bbcf08cdc3
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-26 09:15:33 -05:00
Slava Pestov
0ff80a063d
compiler: only run float test in low-level-ir if float intrinsics enabled; fixes SIGILL on non-sse2 x86 machines
2009-08-26 06:58:47 -05:00
sheeple
61c1ed17d9
basis/compiler/tests/low-level-ir: add ##copy double-float-rep test
2009-08-25 19:41:17 -05:00
Doug Coleman
0ce57d0566
update new structs again
2009-08-25 16:31:58 -05:00
Doug Coleman
2c6ef83c13
update compiler.tests.alien to joe's latest changes
2009-08-25 12:00:06 -05:00
Doug Coleman
b756a37d75
use new structs wherever possible in compiler tests
2009-08-25 11:59:33 -04:00
Slava Pestov
49bd2228ec
compiler.tree.modular-arithmetic: fix regression; set-alien-*-1 was not always open-coded
2009-08-20 17:56:49 -05:00
Slava Pestov
a598cc35a5
compiler: add unit tests for new bugs
2009-08-19 16:56:26 -05:00
Slava Pestov
507e2b7f3a
Fix some unit test failures
2009-08-18 03:49:05 -05:00
Doug Coleman
7c92ab1ea5
move if-zero etc to math, remove 1-/1+ from math
2009-08-14 14:27:23 -05:00
Doug Coleman
3f3d57032b
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
7bfbb0c5ac
math.intervals: fix interval-rem
2009-08-11 16:49:28 -05:00
Slava Pestov
d0c393aa60
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
4b7ba38aab
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
725280d424
Split off the notion of a register representation from a register class
2009-08-07 17:44:50 -05:00
Slava Pestov
d20d335447
compiler.cfg.stacks: more accurate deconcatenatization inserts fewer partially redundant ##peeks. 11% improvement on benchmark.beust2, 2% reduction in ##peek and ##replace instructions inserted
2009-08-03 07:08:28 -05:00
Slava Pestov
21489ce85e
compiler tests: add test case for coalescing bug
2009-08-02 03:49:54 -05:00
Slava Pestov
e1c7f7394a
compiler.cfg: clean up unit tests using some new utilities
2009-08-02 03:49:25 -05:00
Slava Pestov
20ec574965
compiler.cfg.ssa.destruction: fix bug in trivial-interference heuristic, and type error in code path that didn't run before
2009-08-01 20:22:31 -05:00
Slava Pestov
7c43f71c6d
compiler: Oops, typos in unit tests
2009-07-31 22:33:02 -05:00
Slava Pestov
d515715b0c
compiler.cfg.ssa.destruction: fix bug in renaming triggered by sequence-parser:take-sequence
2009-07-31 18:34:15 -05:00
Slava Pestov
34432c5f18
compiler: fix test
2009-07-29 06:39:54 -05:00
Slava Pestov
7a6bdffaaa
IN: fix for compiler test
2009-07-28 11:16:21 -05:00
Slava Pestov
cb07256ff5
Add some compiler tests
2009-07-28 06:45:31 -05:00
Slava Pestov
cf90945b4c
Add some tests that directly generate low level IR
2009-07-27 22:29:33 -05:00
Slava Pestov
ff7f0e2f3b
Add testcase for recent bug
2009-07-23 18:03:14 -05:00
Slava Pestov
69ded76c66
Fixing compiler tests
2009-07-22 21:10:50 -05:00
Slava Pestov
3fb4fc1bde
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
11731f8d48
compiler.cfg.value-numbering: merge in compiler.cfg.branch-folding
2009-07-14 20:05:01 -05:00
Slava Pestov
03cd550b93
Fix codegen test
2009-07-14 16:11:14 -05:00
Slava Pestov
2ace87370e
compiler.cfg.value-numbering: more optimizations
2009-07-14 16:05:25 -05:00
Slava Pestov
fb488025aa
compiler.cfg.value-numbering.rewrite: fix ##compare-imm rewrite rule
2009-07-04 02:50:50 -05:00
Slava Pestov
9404a7d0e3
half-floats: Add some more unit tests
2009-07-02 17:52:53 -05:00
Slava Pestov
64f93e41a9
Various linear scan fixes
...
insert spill before reload to fix x86-32 regression
inactive splitting: if all inactive intervals' registers are in use, don't fail
fix stack analysis tests
2009-06-13 17:35:40 -05:00
Slava Pestov
ade5db2405
cpu.x86: fix small register intrinsics on x86-64
2009-06-03 03:22:46 -05:00
Slava Pestov
66a9416473
Update documentation for stricter vocabulary search path semantics
2009-05-16 00:29:21 -05:00
Slava Pestov
b67b617746
Fix compiler breakage if a GENERIC# has an incorrect stack effect declaration
2009-05-12 21:23:52 -05:00
Slava Pestov
65faa3fda3
Fix unit tests and load errors for slip removal
2009-05-10 17:03:41 -05:00
Slava Pestov
75d9946bd7
compiler.tree.modular-arithmetic: convert >integer >fixnum into >fixnum
2009-05-07 12:54:23 -05:00
Slava Pestov
58d0e17936
Fix bool type; its actually 1 byte not 4 in structs. Bug reported by jedahu
2009-05-05 18:37:40 -05:00
Slava Pestov
a63ad6a7a5
Remove cruddy string encoding/decoding code from VM
2009-05-02 13:45:38 -05:00
Slava Pestov
21ac396128
Fix typo in redefine14 test
2009-05-01 08:29:04 -05:00
Slava Pestov
92781739c8
Some new compiler tests
2009-05-01 06:48:33 -05:00
Slava Pestov
a70a2c0e31
Fix some test failures and add an unportable tag
2009-04-30 22:56:15 -05:00
Slava Pestov
e5cdb7ac2d
call( fast-path now supports curry and compose
2009-04-30 21:08:29 -05:00
Slava Pestov
a79e3eb687
Passing an invalid parameter to 'declare' doesn't break the compiler anymore
2009-04-30 20:40:47 -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
deaea55d85
compiler: don't wrap non-inference errors in compile errors, since they indicate compiler bugs; just rethrow them. Add unit test for a PIC regression
2009-04-29 19:39:04 -05:00
Slava Pestov
7f766ab355
Update compiler tests for tag number changes
2009-04-28 21:43:30 -05:00
Slava Pestov
5f6c074edd
Split up types.c/h into smaller files, remove optimized slot from F_WORD struct
2009-04-28 17:26:11 -05:00
Doug Coleman
28cacc8d61
fix some compiler tests
2009-04-26 02:23:33 -05:00
erg
acd312ab19
fix IN: for compiler tests
2009-04-26 00:51:47 -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
Slava Pestov
05f3f9dcb9
Fixing unit tests for stack effect inference changes
2009-04-20 21:15:19 -05:00
Slava Pestov
5165d811d5
Changing the stack effect of a generic word could break the compiler
2009-04-20 04:21:00 -05:00
Doug Coleman
7a1841f59b
(( -- )) eval -> eval( -- )
2009-04-17 15:49:21 -05:00
Doug Coleman
dba4c0d589
fixing compiler errors in basis
2009-04-17 12:46:04 -05:00
Doug Coleman
5460a5375e
change makefile to use .so instead of .a on unix
2009-03-28 14:41:48 -05:00
U-SLAVA-DFB8FF805\Slava
40631ec2a9
Fix alien tests on Windows; LoadLibraryEx does not like UNC paths
2009-03-28 02:37:07 -05:00
Doug Coleman
6f743b280d
hopefully last fix for alien.factor
2009-03-27 17:58:31 -05:00
sheeple
1cf5c519cc
fix ffi tests on 32bit
2009-03-27 14:39:45 -05:00
sheeple
e04efe5f5a
use .a instead of .so on unix
2009-03-27 10:41:24 -05:00
Doug Coleman
73b8bf1193
fix using list
2009-03-26 19:58:23 -05:00
Doug Coleman
63e06589bd
don't normalize-path in add-library
2009-03-26 18:56:10 -05:00
Doug Coleman
b771758ff7
fix load errors, help lint
2009-03-26 10:45:52 -05:00
Doug Coleman
4b275c2861
make add-library normalize-path, use libfactor-ffi-tests for testing ffi
2009-03-25 13:05:34 -05:00
Slava Pestov
9ebd9c8d01
Add unit test for regression
2009-03-22 21:42:15 -05:00
Slava Pestov
6080c6e734
Fix stack effect redefinition
2009-03-22 20:16:31 -05:00
Slava Pestov
2f4e2735ea
Fix compile errors in compiler tests so that they actually test the compiler instead of being useless
2009-03-22 17:50:53 -05:00
Slava Pestov
9d44b7620f
Fixing the build
2009-03-18 17:01:26 -05:00
Slava Pestov
37bc52afa8
Redefining methods didn't always update callers if more than one method on the same generic was redefined in a compilation unit
2009-03-06 23:33:30 -06:00
Slava Pestov
65a53e1fa5
Don't keep compiled-effect around anymore
2009-02-23 23:55:16 -06:00
Slava Pestov
901bcccc1c
Fix remaining text failures
2009-02-23 23:25:13 -06:00
Slava Pestov
1951d739a0
Stack effect declarations are mandatory on all words now
...
define-temp now takes an effect parameter
Fix compiler bug that Dan found
Stricter enforcement of * effects
Move compile-call from compiler.units to compiler
2009-02-23 20:27:05 -06:00
Slava Pestov
01c2e26dfe
Fix alien tests, oops
2009-02-06 12:30:11 -06:00
sheeple
173b0ee78d
Add some more tests for complex numbers in FFI
2009-02-06 12:21:53 -06:00
Slava Pestov
d6aa376ed0
Removing now-redundant underlying>> calls
2009-02-06 04:37:28 -06:00
Slava Pestov
7bb0e78314
Add support for C99 complex float and complex double types to FFI
...
They are named complex-float and complex-double in the Factor world
2009-02-06 04:02:00 -06:00
Doug Coleman
3c408342ef
renaming: contain? -> any?, deep-contains? -> deep-any?, pad-left -> pad-head, pad-right -> pad-tail, trim-left -> trim-head, trim-right -> trim-tail
2009-01-29 22:19:07 -06:00
Slava Pestov
44bfff7c7b
Rename ##load-indirect to ##load-reference since this is more descriptive; value numbering doesn't assign expressions to ##load-reference nodes since this would end up folding literals which were eq? but not =
2009-01-29 01:44:58 -06:00
Slava Pestov
3e685b2eb4
Add test case for bug discovered by erg
2009-01-28 23:35:41 -06:00
Slava Pestov
f34c14a0f5
Remove some usages of tuck
2009-01-23 18:20:47 -06:00
Slava Pestov
34792a9f23
Remove >r/r>
2008-12-17 19:17:37 -06:00
Slava Pestov
c679ae025b
Rename tools.disassembler.udis:& to alien.syntax:&: and fix it to survive image save/load
2008-12-11 00:03:58 -06:00
Slava Pestov
e4f8448eb1
Fix some problems with arithmetic type inference, exposed by recent changes to log2 word
...
- declared input type for bignum-shift was stricter than the runtime behavior, leading to bad propagation of type info if shift count was a bignum
- types inferred for type functions which used number-valued/integer-valued/real-valued were not always precise, eg bignum bignum bitxor => integer
- add interval-log2, type function for (log2)
- remove math-class-min, it was useless
2008-12-07 19:44:49 -06:00
Slava Pestov
f51708386d
Fix conflicts
2008-12-01 20:39:43 -06:00
sheeple
6400085bea
Fix bootstrap, add a unit test
2008-11-30 07:36:29 -06:00
Slava Pestov
e8a69a3aea
Fix conflict
2008-11-29 05:14:49 -06:00
Slava Pestov
52f1ff3a95
Fix conflict
2008-11-29 04:23:23 -06:00
Slava Pestov
1c0789e616
Didn't generate ##branch after ##alien-invoke and ##alien-indirect
2008-11-29 03:46:57 -06:00
sheeple
26c002d23f
Fix fixnum* problem; result was shifted to the right by 3 bits if both input registers were equal
2008-11-29 00:44:46 -06:00
Slava Pestov
c1d249afb2
Add unit test
2008-11-29 00:37:07 -06:00
Slava Pestov
f2040c0529
Add some more tests
2008-11-24 11:12:36 -06:00
Slava Pestov
eeb2133ba2
Fix compiler test
2008-11-23 21:40:10 -06:00
Slava Pestov
7788b3e0db
Merge branch 'master' into microseconds
2008-11-23 03:06:32 -06:00
Slava Pestov
3a2e15327f
Disable these for now
2008-11-22 22:47:40 -06:00
Slava Pestov
f0716b3a0d
1% image size reduction by not storing empty compiled-generic-uses and compiled-uses props
2008-11-22 22:46:57 -06:00
Slava Pestov
8819f23312
Replace millis primitive with micros primitive
...
Add millis as a library word
sleep now takes either a duration or a microsecond count; code using durations doens't need to be updated, code using millisecond counts updated to use durations for the most part
2008-11-19 01:50:05 -06:00
Slava Pestov
281657dd82
Fix conflict
2008-11-18 22:18:14 -06:00
Slava Pestov
14246fde37
Better FFI unit tests expose a new problem
2008-11-17 12:23:44 -06:00
Slava Pestov
2fe364a7bb
Specialized arrays work in progress
2008-11-14 20:18:16 -06:00
Slava Pestov
5b4e8e9d09
Rename tests/templates.factor to tests/codegen.factor since that's really what its testing
2008-11-13 04:16:58 -06:00
sheeple
5b7d40d9b4
We need to end the basic block after the ##prologue in the dispatch branch so that the GC check can go after the prologue
2008-11-10 02:58:05 -06:00
sheeple
d1f248dac6
Fixing PowerPC backend: prolog register clobberage, spilling, and general stack frame usage. Add some lame tests for spilling
2008-11-06 19:00:56 -06:00
sheeple
d2ec46e38f
PowerPC backend almost functional; some new compiler unit tests added,
...
better compilation of 'f eq?'; f becomes an immediate operand
move aux-offset to compiler.constants
2008-11-06 06:27:27 -06:00
Slava Pestov
4fd1767768
Old fix for classes-intersect? no-method bug was incorrect; we were
...
ignoring anonymous classes in compiled-generic-crossref. Also,
forget* now calls reset-word so that references to predicates of
forgotten classes don't break the compiler with a similar error.
2008-11-05 18:32:02 -06:00
Slava Pestov
46830bb38d
Fix another name clash in tests; putting all compiler tests in compiler.tests vocab is probably not good
2008-11-04 00:46:06 -06:00
Slava Pestov
06b99c31ee
Fix regression. If a parsing word called the compiler, it might compile a caller of a generic before the generic gets built, which would throw an error since the inferred effect of the generic might have less inputs than the combination's dispatch#
2008-11-03 20:59:48 -06:00
Slava Pestov
b649c01de6
Fix name clash with templates.factor
2008-11-03 06:34:56 -06:00
Slava Pestov
1b06ab1b39
Fixing various bugs
2008-10-21 23:17:32 -05:00
Slava Pestov
f092622fac
CFG IR is now pure SSA
2008-10-20 01:56:28 -05:00
Slava Pestov
4ae66793f0
Fixing unit tests
2008-10-19 03:51:01 -05:00
Slava Pestov
14d8696f40
Oops, don't mix register classes in active set
2008-10-19 03:34:42 -05:00
Slava Pestov
fedadc8032
Remove obsolete test file
2008-10-13 13:08:28 -05:00
Slava Pestov
40c1529ce8
Add stack effect
2008-10-12 18:40:57 -05:00
Slava Pestov
0e4e05d5cd
Debugging new codegen
2008-10-08 03:51:44 -05:00
Slava Pestov
c19f2257f4
Fix permission bits
2008-10-02 08:34:49 -05:00
Slava Pestov
d4134a2ca1
Fix loop detection bug
2008-10-02 01:17:45 -05:00
Slava Pestov
722cacddb4
Fixing some problems with returning structs by value in x86.64 FFI
2008-09-13 20:28:13 -05:00
Slava Pestov
ec660c857f
Add unit test for Joe Groff's bg
2008-09-12 00:04:56 -05:00
Slava Pestov
0c8e2584b4
Fixing unit tests for make, fry changes
2008-09-11 00:20:06 -05:00
Slava Pestov
a3d1379b8c
Fix bug with large structs passed by value on x86.64
2008-09-09 03:10:43 -05:00
Doug Coleman
14d707898d
new accessors
2008-09-02 01:53:01 -05:00
U-SLAVA-DFB8FF805\Slava
8fed0d29eb
Fix dead code elimination with alien nodes
2008-09-01 02:04:42 -05:00
Slava Pestov
18d629a916
Add failing unit test
2008-08-31 09:22:36 -05:00
Slava Pestov
f5fbd94a4c
New compiled crossref implementation
2008-08-31 01:34:00 -05:00
Slava Pestov
85cdb1b767
Working on new compiled usage strategy; old one was wrong
2008-08-30 00:05:27 -05:00
Slava Pestov
ef8bd93ae8
Add a test
2008-08-29 17:53:00 -05:00
Doug Coleman
5f12667788
new accessors
2008-08-29 12:00:54 -05:00
Slava Pestov
1fcbdf9d52
Fix more compiler bugs
2008-08-29 00:26:47 -05:00
Slava Pestov
74dccc7fbf
Debugging compiler
2008-08-28 22:28:34 -05:00
Slava Pestov
ea2d02f248
Add some failing tests
2008-08-27 16:25:37 -05:00
Slava Pestov
a4ac751605
Starting to remove delegation
2008-08-22 23:20:49 -05:00
Slava Pestov
8b855b2445
Help lint fixes
2008-08-22 23:00:35 -05:00
Slava Pestov
2440fc1ceb
Fixing remaining issues
2008-08-22 17:38:23 -05:00
Slava Pestov
9aa6d8ae04
Compiler fixes
2008-08-22 15:30:57 -05:00
Slava Pestov
48fa2e2d0e
Updating some code
2008-08-12 03:31:48 -05:00
Slava Pestov
6047429401
More unit test fixes
2008-07-29 16:57:30 -05:00
Slava Pestov
d66f887736
Create basis vocab root
2008-07-28 22:03:13 -05:00