Joe Groff
34def34481
don't generate a ##not-vector instruction if the cpu doesn't have one; instead, fall back to a ##fill-vector/##xor-vector combo. get rid of pretend %not-vector in cpu.x86
2009-10-07 11:59:36 -05:00
Joe Groff
879fe9a665
fix x86 %unpack-vector insns
2009-10-06 20:38:51 -05:00
Joe Groff
785f8620fd
glue conversion intrinsics to instructions
2009-10-06 20:13:38 -05:00
Slava Pestov
697e2342d0
vm: put code block owner directly in the header, instead of as the first entry in the literal table. Reduces x86-64 image size by ~700kb, also eliminates separate 'strip' set of staging images from deploy tool
2009-10-06 06:25:07 -05:00
Joe Groff
fb8eeb6065
Merge branch 'master' of git://factorcode.org/git/factor
2009-10-05 22:34:41 -05:00
Joe Groff
529c444e32
add insns for vector pack, unpack, integer>float, and float>integer
2009-10-05 22:34:14 -05:00
Slava Pestov
55fe25ebd1
Merge branch 'master' of git://factorcode.org/git/factor
2009-10-05 18:22:09 -05:00
Slava Pestov
5b40fc6533
compiler.cfg.linear-scan: fix unit test
2009-10-05 18:21:58 -05:00
Joe Groff
fbe810fc3b
rename SIMD vmerge and kids to (vmerge), make new vmerge more generally useful
2009-10-05 17:55:39 -05:00
Slava Pestov
b4e36608da
compiler.cfg: remove _gc instruction, it doesn't need to exist, and change GC checks to ensure that the right amount of space is available instead of blindly checking for 1Kb
2009-10-05 05:27:49 -05:00
Joe Groff
0c9c3d4859
add %merge-vector-head and %merge-vector-tail instructions to back vmerge
2009-10-03 21:48:53 -05:00
Joe Groff
04bb03bb61
add intrinsics for v<=, v<, v=, v>, v>=, vunordered?
2009-10-03 11:29:34 -05:00
Joe Groff
4e024cbbc2
extend x86 %compare-vector to cover all comparison codes, sometimes stupidly for now
2009-10-02 23:19:56 -05:00
Joe Groff
38f413a8a6
add intrinsic for vnot/vbitnot
2009-10-02 20:04:28 -05:00
Doug Coleman
67167cf9ea
Merge branch 'docs' of git://github.com/klazuka/factor into klazuka
...
Conflicts:
basis/math/vectors/vectors-docs.factor
2009-10-02 15:58:45 -05:00
Joe Groff
aa3392e50f
implement vand, vor, vandn, and vxor as bitwise intrinsics for simd types
2009-10-02 14:17:01 -05:00
Keith Lazuka
405e5d015b
docs: change $subsection to $subsections
2009-10-02 12:15:48 -04:00
Slava Pestov
cb71fbf4fe
Fix compiler.cfg.value-numbering and math.matrices.simd unit tests
2009-10-02 02:32:35 -05:00
Slava Pestov
bcbdc9e0c8
Merge branch 'master' of git://factorcode.org/git/factor into improved-aa
2009-10-02 00:21:44 -05:00
Slava Pestov
fb09d67936
compiler.cfg.alias-analysis: fix ##compare where operands are copies
2009-10-01 23:54:19 -05:00
Slava Pestov
2a4475f85e
Fix alias analysis of a ##compare whose input is another ##compare
2009-10-01 23:20:05 -05:00
Joe Groff
53b265f682
Merge branch 'master' of git://factorcode.org/git/factor
...
Conflicts:
basis/compiler/codegen/codegen.factor
2009-10-01 23:14:16 -05:00
Slava Pestov
31f39ce32f
compiler.cfg.alias-analysis: optimize ##vm-field-ptr and ##alien-global instructions, and optimize out ##compare between values of different alias classes; this optimizes '[ [ >float ] bi@ [ + ] [ - ] 2bi eq? ]' down to an o-op and removes boxing from '[ [ >float ] bi@ [ + ] [ - ] 2bi = ]'
2009-10-01 23:03:17 -05:00
Joe Groff
f9695951a0
fold test-vector/branch sequences into a test-vector-branch instruction
2009-10-01 19:53:30 -05:00
Slava Pestov
c3d81cefe9
compiler.cfg: don't unbox the same value more than once per basic block
2009-10-01 19:41:23 -05:00
Slava Pestov
b9577e2b0e
compiler.cfg.instructions: remove ##box-float, ##unbox-float, ##box-vector, ##unbox-vector since they can be expressed in terms of ##alien-double, ##set-alien-double, ##alien-vector, ##set-alien-vector, and ##allot
2009-10-01 18:07:50 -05:00
Joe Groff
d14f150b58
%test-vector instruction for vany?, vall?, vnone?
2009-10-01 15:35:38 -05:00
Joe Groff
987ced4070
%compare-vector instruction (only does v= for now)
2009-10-01 14:31:37 -05:00
Joe Groff
a93f8f66f9
Revert "add a %blend-vector intrinsic for v?"
...
This reverts commit 21e4b28b67
.
2009-09-30 23:40:37 -05:00
Joe Groff
67cc45235d
Merge branch 'master' of git://factorcode.org/git/factor
2009-09-30 23:04:04 -05:00
Joe Groff
7db7b63552
add a %blend-vector intrinsic for v?
2009-09-30 23:03:59 -05:00
Slava Pestov
2384b630b2
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
2625f2d210
Merge branch 'master' of git://factorcode.org/git/factor
2009-09-30 11:35:40 -05:00
Joe Groff
cb646db54a
add a "test-mr." word to compiler.cfg.debugger equivalent to "test-mr mr."
2009-09-30 11:34:19 -05:00
Slava Pestov
b677822b76
compiler.cfg.value-numbering: fix overly-zealous ##compare-imm conversion
2009-09-30 05:09:20 -05:00
Slava Pestov
cdc7b7e2c7
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
1da18d06b1
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
80e84a357d
math.vectors.simd: add vbroadcast intrinsic, fix integer overflow issues
2009-09-29 22:58:20 -05:00
Slava Pestov
810cd7b4bb
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
f395d83379
math.vectors.simd: add fast intrinsic for 'nth', replace broadcast primitive with shuffles
2009-09-29 04:48:11 -05:00
Slava Pestov
e40a95c1e1
math.vectors.simd: add vshuffle intrinsic
2009-09-28 23:12:13 -05:00
Slava Pestov
a8ea929ad9
Work in progress
2009-09-28 17:31:34 -05:00
Slava Pestov
4abfe06b51
Fixing various test failures caused by C type parser change, and clarify C type docs some more
2009-09-28 08:48:39 -05:00
Slava Pestov
08a2eb74f4
cpu.x86: shifts didn't work if dst != src1; re-organize file a bit
2009-09-28 05:39:53 -05:00
Slava Pestov
da5f0d0a14
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
530accdad9
io.mmap: fix obsolete tests and get code to inline better
2009-09-28 03:18:27 -05:00
Slava Pestov
b2ea3afd84
math.vectors.simd: add hlshift, hrshift (128-bit shift), vbitandn intrinsics
2009-09-28 02:17:46 -05:00
Slava Pestov
2de6ab9e21
compiler.cfg.linear-scan: fix tests for hash order
2009-09-27 23:35:56 -05:00
Slava Pestov
1d872db58d
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
aa3b9097c8
compiler: fix codegen test
2009-09-27 22:23:03 -05:00
Slava Pestov
999b22788e
compiler: add a unit test
2009-09-27 20:36:19 -05:00
Slava Pestov
59fbe85c9b
compiler.cfg: nuke ##bignum>integer and ##integer>bignum since they were unused
2009-09-27 20:36:05 -05:00
Slava Pestov
66071f45a3
Add a couple more def-is-use instructions
2009-09-27 20:34:20 -05:00
Slava Pestov
f757b454cc
Merge branch 'master' into more_aggressive_coalescing
2009-09-27 19:29:50 -05:00
Slava Pestov
705b4ab5c3
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
1e841e5086
compiler.cfg.ssa.destruction: more aggressive coalescing work in progress
2009-09-27 17:17:26 -05:00
Joe Groff
dce02fcdfb
Merge branch 'master' of git://factorcode.org/git/factor
2009-09-26 20:38:19 -05:00
Joe Groff
2cf0f3e5d3
move alien.inline, alien.cxx, alien.marshall to unmaintained; nuke alien.structs
2009-09-26 20:37:42 -05:00
sheeple
01a4047126
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
c704a823e7
Fixing low-level-ir compiler tests for slot changes
2009-09-26 02:48:40 -05:00
Daniel Ehrenberg
51f2bbd74b
Completing slot and set-slot changes on x86
2009-09-26 01:39:48 -05:00
Daniel Ehrenberg
7bd330cfd5
Making ##slot and ##set-slot not have a temporary parameter
2009-09-26 00:28:14 -05:00
Slava Pestov
d017a53227
Merge branch 'vm_cleanup' of git://github.com/phildawes/factor
2009-09-25 19:04:19 -05:00
Slava Pestov
c0abb9ce95
hints: fix regression with declarations
2009-09-25 18:50:08 -05:00
Slava Pestov
a6654c97ef
compiler: add unit test for undefined_symbol regression
2009-09-25 18:08:33 -05:00
Phil Dawes
d457df1fbf
moved %(un)nest-stacks out to cpu specific files to eliminate %vm-invoke from compiler.codegen
2009-09-25 19:32:08 +01:00
Phil Dawes
a07a2f7496
compiler.codegen passes temp reg to %call-gc
2009-09-25 18:48:13 +01:00
Slava Pestov
bbbb207dab
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
7ea8832556
Tweaks to reduce deployed image size
2009-09-24 06:24:43 -05:00
Slava Pestov
cb497f009b
Merge branch 'vm_cleanup' of git://github.com/phildawes/factor
2009-09-24 04:31:55 -05:00
Slava Pestov
7b6128dd03
math.vectors.simd: add v<< and v>> intrinsics for bitwise shifts on elements
2009-09-24 03:32:39 -05:00
Phil Dawes
84faf2431f
cleaned up vm-field-ptr compiler code
2009-09-24 08:16:57 +01:00
Doug Coleman
810bd63820
Merge branch 'master' of git://factorcode.org/git/factor
...
Conflicts:
basis/math/vectors/simd/simd-docs.factor
2009-09-23 10:11:49 -05:00
Slava Pestov
9f59f6b9c6
Merge branch 'master' into integer-simd
2009-09-23 02:48:38 -05:00
Slava Pestov
7d39499d86
compiler.cfg.ssa.cssa: correctly handle overflowing fixnum instructions
2009-09-23 02:47:56 -05:00
Slava Pestov
43fa252af5
math.vectors.simd: new operations: vabs vsqrt vbitand vbitor vbitxor
2009-09-23 02:47:14 -05:00
Slava Pestov
d23826906f
Merge branch 'master' into integer-simd
2009-09-22 20:21:40 -05:00
Doug Coleman
e475817764
Merge branch 'master' of git://factorcode.org/git/factor
2009-09-22 18:00:47 -05:00
Slava Pestov
7cfc63af51
compiler.tree.propagation.branches: M: #phi propagate-around was unnecessary
2009-09-22 17:56:50 -05:00
Daniel Ehrenberg
45ba559ce4
Merge branch 'master' of git://factorcode.org/git/factor into constraints
2009-09-22 16:09:33 -05:00
Daniel Ehrenberg
6e936bdb05
Fixing failing unit tests in compiler.tree.propagation due to constraints
2009-09-22 16:01:14 -05:00
Doug Coleman
51ddc963b8
Merge branch 'master' of git://factorcode.org/git/factor
...
Conflicts:
core/generic/generic-tests.factor
2009-09-22 10:25:42 -05:00
Slava Pestov
0e3a261637
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
629fd1fc82
Merge branch 'master' into integer-simd
2009-09-22 03:24:52 -05:00
Slava Pestov
513ba1f176
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
Doug Coleman
b86314ec39
Merge branch 'master' of git://factorcode.org/git/factor
2009-09-21 17:59:48 -05:00
Slava Pestov
0f0bf667b5
Merge branch 'master' of git://factorcode.org/git/factor into integer-simd
2009-09-21 17:58:24 -05:00
Slava Pestov
962d039852
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
9d90bdd439
Fix conflict
2009-09-20 23:18:07 -05:00
Slava Pestov
ea44ea3522
math.vectors.simd: add saturated arithmetic operations
2009-09-20 23:16:02 -05:00
Doug Coleman
5cb34724b7
Merge branch 'master' of git://factorcode.org/git/factor
...
Conflicts:
basis/classes/struct/struct-tests.factor
basis/functors/functors-tests.factor
basis/specialized-arrays/specialized-arrays-tests.factor
2009-09-20 23:02:49 -05:00
Doug Coleman
eceed177d6
replace usages of <" with """
2009-09-20 22:42:40 -05:00
Slava Pestov
acea55c692
math.vectors: add v+- word which is accelerated by SSE3
2009-09-20 17:43:16 -05:00
Slava Pestov
47d8763340
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
Slava Pestov
f8a91438cd
Merge Phil Dawes' VM work
2009-09-20 03:48:08 -05:00
Joe Groff
076ab42dc3
move some allocation words that don't really have much to do with c types out of alien.c-types into a new alien.data vocab
2009-09-17 22:36:05 -05:00
Joe Groff
01d2ef415a
get compiler tests loading
2009-09-16 09:20:47 -05:00
Phil Dawes
0bc7c0c1d0
separated vm-1st-arg and vm-3rd-arg asm invoke words (needed for ppc & x86.64)
2009-09-16 08:20:09 +01:00
Phil Dawes
005549ba43
vm pointer passed to nest_stacks and unnest_stacks (win32)
2009-09-16 08:17:26 +01:00
Phil Dawes
ff8f2b10ec
fixed up getenv compiler intrinsic to use vm struct userenv
2009-09-16 08:16:32 +01:00
Phil Dawes
a5f24c8fb9
added VM relocation type
2009-09-16 08:16:30 +01:00
Joe Groff
3b4330fcf6
get things to a point where they bootstrap again
2009-09-15 21:43:18 -05:00
Joe Groff
4d16c569f0
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
172219e931
compiler.tree.propagation: fix unary-op type functions with complex number inputs
2009-09-15 14:30:20 -07:00
Slava Pestov
4f702de449
math.functions: more accurate log10 (fixes problem reported by OneEyed)
2009-09-14 16:19:58 -05:00
Slava Pestov
a2de9d9e54
compiler.cfg.builder: don't run certain tests if float intrinsics are not available
2009-09-13 23:12:47 -05:00
Slava Pestov
32b95c2cdf
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
a2b864e4f5
ALIEN: now reads a hexadecimal integer instead of a decimal one, since in general hex is more useful for addresses
2009-09-12 21:17:53 -05:00
Slava Pestov
dd661edf46
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
86a848bae6
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
7f2e2b1777
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
daff63071f
Fix the build
2009-09-09 13:44:54 -05:00
Slava Pestov
15d85c1c4f
compiler.cfg.save-contexts: add new pass
2009-09-08 21:56:28 -05:00
Slava Pestov
7e2f0e5dbf
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
0ea9949e51
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
a0e1af5891
Merge branch 'master' of git://factorcode.org/git/factor
2009-09-08 14:22:52 -05:00
Slava Pestov
1e5bc3b376
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
942fb7b048
Merge branch 'master' of git://factorcode.org/git/factor
2009-09-08 13:22:52 -05:00
Slava Pestov
bbca00e2ae
Fix conflicts
2009-09-07 23:51:25 -05:00
Slava Pestov
9f9b6bca01
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
a1ae209f81
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
7c04b912bb
compiler.cfg.value-numbering: update tests for Joe's condition code changes
2009-09-04 03:11:56 -05:00
Slava Pestov
4a2823b2eb
compiler: tweak generated code
2009-09-04 03:01:18 -05:00
Slava Pestov
e11d1e37f5
math.vectors.simd: allow punning SIMD vectors between types
2009-09-04 02:35:58 -05:00
Slava Pestov
c92e54b560
compiler.cfg.intrinsics: fix type detection on the alien type for vector accessors
2009-09-04 02:22:54 -05:00
Slava Pestov
e36a0d7ef4
compiler: clean up code generation for alien boxing/unboxing a bit
2009-09-03 21:22:43 -05:00
Slava Pestov
4d5a4222b6
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
036ff77306
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
bf81cb4259
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
ae051e0c9a
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
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
85a2bfab6c
compiler: eliminate boilerplate by centralizing info in declarative INSN: syntax
2009-09-02 06:22:37 -05:00
Slava Pestov
f91b539c31
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
868009aaee
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
bd629c1262
compiler/tests/codegen.factor: don't do exact float comparison
2009-08-30 18:57:45 -05:00
Slava Pestov
447c5fbf7a
compiler.cfg.linear-scan.live-intervals: dead-value-error is never thrown anymore
2009-08-30 05:15:18 -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
908b4742c5
compiler.cfg.value-numbering: fix ##box-displaced-alien simplification
2009-08-28 19:05:49 -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
ba0f3a9911
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
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
8bf709acd0
compiler.cfg.linear-scan: fix unit tests for new fake-representations
2009-08-26 08:58:00 -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
Slava Pestov
8d55616d34
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
0df8aadce2
cpu.x86: use SQRTSD instruction for math.libm:fsqrt word
2009-08-25 23:22:15 -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
81b72cb5c5
Add some unit tests
2009-08-22 17:15:10 -05:00
Slava Pestov
1961b4da16
next-fastcall-param word was not being called; on x86 its equivalent to inc but on ppc there is more logic, this fixes FFI on PowerPC
2009-08-21 20:15:19 -05:00
Slava Pestov
5197aca215
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
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
9ef8f6c81d
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
f01f7ad6eb
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
fd2f0a602d
compiler.cfg.stacks.local: more accurate local replace set computation; optimizes out 'swap swap'
2009-08-19 22:00:21 -05:00
Slava Pestov
a598cc35a5
compiler: add unit tests for new bugs
2009-08-19 16:56:26 -05:00
Slava Pestov
2dc99ea05f
Fix interval inference of abs, absq when input is a complex number
2009-08-19 16:06:37 -05:00
Slava Pestov
829107902e
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
507e2b7f3a
Fix some unit test failures
2009-08-18 03:49:05 -05:00
Slava Pestov
d7594c3381
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
3047d4a451
compiler.tree.propagation: remove method inlining heuristic
2009-08-17 22:29:05 -05:00
Slava Pestov
bf57d78b09
compiler.tree.modular-arithmetic: >fixnum elimination and value info annotations were too aggressive
2009-08-17 01:20:25 -05:00
Slava Pestov
5297be3e19
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
Daniel Ehrenberg
478b960560
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-14 20:11:54 -05:00
Daniel Ehrenberg
3cec74867d
Improving write barrier elimination; change to compiler.cfg.utilities to support this
2009-08-14 19:41:41 -05:00
Doug Coleman
7c92ab1ea5
move if-zero etc to math, remove 1-/1+ from math
2009-08-14 14:27:23 -05:00
Daniel Ehrenberg
8197d9356b
Write barriers are hoisted out of loops when their target is slot-available
2009-08-13 20:26:44 -05:00
Doug Coleman
2ed4425b7a
Merge branch 'master' of git://factorcode.org/git/factor
...
Conflicts:
basis/calendar/calendar.factor
2009-08-13 19:40:02 -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
Daniel Ehrenberg
5a3e350490
Global write barrier elimination tracks newly allocated objects
2009-08-13 15:18:47 -05:00
Daniel Ehrenberg
ad772cd261
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-12 23:56:05 -05:00
Daniel Ehrenberg
d35e1eb76c
Fixing write-barrier elimination; adding bb as a parameter to join-sets in dataflow analysis
2009-08-12 23:52:29 -05:00
Slava Pestov
4ecf5a904a
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
Daniel Ehrenberg
1a7ab59f56
Making write barrier elimination global
2009-08-11 21:21:21 -05:00
Slava Pestov
7bfbb0c5ac
math.intervals: fix interval-rem
2009-08-11 16:49:28 -05:00
Slava Pestov
422dd24bad
alien.complex: fix tests
2009-08-11 14:07:33 -05:00
Philipp Brüschweiler
26859a45eb
various doc fixes
2009-08-11 16:58:47 +02:00
Slava Pestov
7e35723db0
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
8a9c15ab0b
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
cc5476c823
_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
687454878a
compiler.cfg.linearization: change order to fit older unit tests
2009-08-08 23:06:57 -05:00
Slava Pestov
e400d80d8b
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
61ea749bb6
More accurate interval-mod and interval-rem
2009-08-08 22:01:12 -05:00
Slava Pestov
24a50c8006
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
55acddef3f
compiler.cfg.representation: OK to unbox output of ##load-reference globally
2009-08-08 20:03:13 -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
11dc0a23a8
compiler.cfg.ssa.liveness: fix tests
2009-08-08 16:15:45 -05:00
Slava Pestov
1bf8a0cac7
compiler.cfg.representations: emit-conversion should not be private since CSSA construction uses it
2009-08-08 04:13:30 -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
e21ca289c3
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
725280d424
Split off the notion of a register representation from a register class
2009-08-07 17:44:50 -05:00
Slava Pestov
370f4c081d
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
97ec3ea1b4
compiler.graphviz: add high-level IR call graph rendering
2009-08-05 03:33:06 -05:00
Slava Pestov
fb03a93763
compiler.tree.recursive: have to check tail call flag of call tree edges too
2009-08-05 02:14:49 -05:00
Slava Pestov
c3d60e5899
compiler.tree.recursive: more accurate loop detection
2009-08-04 19:18:40 -05:00
Slava Pestov
eed4f4dcfc
compiler.tree.recursive: add some more more loop detection tests
2009-08-04 16:23:14 -05:00
Slava Pestov
b49e4c9c9b
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-03 10:31:27 -05:00
Slava Pestov
d286a7f426
compiler.cfg.critical-edges: no longer neededed
2009-08-03 10:31:00 -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
720bfe378f
compiler.cfg.stacks.uninitialized: use bitand instead of min
2009-08-03 06:03:38 -05:00
Joe Groff
63e5b0d6d8
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-02 23:16:52 -05:00
Joe Groff
7c5ef08aab
[ [ ... ] compare ] sort => [ ... ] sort-with
2009-08-02 20:09:23 -05:00
Slava Pestov
dac7edd2ab
compiler.cfg.def-use: remove compute-def-use word, passes have to call compute-defs or compute-uses now; compiler.cfg.ssa.liveness: don't compute dominance and def-use first since destruction does already
2009-08-02 19:12:32 -05:00
Slava Pestov
df6c87d350
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-02 18:46:27 -05:00
Slava Pestov
32d9102feb
Revert "SSA destruction uses new SSA liveness checking"
...
This reverts commit 98c7de8410
.
2009-08-02 18:41:31 -05:00
Slava Pestov
a15b20a671
Revert "compiler.cfg.liveness.ssa: remove"
...
This reverts commit 6144fee101
.
2009-08-02 18:41:16 -05:00
Daniel Ehrenberg
665b3921d1
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-02 18:25:37 -04:00
Daniel Ehrenberg
f7a53811c1
Merge branch 'master' of git://factorcode.org/git/factor
...
Conflicts:
basis/compiler/cfg/ssa/liveness/liveness-tests.factor
2009-08-02 18:23:49 -04:00
Slava Pestov
634e1dd525
compiler.cfg.liveness.ssa: remove
2009-08-02 17:19:01 -05:00
Daniel Ehrenberg
765efc1a66
Removing phi-outs set in SSA liveness checking
2009-08-02 18:15:18 -04:00
Slava Pestov
777bda70dc
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-02 17:07:06 -05:00
Slava Pestov
8a8ebcb908
compiler.cfg.ssa.liveness: fix unit tests
2009-08-02 17:06:35 -05:00
Daniel Ehrenberg
3b78d03e2a
minor SSA liveness code reorganization
2009-08-02 18:05:51 -04:00
Daniel Ehrenberg
cf7ab59fb7
SSA destruction uses new SSA liveness checking
2009-08-02 18:04:45 -04:00
Daniel Ehrenberg
d349cc565a
def-use puts phi uses in respective predecessors
2009-08-02 18:04:07 -04:00
Slava Pestov
73e7ead209
compiler.cfg.ssa.destruction: add optimization from old destruction pass: don't run on CFGs that have no phi instructions
2009-08-02 10:57:27 -05:00
Slava Pestov
ba55633b19
compiler.cfg.ssa.interference: cleanup
2009-08-02 10:35:02 -05:00
Slava Pestov
82c1106945
compiler.cfg.ssa.destruction: new implementation: simpler and more correct
2009-08-02 10:26:52 -05:00
Slava Pestov
c1c8424605
Compiler speedups
2009-08-02 09:16:21 -05:00
Slava Pestov
8aa41672ca
compiler.cfg.ssa.destruction.copies: factor out add-instructions combinator into compiler.cfg.utilities
2009-08-02 08:20:50 -05:00
Slava Pestov
cff5976a0d
Move compiler.cfg.ssa.destruction.interference to compiler.cfg.ssa.interference
2009-08-02 08:15:36 -05:00
Slava Pestov
87e13db946
compiler.cfg.ssa.destruction.interference: fix a bug and add unit tests
2009-08-02 08:11:30 -05:00
Slava Pestov
7ec288b013
compiler.cfg.debugger: fix load error
2009-08-02 08:11:04 -05:00
Slava Pestov
b5a978d4e5
compiler.cfg.ssa.destruction: add some unit tests
2009-08-02 06:17:44 -05:00
Slava Pestov
c61b729125
compiler.cfg.critical-edges: update ##phi nodes
2009-08-02 06:17:22 -05:00
Slava Pestov
01f51a96cd
compiler.cfg.utilities: add each-phi combinator to iterate over all ##phi instructions in a basic block
2009-08-02 06:16:58 -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
9bde92220b
compiler.cfg.two-operand: if last instruction in a basic block is an overflowing arithmetic op of the form x = y op x, we now convert it correctly. This fixes compiler regression with benchmark.dawes after recent coalescing changes
2009-08-01 23:50:47 -05:00
Slava Pestov
e01fc93812
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
1ef9cd27d3
compiler.cfg.copy-prop: eliminate phi nodes that have the same inputs as a previous phi node in the basic block
2009-08-01 22:33:27 -05:00
Slava Pestov
05b7bb0079
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-01 20:22:51 -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
Daniel Ehrenberg
0838beed1e
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-01 20:33:41 -04:00
Slava Pestov
76368cae9b
compiler.cfg.liveness.ssa: fix bad bug discovered by littledan
2009-08-01 18:54:24 -05:00
Slava Pestov
2d719534cf
compiler.cfg.stacks: kill set now includes all locations eliminated as a result of stack height decrease; reduces number of ##replace instructions generated by 2%
2009-08-01 06:12:43 -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
45770c6250
Move a bunch of GC check generation logic to platform-independent side
2009-07-30 21:28:27 -05:00
Daniel Ehrenberg
8134d775a8
Faster SSA liveness testing
2009-07-30 15:23:47 -04:00
Slava Pestov
be363d1a5b
compiler.cfg: Get inline GC checks working again, using a dataflow analysis to compute uninitialized stack locations in compiler.cfg.stacks.uninitialized. Re-enable intrinsics which use inline allocation
2009-07-30 09:19:44 -05:00
Slava Pestov
791fbe4003
compiler.cfg.linear-scan: fix case where a register can be made available for only a part of a live interval's lifetime, but there are no more usages after the split location. This case never came up until global stack analysis, at which point it started to be exercised on x86-32
2009-07-30 02:13:30 -05:00
Slava Pestov
6274c0337a
compiler.cfg.ssa.destruction: fix
2009-07-29 23:43:00 -05:00
Slava Pestov
b133649edd
compiler.cfg.ssa.destruction: tweak in preparation for landing Dan's new SSA liveness analysis
2009-07-29 23:35:51 -05:00