2010-01-02 07:03:30 -05:00
|
|
|
! Copyright (C) 2008, 2010 Slava Pestov.
|
2008-09-10 23:11:03 -04:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2008-10-17 16:35:04 -04:00
|
|
|
USING: assocs accessors arrays kernel sequences namespaces words
|
2010-04-22 04:21:23 -04:00
|
|
|
math math.order layouts classes.union compiler.units alien
|
|
|
|
byte-arrays combinators compiler.cfg.registers
|
|
|
|
compiler.cfg.instructions.syntax ;
|
2008-09-15 02:54:48 -04:00
|
|
|
IN: compiler.cfg.instructions
|
2008-09-10 23:11:03 -04:00
|
|
|
|
2009-09-02 07:22:37 -04:00
|
|
|
<<
|
|
|
|
SYMBOL: insn-classes
|
|
|
|
V{ } clone insn-classes set-global
|
|
|
|
>>
|
|
|
|
|
2009-07-29 07:50:46 -04:00
|
|
|
: new-insn ( ... class -- insn ) f swap boa ; inline
|
2009-05-29 14:11:34 -04:00
|
|
|
|
2010-05-13 01:46:58 -04:00
|
|
|
! Virtual CPU instructions, used by CFG IR
|
2008-10-24 10:17:06 -04:00
|
|
|
TUPLE: insn ;
|
2008-09-10 23:11:03 -04:00
|
|
|
|
2010-05-14 18:18:04 -04:00
|
|
|
! Instructions which use vregs
|
|
|
|
TUPLE: vreg-insn < insn ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
! Instructions which do not have side effects; used for
|
|
|
|
! dead code elimination
|
|
|
|
TUPLE: flushable-insn < vreg-insn ;
|
|
|
|
|
2009-09-02 07:22:37 -04:00
|
|
|
! Instructions which are referentially transparent; used for
|
|
|
|
! value numbering
|
2010-07-13 07:40:14 -04:00
|
|
|
TUPLE: foldable-insn < flushable-insn ;
|
2008-10-20 02:56:28 -04:00
|
|
|
|
2010-04-21 03:08:52 -04:00
|
|
|
! Constants
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##load-integer
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: val ;
|
2008-10-20 02:56:28 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##load-reference
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: obj ;
|
2008-10-20 02:56:28 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
! These four are inserted by representation selection
|
|
|
|
FLUSHABLE-INSN: ##load-tagged
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: val ;
|
2009-09-30 03:18:29 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##load-float
|
2010-05-07 18:26:00 -04:00
|
|
|
def: dst/float-rep
|
|
|
|
literal: val ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##load-double
|
2010-04-18 22:42:19 -04:00
|
|
|
def: dst/double-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: val ;
|
2010-04-18 22:42:19 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##load-vector
|
2010-04-30 21:33:42 -04:00
|
|
|
def: dst
|
|
|
|
literal: val rep ;
|
|
|
|
|
2010-04-21 03:08:52 -04:00
|
|
|
! Stack operations
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##peek
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: loc ;
|
2008-10-20 02:56:28 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##replace
|
2010-04-19 15:05:55 -04:00
|
|
|
use: src/tagged-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: loc ;
|
2008-09-10 23:11:03 -04:00
|
|
|
|
2010-05-01 03:04:31 -04:00
|
|
|
INSN: ##replace-imm
|
|
|
|
literal: src loc ;
|
|
|
|
|
2009-09-02 07:22:37 -04:00
|
|
|
INSN: ##inc-d
|
|
|
|
literal: n ;
|
2008-10-20 02:56:28 -04:00
|
|
|
|
2009-09-02 07:22:37 -04:00
|
|
|
INSN: ##inc-r
|
|
|
|
literal: n ;
|
2008-10-20 02:56:28 -04:00
|
|
|
|
2009-09-02 07:22:37 -04:00
|
|
|
! Subroutine calls
|
|
|
|
INSN: ##call
|
|
|
|
literal: word ;
|
2008-10-20 02:56:28 -04:00
|
|
|
|
2009-09-02 07:22:37 -04:00
|
|
|
INSN: ##jump
|
|
|
|
literal: word ;
|
2008-09-10 23:11:03 -04:00
|
|
|
|
2010-05-02 18:48:41 -04:00
|
|
|
INSN: ##prologue ;
|
|
|
|
|
|
|
|
INSN: ##epilogue ;
|
|
|
|
|
2008-10-07 17:13:29 -04:00
|
|
|
INSN: ##return ;
|
|
|
|
|
2009-06-30 22:21:46 -04:00
|
|
|
! Dummy instruction that simply inhibits TCO
|
|
|
|
INSN: ##no-tco ;
|
|
|
|
|
2008-09-10 23:11:03 -04:00
|
|
|
! Jump tables
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##dispatch
|
2010-04-21 03:08:52 -04:00
|
|
|
use: src/int-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
temp: temp/int-rep ;
|
2008-09-10 23:11:03 -04:00
|
|
|
|
2008-10-20 02:56:28 -04:00
|
|
|
! Slot access
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##slot
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2010-04-23 20:20:06 -04:00
|
|
|
use: obj/tagged-rep slot/int-rep
|
|
|
|
literal: scale tag ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##slot-imm
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
|
|
|
use: obj/tagged-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: slot tag ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##set-slot
|
2010-04-23 20:20:06 -04:00
|
|
|
use: src/tagged-rep obj/tagged-rep slot/int-rep
|
|
|
|
literal: scale tag ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##set-slot-imm
|
2010-04-19 15:05:55 -04:00
|
|
|
use: src/tagged-rep obj/tagged-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: slot tag ;
|
2008-10-20 02:56:28 -04:00
|
|
|
|
2010-04-21 03:08:52 -04:00
|
|
|
! Register transfers
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##copy
|
2009-09-03 03:33:07 -04:00
|
|
|
def: dst
|
|
|
|
use: src
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##tagged>integer
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src/tagged-rep ;
|
|
|
|
|
2008-10-20 02:56:28 -04:00
|
|
|
! Integer arithmetic
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##add
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep src2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##add-imm
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##sub
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep src2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##sub-imm
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##mul
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep src2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##mul-imm
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##and
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep src2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##and-imm
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##or
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep src2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##or-imm
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##xor
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep src2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##xor-imm
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##shl
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep src2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##shl-imm
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##shr
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep src2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##shr-imm
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##sar
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep src2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##sar-imm
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##min
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep src2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##max
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src1/int-rep src2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##not
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##neg
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src/int-rep ;
|
2009-09-28 18:31:34 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##log2
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src/int-rep ;
|
2008-10-20 21:40:15 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##bit-count
|
2010-05-15 16:57:35 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src/int-rep ;
|
|
|
|
|
2008-10-20 02:56:28 -04:00
|
|
|
! Float arithmetic
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##add-float
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/double-rep
|
|
|
|
use: src1/double-rep src2/double-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##sub-float
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/double-rep
|
|
|
|
use: src1/double-rep src2/double-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##mul-float
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/double-rep
|
|
|
|
use: src1/double-rep src2/double-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##div-float
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/double-rep
|
|
|
|
use: src1/double-rep src2/double-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##min-float
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/double-rep
|
|
|
|
use: src1/double-rep src2/double-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##max-float
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/double-rep
|
|
|
|
use: src1/double-rep src2/double-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##sqrt
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/double-rep
|
|
|
|
use: src/double-rep ;
|
2008-10-20 02:56:28 -04:00
|
|
|
|
2009-08-30 05:52:01 -04:00
|
|
|
! libc intrinsics
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##unary-float-function
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/double-rep
|
|
|
|
use: src/double-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: func ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##binary-float-function
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/double-rep
|
|
|
|
use: src1/double-rep src2/double-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: func ;
|
2009-08-30 05:52:01 -04:00
|
|
|
|
2009-09-03 03:33:07 -04:00
|
|
|
! Single/double float conversion
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##single>double-float
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/double-rep
|
|
|
|
use: src/float-rep ;
|
2009-09-03 03:33:07 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##double>single-float
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/float-rep
|
|
|
|
use: src/double-rep ;
|
2009-09-03 03:33:07 -04:00
|
|
|
|
2008-10-20 02:56:28 -04:00
|
|
|
! Float/integer conversion
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##float>integer
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
2009-09-03 21:58:56 -04:00
|
|
|
use: src/double-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##integer>float
|
2009-09-03 21:58:56 -04:00
|
|
|
def: dst/double-rep
|
2010-04-21 03:08:52 -04:00
|
|
|
use: src/int-rep ;
|
2008-10-20 02:56:28 -04:00
|
|
|
|
2009-09-03 03:33:07 -04:00
|
|
|
! SIMD operations
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##zero-vector
|
2009-09-28 18:31:34 -04:00
|
|
|
def: dst
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##fill-vector
|
2009-10-02 21:04:28 -04:00
|
|
|
def: dst
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##gather-vector-2
|
2009-09-03 03:33:07 -04:00
|
|
|
def: dst
|
|
|
|
use: src1/scalar-rep src2/scalar-rep
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##gather-int-vector-2
|
2010-05-16 02:48:22 -04:00
|
|
|
def: dst
|
|
|
|
use: src1/int-rep src2/int-rep
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##gather-vector-4
|
2009-09-03 03:33:07 -04:00
|
|
|
def: dst
|
|
|
|
use: src1/scalar-rep src2/scalar-rep src3/scalar-rep src4/scalar-rep
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##gather-int-vector-4
|
2010-05-16 02:48:22 -04:00
|
|
|
def: dst
|
|
|
|
use: src1/int-rep src2/int-rep src3/int-rep src4/int-rep
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##select-vector
|
2010-05-16 03:49:12 -04:00
|
|
|
def: dst/int-rep
|
|
|
|
use: src
|
|
|
|
literal: n rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##shuffle-vector
|
2009-09-28 18:31:34 -04:00
|
|
|
def: dst
|
2009-10-09 21:46:52 -04:00
|
|
|
use: src shuffle
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##shuffle-vector-halves-imm
|
2010-05-14 03:15:29 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: shuffle rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##shuffle-vector-imm
|
2009-10-09 21:46:52 -04:00
|
|
|
def: dst
|
2009-09-28 18:31:34 -04:00
|
|
|
use: src
|
|
|
|
literal: shuffle rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##tail>head-vector
|
2009-10-07 15:09:46 -04:00
|
|
|
def: dst
|
|
|
|
use: src
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##merge-vector-head
|
2009-10-03 22:48:53 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##merge-vector-tail
|
2009-10-03 22:48:53 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##float-pack-vector
|
2010-06-01 03:34:50 -04:00
|
|
|
def: dst
|
|
|
|
use: src
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##signed-pack-vector
|
2009-10-05 22:01:34 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##unsigned-pack-vector
|
2009-10-05 22:01:34 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##unpack-vector-head
|
2009-10-05 22:01:34 -04:00
|
|
|
def: dst
|
|
|
|
use: src
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##unpack-vector-tail
|
2009-10-05 22:01:34 -04:00
|
|
|
def: dst
|
|
|
|
use: src
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##integer>float-vector
|
2009-10-05 22:01:34 -04:00
|
|
|
def: dst
|
|
|
|
use: src
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##float>integer-vector
|
2009-10-05 22:01:34 -04:00
|
|
|
def: dst
|
|
|
|
use: src
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##compare-vector
|
2009-10-01 15:31:37 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep cc ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##test-vector
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2009-10-01 20:53:30 -04:00
|
|
|
use: src1
|
|
|
|
temp: temp/int-rep
|
|
|
|
literal: rep vcc ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##test-vector-branch
|
2009-10-01 20:53:30 -04:00
|
|
|
use: src1
|
|
|
|
temp: temp/int-rep
|
|
|
|
literal: rep vcc ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##add-vector
|
2009-09-03 03:33:07 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##saturated-add-vector
|
2009-09-03 03:33:07 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##add-sub-vector
|
2009-09-20 18:43:16 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##sub-vector
|
2009-09-21 00:16:02 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##saturated-sub-vector
|
2009-09-21 00:16:02 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##mul-vector
|
2009-09-03 03:33:07 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
2009-09-21 00:16:02 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##mul-high-vector
|
2009-12-05 17:52:18 -05:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##mul-horizontal-add-vector
|
2009-12-05 17:52:18 -05:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##saturated-mul-vector
|
2009-09-21 00:16:02 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
2009-09-03 03:33:07 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##div-vector
|
2009-09-03 03:33:07 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##min-vector
|
2009-09-03 03:33:07 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##max-vector
|
2009-09-03 03:33:07 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##avg-vector
|
2009-12-05 17:52:18 -05:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##dot-vector
|
2009-09-28 18:31:34 -04:00
|
|
|
def: dst/scalar-rep
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##sad-vector
|
2009-12-05 17:52:18 -05:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##horizontal-add-vector
|
2009-11-04 13:18:01 -05:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
2009-09-23 03:46:54 -04:00
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##horizontal-sub-vector
|
2009-11-04 13:18:01 -05:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
2009-09-28 03:17:46 -04:00
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##horizontal-shl-vector-imm
|
2009-09-28 03:17:46 -04:00
|
|
|
def: dst
|
|
|
|
use: src1
|
|
|
|
literal: src2 rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##horizontal-shr-vector-imm
|
2009-09-28 03:17:46 -04:00
|
|
|
def: dst
|
|
|
|
use: src1
|
|
|
|
literal: src2 rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##abs-vector
|
2009-09-02 07:22:37 -04:00
|
|
|
def: dst
|
|
|
|
use: src
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##sqrt-vector
|
2009-09-23 03:46:54 -04:00
|
|
|
def: dst
|
2009-09-03 03:33:07 -04:00
|
|
|
use: src
|
|
|
|
literal: rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##and-vector
|
2009-09-23 03:46:54 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##andn-vector
|
2009-09-28 03:17:46 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##or-vector
|
2009-09-23 03:46:54 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##xor-vector
|
2009-09-23 03:46:54 -04:00
|
|
|
def: dst
|
|
|
|
use: src1 src2
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##not-vector
|
2009-10-02 21:04:28 -04:00
|
|
|
def: dst
|
|
|
|
use: src
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##shl-vector-imm
|
2009-10-30 01:41:19 -04:00
|
|
|
def: dst
|
|
|
|
use: src1
|
|
|
|
literal: src2 rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##shr-vector-imm
|
2009-10-30 01:41:19 -04:00
|
|
|
def: dst
|
|
|
|
use: src1
|
|
|
|
literal: src2 rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##shl-vector
|
2009-09-24 04:32:39 -04:00
|
|
|
def: dst
|
2009-09-30 21:04:37 -04:00
|
|
|
use: src1 src2/int-scalar-rep
|
2009-09-24 04:32:39 -04:00
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##shr-vector
|
2009-09-24 04:32:39 -04:00
|
|
|
def: dst
|
2009-09-30 21:04:37 -04:00
|
|
|
use: src1 src2/int-scalar-rep
|
2009-09-24 04:32:39 -04:00
|
|
|
literal: rep ;
|
|
|
|
|
2009-09-29 05:46:38 -04:00
|
|
|
! Scalar/vector conversion
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##scalar>integer
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
2009-09-24 04:32:39 -04:00
|
|
|
use: src
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##integer>scalar
|
2009-09-24 04:32:39 -04:00
|
|
|
def: dst
|
2010-04-21 03:08:52 -04:00
|
|
|
use: src/int-rep
|
2009-09-24 04:32:39 -04:00
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##vector>scalar
|
2009-09-29 05:46:38 -04:00
|
|
|
def: dst/scalar-rep
|
|
|
|
use: src
|
|
|
|
literal: rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##scalar>vector
|
2009-09-29 05:46:38 -04:00
|
|
|
def: dst
|
|
|
|
use: src/scalar-rep
|
|
|
|
literal: rep ;
|
|
|
|
|
2009-09-03 03:33:07 -04:00
|
|
|
! Boxing and unboxing aliens
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##box-alien
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2010-04-21 03:08:52 -04:00
|
|
|
use: src/int-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
temp: temp/int-rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##box-displaced-alien
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2010-04-22 18:02:56 -04:00
|
|
|
use: displacement/int-rep base/tagged-rep
|
2009-11-03 03:42:27 -05:00
|
|
|
temp: temp/int-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: base-class ;
|
2008-10-20 06:55:20 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##unbox-any-c-ptr
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
2010-04-19 15:05:55 -04:00
|
|
|
use: src/tagged-rep ;
|
2009-09-03 22:22:43 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##unbox-alien
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
2010-04-19 15:05:55 -04:00
|
|
|
use: src/tagged-rep ;
|
2008-10-20 06:55:20 -04:00
|
|
|
|
2010-04-23 18:42:09 -04:00
|
|
|
! Raw memory accessors
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##load-memory
|
2010-04-24 00:13:44 -04:00
|
|
|
def: dst
|
|
|
|
use: base/int-rep displacement/int-rep
|
|
|
|
literal: scale offset rep c-type ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##load-memory-imm
|
2009-09-03 03:33:07 -04:00
|
|
|
def: dst
|
2010-04-23 18:42:09 -04:00
|
|
|
use: base/int-rep
|
|
|
|
literal: offset rep c-type ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##store-memory
|
2010-04-24 00:13:44 -04:00
|
|
|
use: src base/int-rep displacement/int-rep
|
|
|
|
literal: scale offset rep c-type ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##store-memory-imm
|
2010-04-23 18:42:09 -04:00
|
|
|
use: src base/int-rep
|
|
|
|
literal: offset rep c-type ;
|
2009-09-03 03:33:07 -04:00
|
|
|
|
2009-09-02 07:22:37 -04:00
|
|
|
! Memory allocation
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##allot
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: size class
|
|
|
|
temp: temp/int-rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##write-barrier
|
2010-04-21 03:08:52 -04:00
|
|
|
use: src/tagged-rep slot/int-rep
|
2010-04-23 20:20:06 -04:00
|
|
|
literal: scale tag
|
2009-10-14 03:06:01 -04:00
|
|
|
temp: temp1/int-rep temp2/int-rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##write-barrier-imm
|
2010-04-19 15:05:55 -04:00
|
|
|
use: src/tagged-rep
|
2010-04-23 20:20:06 -04:00
|
|
|
literal: slot tag
|
2009-10-14 03:06:01 -04:00
|
|
|
temp: temp1/int-rep temp2/int-rep ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##alien-global
|
2010-04-21 03:08:52 -04:00
|
|
|
def: dst/int-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: symbol library ;
|
2008-12-06 10:16:29 -05:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##vm-field
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2010-04-01 20:06:18 -04:00
|
|
|
literal: offset ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##set-vm-field
|
2010-04-22 18:02:56 -04:00
|
|
|
use: src/tagged-rep
|
2010-04-01 20:06:18 -04:00
|
|
|
literal: offset ;
|
2010-03-26 23:11:05 -04:00
|
|
|
|
2008-09-10 23:11:03 -04:00
|
|
|
! FFI
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##unbox
|
2010-05-11 19:11:31 -04:00
|
|
|
def: dst
|
|
|
|
use: src/tagged-rep
|
|
|
|
literal: unboxer rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##unbox-long-long
|
2010-07-15 19:49:29 -04:00
|
|
|
def: dst1/int-rep dst2/int-rep
|
|
|
|
use: src/tagged-rep
|
2010-05-19 01:07:22 -04:00
|
|
|
literal: unboxer ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##local-allot
|
2010-05-19 00:33:15 -04:00
|
|
|
def: dst/int-rep
|
2010-05-22 01:25:10 -04:00
|
|
|
literal: size align offset ;
|
2010-05-11 19:11:31 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##box
|
2010-05-09 23:25:46 -04:00
|
|
|
def: dst/tagged-rep
|
2010-05-16 03:43:02 -04:00
|
|
|
use: src
|
2010-06-13 17:36:08 -04:00
|
|
|
literal: boxer rep gc-map ;
|
2010-05-09 21:36:52 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##box-long-long
|
2010-05-09 23:25:46 -04:00
|
|
|
def: dst/tagged-rep
|
2010-05-16 03:43:02 -04:00
|
|
|
use: src1/int-rep src2/int-rep
|
2010-06-13 17:36:08 -04:00
|
|
|
literal: boxer gc-map ;
|
2010-05-09 21:36:52 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
! Alien call inputs and outputs are arrays of triples with shape
|
|
|
|
! { vreg rep stack#/reg }
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##alien-invoke
|
|
|
|
literal: reg-inputs stack-inputs reg-outputs cleanup stack-size symbols dll gc-map ;
|
2010-05-09 21:36:52 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##alien-indirect
|
2010-06-13 17:36:08 -04:00
|
|
|
use: src/int-rep
|
2010-07-13 07:40:14 -04:00
|
|
|
literal: reg-inputs stack-inputs reg-outputs cleanup stack-size gc-map ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##alien-assembly
|
|
|
|
literal: reg-inputs stack-inputs reg-outputs cleanup stack-size quot gc-map ;
|
2010-05-09 21:36:52 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##callback-inputs
|
|
|
|
literal: reg-outputs stack-outputs ;
|
2010-01-06 23:39:22 -05:00
|
|
|
|
2009-09-02 07:22:37 -04:00
|
|
|
INSN: ##alien-callback
|
2010-05-09 21:36:52 -04:00
|
|
|
literal: quot ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##callback-outputs
|
|
|
|
literal: reg-inputs ;
|
2010-05-09 21:36:52 -04:00
|
|
|
|
2010-05-02 18:48:41 -04:00
|
|
|
! Control flow
|
2010-07-13 07:40:14 -04:00
|
|
|
FLUSHABLE-INSN: ##phi
|
2009-09-02 07:22:37 -04:00
|
|
|
def: dst
|
|
|
|
literal: inputs ;
|
2009-05-21 17:49:28 -04:00
|
|
|
|
2010-05-02 18:48:41 -04:00
|
|
|
INSN: ##branch ;
|
|
|
|
|
2010-04-22 04:21:23 -04:00
|
|
|
! Tagged conditionals
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##compare-branch
|
2010-04-19 15:05:55 -04:00
|
|
|
use: src1/tagged-rep src2/tagged-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: cc ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##compare-imm-branch
|
2010-04-19 15:05:55 -04:00
|
|
|
use: src1/tagged-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 cc ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##compare
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
|
|
|
use: src1/tagged-rep src2/tagged-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: cc
|
|
|
|
temp: temp/int-rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##compare-imm
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
|
|
|
use: src1/tagged-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 cc
|
2010-04-22 04:21:23 -04:00
|
|
|
temp: temp/int-rep ;
|
|
|
|
|
|
|
|
! Integer conditionals
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##compare-integer-branch
|
2010-04-22 04:21:23 -04:00
|
|
|
use: src1/int-rep src2/int-rep
|
|
|
|
literal: cc ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##compare-integer-imm-branch
|
2010-04-22 04:21:23 -04:00
|
|
|
use: src1/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 cc ;
|
2010-04-22 04:21:23 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##test-branch
|
2010-05-14 08:14:22 -04:00
|
|
|
use: src1/int-rep src2/int-rep
|
|
|
|
literal: cc ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##test-imm-branch
|
2010-05-14 08:14:22 -04:00
|
|
|
use: src1/int-rep
|
|
|
|
literal: src2 cc ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##compare-integer
|
2010-04-22 04:21:23 -04:00
|
|
|
def: dst/tagged-rep
|
|
|
|
use: src1/int-rep src2/int-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: cc
|
|
|
|
temp: temp/int-rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##compare-integer-imm
|
2010-04-22 04:21:23 -04:00
|
|
|
def: dst/tagged-rep
|
|
|
|
use: src1/int-rep
|
2010-04-24 04:49:35 -04:00
|
|
|
literal: src2 cc
|
2010-04-22 04:21:23 -04:00
|
|
|
temp: temp/int-rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##test
|
2010-05-14 08:14:22 -04:00
|
|
|
def: dst/tagged-rep
|
|
|
|
use: src1/int-rep src2/int-rep
|
|
|
|
literal: cc
|
|
|
|
temp: temp/int-rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##test-imm
|
2010-05-14 08:14:22 -04:00
|
|
|
def: dst/tagged-rep
|
|
|
|
use: src1/int-rep
|
|
|
|
literal: src2 cc
|
|
|
|
temp: temp/int-rep ;
|
|
|
|
|
2010-04-22 04:21:23 -04:00
|
|
|
! Float conditionals
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##compare-float-ordered-branch
|
2009-09-03 21:58:56 -04:00
|
|
|
use: src1/double-rep src2/double-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: cc ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##compare-float-unordered-branch
|
2009-09-08 18:04:26 -04:00
|
|
|
use: src1/double-rep src2/double-rep
|
|
|
|
literal: cc ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##compare-float-ordered
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2009-09-08 18:04:26 -04:00
|
|
|
use: src1/double-rep src2/double-rep
|
|
|
|
literal: cc
|
|
|
|
temp: temp/int-rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
FOLDABLE-INSN: ##compare-float-unordered
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2009-09-03 21:58:56 -04:00
|
|
|
use: src1/double-rep src2/double-rep
|
2009-09-02 07:22:37 -04:00
|
|
|
literal: cc
|
|
|
|
temp: temp/int-rep ;
|
2008-10-20 02:56:28 -04:00
|
|
|
|
2009-09-02 07:22:37 -04:00
|
|
|
! Overflowing arithmetic
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##fixnum-add
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2010-04-27 10:51:00 -04:00
|
|
|
use: src1/tagged-rep src2/tagged-rep
|
|
|
|
literal: cc ;
|
2008-10-20 06:55:20 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##fixnum-sub
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2010-04-27 10:51:00 -04:00
|
|
|
use: src1/tagged-rep src2/tagged-rep
|
|
|
|
literal: cc ;
|
2008-09-11 03:05:22 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##fixnum-mul
|
2010-04-19 15:05:55 -04:00
|
|
|
def: dst/tagged-rep
|
2010-04-27 10:51:00 -04:00
|
|
|
use: src1/tagged-rep src2/int-rep
|
|
|
|
literal: cc ;
|
2009-05-31 19:21:11 -04:00
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##save-context
|
2009-12-21 21:42:49 -05:00
|
|
|
temp: temp1/int-rep temp2/int-rep ;
|
2009-09-08 22:50:55 -04:00
|
|
|
|
2010-04-27 10:51:00 -04:00
|
|
|
! GC checks
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##check-nursery-branch
|
2010-04-27 10:51:00 -04:00
|
|
|
literal: size cc
|
|
|
|
temp: temp1/int-rep temp2/int-rep ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
INSN: ##call-gc
|
|
|
|
literal: gc-map ;
|
2010-04-27 10:51:00 -04:00
|
|
|
|
2010-04-28 03:35:46 -04:00
|
|
|
! Spills and reloads, inserted by register allocator
|
|
|
|
TUPLE: spill-slot { n integer } ;
|
|
|
|
C: <spill-slot> spill-slot
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##spill
|
2010-04-28 03:35:46 -04:00
|
|
|
use: src
|
|
|
|
literal: rep dst ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
VREG-INSN: ##reload
|
2010-04-28 03:35:46 -04:00
|
|
|
def: dst
|
|
|
|
literal: rep src ;
|
|
|
|
|
2009-09-02 07:22:37 -04:00
|
|
|
UNION: ##allocation
|
|
|
|
##allot
|
|
|
|
##box-alien
|
2009-09-27 21:36:05 -04:00
|
|
|
##box-displaced-alien ;
|
2009-09-02 07:22:37 -04:00
|
|
|
|
2010-04-27 10:51:00 -04:00
|
|
|
UNION: conditional-branch-insn
|
|
|
|
##compare-branch
|
|
|
|
##compare-imm-branch
|
|
|
|
##compare-integer-branch
|
|
|
|
##compare-integer-imm-branch
|
2010-05-14 08:14:22 -04:00
|
|
|
##test-branch
|
|
|
|
##test-imm-branch
|
2010-04-27 10:51:00 -04:00
|
|
|
##compare-float-ordered-branch
|
|
|
|
##compare-float-unordered-branch
|
|
|
|
##test-vector-branch
|
|
|
|
##check-nursery-branch
|
|
|
|
##fixnum-add
|
|
|
|
##fixnum-sub
|
|
|
|
##fixnum-mul ;
|
|
|
|
|
2009-09-02 07:22:37 -04:00
|
|
|
! For alias analysis
|
2010-04-01 20:06:18 -04:00
|
|
|
UNION: ##read ##slot ##slot-imm ##vm-field ##alien-global ;
|
|
|
|
UNION: ##write ##set-slot ##set-slot-imm ##set-vm-field ;
|
2009-07-16 03:17:58 -04:00
|
|
|
|
2010-07-02 15:44:12 -04:00
|
|
|
! Instructions that contain subroutine calls to functions which
|
|
|
|
! can callback arbitrary Factor code
|
|
|
|
UNION: factor-call-insn
|
|
|
|
##alien-invoke
|
|
|
|
##alien-indirect
|
|
|
|
##alien-assembly ;
|
|
|
|
|
2010-06-13 17:36:08 -04:00
|
|
|
! Instructions that contain subroutine calls to functions which
|
|
|
|
! allocate memory
|
|
|
|
UNION: gc-map-insn
|
|
|
|
##call-gc
|
|
|
|
##box
|
|
|
|
##box-long-long
|
2010-07-02 15:44:12 -04:00
|
|
|
factor-call-insn ;
|
2010-06-13 17:36:08 -04:00
|
|
|
|
|
|
|
M: gc-map-insn clone call-next-method [ clone ] change-gc-map ;
|
|
|
|
|
|
|
|
! Each one has a gc-map slot
|
|
|
|
TUPLE: gc-map scrub-d scrub-r gc-roots ;
|
|
|
|
|
|
|
|
: <gc-map> ( -- gc-map ) gc-map new ;
|
|
|
|
|
2010-07-13 07:40:14 -04:00
|
|
|
UNION: alien-call-insn
|
|
|
|
##alien-invoke
|
|
|
|
##alien-indirect
|
|
|
|
##alien-assembly ;
|
|
|
|
|
2010-05-16 03:43:02 -04:00
|
|
|
! Instructions that clobber registers. They receive inputs and
|
|
|
|
! produce outputs in spill slots.
|
|
|
|
UNION: hairy-clobber-insn
|
|
|
|
##call-gc
|
2010-07-13 07:40:14 -04:00
|
|
|
alien-call-insn
|
|
|
|
##callback-inputs
|
2010-07-15 19:49:29 -04:00
|
|
|
##callback-outputs
|
|
|
|
##unbox-long-long ;
|
2009-08-30 05:52:01 -04:00
|
|
|
|
2010-05-16 03:43:02 -04:00
|
|
|
! Instructions that clobber registers but are allowed to produce
|
|
|
|
! outputs in registers. Inputs are in spill slots, except for
|
|
|
|
! inputs coalesced with the output, in which case that input
|
|
|
|
! will be in a register.
|
|
|
|
UNION: clobber-insn
|
|
|
|
hairy-clobber-insn
|
|
|
|
##unary-float-function
|
|
|
|
##binary-float-function
|
|
|
|
##unbox
|
|
|
|
##box
|
2010-07-16 19:57:45 -04:00
|
|
|
##box-long-long ;
|
2010-05-16 03:43:02 -04:00
|
|
|
|
2009-07-27 23:29:17 -04:00
|
|
|
! Instructions that have complex expansions and require that the
|
|
|
|
! output registers are not equal to any of the input registers
|
|
|
|
UNION: def-is-use-insn
|
2009-09-27 21:34:20 -04:00
|
|
|
##box-alien
|
|
|
|
##box-displaced-alien
|
|
|
|
##unbox-any-c-ptr ;
|