Commit Graph

640 Commits (d649daaf4fe78994d98c78c95ce3893dee431342)

Author SHA1 Message Date
Slava Pestov fc5fe2bd2a Merge Phil Dawes' VM work 2009-09-20 03:48:08 -05:00
Slava Pestov ea2bcd69c7 math.vectors.simd: redesign to be more flexible, integer SIMD work in progress 2009-09-20 02:08:32 -05:00
Joe Groff 4a1422e7fe 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 db2eba9b58 disambiguate math:float in cpu.ppc 2009-09-17 19:10:40 -05:00
Joe Groff ac5ea1769b get compiler tests loading 2009-09-16 09:20:47 -05:00
Phil Dawes 30b8b98446 small x86 asm cleanup 2009-09-16 08:22:17 +01:00
Phil Dawes a73886942a vm passed in primitives as arg0 for x86.64 2009-09-16 08:22:17 +01:00
Phil Dawes 123c6ce703 fixed up some alien boxing (x86 32 & 64) 2009-09-16 08:20:50 +01:00
Phil Dawes 46dac01d50 fixed vm ptr passing to to_value_struct 2009-09-16 08:20:50 +01:00
Phil Dawes 54d8285c7e fixed vm ptr passing to box_small_struct 2009-09-16 08:20:50 +01:00
Phil Dawes 0841b7ee90 fixed vm ptr passing to box_value_struct 2009-09-16 08:20:50 +01:00
Phil Dawes 898f5be1e0 quick test vocab for mt stuff 2009-09-16 08:20:50 +01:00
Phil Dawes 26586c24f0 added vm passing to some alien/boxing functions and added some vm asserts 2009-09-16 08:20:10 +01:00
Phil Dawes d7e2f770c0 vm ptr passed to lazy_jit_compile on x86.64 2009-09-16 08:20:10 +01:00
Phil Dawes 44d2d8672e Primitives now pass vm ptr on 64bit x86 2009-09-16 08:20:09 +01: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 b629429086 Dev checkpoint 2009-09-16 08:17:26 +01:00
Phil Dawes 6c046ec5bf added vm ptr to x86.32 boxing asm 2009-09-16 08:16:33 +01:00
Phil Dawes 780415b159 added code to pass vm ptr to some unboxers 2009-09-16 08:16:32 +01:00
Phil Dawes 2a1a4ccf27 fixed up getenv compiler intrinsic to use vm struct userenv 2009-09-16 08:16:32 +01:00
Phil Dawes cb3df86491 moved cards_offset and decks_offset into vm struct (for x86) 2009-09-16 08:16:31 +01:00
Phil Dawes fd72e140d2 nursery global variable moved into vm 2009-09-16 08:16:31 +01:00
Phil Dawes 6da959ff3b renamed to vm-field-offset. Slava's better at naming than me 2009-09-16 08:16:31 +01:00
sheeple 3602f86ab1 ppc asm to get stack_chain using vm ptr 2009-09-16 08:16:31 +01:00
Phil Dawes 77a13b1b6a Added a vm C-STRUCT, using it for struct offsets in x86 asm 2009-09-16 08:16:31 +01:00
Phil Dawes f9f1031dd8 moved stack_chain into vm struct 2009-09-16 08:16:31 +01:00
Phil Dawes 53aa98902e throw_impl now forwards the vm ptr 2009-09-16 08:16:30 +01:00
Phil Dawes 60d0300876 passing vm ptr to lazy_jit_compile mostly working 2009-09-16 08:16:30 +01:00
Phil Dawes 1fda8af73b Added %vm-invoke to pass vm ptr to vm functions (x86.32 only, otherwise uses singleton vm) 2009-09-16 08:16:30 +01:00
Phil Dawes df37e010d4 vm ptr passed to primitives on X86.32 (other cpus still use singleton vm ptr) 2009-09-16 08:16:30 +01:00
Joe Groff 334e93bbbf get things to a point where they bootstrap again 2009-09-15 21:43:18 -05:00
Joe Groff e33857a0c3 Merge branch 'master' into c-type-words 2009-09-15 19:14:41 -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
Joe Groff e5145b5a48 convert compiler cpu backends to use c-type words 2009-09-15 16:08:42 -05:00
Slava Pestov 680e6424bc cpu.ppc: fix %single>double-float and %double>single-float 2009-09-10 13:04:58 -05:00
Joe Groff 687a86fbb7 Merge branch 'master' of git://factorcode.org/git/factor 2009-09-09 17:14:48 -05:00
Joe Groff 54b8f04433 altivec instructions for powerpc assembler 2009-09-09 17:14:36 -05:00
Slava Pestov c04fb12f4c Merge branch 'master' of git://factorcode.org/git/factor 2009-09-09 13:56:20 -05:00
Slava Pestov 66f500bdd7 Fix the build 2009-09-09 13:44:54 -05:00
Slava Pestov 9f33d7e0fa cpu.ppc: fix bootstrap 2009-09-08 23:53:51 -05:00
Slava Pestov dd56449145 Merge branch 'master' of git://factorcode.org/git/factor 2009-09-08 22:34:17 -05:00
Slava Pestov 19a5f58b53 cpu.x86: tweak SIMD intrinsics 2009-09-08 22:34:01 -05:00
Joe Groff fe015ce2f0 no really, update ppc for argument order changes 2009-09-08 22:21:00 -05:00
Joe Groff b71f50ee04 Merge branch 'master' of git://factorcode.org/git/factor 2009-09-08 21:58:25 -05:00
Joe Groff b64b4a5cd9 update cpu.ppc for argument order changes 2009-09-08 21:58:11 -05:00
Slava Pestov 020e3b5713 Merge branch 'master' of git://factorcode.org/git/factor 2009-09-08 21:51:21 -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 f4e574383c typos in cpu.ppc 2009-09-08 21:44:11 -05:00
Slava Pestov fe0c137a1b Merge branch 'master' of git://factorcode.org/git/factor 2009-09-08 19:35:14 -05:00
Slava Pestov 3e90786bc1 Fix various test failures 2009-09-08 19:18:56 -05:00
Doug Coleman 8351100f7e Merge branch 'master' of git://factorcode.org/git/factor 2009-09-08 17:05:58 -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
Doug Coleman 74dea1e898 duplicate using 2009-09-08 17:02:31 -05:00
Slava Pestov 6396e901ca cpu.x86.features: better wording 2009-09-08 14:17:05 -05:00
Slava Pestov 05bffecab7 cpu.x86.features: add -sse-version command-line switch to override SSE detection 2009-09-08 13:56:37 -05:00
Slava Pestov 8eeeeb5c5b inline alien-vector and set-alien-vector if SIMD is not available for a small speedup 2009-09-08 13:56:17 -05:00
Slava Pestov ef09991500 Fixes 2009-09-08 00:13:18 -05:00
Slava Pestov 17821626c3 Fix conflicts 2009-09-07 23:51:25 -05:00
Joe Groff 9430fdc4b6 i had comisd/ucomisd backwards on x86 2009-09-04 12:30:30 -05:00
Slava Pestov 09c8175919 fix some typos in cpu.ppc 2009-09-04 11:18:41 -05:00
Slava Pestov 7f0ab1dc1e Merge branch 'master' of git://factorcode.org/git/factor into ppc-float-compare 2009-09-04 10:58:50 -05:00
Joe Groff e36700feb0 update powerpc compiler to generate correct float comparisons 2009-09-04 10:51:12 -05:00
Slava Pestov 7571d50bd3 cpu.ppc: fix typo 2009-09-04 06:41:33 -05:00
Slava Pestov 1f5193198b compiler: clean up code generation for alien boxing/unboxing a bit 2009-09-03 21:22:43 -05:00
Joe Groff b1ba82c84f convert comparison branch code in compiler to use locals 2009-09-03 21:19:39 -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 80ed4bc918 Merge branch 'master' into simd 2009-09-03 03:45:58 -05:00
Slava Pestov f811208271 Detect SSE version and enable the correct set of SIMD intrinsics 2009-09-03 03:28:38 -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
Joe Groff e9a5ed5931 i suck at reading tech docs--those were m64 instructions, not mm instructions 2009-09-02 12:58:35 -05:00
Joe Groff 0ddf19d033 get rid of useless mm->xmm instructions in cpu.x86.assembler, add MOVHLPS and MOVLHPS 2009-09-02 11:06:08 -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 e659203907 cpu.ppc: fix %box-displaced-alien 2009-08-30 20:56:04 -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
sheeple 8970cbc961 cpu.ppc: fix ##box-displaced-alien 2009-08-27 04:43:45 -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 e44b2eb875 cpu.ppc.assembler: LOAD32 assembler macro was busted 2009-08-25 22:37:10 -05:00
Slava Pestov 9805dde418 basis/cpu: eliminate some usages of rot 2009-08-25 19:38:48 -05:00
Slava Pestov e9818be8ae cpu.ppc.assembler: fix FMR and FMR. opcodes 2009-08-25 19:33:35 -05:00
sheeple 90b3921b31 cpu.ppc: integer>fixnum scratch area overlapped with the rest of stack frame, very bad 2009-08-22 20:23:28 -05:00
Slava Pestov 1b8636bad5 Merge branch 'master' of git://factorcode.org/git/factor 2009-08-21 18:48:44 -05:00
Slava Pestov b1a12f85e4 cpu.ppc: work in progress 2009-08-21 18:48:34 -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 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 4d2160799f Split off the notion of a register representation from a register class 2009-08-07 17:44:50 -05:00
Slava Pestov a7e61632d9 cpu.x86.assembler: make some words private 2009-08-05 18:30:42 -05:00
Slava Pestov 203a64f236 cpu.ppc: put spill slots and GC roots in stack frame where subroutine calls can't clobber them 2009-07-31 23:47:07 -05:00
Slava Pestov ebec4ffd75 Merge branch 'master' of git://factorcode.org/git/factor 2009-07-31 17:59:00 -05:00
Slava Pestov 0e59d29282 cpu.ppc: fix small typos 2009-07-31 17:57:15 -05:00
Doug Coleman c33343b302 fix using list on win64 2009-07-31 16:27:18 -05:00
Slava Pestov e32477fd59 cpu.ppc: Updating PowerPC backend for codegen changes over the last two months: new shift intrinsics added, fixnum overflow intrinsics are now treated like conditionals, GC checks are more complex and have a different API 2009-07-30 21:44:22 -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 d09013b311 Merge branch 'master' of git://factorcode.org/git/factor 2009-07-30 19:11:02 -05:00
Joe Groff b49fb43b60 Merge branch 'master' of git://factorcode.org/git/factor 2009-07-30 11:05:36 -05:00
Joe Groff c59c619364 add additional SSE2 packed integer operations 2009-07-30 11:05:12 -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 e3c38262ed Oopsie 2009-07-30 08:27:52 -05:00
Slava Pestov c9feb6f012 cpu.x86: Fix shuffle bug. Shuffling bugs occurring in code that runs before optimizer/stack checker is online are only caught at runtime during bootstrap, what a pain 2009-07-30 05:12:40 -05:00
Slava Pestov 4842641e75 cpu.x86: fix a bug in small-register logic on 32-bit. Also, on 32-bit, we don't need to do any special register shuffling to work with 16-bit operands since all registers have 16-bit variants. So now only 8-bit operands on x86-32 require special treatment 2009-07-30 05:04:46 -05:00
Slava Pestov 32a3abc9b4 cpu.x86: update non-optimizing compiler backends for assembler vocab split 2009-07-30 02:22:37 -05:00
Slava Pestov 226908d2d2 cpu.x86.assembler: fix extended 8-bit registers (DIL, SIL, SPL, BPL) 2009-07-29 22:32:22 -05:00
Slava Pestov 0899934220 cpu.x86: use full set of 8-bit, 16-bit and 32-bit registers on x86-64 to avoid clumsy save/restore logic 2009-07-29 21:56:37 -05:00
Slava Pestov 7831293fda cpu.x86.assembler: move operands to operands sub-vocabulary, clean up small-reg-* code in compiler backend 2009-07-29 21:44:08 -05:00
Slava Pestov c1fd97d515 Merge branch 'dcn' 2009-07-28 12:37:45 -05:00
Joe Groff 4c664a469a SSE4 opcodes for x86 assembler 2009-07-28 12:19:37 -05:00
Slava Pestov afd914c808 Merge branch 'master' into dcn 2009-07-28 11:20:43 -05:00
Joe Groff 1fe11f7c87 SSE1–SSSE3 opcodes + branch hints for x86 assembler 2009-07-28 00:22:27 -05:00
Slava Pestov f0a5ac3fbb cpu.x86: compile a load of zero, and adds, subs where dst = src1 more efficiently 2009-07-27 22:27:54 -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 1eae4286cd compiler.cfg: split off condition codes into a comparisons sub-vocabulary 2009-07-13 14:42:52 -05:00
Slava Pestov 27c0577c91 cpu.x86.32: don't emit sub %esp,0x0 in prologue on Linux and Windows 2009-07-01 18:13:45 -05:00
Slava Pestov 554559c0b1 %dispatch: sometimes the generated sequence is one byte longer, so instead of hard-coding it, compute the right length 2009-06-30 18:11:15 -05:00
Slava Pestov 4782c737ab cpu.x86: don't clobber src in %dispatch 2009-06-30 16:47:22 -05:00
Slava Pestov a61a992bfd cpu.x86.assembler: IMUL2 instruction was busted for immediate operands
When given a register and an immediate, it would generate imul imm,dst,dst however the 64-bit prefix was generated wrong and if dst was an extended register only the first operand would be an extended register. To fix this, change IMUL2 to not work on immediates anymore, and added a new IMUL3 that takes a destination register, source register, and immediate. Also, change compiler.cfg.two-operand to not two-operandize %mul-imm, since this isn't needed anymore.
This fixes the sporadic benchmark.tuple-arrays crash on 64-bit machines.
2009-06-08 21:15:52 -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 f0b132fa7f Fix 32-bit bootstrap 2009-06-03 03:23:55 -05:00
Slava Pestov fd710385e5 cpu.x86: fix small register intrinsics on x86-64 2009-06-03 03:22:46 -05:00
Slava Pestov 7aca076408 GC checks now save and restore registers 2009-06-02 18:23:47 -05:00
Slava Pestov 3de85158de Merge branch 'master' into global_optimization 2009-06-01 03:12:32 -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 e2b8b04d15 cpu.x86.features: add RDTSC support. This is a new vocabulary with words: sse2? instruction-counter count-instructions 2009-05-31 15:02:14 -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
U-C4\Administrator 9c85bc8ce3 fix duplicate using lines 2009-05-17 20:29:32 -05:00
Slava Pestov 514956537f Fix cpu.ppc for strict vocabulary search path semantics 2009-05-16 08:58:10 -05:00
Slava Pestov ba04d5af1e Update documentation for stricter vocabulary search path semantics 2009-05-16 00:29:21 -05:00
Slava Pestov 3e7269731b cpu.ppc: really fix bool type 2009-05-10 19:10:20 -05:00
Slava Pestov 9b491d1442 Fix bool type on PowerPC 2009-05-10 19:01:38 -05:00
Slava Pestov 931db821d1 Merge branch 'master' of git://factorcode.org/git/factor 2009-05-07 23:26:37 -05:00
Slava Pestov e007cb56e8 cpu.ppc: fix alien-indirect 2009-05-07 23:26:33 -05:00
Slava Pestov 5e35f19312 cpu.ppc: bools are 4 bytes on OS X/PowerPC 2009-05-07 23:18:41 -05:00
Slava Pestov 02bd871575 Merge branch 'master' of git://factorcode.org/git/factor 2009-05-07 19:47:42 -05:00
Slava Pestov cb9d50887c Update PowerPC %jump and %dispatch-label, and add PIC-related functions to cpu-ppc.hpp 2009-05-07 19:47:38 -05:00
Slava Pestov e78c043acb Merge branch 'master' of git://factorcode.org/git/factor 2009-05-07 19:41:54 -05:00
Slava Pestov b45284421d cpu.ppc.bootstrap: updates 2009-05-07 19:40:25 -05:00
Slava Pestov db6ae46c47 Fix x86-64 backend 2009-05-07 16:58:18 -05:00
Slava Pestov 9b419aa0b1 Count megamorphic cache hits 2009-05-07 14:26:08 -05:00
Slava Pestov 74094142fe Fix tail call PICs on x86-64 2009-05-06 22:44:30 -05:00
Slava Pestov 4f0a1b024e Clean up bootstrap.image, and implement new calling convention for tail calls; tail call sites now have PICs 2009-05-06 22:04:01 -05:00
Slava Pestov c1e25f3b43 JIT now supports multiple relocations per code template. This simplifies non-optimizing compiler backends 2009-05-06 20:04:49 -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 fdb87205d4 Merge branch 'master' of git://factorcode.org/git/factor 2009-05-06 15:34:48 -05:00
Slava Pestov 5e90662337 Working on PowerPC backend 2009-05-06 15:39:03 -05:00
Slava Pestov ddf05d82ce cpu.ppc.bootstrap: working on polymorphic inline caching for PowerPC 2009-05-06 15:30:52 -05:00
Slava Pestov bb246d5afc Remove some unused constants and update an obsolete comment 2009-05-06 14:57:17 -05:00
Slava Pestov 18454e4e6e cpu.x86.bootstrap: remove obsolete comment 2009-05-05 20:56:44 -05:00
Slava Pestov 9e34307f58 cpu.ppc.assembler: update for code_format=1 2009-05-05 20:56:36 -05:00
Slava Pestov 6f03366e2b Rename enable/disable-compiler to enable/disable-optimizer, and add with-optimizer and without-optimizer combinators 2009-05-01 05:52:05 -05:00
Slava Pestov 742d574162 Non-optimizing compiler doesn't need to optimize 'dispatch' primitive anymore since its rarely used 2009-04-30 19:42:08 -05:00
Slava Pestov f9ec0a07c5 Fix PICs for x86-64 2009-04-30 18:00:49 -05:00
Slava Pestov 5c9dc6d753 Tag-only PIC checks would always miss 2009-04-30 06:41:37 -05:00
Slava Pestov 4ae6269185 PPC make-image fix 2009-04-30 05:59:59 -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 59d6131c7c Bum 3 instructions out of megamorphic fast path by switching to fixed-size caches 2009-04-30 04:14:14 -05:00
Slava Pestov 8c01b79d06 Fix PPC make-image 2009-04-30 04:00:44 -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 62db617927 Get rid of two instructions from tag pics and one instruction from all others 2009-04-29 22:24:28 -05:00
Slava Pestov 5188f4e1f0 Fix TEST opcode in cpu.x86.assembler 2009-04-29 22:23:42 -05:00
Slava Pestov bd186b6320 Eliminate 3 instructions from PIC fast path 2009-04-29 21:32:05 -05:00
Slava Pestov 38a38a57a9 Fix hi-tag-or-tuple PICs 2009-04-29 03:00:09 -05:00
Slava Pestov 9243316489 Debugging inline caching 2009-04-28 23:05:18 -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 4d10105802 Working on inline caching 2009-04-28 03:48:37 -05:00
Slava Pestov 7e84daf0f1 Move (execute) to kernel.private 2009-04-26 02:42:37 -05:00
Slava Pestov 76281235e7 bootstrap.image: clean up jit-define and define-sub-primitive so that 2009-04-25 22:35:19 -05:00
Slava Pestov 27c84e89fe Working on faster (execute) 2009-04-25 21:14:59 -05:00
Slava Pestov 3353a777f7 Fixing some unit test failures 2009-04-22 07:05:00 -05:00
Slava Pestov 0f0218b209 Fix some compile warnings in bootstrap 2009-04-17 17:53:26 -05:00
sheeple 42d164db77 Fix C99 complex number support in FFI on Mac OS X/PPC 2009-03-30 07:19:14 -05:00
Slava Pestov 75452c842f cpu.ppc.bootstrap: update for syntax change 2009-03-22 21:37:42 -05:00
Slava Pestov ea60f8ae93 Changing : foo ; parsing to SYNTAX: foo ; 2009-03-21 01:27:50 -05:00
Slava Pestov 7f4c967ace More compact relocation layout 2009-03-19 20:02:43 -05:00
Slava Pestov bf41b187b0 Re-organize code so that with-compilation-unit can infer
Fix with-compilation-unit to work in deployed code
2009-03-13 19:39:32 -05:00
Doug Coleman 990513db60 use CONSTANT: in basis 2009-02-22 19:13:08 -06:00
Slava Pestov 6b25e99470 Add summary for heaps more vocabs 2009-02-16 21:05:13 -06:00
Slava Pestov 6b99b04531 Add vocab: for vocab-relative paths 2009-02-15 19:53:21 -06:00
sheeple 3c1ddde1f9 Fix complex float support on NetBSD 2009-02-12 08:10:21 -06:00
sheeple facd455e92 Working on complex float support in FFI on NetBSD 2009-02-12 06:25: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 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 c5160d76e9 Merge qualified, alias, symbols, constants into core 2008-12-17 18:10:01 -06:00
Slava Pestov 97fd662d61 Clean up PPC backend a bit 2008-12-16 02:03:21 -06:00
Slava Pestov 0021cde743 Fix more compile errors 2008-12-15 22:21:56 -06:00
Slava Pestov 5a45119252 Fix jit-dispatch on x86-64; was broken on windows 2008-12-15 20:55:24 -06:00
Slava Pestov 09c60f7e90 Fix some vocabularies for new requirement that inline words have a stack effect declaration 2008-12-15 20:31:55 -06:00
Slava Pestov d821cd7281 Fix win64 bootstrap 2008-12-10 01:19:22 -06:00
Slava Pestov 4b927f732f Clean up JIT backend a little 2008-12-09 17:14:17 -06:00
Slava Pestov 05e4626c49 Clean up 2008-12-09 03:22:09 -06:00
Slava Pestov 0359ec8eac Fix PowerPC backend again 2008-12-06 16:57:28 -06:00
Slava Pestov 8a8f0c925c Use BSR instruction to implement fixnum-log2 intrinsic 2008-12-06 15:31:17 -06:00
Slava Pestov d2ce4355f8 Fixing PPC backend 2008-12-06 15:30:40 -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 b06cfc6225 Update ppc backend for recent string intrinsic changes 2008-12-06 00:12:07 -06:00
Slava Pestov 82cf6530c6 set-string-nth-fast intrinsic was busted 2008-12-05 23:52:09 -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 e5ed7447ed Removing more >r/r> usages 2008-12-03 08:46:16 -06:00
Slava Pestov e4db2afb7e Update cpu.x86.assembler to use dip instead of >r/r> 2008-12-02 03:10:01 -06:00
Slava Pestov a558f91d5d Better command-line processing 2008-12-01 16:10:48 -06:00
Slava Pestov 3e25d14e54 Code cleanup: refactoring usages of rot and -rot to use newer idioms instead 2008-11-30 17:47:29 -06:00
Slava Pestov f55c5d1bd0 Fix compile error 2008-11-30 11:37:39 -06:00
Slava Pestov c7c3bbc5f5 Fix register assignments on 64-bit x86 2008-11-30 08:05:36 -06:00
sheeple 6400085bea Fix bootstrap, add a unit test 2008-11-30 07:36:29 -06:00
sheeple ff000f3e82 Merge branch 'master' of git://factorcode.org/git/factor 2008-11-30 07:25:37 -06:00
Slava Pestov e7f4563374 fixnum* intrinsic for x86 2008-11-30 07:26:49 -06:00
sheeple abc486c342 Subtraction overflow was wrong way round on PowerPC 2008-11-30 06:08:16 -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
U-SLAVA-DFB8FF805\Slava 6f0ec04310 Fix stack effect of param-reg-[12] on x86.3C2 2008-11-24 19:09:55 -06:00
Slava Pestov 9081247e34 Merge branch 'master' of git://factorcode.org/git/factor into faster_overflow_checks 2008-11-28 22:26:49 -06:00
sheeple 2b1a90e90a Fixing PowerPC arithmetic primitives 2008-11-28 22:22:26 -06:00
Slava Pestov bac609d7af Implement both-fixnums? sub-primitive for PowerPC 2008-11-28 21:18:42 -06:00
Slava Pestov 68dd6cc35a Working on PowerPC overflow checks 2008-11-28 20:02:50 -06:00
Slava Pestov eb8c621b6f Faster generic arithmetic on fiixnums: both-fixnums? sub-primitive performs a check if the top two stack items are both fixnums with a single conditional branch 2008-11-28 08:35:02 -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
Slava Pestov 6dfce7d4e7 load-locals is a primitive now, change semantics of get-locals to bum out 2 instructions from the sub-primitive 2008-11-27 22:30:29 -06:00
Slava Pestov 12d4f684ec Fix <long>, <ulong>, *long, *ulong on win64 2008-11-24 16:28:56 -06:00
Slava Pestov e62a558cf4 Merge branch 'master' of git://factorcode.org/git/factor 2008-11-24 12:01:55 -06:00
Slava Pestov d849287779 Fix fixnum/i-fast and fixnum/md-fast on PowerPC 2008-11-24 12:01:08 -06:00
sheeple 6c568d5c3d Fix PowerPC bootstrap 2008-11-24 11:34:18 -06:00
Slava Pestov ab689c098b Clean up direct literal code and make a first attempt at PowerPC support 2008-11-24 08:16:14 -06:00
Slava Pestov 2aaf860f47 Experimental optimizations 2008-11-24 06:40:51 -06:00
Slava Pestov dbf52c6176 Fix PowerPC bootstrap 2008-11-24 01:45:36 -06:00
Slava Pestov 87bc7d8c8b Update PPC non-optimizing compiler backend 2008-11-24 00:29:34 -06:00
Slava Pestov d86524f4bc Non-optimizing compiler now compiles dip, 2dip, 3dip, if, with direct branches instead of indirect branches. 8% bootstrap time improvement on Core Duo 2 2008-11-24 00:23:17 -06:00
Slava Pestov 60964487e0 Fix PowerPC dip/2dip/3dip 2008-11-23 04:14:17 -06:00
Slava Pestov 616df5da22 PowerPC dip/2dip/3dip JIT intrinsics (untested) 2008-11-23 03:04:45 -06:00
Slava Pestov a4d9cdfeb3 Refactor all usages of >r/r> in core to use dip, 2dip, 3dip
Non-optimizing compiler now special-cases dip, 2dip, 3dip following a
literal quotation: this allows us to break the dip/slip meta-circle
without explicit calls to >r/r>
2008-11-23 02:44:56 -06:00
Slava Pestov 303b3f2f83 Fix compile error in x86 bootstrap 2008-11-23 00:09:23 -06:00
Slava Pestov d5559d4132 Add fixnum/mod and fixnum/i subprimitives on PowerPC 2008-11-21 02:24:37 -06:00
Slava Pestov ae4f9a2809 Add fixnum/mod-fast and fixnum/i-fast subprimitives 2008-11-21 02:11:36 -06:00
unknown ccd13ce975 Define intptr_t type 2008-11-17 18:42:10 -06:00
Slava Pestov 20f5541d35 Refactoring FFI for Win64 2008-11-17 13:34:37 -06:00
Slava Pestov eef45a1cc3 Tweak PowerPC %dispatch 2008-11-13 05:58:49 -06:00
Slava Pestov a14e1ebcb5 Fix PowerPC bootstrap 2008-11-13 05:55:34 -06:00
Slava Pestov eb05dd3a12 Optimize a ##dispatch that is applied to the result of a ##sub-imm or ##add-imm; this eliminates an instruction from the common 1 fixnum-fast { ... } dispatch and 8 fixnum-fast { ... } dispatch code sequences appearing in generic word expansions 2008-11-13 04:16:08 -06:00
Slava Pestov 029ee67525 Fix ppc make-image 2008-11-13 04:12:09 -06:00
Slava Pestov cfa82cb474 New calling convention for VM primitives:
instead of the Factor side passing the stack pointer as the first parameter, and having the VM save it to stack_chain->top, we instead have the Factor side save it. Eliminates a lot of crud in the VM
2008-11-13 03:20:34 -06:00
sheeple ffe4bd6787 Various updates 2008-11-10 03:18:58 -06:00
Slava Pestov 28e397420d Fix USING: 2008-11-08 21:43:55 -06:00
unknown 7a6a280b5c Fix conflict 2008-11-08 21:41:33 -06:00
unknown f7fe84e563 Working on Win64 FFI 2008-11-08 21:40:47 -06:00
Slava Pestov 65dea0aa26 PowerPC backend fixes 2008-11-08 20:36:14 -06:00
Slava Pestov 9cc193ea5b Add unportable tags and fix my-arch word 2008-11-07 22:37:40 -06:00
Slava Pestov eb83b542d6 Fix unix x86.64 bootstrap 2008-11-07 21:54:13 -06:00
unknown de0cc7f99a Merge branch 'master' of git://factorcode.org/git/factor 2008-11-07 20:49:42 -06:00
Slava Pestov 639da2d335 Refactor OS-specific parts of PowerPC backend 2008-11-07 20:45:25 -06:00
unknown 7365959f01 Starting work on Win64 port 2008-11-07 20:33:32 -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
Slava Pestov 9366ad650d Add unportable tag 2008-11-06 09:29:21 -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 7741096bff Tweak PPC register usage; gcc doesn't like it when you mess with r31 for some reason 2008-11-06 03:36:46 -06:00
Slava Pestov 53cd75b06c Add string-nth intrinsic 2008-11-06 01:11:28 -06:00
Slava Pestov 2239f4fb99 More work on PowerPC backend; change register usage, free up some more integer and float regs (untested) 2008-11-05 04:20:35 -06:00
Slava Pestov dae41147fe %bignum>integer now takes a temporary register since this is useful on both x86 and ppc 2008-11-05 04:16:08 -06:00
Slava Pestov 8b7c47a68b Clean up x86 backend: move cpu.x86.architecture to cpu.x86, use branchless arithmetic in some intrinsics 2008-11-05 04:15:48 -06:00
Slava Pestov 10d3b4a55d New PPC backend (untested) 2008-11-05 00:31:08 -06:00
Slava Pestov d8345b5eda Update PPC non-optimizing compiler backend: there are three new sub-primitives to support 2008-11-04 06:07:19 -06:00
Slava Pestov 75e9708488 Oops 2008-11-03 06:50:59 -06:00
Slava Pestov e6f6cd5d93 Fix USING: -- you can now make ppc images, they just don't work yet 2008-11-03 06:40:14 -06:00
Slava Pestov 59f4f25b91 Loop alignment: appears to be a small win for reverse-complement 2008-11-03 06:20:51 -06:00
Slava Pestov 44a2499c17 fixnum-shift-fast and fixnum-mod subprimitives 2008-11-03 01:18:35 -06:00
Slava Pestov dd20b39cd6 fixnum-shift-fast subprimitive 2008-11-03 00:03:39 -06:00
Slava Pestov abb02f1784 Flesh out shift instructions 2008-11-03 00:03:00 -06:00
Slava Pestov 804c6f93ea Fix x86.32 2008-10-31 21:07:41 -05:00
Slava Pestov db4db19cd9 Start working on coalescing 2008-10-28 02:38:37 -07:00
Slava Pestov 69a0ad5e42 Ricing locals 2008-10-23 05:49:32 -05:00
Slava Pestov 84820244dd Merge branch 'master' into new_codegen 2008-10-21 23:19:20 -05:00
Slava Pestov 52020c2fe3 Fixing x86 instruction encoding for addressing with base = ESP or R12 2008-10-21 23:18:27 -05:00
Slava Pestov 1b06ab1b39 Fixing various bugs 2008-10-21 23:17:32 -05:00
Slava Pestov 87e9fbb34c Comparison operations 2008-10-21 03:21:29 -05:00
Slava Pestov e92f795a76 More work on intrinsics; memory allocation and slot access now expands correctly 2008-10-20 20:40:15 -05:00
Slava Pestov 508b1f52b8 Update x86 backend for SSA codegen 2008-10-20 05:55:57 -05:00
Slava Pestov 37cf7d9a9c Add SSA comparison instructions, fix various problems 2008-10-20 05:55:20 -05:00
Slava Pestov f092622fac CFG IR is now pure SSA 2008-10-20 01:56:28 -05:00
Slava Pestov 14d8696f40 Oops, don't mix register classes in active set 2008-10-19 03:34:42 -05:00
Slava Pestov 774ecf61e9 Implement spilling on x86 2008-10-19 01:10:45 -05:00
Slava Pestov fe2c20882a Fix alien accessor intrinsics; a bit more complex now that we don't reserve a tempreg 2008-10-13 22:43:32 -05:00
Slava Pestov f2c6f8de5b Using fry in cpu.x86, working on alien intrinsics 2008-10-13 16:43:58 -05:00
Slava Pestov 740b6ef3f2 Free up a register on x86.64 2008-10-13 14:03:21 -05:00
Slava Pestov d8d3645d72 Fixing more codegen bugs 2008-10-13 12:49:20 -05:00
Slava Pestov ae3c4ae1b6 Fix some problems with callbacks 2008-10-12 23:32:14 -05:00
Slava Pestov 2f4f86d288 Fix (set-slot) template 2008-10-12 17:36:34 -05:00
Slava Pestov 048d8daf09 Update intrinsics 2008-10-11 14:05:24 -05:00
Slava Pestov 3844cb62d8 Fix %write-barrier 2008-10-10 03:16:26 -05:00
Slava Pestov c98651043c Fix reversed polarity of FP comparisons 2008-10-10 02:33:47 -05:00
Slava Pestov e5a55dafad Fix bignum inline allocator 2008-10-09 17:03:30 -05:00
Slava Pestov 2438c78c6c Merge branch 'master' into new_codegen 2008-10-09 14:18:24 -05:00
sheeple bb6b998686 Fix alien-indirect on ppc 2008-10-09 14:04:33 -05:00
Slava Pestov cf46a832e7 Debugging register allocator and inline allocation 2008-10-08 23:42:53 -05:00
Slava Pestov 0e4e05d5cd Debugging new codegen 2008-10-08 03:51:44 -05:00
Slava Pestov 7b6d9c4c4f Debugging new codegen 2008-10-07 20:00:38 -05:00
Slava Pestov e6e313eba9 Backend updates 2008-10-07 16:42:11 -05:00
Slava Pestov e69278b8fc Merging in new codegen 2008-10-07 16:17:55 -05:00
Slava Pestov 3c2caf948a 16-align stack on x86-64 2008-10-06 00:33:47 -05:00
Slava Pestov 4ca06ae50f Typo 2008-10-06 00:20:24 -05:00
Slava Pestov 33d775890c More stack frame refactoring 2008-10-06 00:20:00 -05:00
Slava Pestov a5fcb006fb Clean up x86 stack frame code a bit more 2008-10-05 22:17:56 -05:00
Slava Pestov d5112a0ced Working on stack frame cleanup 2008-10-05 21:30:29 -05:00
Slava Pestov c19f2257f4 Fix permission bits 2008-10-02 08:34:49 -05:00
Slava Pestov 2305117c21 Fix PPC bootstrap 2008-09-13 20:40:54 -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 8b9784108e Don't clobber RBX 2008-09-13 14:25:06 -05:00
Slava Pestov 6d050a61a7 Fix Joe Groff's x86-64 structs/callbacks bug 2008-09-12 04:02:32 -05:00
Slava Pestov 2f96db70b5 Merge branch 'master' of git://factorcode.org/git/factor 2008-09-11 01:21:49 -05:00
Doug Coleman b544a3b1b7 ppc bootstrap 2008-09-11 01:15:31 -05:00
Slava Pestov 127896c201 More fixes 2008-09-11 00:48:23 -05:00
Slava Pestov 0c8e2584b4 Fixing unit tests for make, fry changes 2008-09-11 00:20:06 -05:00
Slava Pestov cf80dd122a Updating code for make and fry changes 2008-09-10 22:11:40 -05:00
Slava Pestov 44f53de164 Move make to its own vocabulary, remove fry _ feature 2008-09-10 20:07:00 -05:00
Slava Pestov a3d1379b8c Fix bug with large structs passed by value on x86.64 2008-09-09 03:10:43 -05:00
Slava Pestov aea0fed14c Fixing basis -> extra dependencies 2008-09-05 19:29:14 -05:00
Slava Pestov fdf75fe110 Remove slots.deprecated, remove unused slots from slot-spec tuple; last vestiges of old accessors are now gone forever 2008-09-03 18:47:52 -05:00
Slava Pestov d552ee1071 Tweak PPC intrinsics 2008-09-03 04:02:25 -05:00
Slava Pestov a4a00f6e40 Adding missing optimizations to finalization pass 2008-09-02 22:59:49 -05:00
sheeple 1ef49b1a00 fix intrinsic 2008-09-02 17:02:15 -05:00
sheeple 6dcb6b9c95 Merge branch 'master' of git://factorcode.org/git/factor 2008-09-01 19:06:02 -05:00
sheeple c8cecf8768 Fix stack effect declarations 2008-09-01 19:06:00 -05:00
Slava Pestov 4be346cd9c Fixing PowerPC intrinsics 2008-09-01 18:34:16 -05:00
Slava Pestov 0c304b8fc6 Removing old accessor usages from core and basis 2008-08-31 07:45:33 -05:00
Slava Pestov b73bc69084 Fix PPC again, oops 2008-08-31 05:50:02 -05:00
Slava Pestov 01e1092c8d Fix PowerPC backend 2008-08-31 02:12:12 -05:00
Slava Pestov 6ead724b25 Fixing bugs 2008-08-29 04:23:39 -05:00
Slava Pestov 1fcbdf9d52 Fix more compiler bugs 2008-08-29 00:26:47 -05:00
Slava Pestov 86f11713e3 Fixing some more bugs 2008-08-22 03:12:15 -05:00
Slava Pestov 87cd0a5dab Fix 2008-08-13 14:17:36 -05:00
Slava Pestov a5ff214d67 More load fixes 2008-08-12 03:38:56 -05:00
Slava Pestov 48fa2e2d0e Updating some code 2008-08-12 03:31:48 -05:00
Slava Pestov 6408b01e9d Add 'unportable' tag in place of hard-coded list of 'dangerous' vocabs in load-everything 2008-07-29 16:47:52 -05:00
Slava Pestov 04df07ae7e Fix PowerPC make-image 2008-07-29 00:07:31 -05:00
Slava Pestov d66f887736 Create basis vocab root 2008-07-28 22:03:13 -05:00