Commit Graph

173 Commits (7f0469efef232e42efbaaaadde511528bf2e4b9f)

Author SHA1 Message Date
Slava Pestov 4d0ec09d9c 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 84ecb1266d add insns for vector pack, unpack, integer>float, and float>integer 2009-10-05 22:34:14 -05:00
Slava Pestov 931107397c 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 dca9d3e535 add %merge-vector-head and %merge-vector-tail instructions to back vmerge 2009-10-03 21:48:53 -05:00
Joe Groff e2e75c6b3a add intrinsic for vnot/vbitnot 2009-10-02 20:04:28 -05:00
Joe Groff 9d424a1092 Merge branch 'master' of git://factorcode.org/git/factor
Conflicts:
	basis/compiler/codegen/codegen.factor
2009-10-01 23:14:16 -05:00
Joe Groff 7b13fa4283 fold test-vector/branch sequences into a test-vector-branch instruction 2009-10-01 19:53:30 -05:00
Joe Groff 228ad950bb %test-vector instruction for vany?, vall?, vnone? 2009-10-01 15:35:38 -05:00
Joe Groff 94070c11aa %compare-vector instruction (only does v= for now) 2009-10-01 14:31:37 -05:00
Joe Groff 3ba79be651 Revert "add a %blend-vector intrinsic for v?"
This reverts commit 21e4b28b67.
2009-09-30 23:40:37 -05:00
Joe Groff 21e4b28b67 add a %blend-vector intrinsic for v? 2009-09-30 23:03:59 -05:00
Slava Pestov 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 2b13245704 math.vectors.simd: add fast intrinsic for 'nth', replace broadcast primitive with shuffles 2009-09-29 04:48:11 -05:00
Slava Pestov db217295b0 Work in progress 2009-09-28 17:31:34 -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 e8cfaccef0 compiler.cfg: nuke ##bignum>integer and ##integer>bignum since they were unused 2009-09-27 20:36:05 -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
Joe Groff bf3eef9e2d Merge branch 'master' of git://factorcode.org/git/factor 2009-09-26 20:38:19 -05:00
Joe Groff e30819bcac move alien.inline, alien.cxx, alien.marshall to unmaintained; nuke alien.structs 2009-09-26 20:37:42 -05:00
Phil Dawes 5b404aae7e 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 c0957ed908 compiler.codegen passes temp reg to %call-gc 2009-09-25 18:48:13 +01: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 abac963882 math.vectors.simd: new operations: vabs vsqrt vbitand vbitor vbitxor 2009-09-23 02:47:14 -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
Slava Pestov fc5fe2bd2a Merge Phil Dawes' VM work 2009-09-20 03:48:08 -05:00
Phil Dawes f5e6d43e1e 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 6e5ddc0c33 vm pointer passed to nest_stacks and unnest_stacks (win32) 2009-09-16 08:17:26 +01:00
Phil Dawes 2a1a4ccf27 fixed up getenv compiler intrinsic to use vm struct userenv 2009-09-16 08:16:32 +01:00
Joe Groff 334e93bbbf get things to a point where they bootstrap again 2009-09-15 21:43:18 -05: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 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 555543faae compiler: tweak generated code 2009-09-04 03:01:18 -05:00
Slava Pestov 1f5193198b compiler: clean up code generation for alien boxing/unboxing a bit 2009-09-03 21:22:43 -05:00
Slava Pestov 20dfbf7ac8 More SIMD work
- Rename SIMD types and register representations: <type>-<count> rather than <count><type>-array
- Make a functor to define 256-bit vector types, use it to define float-8 type
- Make SIMD instructions pure-insns so that they participate in value numbering
2009-09-03 20:58:56 -05:00
Slava Pestov 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 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 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 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 4fe0257169 cpu.x86: use SQRTSD instruction for math.libm:fsqrt word 2009-08-25 23:22:15 -05:00
Slava Pestov 930c9ed2ac 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
Doug Coleman d1ce837569 Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places, minor refactoring 2009-08-13 19:21:44 -05:00
Slava Pestov 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 4d2160799f Split off the notion of a register representation from a register class 2009-08-07 17:44:50 -05:00
Slava Pestov db55a031df Move a bunch of GC check generation logic to platform-independent side 2009-07-30 21:28:27 -05:00
Slava Pestov 99216b8435 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 68d06c4b06 compiler.cfg.linear-scan.assignment: modifies instructions in place instead of storing a registers assoc for further compile-time performance improvement 2009-07-29 06:36:14 -05:00
Slava Pestov cef47c452a compiler.codegen: collect instruction statistics 2009-07-27 03:58:15 -05:00
Slava Pestov 7c488f2b25 Insert _loop-entry in linearization pass instead of in CFG builder, so that optimizations don't have to worry about it 2009-07-22 06:05:17 -05:00
Slava Pestov 39a70db831 Improve code generation for shift word: add intrinsics for fixnum-shift-fast in the case where the shift count is not constant, transform 1 swap shift into a more overflow check with open-coded fast case, transform bitand into fixnum-bitand in more cases 2009-07-16 23:50:48 -05:00
Slava Pestov 99faf3c79f Overflowing fixnum intrinsics now expand into several CFG nodes. This speeds up the common case since only the uncommon case is now a stack syncpoint 2009-07-16 18:29:40 -05:00
Slava Pestov fa4f710095 compiler.cfg Remove height tracking for ##call instructions, wire in ##no-tco instruction 2009-06-30 21:21:46 -05:00
Slava Pestov d09ece8152 Split up compiler.cfg.linear-scan.allocation into a number of sub-vocabularies; start work on compiler.cfg.linear-scan.resolve; start work on inactive interval splitting 2009-06-11 17:55:14 -05:00
Slava Pestov 0d265fe016 Remove %dispatch-label since its tehe same on all platforms; fix %gc on PowerPC 2009-06-07 21:46:28 -05:00
Slava Pestov 7aca076408 GC checks now save and restore registers 2009-06-02 18:23:47 -05:00
Slava Pestov a07279bf6d Fix compiler errors 2009-06-01 03:00:10 -05:00
Slava Pestov 096803e58f Redo compiler.codegen.fixup and get %dispatch to work 2009-06-01 02:32:36 -05:00
Slava Pestov 64114947d2 Various improvements aimed at getting local optimization regressions fixed:
- Rename _gc to ##gc
- Absolute labels are now supported
- Generate _dispatch-label
2009-05-31 23:28:08 -05:00
Slava Pestov 40949800bf Fixing various bugs; alias analysis wasn't handling ##phi nodes, stack analysis incorrectly handled height-changing back edges and ##fixnum-*, clean up ##dispatch generation 2009-05-29 01:39:14 -05:00
Slava Pestov dfb7514a02 Removing slip usage from basis 2009-05-10 15:28:22 -05:00
Slava Pestov d3b85c14c9 Working on inline caching for tail call sites 2009-05-06 19:22:22 -05:00
Slava Pestov 478d29a175 Better separation of concerns: cpu.{x86,ppc}.assembler no longer depends on compiler.codegen.fixup and cpu.architecture. Rename rt-xt-direct to rt-xt-pic to better explain its purpose 2009-05-06 16:14:53 -05:00
Slava Pestov c68e05d3d8 Fix some test failures 2009-05-04 09:44:26 -05:00
Slava Pestov 5fb5c19d61 Machine code is now stored in a byte array instead of an array for add_code_block() 2009-04-30 04:34:35 -05:00
Slava Pestov 515c619202 Non-optimizing compiler now open-codes megamorphic dispatch fast path 2009-04-30 03:37:07 -05:00
Slava Pestov c15a4c1c5a Add new relocation type for call sites which may be replaced by ICs 2009-04-28 17:53:14 -05:00
Slava Pestov 7e84daf0f1 Move (execute) to kernel.private 2009-04-26 02:42:37 -05:00
Slava Pestov 8ea3db9eef Get rid of a 'rot' 2009-04-25 22:35:30 -05:00
Slava Pestov 5649cc7a0a Compiler warnings are no more 2009-04-23 22:17:25 -05:00
Slava Pestov c4be8bd65a Refactor error code so that error types are registered; listener prints a summary of errors 2009-04-12 16:08:46 -05:00
Slava Pestov 0a7485190b compile-error-type => source-error-type; make test failures global 2009-04-10 03:52:12 -05:00
Slava Pestov 39b53817b9 Small size reduction for deployed images 2009-03-31 08:15:27 -05:00
Doug Coleman 8b7fcce399 update code for usages of add-library 2009-03-25 23:00:19 -05:00
Slava Pestov 7f4c967ace More compact relocation layout 2009-03-19 20:02:43 -05:00
Slava Pestov be4fb1e7d9 Move call( and execute( to core 2009-03-16 20:11:36 -05:00
Slava Pestov 38c6be94d4 Fixing some stack comments 2009-03-16 06:17:18 -05:00
Slava Pestov 6b25e99470 Add summary for heaps more vocabs 2009-02-16 21:05:13 -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 4204fd495f Move formatted stream output words to io.styles; they didn't belong in core, and this reduces deployed image size 2009-01-13 17:12:43 -06:00
Slava Pestov 0021cde743 Fix more compile errors 2008-12-15 22:21:56 -06:00
Slava Pestov daf2857d7b define-inline now takes an effect parameter
C: now sets the stack effect of the new word to slot names
add new basis/constants vocab; CONSTANT: foo bar is equivalent to : foo bar ; inline
(going to fold CONSTANT:, ALIAS: and qualified into core soon perhaps)
tighten the screws: inline words now need a stack declaration too
update some usages of inline words
2008-12-15 19:44:56 -06:00
Slava Pestov 4f0a9f311e Untangling some dependencies 2008-12-08 14:58:00 -06:00
Slava Pestov 8a8f0c925c Use BSR instruction to implement fixnum-log2 intrinsic 2008-12-06 15:31:17 -06:00
Slava Pestov a56d480aa6 Various optimizations leading to a 10% speedup on compiling empty EBNF parser:
- open-code getenv primitive
- inline tuple predicates in finalization
- faster partial dispatch
- faster built-in type predicates
- faster tuple predicates
- faster lo-tag dispatch
- compile V{ } clone and H{ } clone more efficiently
- add fixnum fast-path to =; avoid indirect branch if two fixnums not eq
- faster >alist on hashtables
2008-12-06 09:16:29 -06:00
Slava Pestov f48653c47a Fix compile error 2008-12-05 23:51:34 -06:00
Slava Pestov aa838dbc2d Fix compile errors 2008-12-05 09:04:16 -06:00
Slava Pestov e256846acd Tweak string representation; high bit indicates if character has high bits in aux vector. Avoids memory access in common case. Split set-string-nth into two primitives; set-string-nth-fast is open-coded by optimizing compiler. 13% improvement on reverse-complement 2008-12-05 06:38:51 -06:00
Slava Pestov 6dce834d91 Get rid of some more >r/r> usages 2008-11-30 18:28:15 -06:00
Slava Pestov e7f4563374 fixnum* intrinsic for x86 2008-11-30 07:26:49 -06:00
Slava Pestov f44506089d More work on overflow instructions: don't need temp register anymore, add -tail variants which don't need stack frame 2008-11-28 06:36:30 -06:00
Slava Pestov 5634becda1 ##fixnum-add, ##fixnum-sub instructions open-code overflow check 2008-11-28 05:33:58 -06:00