Commit Graph

758 Commits (e374f2fa19da526356258baca386916bce11010b)

Author SHA1 Message Date
Slava Pestov a7b5957f6d compiler: hack to make XCreateIC() work on x86-64 2010-05-16 04:49:53 -04:00
Slava Pestov 8ebecac4d2 Merge branch 'master' of git://factorcode.org/git/factor 2010-05-16 04:10:03 -04:00
Slava Pestov e6abc0be15 Fixes for FFI changes 2010-05-16 04:09:47 -04:00
Joe Groff 645164188d compiler.cfg.instructions: ##select-vector instruction mapping to SSE4 PEXTR* 2010-05-16 00:50:19 -07:00
Slava Pestov 5b48cd2a63 FFI rewrite part 5: return value boxing and callback parameter boxing now uses vregs; simplify return value unboxing 2010-05-16 03:43:23 -04:00
Joe Groff 8c878ada17 compiler.cfg.instructions: ##gather-int-vector-2/4 instructions that map to SSE4 PINSR/PEXTR 2010-05-15 23:48:22 -07:00
Joe Groff 7c0cd6dc37 cpu.x86: fix bootstrap load error 2010-05-15 15:28:22 -07:00
Joe Groff 3de020c18a cpu.x86: don't enable bit-count intrinsic by default 2010-05-15 14:52:00 -07:00
Joe Groff 3956dd1516 cpu.x86.features: ( int alien-assembly ) c-bool> ==> ( bool alien-assembly ) 2010-05-15 14:33:19 -07:00
Joe Groff 009408dd11 cpu.x86: enable bit-count intrinsic if POPCNT available 2010-05-15 14:00:12 -07:00
Joe Groff 7fec53b509 compiler.cfg.instructions: ##bit-count insn 2010-05-15 13:57:35 -07:00
Joe Groff c00272d80a cpu.x86.features: add popcnt? test 2010-05-15 13:26:14 -07:00
Joe Groff d5b7ec3348 cpu.x86.assembler: SETcc instructions 2010-05-15 13:14:27 -07:00
Joe Groff 986ed057d8 cpu.x86.assembler: BT family instructions 2010-05-15 13:08:22 -07:00
Slava Pestov 62eadda2aa cpu.x86.bootstrap: use TEST instruction 2010-05-14 18:37:10 -04:00
Slava Pestov 5a67711bfd compiler.cfg: use x86 TEST instruction to optimize 'bitand 0 =' 2010-05-14 18:37:06 -04:00
Joe Groff 3766abd65e compiler.cfg.instructions: ##shuffle-vector-halves-imm insn to map to SSE's two-input SHUFPS/SHUFPD 2010-05-14 00:20:21 -07:00
Slava Pestov 4a98278720 cpu.x86.32: check for SSE2 on bootstrap since Factor now requires it 2010-05-13 18:25:46 -04:00
Slava Pestov 42b0d456cd Refactor x86-32 stack cleanup logic 2010-05-12 02:09:11 -04:00
Slava Pestov f89b85db7b Temporary fixes for x86-32 until FFI boxing is rewritten 2010-05-12 01:41:49 -04:00
Slava Pestov 1c76c87c5c cpu.x86.64: fix typo 2010-05-11 22:29:46 -04:00
Slava Pestov ee0640f176 Move flatten-c-type to death row so that it can be executed in part 5 2010-05-11 22:26:31 -04:00
Slava Pestov eb802208d1 FFI rewrite part 4: parameter and return value unboxing redesign 2010-05-11 19:11:44 -04:00
Slava Pestov 423f9c607a cpu.ppc: fixes 2010-05-10 17:50:10 -05:00
Slava Pestov 9321f9378a cpu.ppc: update for recent changes -- untested 2010-05-10 02:21:23 -04:00
Slava Pestov 45689dbfe6 compiler: simplify ##unbox-small/large-struct by emitting an ##unbox-any-c-ptr first 2010-05-10 01:38:34 -04:00
Slava Pestov 4478c3a51a FFI rewrite part 3: eliminate ##push-context-stack and ##pop-context-stack 2010-05-10 00:46:29 -04:00
Slava Pestov 7450dcf9ff cpu.x86.32: fix load error 2010-05-09 23:36:57 -04:00
Slava Pestov 7316d41226 FFI rewrite part 2: use ##peek and ##replace instructions to access stack 2010-05-09 23:26:43 -04:00
Slava Pestov 2912f21acc cpu.x86.64.unix: fix load error 2010-05-09 22:15:14 -04:00
Slava Pestov 839e26de3a cpu.x86.32: fix load error 2010-05-09 21:55:21 -04:00
Slava Pestov c211c3e84e FFI rewrite part 1: split up ##alien-invoke and friends into smaller instructions 2010-05-09 21:36:52 -04:00
Slava Pestov f988dad79c compiler.cfg: add ##load-float instruction for single precision floating point constants 2010-05-07 18:26:00 -04:00
Slava Pestov 627295f094 Language change: tuple slot setter words with stack effect ( value object -- ) are now named FOO<< instead of (>>FOO) 2010-05-06 17:21:02 -04:00
Slava Pestov 020c011d00 cpu.ppc: add missing cases to ##load/store-memory instructions 2010-05-05 13:37:25 -04:00
Slava Pestov aaa706dd29 cpu.x86.32: fix load error 2010-05-05 02:54:48 -04:00
Slava Pestov e763c74096 More FFI cleanups 2010-05-05 01:13:45 -04:00
Slava Pestov f3ea9288df cpu.ppc: updating optimizing compiler backend for recent changes 2010-05-04 05:51:54 -05:00
Slava Pestov 92a4b5ec7b cpu.ppc.assembler: new opcodes: LFDUX LFDX LFSUX LFSX STFDUX STFDX STFSUX STFSX 2010-05-04 05:47:21 -05:00
Slava Pestov fec408260e vm: tweak inline_gc() for PowerPC 2010-05-04 06:52:30 -04:00
Slava Pestov dd2a4c2c77 cpu.x86: GC root offsets were computed wrong in words containing alien calls 2010-05-04 02:53:53 -04:00
Slava Pestov 6c35652666 cpu: cleanups 2010-05-03 23:08:24 -04:00
Slava Pestov 86d89f3ff7 cpu.ppc: fixing typos in non-optimizing backend 2010-05-03 22:43:51 -04:00
Slava Pestov 652c4c28c6 cpu.x86.assembler: fix test on 64-bit 2010-05-03 20:16:13 -04:00
Slava Pestov bb3cea31ea cpu.ppc: updates for recent compiler changes, untested 2010-05-03 18:28:31 -04:00
Slava Pestov 58e4381eb1 compiler: new "binary literal area" at the end of a word's machine code stores constant floats and SIMD vectors; this allows ##load-reference/##load-memory fusion to be performed on x86-64, with a RIP-relative address reaching the data; also simplifies VM since custom relocation types used by the previous 32-bit-only optimization are no longer needed 2010-05-03 17:34:35 -04:00
Slava Pestov f5c5d8b44c compiler: remove flat machine representation and generate code directly from the CFG 2010-05-03 17:34:32 -04:00
Slava Pestov 428ba9fd0f compiler.cfg: fuse ##load-integer/##load-reference into ##replace to form ##replace-imm 2010-05-03 17:34:28 -04:00
Slava Pestov 9788323d25 compiler: add ##load-vector instruction to avoid wasting a temporary register on x86-32 2010-05-03 17:34:28 -04:00
Slava Pestov 1b4b66e341 cpu.x86: use available type info to generate more efficient %box-displaced-alien where possible 2010-05-03 17:34:27 -04:00
Slava Pestov 43f269e4eb Register allocation now uses SSA properties to coalesce values with different representations 2010-05-03 17:34:20 -04:00
Slava Pestov 95ff5ffe51 New GC checks work in progress 2010-05-03 17:34:16 -04:00
Slava Pestov 655497b7b4 cpu.x86.assembler: small cleanups 2010-05-03 17:34:15 -04:00
Slava Pestov a9ccfa8f05 strings: move string-nth primitive out of the VM and into the library 2010-05-03 17:34:12 -04:00
Slava Pestov 0f5d9974a0 compiler.cfg.representations: fix various bugs 2010-05-03 17:34:11 -04:00
Slava Pestov 378c2b2a46 compiler.cfg: add ##load-memory and ##store-memory instructions implementing complex addressing modes, and associated value numbering optimizations 2010-05-03 17:34:07 -04:00
Slava Pestov 2475699736 compiler.cfg: more flexible addressing for ##slot and ##set-slot 2010-05-03 17:34:06 -04:00
Slava Pestov 6d41d2277f cpu.x86.assembler: support all addressing modes 2010-05-03 17:34:06 -04:00
Slava Pestov 913b95192e compiler.cfg: merge all alien accessors into ##load-memory-imm and ##store-memory-imm 2010-05-03 17:34:06 -04:00
Slava Pestov 279eb461b1 compiler.cfg: remove ##set-string-nth-fast instruction since it can be expressed just as efficiently using other instructions 2010-05-03 17:34:04 -04:00
Slava Pestov 2ce926594d compiler.cfg.value-numbering: new optimizations; reassociation for shifts and redistribution for shifts/multiplies over additions/subtractions 2010-05-03 17:34:02 -04:00
Slava Pestov 82fb1879af Debugging untagged fixnums 2010-05-03 17:34:02 -04:00
Slava Pestov 5d3a7a7362 Untagged fixnums work in progress 2010-05-03 17:34:02 -04:00
Slava Pestov 503c0fcfde compiler: Start using tagged-rep for stuff, and split up compiler.cfg.representations into several sub-vocabularies 2010-05-03 17:34:01 -04:00
Slava Pestov d88aeb80d9 cpu.ppc: fix breakage caused by ##compare-imm change 2010-04-19 01:40:16 -05:00
Slava Pestov 2517b2fc2b compiler: combine ##load-constant followed by ##alien-double into a ##load-double on x86-32, saving an integer register 2010-04-18 21:42:45 -05:00
Slava Pestov 8f0739197e compiler.cfg: fix some bugs introduced by the ##compare-imm fusion patch 2010-04-18 21:42:45 -05:00
Slava Pestov 2aaf24412a compiler: change how 'f' is represented in low level IR to simplify some code, and fuse a ##load-constant of a word with a ##compare into a ##compare-imm on x86-32. This eliminates a spill from binary-search 2010-04-18 21:42:45 -05:00
Slava Pestov da6bcbedfc Replace 'untested' tag with 'not loaded' and 'not tested' tags 2010-04-13 18:43:01 -07:00
Slava Pestov 67e24b1d2a compiler.codegen: need to do name decoration with fastcall as well 2010-04-12 18:10:25 -05:00
Slava Pestov 2712496880 cpu.x86.32: fastcall struct returns are different on Linux than everywhere else for some unknown reason 2010-04-12 18:44:02 -04:00
Slava Pestov 1434a305c8 vm: add a new rc-absolute-1 relocation class to allow storing values in 8-bit operands, and optimized code sequences for inline caches using this 2010-04-12 14:22:41 -07:00
Slava Pestov 0202c35d2a alien: now that fastcall works better it doesn't need to be private 2010-04-10 16:57:07 -07:00
Slava Pestov ed40eb4239 cpu.x86.32: cleanups and fixes to make fastcall and thiscall callbacks work 2010-04-10 16:54:17 -07:00
Slava Pestov 46a1fb2646 Merge remote branch 'origin/abi-symbols' into fastcall-madness 2010-04-10 00:10:33 -07:00
Slava Pestov f828f9fdaa Fiddle with register assignments in non-optimizing x86-32 backend 2010-04-10 00:10:05 -07:00
Joe Groff 3e0d86f355 Merge branch 'master' of git://factorcode.org/git/factor into abi-symbols
Conflicts:
	basis/compiler/tests/alien.factor
2010-04-06 12:30:15 -07:00
Slava Pestov 430a05dcea Store stack bounds in TIB on win64 to make C++ exceptions work 2010-04-05 19:07:10 -04:00
Slava Pestov c0af678c5b cpu.x86.assembler: add support for absolute addressing on x86-64; [RIP+] now behaves like [] did, and [] now does absolute addressing just like in 32-bit mode 2010-04-04 19:42:57 -04:00
Slava Pestov b16d91576c cpu.x86.64: fix typo that caused bootstrap crash 2010-04-03 21:11:04 -04:00
Slava Pestov 74640b7f71 Get green threads working on Windows
- store stack base and limit in TIB
- set up a frame-based structured exception handler in each context's callstack
- boot.x86.32.image has now been replaced by boot.winnt-x86.32.image and boot.unix-x86.32.image
2010-04-03 20:24:33 -04:00
Joe Groff 2c3fde412a cpu.x86.32: add load-return-regs methods for stack-params so callbacks can box the struct return pointer 2010-04-01 22:01:10 -07:00
Slava Pestov 0faa3bcf4a vm: pre-allocate context alien 2010-04-02 00:02:21 -04:00
Joe Groff 88fbcba067 flatten non-integral types to (stack-value) on x86.32 2010-04-01 20:56:43 -07:00
Slava Pestov 044171e6b9 cpu.ppc: fix optimizing compiler backend 2010-04-01 21:41:13 -05:00
Slava Pestov 2cab0bb86c cpu.ppc: stick old stack pointer in a register for use by callbacks 2010-04-01 22:39:46 -04:00
Joe Groff 553b9fcd93 make "fastcall" symbol private since it doesn't really work in all cases 2010-04-01 18:34:15 -07:00
Joe Groff 666081f155 update %load-param-reg, %save-param-reg, and %cleanup to take register args into account 2010-04-01 17:36:09 -07:00
Slava Pestov eceabbc57e compiler: new set-special-object intrinsic; more efficient special-object intrinsic 2010-04-01 20:09:14 -04:00
Joe Groff ef884ef7f2 Merge branch 'master' into abi-symbols 2010-04-01 15:28:36 -07:00
Joe Groff 615c64443b update M\ int-regs param-regs for x86-32 to give input regs for thiscall/fastcall 2010-04-01 03:35:37 -07:00
Joe Groff 4fd61f0b5c cpu.architecture: alter param-regs to take abi as an (ignored for now) argument 2010-04-01 02:53:40 -07:00
Slava Pestov 1f9fbd22eb cpu.ppc: updating optimizing compiler backend for recent changes (untested) 2010-04-01 00:22:10 -04:00
Slava Pestov 1e1425a6e1 cpu.ppc: non-optimizing compiler backend fixes 2010-04-01 00:21:41 -04:00
Joe Groff 6805dc6401 remove redundant «stdcall?» word from cpu.x86.32 2010-03-31 19:57:29 -07:00
Joe Groff f3dd625de6 "stdcall" -> stdcall 2010-03-31 19:29:04 -07:00
Joe Groff a6ee4232bb "mingw" -> mingw 2010-03-31 19:28:11 -07:00
Joe Groff 65c3259761 "cdecl" -> cdecl 2010-03-31 19:20:35 -07:00
Slava Pestov 7d24459bb8 cpu.x86.assembler: add segment override prefixes 2010-03-31 20:47:13 -04:00
Slava Pestov ef53e6ecd5 cpu.x86.64: eliminate useless instruction from primitive call sequence for a marginal to non-existent gain 2010-03-31 19:32:36 -04:00
Slava Pestov 4b1361833e cpu.ppc: updating non-optimizing compiler backend for green threads (untested) 2010-03-31 15:19:14 -04:00
Slava Pestov 8f0487f1c3 cpu.x86: remove useless crap from c-to-factor sub-primitive 2010-03-31 15:19:00 -04:00
Slava Pestov fb2ecab614 threads: delete old contexts immediately instead of handing them off to a 'context recycler' thread 2010-03-30 21:47:48 -04:00
Slava Pestov e859a32096 cpu.x86.bootstrap: fix jit-profiling regression 2010-03-28 08:29:55 -04:00
Slava Pestov b6dfdcb909 set-context and start-context primitives can now pass parameters around 2010-03-27 08:13:57 -04:00
Slava Pestov 1717b8d0f7 Implement start-context and set-context primitives 2010-03-27 02:56:11 -04:00
Slava Pestov 560c119cd2 vm: actually use context callstacks when running code 2010-03-26 22:44:43 -04:00
Slava Pestov f9d6191c4b cpu.ppc: fix string c-type usage 2010-02-22 13:18:45 +13:00
Slava Pestov 95bfc8a240 vocabs.metadata: replace unportable tag with a platforms.txt file for more fine-grained control. Rename unportable tag to untested for remaining cases 2010-02-20 13:30:49 +13:00
Slava Pestov a3b74d88c9 cpu.architecture: rep-length now works in deployed images 2010-02-11 18:11:47 +13:00
Slava Pestov d5a25f99bf cpu.x86.64: inline cache miss blocks have a prolog generated in the middle of a procedure; undo a recent change to non-optimizing backend to fix random crashes 2010-02-06 18:45:27 +13:00
Slava Pestov daefa86b6d cpu.ppc: needs same fix for jit-profiling as on x86-64 2010-02-06 18:45:26 +13:00
Slava Pestov aa3d65272a cpu.x86: fix crashes when using certain features (threads, errors, etc) with profiling enabled on x86-64. The profiling stub was clobbering an argument for the unwind_native_frames() entry point 2010-02-05 20:52:19 +13:00
Slava Pestov 034cf391b1 cpu.ppc: final fix 2010-02-03 13:37:12 -06:00
Slava Pestov 5fbb8c8bc7 cpu.ppc: another fix 2010-02-04 08:19:59 +13:00
Slava Pestov 50c2a5ae84 cpu.ppc: load fixes 2010-02-04 08:08:31 +13:00
Slava Pestov 22fbe01c17 Compiled code size optimizations for x86-64 resulting in development image size reduction of about 350kb
- RIP-relative LEA is now used to load program counter in prolog and tail calls; saves 3 bytes of code and 4 bytes of relocation information over an immediate MOV
- VM field accesses no longer involve a redundant addition
2010-02-03 23:11:35 +13:00
Slava Pestov bf05a901c4 Fix ffi-test library to work with Windows SDK. Turns out MINGW has a different ABI for struct returns than MS's compiler; make the MS ABI the default for cdecl on Windows, and add mingw ABI for libraries that use the MINGW ABI 2010-02-02 04:01:12 -06:00
Slava Pestov 942f6e0943 Update Win64 support 2010-01-25 15:39:34 +13:00
Slava Pestov 892522f8bd alien.c-types: ensure that long and ulong types are defined with define-primitive-type and not typedef 2010-01-23 00:15:08 +13:00
Slava Pestov 5606825e8b vm: remove primitive table, non-optimizing compiler now looks up primitives with dlsym() 2010-01-19 20:00:33 +13:00
Slava Pestov 637a77c018 Stop wearing monocle and use the term "entry point" instead of "XT" throughout VM and compiler; also remove two unused relocation types 2010-01-18 20:54:00 +13:00
Slava Pestov 7bf76b9f13 PowerPC optimizing compiler backend fixes 2010-01-12 08:02:10 -06:00
Slava Pestov 988c8d0601 More PowerPC non-optimizing compiler backend fixes 2010-01-13 03:09:43 +13:00
Slava Pestov 85a45d63d9 unwind-stack-frames didn't load VM pointer into the VM register on PowerPC and x86-64, and so if C code had clobbered this register it would crash 2010-01-12 16:31:10 +13:00
Slava Pestov 87f6efc8ec cpu.ppc: fix some typos in non-optimizing backend 2010-01-11 14:15:41 +13:00
Slava Pestov 8d34a0f3c1 Store VM object in a register on x86-64 2010-01-11 01:20:32 +13:00
Slava Pestov 5b58117be1 cpu.x86: c-to-factor needs to deal with the fact that vm-reg might have been clobbered 2010-01-09 19:09:48 +13:00
Slava Pestov 6266b41325 Starting to update PowerPC backend for recent VM changes (untested) 2010-01-08 19:46:27 +13:00
Slava Pestov 1f88a925b4 Fix set-callstack primitive on Windows 2010-01-07 19:31:15 +13:00
Slava Pestov a04b85a45e cpu.x86: sse_version was renamed to (sse-version) 2010-01-07 18:30:01 +13:00
Slava Pestov 0f29fed1f1 cpu.x86: add some alien-assembly unit tests 2010-01-07 17:59:17 +13:00
Slava Pestov 235f3238f5 Add alien-assembly form for inline assembler, works like alien-invoke except calls a user-supplied quotation instead of generating a subroutine call. Replaces FPU status control, SSE detection and read timestamp routines in vm/cpu-x86.*S 2010-01-07 17:39:22 +13:00
Slava Pestov 9508a5a083 cpu.x86: don't have to pass VM pointer to quotations anymore 2010-01-06 23:42:00 +13:00
Slava Pestov 47c6197799 Update x86-32 for assembly entry point changes 2010-01-06 17:55:20 +13:00
Slava Pestov 36d2ac8921 vm: move c_to_factor, lazy_jit_compile_impl, throw_impl, set_callstack assembly routines into non-optimizing compiler for x86-64 2010-01-06 15:47:36 +13:00
Slava Pestov 18929373b9 Merge branch 'master' of git://factorcode.org/git/factor 2010-01-03 23:21:31 +13:00
Slava Pestov ba5b90e063 Change how non-volatile register preservation is done in alien callbacks, with the aim of fixing callbacks on PowerPC, and to eventually eliminate assembly code from VM
- Simplify calculation of offset in relocation table
- Open-code %alien-callback
- Remove magic_frame hack from context objects
- Move magical return instruction from optimizing compiler backend into callback entry stub
2010-01-03 01:11:51 +13:00
Slava Pestov 81430947d5 PowerPC: fix set-callstack primitive and start updating optimizing compiler backend for recent changes 2009-12-28 08:08:15 -06:00
Slava Pestov 94fbd8a224 cpu.ppc: fix non-optimizing compiler backend 2009-12-29 02:42:34 +13:00
Slava Pestov 285caff08e Updating non-optimizing PowerPC backend for register variable removal (untested) 2009-12-28 12:40:45 +13:00
Slava Pestov a77f48fe6b Updating x86-64 port for global register variable removal 2009-12-27 01:17:42 +13:00
Slava Pestov 67153bf4bb Fix bug in c_to_factor 2009-12-26 15:24:46 +13:00
Slava Pestov 15eb8d1a0a vm: remove VM_ASM_API 2009-12-24 01:37:24 +13:00
Slava Pestov e96404327e Get optimizing compiler working without global register variables in VM 2009-12-22 15:42:49 +13:00
Slava Pestov 63edd20a55 vm: eliminating register variables work in progress. Works on x86-32 with non-optimizing compiler 2009-12-19 10:59:56 +13:00
Slava Pestov c4719b7f5f Fix PowerPC compiler backend for recent changes 2009-12-15 09:51:20 -05:00
Slava Pestov 0068bce934 vm: big overhaul of non-optimizing compiler
- change some primitives into sub-primitives: fixnum+ fixnum- fixnum* inline-cache-miss inline-cache-miss-tail
- rename some relocation types for clarity
- some other minor re-organizations and cleanups
2009-12-15 07:20:09 -05:00
Joe Groff 3e40a36c50 fix simd tests 2009-12-05 17:17:16 -08:00
Joe Groff 1c40e4faa4 implement %scalar>integer for longlong reps on x86.64 2009-12-05 15:38:43 -08:00