00:00:00 --- log: started forth/09.07.26 02:27:27 --- quit: jauaor () 04:06:22 --- join: diverkk (n=lobane@unaffiliated/romani) joined #forth 04:25:20 --- part: diverkk left #forth 05:01:55 --- join: jauaor (n=araujo@gentoo/developer/araujo) joined #forth 06:26:55 --- join: GeDaMo (n=gedamo@212.225.107.61) joined #forth 07:03:14 --- join: crc (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #forth 07:30:04 --- quit: mathrick (Read error: 60 (Operation timed out)) 07:56:50 --- join: mathrick (n=mathrick@users177.kollegienet.dk) joined #forth 08:10:21 --- join: impomatic (n=John@nat66.mia.three.co.uk) joined #forth 08:10:28 Hi :-) 08:15:21 hey 09:33:19 --- join: NaNIV (n=NaN@200.125.72.229) joined #forth 09:34:44 --- part: NaNIV left #forth 09:41:52 --- quit: crc () 11:23:47 --- join: TreyB (n=trey@adsl-99-165-171-251.dsl.hstntx.sbcglobal.net) joined #forth 11:28:43 --- quit: jauaor () 12:03:00 --- join: I440r (n=mark4__@c-69-136-171-118.hsd1.in.comcast.net) joined #forth 12:06:14 In MOVE, the count is character isn't it, not words? The standard isn't clear. 12:07:47 more accurately BYTES 12:08:35 Thanks. Just implementing it now. 13:26:31 --- quit: proteusguy (Read error: 60 (Operation timed out)) 13:32:25 --- join: proteusguy (n=proteusg@zeppelin.proteus-tech.com) joined #forth 14:01:34 --- join: TreyB_ (n=trey@adsl-75-53-202-90.dsl.hstntx.sbcglobal.net) joined #forth 14:07:26 --- quit: TreyB (Read error: 110 (Connection timed out)) 14:13:16 --- join: crc (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #forth 14:49:35 "address units" 14:50:08 hi tathi 14:50:11 hey slava 14:50:19 I implemented my global stack elimination algorithm 14:50:22 did you get your stack -> regiser code working? 14:50:23 ah 14:50:24 so I can say it works now :) 14:50:26 yup 14:50:28 but how? 14:50:31 :) 14:50:58 http://paste.factorcode.org/paste?id=799 14:51:28 tathi: here's a quick overview 14:52:18 so the compiler operates on a control flow graph of basic blocks where each basic block is a list of 'virtual instructions' that operate on an infinite virtual register file 14:52:51 there are instructions for loading and storing stack locations, for doing arithmetic (on virtual registers), and for branching to other basic blocks in the CFG, and for calling other words 14:53:16 there are also instructions for changing the stack height 14:53:21 a naive translation is that every time you see a primitive, say integer addition, you emit two stack loads, the add, a stack height change, and a stack store 14:53:47 instead, what it does, is when the compiler frontend requests to emit a stack load or store, it simply makes a note that this stack location was requested, or modified 14:53:54 right 14:53:58 so for each basic block it has a load set and a store set 14:54:16 the load set contains pairs, with a stack location and the virtual register its going to go into 14:54:29 the store set also has pairs, with a register and the stack location its going to be stored in 14:54:45 got it 14:54:48 (also if there's a store followed by a load, the load just copies the source of the store into the destination virtual register) 14:55:11 now, what it does is it iterates over the CFG, computing 'global' load and store sets at each basic block 14:55:36 so it takes the union of the load sets of each successor, and adds teh block's own load set, and that becomes the block's global load set 14:55:48 and it takes the union of the store sets of each predecessor, and adds the block's store set,a nd that becomes the block's global store set 14:56:01 is the compiler itself written in forth? 14:56:02 this is done with a standard dataflow analysis technique 14:56:05 sure 14:56:27 also, if the basic block has a subroutine call, you don't propagate the load/store sets through 14:56:45 obviously 14:56:49 then, it iterates over all CFG edges, and if the source and destination edge have a mismatch in their load or store sets, it inserts the right stack load and store instructions 14:57:12 cool 14:58:14 after that it looks like a typical SSA-form optimizing compiler, except these stack laod/store instructions are clustered around subroutine calls 14:58:24 also, stack height changes are combined so that there's at most one per basic block 14:58:42 that makes sense 15:00:32 this depends on every subroutine call having a known stack height change 15:00:48 so that stack locaations in different blocks of the CFG can be compared (by normalizing them with the block's entry height first) 15:00:55 other than that, it could work in any stack language 15:02:04 --- quit: GeDaMo ("Leaving.") 16:29:47 --- join: Deformative (n=joe@c-68-84-167-117.hsd1.mi.comcast.net) joined #forth 17:05:49 --- join: nighty__ (n=nighty@210.188.173.245) joined #forth 18:17:51 --- quit: madwork (Read error: 110 (Connection timed out)) 18:27:07 --- join: Al2O3 (n=Al2O3@c-24-9-43-112.hsd1.co.comcast.net) joined #forth 18:56:07 --- quit: crc () 19:40:09 --- join: cataska (n=cataska@210.64.6.235) joined #forth 19:50:43 --- join: jauaor (n=araujo@gentoo/developer/araujo) joined #forth 19:51:27 hello 21:01:25 StrongFORTH imposes the known-stack-height-change requirement. 21:01:29 --- nick: TreyB_ -> TreyB 21:01:41 yeah 21:02:04 so, how about a StrongForth compiler which converts Forth code into SSA and passes it onto LLVM using the above algorithm :) 21:02:34 Seems fairly light-weight to me ;-) 21:07:58 iForth with native StrongFORTH support would get pretty dang close. 21:08:18 iForth doesn't do any interesting optimizations IIRC 21:08:20 its just a peephole optimizer 21:08:40 iForth? It does rather aggressive optimizations, I thought. 21:09:51 It can eliminate most of the stack traffic in a word, but I don't know if it does much in the way of global optimizations. 21:11:09 Both iForth and VFX do rather more than FORTH Inc,'s toolchains, last time I checked. 21:11:57 I'm working on coalescing right now 21:12:15 this is for placing variables in the same physical register at control flow merge points 21:12:57 Nice. 22:13:29 --- quit: Al2O3 () 22:23:42 --- quit: cataska (hubbard.freenode.net irc.freenode.net) 22:23:42 --- quit: malyn (hubbard.freenode.net irc.freenode.net) 22:23:43 --- quit: ment (hubbard.freenode.net irc.freenode.net) 22:28:15 --- join: ment (i=thement@ibawizard.net) joined #forth 22:28:39 --- join: cataska (n=cataska@210.64.6.235) joined #forth 22:28:39 --- join: malyn (n=malyn@unaffiliated/malyn) joined #forth 22:34:56 http://hpaste.org/fastcgi/hpaste.fcgi/view?id=7563#a7563 22:35:06 * jauaor chose self at the end 23:29:43 --- part: TR2N left #forth 23:59:59 --- log: ended forth/09.07.26