| 
									
										
										
										
											2011-09-14 00:38:03 -04:00
										 |  |  | ! Copyright (C) 2008, 2011 Slava Pestov. | 
					
						
							| 
									
										
										
										
											2008-09-10 23:11:03 -04:00
										 |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							| 
									
										
										
										
											2011-09-14 00:38:03 -04:00
										 |  |  | USING: byte-arrays namespaces make math math.order math.parser | 
					
						
							|  |  |  | sequences accessors kernel layouts assocs words summary arrays | 
					
						
							| 
									
										
										
										
											2011-12-05 17:26:14 -05:00
										 |  |  | combinators sets continuations.private fry | 
					
						
							| 
									
										
										
										
											2011-09-14 00:38:03 -04:00
										 |  |  | cpu.architecture classes classes.struct locals slots parser | 
					
						
							|  |  |  | generic.parser strings quotations hashtables | 
					
						
							| 
									
										
										
										
											2011-12-05 17:26:14 -05:00
										 |  |  | sequences.generalizations | 
					
						
							| 
									
										
										
										
											2009-06-07 22:46:28 -04:00
										 |  |  | compiler.constants | 
					
						
							| 
									
										
										
										
											2008-09-17 01:46:38 -04:00
										 |  |  | compiler.cfg | 
					
						
							| 
									
										
										
										
											2010-05-02 18:48:41 -04:00
										 |  |  | compiler.cfg.linearization | 
					
						
							| 
									
										
										
										
											2008-09-17 01:46:38 -04:00
										 |  |  | compiler.cfg.instructions | 
					
						
							| 
									
										
										
										
											2010-05-02 18:48:41 -04:00
										 |  |  | compiler.cfg.comparisons | 
					
						
							| 
									
										
										
										
											2009-06-02 19:23:47 -04:00
										 |  |  | compiler.cfg.stack-frame | 
					
						
							| 
									
										
										
										
											2008-10-07 17:13:29 -04:00
										 |  |  | compiler.cfg.registers | 
					
						
							| 
									
										
										
										
											2008-10-20 02:56:28 -04:00
										 |  |  | compiler.cfg.builder | 
					
						
							| 
									
										
										
										
											2011-09-14 00:38:03 -04:00
										 |  |  | compiler.codegen.gc-maps | 
					
						
							|  |  |  | compiler.codegen.labels | 
					
						
							|  |  |  | compiler.codegen.relocation | 
					
						
							| 
									
										
										
										
											2009-01-13 18:12:43 -05:00
										 |  |  | compiler.utilities ;
 | 
					
						
							| 
									
										
										
										
											2010-02-26 16:01:01 -05:00
										 |  |  | FROM: namespaces => set ;
 | 
					
						
							| 
									
										
										
										
											2008-09-17 01:46:38 -04:00
										 |  |  | IN: compiler.codegen | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-27 04:58:15 -04:00
										 |  |  | SYMBOL: insn-counts | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | H{ } clone insn-counts set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-09-17 01:46:38 -04:00
										 |  |  | GENERIC: generate-insn ( insn -- )
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-02 18:48:41 -04:00
										 |  |  | ! Control flow | 
					
						
							| 
									
										
										
										
											2008-09-17 01:46:38 -04:00
										 |  |  | SYMBOL: labels | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-02 18:48:41 -04:00
										 |  |  | : lookup-label ( bb -- label )
 | 
					
						
							| 
									
										
										
										
											2010-04-27 10:51:00 -04:00
										 |  |  |     labels get [ drop <label> ] cache ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-02 18:48:41 -04:00
										 |  |  | : useless-branch? ( bb successor -- ? )
 | 
					
						
							|  |  |  |     ! If our successor immediately follows us in linearization | 
					
						
							|  |  |  |     ! order then we don't need to branch. | 
					
						
							|  |  |  |     [ block-number ] bi@ 1 - = ; inline
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : emit-branch ( bb successor -- )
 | 
					
						
							|  |  |  |     2dup useless-branch? | 
					
						
							|  |  |  |     [ 2drop ] [ nip lookup-label %jump-label ] if ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: ##branch generate-insn | 
					
						
							|  |  |  |     drop basic-block get dup successors>> first emit-branch ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | GENERIC: generate-conditional-insn ( label insn -- )
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | GENERIC: negate-insn-cc ( insn -- )
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: conditional-branch-insn negate-insn-cc | 
					
						
							|  |  |  |     [ negate-cc ] change-cc drop ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: ##test-vector-branch negate-insn-cc | 
					
						
							|  |  |  |     [ negate-vcc ] change-vcc drop ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M:: conditional-branch-insn generate-insn ( insn -- )
 | 
					
						
							|  |  |  |     basic-block get :> bb | 
					
						
							|  |  |  |     bb successors>> first2 :> ( first second )
 | 
					
						
							|  |  |  |     bb second useless-branch? | 
					
						
							|  |  |  |     [ bb second first ] | 
					
						
							|  |  |  |     [ bb first second insn negate-insn-cc ] if
 | 
					
						
							|  |  |  |     lookup-label insn generate-conditional-insn | 
					
						
							|  |  |  |     emit-branch ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : %dispatch-label ( label -- )
 | 
					
						
							|  |  |  |     cell 0 <repetition> % | 
					
						
							|  |  |  |     rc-absolute-cell label-fixup ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: ##dispatch generate-insn | 
					
						
							|  |  |  |     [ src>> ] [ temp>> ] bi %dispatch | 
					
						
							|  |  |  |     basic-block get successors>> | 
					
						
							|  |  |  |     [ lookup-label %dispatch-label ] each ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : generate-block ( bb -- )
 | 
					
						
							|  |  |  |     [ basic-block set ] | 
					
						
							|  |  |  |     [ lookup-label resolve-label ] | 
					
						
							|  |  |  |     [ | 
					
						
							| 
									
										
										
										
											2009-10-06 07:25:07 -04:00
										 |  |  |         instructions>> [ | 
					
						
							| 
									
										
										
										
											2012-08-02 18:06:04 -04:00
										 |  |  |             [ class-of insn-counts get-global inc-at ] | 
					
						
							| 
									
										
										
										
											2009-10-06 07:25:07 -04:00
										 |  |  |             [ generate-insn ] | 
					
						
							|  |  |  |             bi
 | 
					
						
							|  |  |  |         ] each
 | 
					
						
							| 
									
										
										
										
											2010-05-02 18:48:41 -04:00
										 |  |  |     ] tri ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-14 00:38:03 -04:00
										 |  |  | : init-fixup ( -- )
 | 
					
						
							|  |  |  |     V{ } clone label-table set
 | 
					
						
							|  |  |  |     V{ } clone binary-literal-table set ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : check-fixup ( seq -- )
 | 
					
						
							|  |  |  |     length data-alignment get mod 0 assert= ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : with-fixup ( quot -- code )
 | 
					
						
							|  |  |  |     '[ | 
					
						
							|  |  |  |         init-relocation | 
					
						
							|  |  |  |         init-gc-maps | 
					
						
							|  |  |  |         init-fixup | 
					
						
							|  |  |  |         [ | 
					
						
							|  |  |  |             @ | 
					
						
							|  |  |  |             emit-binary-literals | 
					
						
							|  |  |  |             emit-gc-maps | 
					
						
							|  |  |  |             label-table [ compute-labels ] change
 | 
					
						
							|  |  |  |             parameter-table get >array
 | 
					
						
							|  |  |  |             literal-table get >array
 | 
					
						
							|  |  |  |             relocation-table get >byte-array | 
					
						
							|  |  |  |             label-table get
 | 
					
						
							|  |  |  |         ] B{ } make | 
					
						
							|  |  |  |         dup check-fixup | 
					
						
							| 
									
										
										
										
											2011-12-14 15:51:12 -05:00
										 |  |  |         cfg get [ stack-frame>> [ total-size>> ] [ 0 ] if* ] [ 0 ] if*
 | 
					
						
							| 
									
										
										
										
											2011-11-25 21:58:21 -05:00
										 |  |  |     ] call 6 narray ; inline
 | 
					
						
							| 
									
										
										
										
											2011-09-14 00:38:03 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-02 18:48:41 -04:00
										 |  |  | : generate ( cfg -- code )
 | 
					
						
							| 
									
										
										
										
											2010-05-10 00:42:03 -04:00
										 |  |  |     [ | 
					
						
							| 
									
										
										
										
											2010-05-02 18:48:41 -04:00
										 |  |  |         H{ } clone labels set
 | 
					
						
							|  |  |  |         linearization-order | 
					
						
							|  |  |  |         [ number-blocks ] [ [ generate-block ] each ] bi
 | 
					
						
							| 
									
										
										
										
											2009-06-01 03:32:36 -04:00
										 |  |  |     ] with-fixup ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | ! Special cases | 
					
						
							| 
									
										
										
										
											2009-06-30 22:21:46 -04:00
										 |  |  | M: ##no-tco generate-insn drop ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-02 18:48:41 -04:00
										 |  |  | M: ##prologue generate-insn | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     cfg get stack-frame>> | 
					
						
							|  |  |  |     [ [ stack-frame set ] [ total-size>> %prologue ] bi ] when* ;
 | 
					
						
							| 
									
										
										
										
											2008-09-17 01:46:38 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-02 18:48:41 -04:00
										 |  |  | M: ##epilogue generate-insn | 
					
						
							|  |  |  |     drop
 | 
					
						
							|  |  |  |     cfg get stack-frame>> [ total-size>> %epilogue ] when* ;
 | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! Some meta-programming to generate simple code generators, where | 
					
						
							|  |  |  | ! the instruction is unpacked and then a %word is called | 
					
						
							|  |  |  | << | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : insn-slot-quot ( spec -- quot )
 | 
					
						
							| 
									
										
										
										
											2010-05-02 18:48:41 -04:00
										 |  |  |     name>> reader-word 1quotation ;
 | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : codegen-method-body ( class word -- quot )
 | 
					
						
							|  |  |  |     [ | 
					
						
							|  |  |  |         "insn-slots" word-prop | 
					
						
							| 
									
										
										
										
											2009-09-04 04:01:18 -04:00
										 |  |  |         [ insn-slot-quot ] map cleave>quot
 | 
					
						
							|  |  |  |     ] dip suffix ;
 | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | SYNTAX: CODEGEN: | 
					
						
							|  |  |  |     scan-word [ \ generate-insn create-method-in ] keep scan-word | 
					
						
							|  |  |  |     codegen-method-body define ;
 | 
					
						
							| 
									
										
										
										
											2010-04-27 10:51:00 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | >> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-21 03:08:52 -04:00
										 |  |  | CODEGEN: ##load-integer %load-immediate | 
					
						
							|  |  |  | CODEGEN: ##load-tagged %load-immediate | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | CODEGEN: ##load-reference %load-reference | 
					
						
							| 
									
										
										
										
											2010-05-07 18:26:00 -04:00
										 |  |  | CODEGEN: ##load-float %load-float | 
					
						
							| 
									
										
										
										
											2010-04-18 22:42:19 -04:00
										 |  |  | CODEGEN: ##load-double %load-double | 
					
						
							| 
									
										
										
										
											2010-04-30 21:33:42 -04:00
										 |  |  | CODEGEN: ##load-vector %load-vector | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | CODEGEN: ##peek %peek | 
					
						
							|  |  |  | CODEGEN: ##replace %replace | 
					
						
							| 
									
										
										
										
											2010-05-01 03:04:31 -04:00
										 |  |  | CODEGEN: ##replace-imm %replace-imm | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | CODEGEN: ##inc-d %inc-d | 
					
						
							|  |  |  | CODEGEN: ##inc-r %inc-r | 
					
						
							| 
									
										
										
										
											2010-02-03 07:36:52 -05:00
										 |  |  | CODEGEN: ##call %call | 
					
						
							|  |  |  | CODEGEN: ##jump %jump | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | CODEGEN: ##return %return | 
					
						
							| 
									
										
										
										
											2011-10-18 01:43:19 -04:00
										 |  |  | CODEGEN: ##safepoint %safepoint | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | CODEGEN: ##slot %slot | 
					
						
							|  |  |  | CODEGEN: ##slot-imm %slot-imm | 
					
						
							|  |  |  | CODEGEN: ##set-slot %set-slot | 
					
						
							|  |  |  | CODEGEN: ##set-slot-imm %set-slot-imm | 
					
						
							|  |  |  | CODEGEN: ##add %add | 
					
						
							|  |  |  | CODEGEN: ##add-imm %add-imm | 
					
						
							|  |  |  | CODEGEN: ##sub %sub | 
					
						
							|  |  |  | CODEGEN: ##sub-imm %sub-imm | 
					
						
							|  |  |  | CODEGEN: ##mul %mul | 
					
						
							|  |  |  | CODEGEN: ##mul-imm %mul-imm | 
					
						
							|  |  |  | CODEGEN: ##and %and | 
					
						
							|  |  |  | CODEGEN: ##and-imm %and-imm | 
					
						
							|  |  |  | CODEGEN: ##or %or | 
					
						
							|  |  |  | CODEGEN: ##or-imm %or-imm | 
					
						
							|  |  |  | CODEGEN: ##xor %xor | 
					
						
							|  |  |  | CODEGEN: ##xor-imm %xor-imm | 
					
						
							|  |  |  | CODEGEN: ##shl %shl | 
					
						
							|  |  |  | CODEGEN: ##shl-imm %shl-imm | 
					
						
							|  |  |  | CODEGEN: ##shr %shr | 
					
						
							|  |  |  | CODEGEN: ##shr-imm %shr-imm | 
					
						
							|  |  |  | CODEGEN: ##sar %sar | 
					
						
							|  |  |  | CODEGEN: ##sar-imm %sar-imm | 
					
						
							|  |  |  | CODEGEN: ##min %min | 
					
						
							|  |  |  | CODEGEN: ##max %max | 
					
						
							|  |  |  | CODEGEN: ##not %not | 
					
						
							| 
									
										
										
										
											2009-09-28 18:31:34 -04:00
										 |  |  | CODEGEN: ##neg %neg | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | CODEGEN: ##log2 %log2 | 
					
						
							| 
									
										
										
										
											2010-05-15 16:57:35 -04:00
										 |  |  | CODEGEN: ##bit-count %bit-count | 
					
						
							| 
									
										
										
										
											2009-09-03 03:33:07 -04:00
										 |  |  | CODEGEN: ##copy %copy | 
					
						
							| 
									
										
										
										
											2010-04-22 04:21:23 -04:00
										 |  |  | CODEGEN: ##tagged>integer %tagged>integer | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | CODEGEN: ##add-float %add-float | 
					
						
							|  |  |  | CODEGEN: ##sub-float %sub-float | 
					
						
							|  |  |  | CODEGEN: ##mul-float %mul-float | 
					
						
							|  |  |  | CODEGEN: ##div-float %div-float | 
					
						
							|  |  |  | CODEGEN: ##min-float %min-float | 
					
						
							|  |  |  | CODEGEN: ##max-float %max-float | 
					
						
							|  |  |  | CODEGEN: ##sqrt %sqrt | 
					
						
							| 
									
										
										
										
											2009-09-03 03:33:07 -04:00
										 |  |  | CODEGEN: ##single>double-float %single>double-float | 
					
						
							|  |  |  | CODEGEN: ##double>single-float %double>single-float | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | CODEGEN: ##integer>float %integer>float | 
					
						
							|  |  |  | CODEGEN: ##float>integer %float>integer | 
					
						
							| 
									
										
										
										
											2009-09-28 18:31:34 -04:00
										 |  |  | CODEGEN: ##zero-vector %zero-vector | 
					
						
							| 
									
										
										
										
											2009-10-07 12:59:36 -04:00
										 |  |  | CODEGEN: ##fill-vector %fill-vector | 
					
						
							| 
									
										
										
										
											2009-09-03 03:33:07 -04:00
										 |  |  | CODEGEN: ##gather-vector-2 %gather-vector-2 | 
					
						
							|  |  |  | CODEGEN: ##gather-vector-4 %gather-vector-4 | 
					
						
							| 
									
										
										
										
											2010-05-16 02:48:22 -04:00
										 |  |  | CODEGEN: ##gather-int-vector-2 %gather-int-vector-2 | 
					
						
							|  |  |  | CODEGEN: ##gather-int-vector-4 %gather-int-vector-4 | 
					
						
							| 
									
										
										
										
											2010-05-16 03:49:12 -04:00
										 |  |  | CODEGEN: ##select-vector %select-vector | 
					
						
							| 
									
										
										
										
											2009-10-09 21:46:52 -04:00
										 |  |  | CODEGEN: ##shuffle-vector-imm %shuffle-vector-imm | 
					
						
							| 
									
										
										
										
											2010-05-14 03:15:29 -04:00
										 |  |  | CODEGEN: ##shuffle-vector-halves-imm %shuffle-vector-halves-imm | 
					
						
							| 
									
										
										
										
											2009-09-28 18:31:34 -04:00
										 |  |  | CODEGEN: ##shuffle-vector %shuffle-vector | 
					
						
							| 
									
										
										
										
											2009-10-07 15:09:46 -04:00
										 |  |  | CODEGEN: ##tail>head-vector %tail>head-vector | 
					
						
							| 
									
										
										
										
											2009-10-03 22:48:53 -04:00
										 |  |  | CODEGEN: ##merge-vector-head %merge-vector-head | 
					
						
							|  |  |  | CODEGEN: ##merge-vector-tail %merge-vector-tail | 
					
						
							| 
									
										
										
										
											2010-06-01 03:34:50 -04:00
										 |  |  | CODEGEN: ##float-pack-vector %float-pack-vector | 
					
						
							| 
									
										
										
										
											2009-10-05 22:01:34 -04:00
										 |  |  | CODEGEN: ##signed-pack-vector %signed-pack-vector | 
					
						
							|  |  |  | CODEGEN: ##unsigned-pack-vector %unsigned-pack-vector | 
					
						
							|  |  |  | CODEGEN: ##unpack-vector-head %unpack-vector-head | 
					
						
							|  |  |  | CODEGEN: ##unpack-vector-tail %unpack-vector-tail | 
					
						
							|  |  |  | CODEGEN: ##integer>float-vector %integer>float-vector | 
					
						
							|  |  |  | CODEGEN: ##float>integer-vector %float>integer-vector | 
					
						
							| 
									
										
										
										
											2009-10-01 15:31:37 -04:00
										 |  |  | CODEGEN: ##compare-vector %compare-vector | 
					
						
							| 
									
										
										
										
											2011-11-12 01:47:54 -05:00
										 |  |  | CODEGEN: ##move-vector-mask %move-vector-mask | 
					
						
							| 
									
										
										
										
											2009-10-01 16:35:38 -04:00
										 |  |  | CODEGEN: ##test-vector %test-vector | 
					
						
							| 
									
										
										
										
											2009-09-03 03:33:07 -04:00
										 |  |  | CODEGEN: ##add-vector %add-vector | 
					
						
							| 
									
										
										
										
											2009-09-21 00:16:02 -04:00
										 |  |  | CODEGEN: ##saturated-add-vector %saturated-add-vector | 
					
						
							| 
									
										
										
										
											2009-09-20 18:43:16 -04:00
										 |  |  | CODEGEN: ##add-sub-vector %add-sub-vector | 
					
						
							| 
									
										
										
										
											2009-09-21 00:16:02 -04:00
										 |  |  | CODEGEN: ##sub-vector %sub-vector | 
					
						
							|  |  |  | CODEGEN: ##saturated-sub-vector %saturated-sub-vector | 
					
						
							| 
									
										
										
										
											2009-09-03 03:33:07 -04:00
										 |  |  | CODEGEN: ##mul-vector %mul-vector | 
					
						
							| 
									
										
										
										
											2009-12-05 17:52:18 -05:00
										 |  |  | CODEGEN: ##mul-high-vector %mul-high-vector | 
					
						
							|  |  |  | CODEGEN: ##mul-horizontal-add-vector %mul-horizontal-add-vector | 
					
						
							| 
									
										
										
										
											2009-09-21 00:16:02 -04:00
										 |  |  | CODEGEN: ##saturated-mul-vector %saturated-mul-vector | 
					
						
							| 
									
										
										
										
											2009-09-03 03:33:07 -04:00
										 |  |  | CODEGEN: ##div-vector %div-vector | 
					
						
							|  |  |  | CODEGEN: ##min-vector %min-vector | 
					
						
							|  |  |  | CODEGEN: ##max-vector %max-vector | 
					
						
							| 
									
										
										
										
											2009-12-05 17:52:18 -05:00
										 |  |  | CODEGEN: ##avg-vector %avg-vector | 
					
						
							| 
									
										
										
										
											2009-09-28 18:31:34 -04:00
										 |  |  | CODEGEN: ##dot-vector %dot-vector | 
					
						
							| 
									
										
										
										
											2009-12-05 17:52:18 -05:00
										 |  |  | CODEGEN: ##sad-vector %sad-vector | 
					
						
							| 
									
										
										
										
											2009-09-03 03:33:07 -04:00
										 |  |  | CODEGEN: ##sqrt-vector %sqrt-vector | 
					
						
							|  |  |  | CODEGEN: ##horizontal-add-vector %horizontal-add-vector | 
					
						
							| 
									
										
										
										
											2009-09-28 03:17:46 -04:00
										 |  |  | CODEGEN: ##horizontal-sub-vector %horizontal-sub-vector | 
					
						
							| 
									
										
										
										
											2009-10-30 01:41:19 -04:00
										 |  |  | CODEGEN: ##horizontal-shl-vector-imm %horizontal-shl-vector-imm | 
					
						
							|  |  |  | CODEGEN: ##horizontal-shr-vector-imm %horizontal-shr-vector-imm | 
					
						
							| 
									
										
										
										
											2009-09-23 03:46:54 -04:00
										 |  |  | CODEGEN: ##abs-vector %abs-vector | 
					
						
							|  |  |  | CODEGEN: ##and-vector %and-vector | 
					
						
							| 
									
										
										
										
											2009-09-28 03:17:46 -04:00
										 |  |  | CODEGEN: ##andn-vector %andn-vector | 
					
						
							| 
									
										
										
										
											2009-09-23 03:46:54 -04:00
										 |  |  | CODEGEN: ##or-vector %or-vector | 
					
						
							|  |  |  | CODEGEN: ##xor-vector %xor-vector | 
					
						
							| 
									
										
										
										
											2009-10-02 21:04:28 -04:00
										 |  |  | CODEGEN: ##not-vector %not-vector | 
					
						
							| 
									
										
										
										
											2009-10-30 01:41:19 -04:00
										 |  |  | CODEGEN: ##shl-vector-imm %shl-vector-imm | 
					
						
							|  |  |  | CODEGEN: ##shr-vector-imm %shr-vector-imm | 
					
						
							| 
									
										
										
										
											2009-09-24 04:32:39 -04:00
										 |  |  | CODEGEN: ##shl-vector %shl-vector | 
					
						
							|  |  |  | CODEGEN: ##shr-vector %shr-vector | 
					
						
							|  |  |  | CODEGEN: ##integer>scalar %integer>scalar | 
					
						
							|  |  |  | CODEGEN: ##scalar>integer %scalar>integer | 
					
						
							| 
									
										
										
										
											2009-09-29 05:46:38 -04:00
										 |  |  | CODEGEN: ##vector>scalar %vector>scalar | 
					
						
							|  |  |  | CODEGEN: ##scalar>vector %scalar>vector | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | CODEGEN: ##box-alien %box-alien | 
					
						
							|  |  |  | CODEGEN: ##box-displaced-alien %box-displaced-alien | 
					
						
							| 
									
										
										
										
											2009-09-03 22:22:43 -04:00
										 |  |  | CODEGEN: ##unbox-alien %unbox-alien | 
					
						
							|  |  |  | CODEGEN: ##unbox-any-c-ptr %unbox-any-c-ptr | 
					
						
							| 
									
										
										
										
											2010-07-19 10:09:28 -04:00
										 |  |  | CODEGEN: ##convert-integer %convert-integer | 
					
						
							| 
									
										
										
										
											2010-04-24 00:13:44 -04:00
										 |  |  | CODEGEN: ##load-memory %load-memory | 
					
						
							| 
									
										
										
										
											2010-04-23 18:42:09 -04:00
										 |  |  | CODEGEN: ##load-memory-imm %load-memory-imm | 
					
						
							| 
									
										
										
										
											2010-04-24 00:13:44 -04:00
										 |  |  | CODEGEN: ##store-memory %store-memory | 
					
						
							| 
									
										
										
										
											2010-04-23 18:42:09 -04:00
										 |  |  | CODEGEN: ##store-memory-imm %store-memory-imm | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | CODEGEN: ##allot %allot | 
					
						
							|  |  |  | CODEGEN: ##write-barrier %write-barrier | 
					
						
							| 
									
										
										
										
											2009-10-14 03:06:01 -04:00
										 |  |  | CODEGEN: ##write-barrier-imm %write-barrier-imm | 
					
						
							| 
									
										
										
										
											2009-09-02 07:22:37 -04:00
										 |  |  | CODEGEN: ##compare %compare | 
					
						
							|  |  |  | CODEGEN: ##compare-imm %compare-imm | 
					
						
							| 
									
										
										
										
											2010-05-14 08:14:22 -04:00
										 |  |  | CODEGEN: ##test %test | 
					
						
							|  |  |  | CODEGEN: ##test-imm %test-imm | 
					
						
							| 
									
										
										
										
											2010-04-22 04:21:23 -04:00
										 |  |  | CODEGEN: ##compare-integer %compare | 
					
						
							| 
									
										
										
										
											2010-05-01 03:04:31 -04:00
										 |  |  | CODEGEN: ##compare-integer-imm %compare-integer-imm | 
					
						
							| 
									
										
										
										
											2009-09-08 18:04:26 -04:00
										 |  |  | CODEGEN: ##compare-float-ordered %compare-float-ordered | 
					
						
							|  |  |  | CODEGEN: ##compare-float-unordered %compare-float-unordered | 
					
						
							| 
									
										
										
										
											2009-09-08 22:50:55 -04:00
										 |  |  | CODEGEN: ##save-context %save-context | 
					
						
							| 
									
										
										
										
											2010-03-26 23:11:05 -04:00
										 |  |  | CODEGEN: ##vm-field %vm-field | 
					
						
							| 
									
										
										
										
											2010-04-01 20:06:18 -04:00
										 |  |  | CODEGEN: ##set-vm-field %set-vm-field | 
					
						
							| 
									
										
										
										
											2010-04-26 05:37:57 -04:00
										 |  |  | CODEGEN: ##alien-global %alien-global | 
					
						
							| 
									
										
										
										
											2010-04-27 10:51:00 -04:00
										 |  |  | CODEGEN: ##call-gc %call-gc | 
					
						
							| 
									
										
										
										
											2010-04-28 03:35:46 -04:00
										 |  |  | CODEGEN: ##spill %spill | 
					
						
							|  |  |  | CODEGEN: ##reload %reload | 
					
						
							| 
									
										
										
										
											2009-07-30 22:28:27 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-09 21:36:52 -04:00
										 |  |  | ! Conditional branches | 
					
						
							| 
									
										
										
										
											2010-04-27 10:51:00 -04:00
										 |  |  | << | 
					
						
							| 
									
										
										
										
											2009-07-30 22:28:27 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-27 10:51:00 -04:00
										 |  |  | SYNTAX: CONDITIONAL: | 
					
						
							|  |  |  |     scan-word [ \ generate-conditional-insn create-method-in ] keep scan-word | 
					
						
							|  |  |  |     codegen-method-body define ;
 | 
					
						
							| 
									
										
										
										
											2009-07-30 22:28:27 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-27 10:51:00 -04:00
										 |  |  | >> | 
					
						
							| 
									
										
										
										
											2009-08-07 18:44:50 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-27 10:51:00 -04:00
										 |  |  | CONDITIONAL: ##compare-branch %compare-branch | 
					
						
							|  |  |  | CONDITIONAL: ##compare-imm-branch %compare-imm-branch | 
					
						
							|  |  |  | CONDITIONAL: ##compare-integer-branch %compare-branch | 
					
						
							| 
									
										
										
										
											2010-05-01 03:04:31 -04:00
										 |  |  | CONDITIONAL: ##compare-integer-imm-branch %compare-integer-imm-branch | 
					
						
							| 
									
										
										
										
											2010-05-14 08:14:22 -04:00
										 |  |  | CONDITIONAL: ##test-branch %test-branch | 
					
						
							|  |  |  | CONDITIONAL: ##test-imm-branch %test-imm-branch | 
					
						
							| 
									
										
										
										
											2010-04-27 10:51:00 -04:00
										 |  |  | CONDITIONAL: ##compare-float-ordered-branch %compare-float-ordered-branch | 
					
						
							|  |  |  | CONDITIONAL: ##compare-float-unordered-branch %compare-float-unordered-branch | 
					
						
							|  |  |  | CONDITIONAL: ##test-vector-branch %test-vector-branch | 
					
						
							|  |  |  | CONDITIONAL: ##check-nursery-branch %check-nursery-branch | 
					
						
							|  |  |  | CONDITIONAL: ##fixnum-add %fixnum-add | 
					
						
							|  |  |  | CONDITIONAL: ##fixnum-sub %fixnum-sub | 
					
						
							|  |  |  | CONDITIONAL: ##fixnum-mul %fixnum-mul | 
					
						
							| 
									
										
										
										
											2010-05-09 21:36:52 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! FFI | 
					
						
							| 
									
										
										
										
											2010-05-11 19:11:31 -04:00
										 |  |  | CODEGEN: ##unbox %unbox | 
					
						
							| 
									
										
										
										
											2010-05-19 01:07:22 -04:00
										 |  |  | CODEGEN: ##unbox-long-long %unbox-long-long | 
					
						
							| 
									
										
										
										
											2010-05-19 00:33:15 -04:00
										 |  |  | CODEGEN: ##local-allot %local-allot | 
					
						
							| 
									
										
										
										
											2010-05-09 21:36:52 -04:00
										 |  |  | CODEGEN: ##box %box | 
					
						
							|  |  |  | CODEGEN: ##box-long-long %box-long-long | 
					
						
							|  |  |  | CODEGEN: ##alien-invoke %alien-invoke | 
					
						
							|  |  |  | CODEGEN: ##alien-indirect %alien-indirect | 
					
						
							| 
									
										
										
										
											2010-07-13 07:40:14 -04:00
										 |  |  | CODEGEN: ##alien-assembly %alien-assembly | 
					
						
							|  |  |  | CODEGEN: ##callback-inputs %callback-inputs | 
					
						
							|  |  |  | CODEGEN: ##callback-outputs %callback-outputs |