]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.*: a few extra doc fixes 1310/head
authorBjörn Lindqvist <bjourne@gmail.com>
Thu, 30 Apr 2015 02:51:58 +0000 (04:51 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Thu, 30 Apr 2015 02:51:58 +0000 (04:51 +0200)
basis/compiler/cfg/builder/alien/alien-docs.factor
basis/compiler/cfg/instructions/instructions-docs.factor
basis/compiler/cfg/intrinsics/fixnum/fixnum-docs.factor [new file with mode: 0644]
basis/compiler/cfg/rpo/rpo-docs.factor
basis/compiler/constants/constants-docs.factor
basis/compiler/constants/constants.factor

index 0899fd4918c37c2762d6ccb677078f404b36b23c..fa22861bca4f5066d1244eb1db3e84d259f7d695 100644 (file)
@@ -1,4 +1,5 @@
-USING: help.markup help.syntax literals make multiline stack-checker.alien ;
+USING: help.markup help.syntax literals make multiline sequences
+stack-checker.alien ;
 IN: compiler.cfg.builder.alien
 
 <<
@@ -19,3 +20,7 @@ HELP: caller-return
 { $values { "params" alien-node-params } }
 { $description "If the last alien call returns a value, then this word will emit an instruction to the current sequence being constructed by " { $link make } " that boxes it." }
 { $examples { $unchecked-example $[ ex-caller-return ] } } ;
+
+HELP: unbox-parameters
+{ $values { "parameters" sequence } { "vregs" sequence } { "reps" sequence } }
+{ $description "Unboxes a sequence of parameters to send to an ffi function." } ;
index 5f6ba66db6a228c9f1c18d3064bbe948b803c17e..c9bf94ab72796e61b3ccc99c5d6e9887f7baca85 100644 (file)
@@ -1,6 +1,7 @@
-USING: alien arrays assocs classes compiler.cfg compiler.cfg.ssa.destruction
-compiler.cfg.value-numbering compiler.codegen.gc-maps cpu.architecture
-help.markup help.syntax kernel layouts sequences slots.private system ;
+USING: alien arrays assocs classes compiler.cfg compiler.cfg.intrinsics.fixnum
+compiler.cfg.ssa.destruction compiler.cfg.value-numbering
+compiler.codegen.gc-maps cpu.architecture help.markup help.syntax kernel layouts
+math sequences slots.private system ;
 IN: compiler.cfg.instructions
 
 HELP: ##alien-invoke
@@ -66,7 +67,8 @@ HELP: ##compare-float-ordered-branch
 } ;
 
 HELP: ##compare-integer
-{ $class-description "This instruction is emitted for integer comparisons." } ;
+{ $class-description "This instruction is emitted for integer (" { $link fixnum } ") comparisons." }
+{ $see-also emit-fixnum-comparison } ;
 
 HELP: ##copy
 { $class-description "Instruction that copies a value from one register to another of the same type. For example, you can copy between two gprs or two simd registers but not across. It has the following slots:"
@@ -75,6 +77,10 @@ HELP: ##copy
   }
 } ;
 
+HELP: ##fixnum-add
+{ $class-description "Instruction for adding two fixnums together." }
+{ $see-also emit-fixnum+ } ;
+
 HELP: ##inc
 { $class-description
   "An instruction that increases or decreases a stacks height by n. For example, " { $link 2drop } " decreases the datastacks height by two and pushing an item increases it by one."
@@ -196,7 +202,17 @@ HELP: ##spill
 { $class-description "Instruction that copies a value from a register to a " { $link spill-slot } "." } ;
 
 HELP: ##store-memory-imm
-{ $class-description "Instruction that copies an 8 byte value from a XMM register to a memory location addressed by a normal register. This instruction is often turned into a cheaper " { $link ##store-memory } " instruction in the " { $link value-numbering } " pass." } ;
+{ $class-description "Instruction that copies an 8 byte value from a XMM register to a memory location addressed by a normal register. This instruction is often turned into a cheaper " { $link ##store-memory } " instruction in the " { $link value-numbering } " pass."
+  { $table
+    { { $slot "base" } { "Vreg that contains the base address." } }
+    {
+        { $slot "offset" }
+        { "Offset in bytes from the address to where the data should be written." }
+    }
+    { { $slot "src" } { "Vreg that contains the item to set." } }
+  }
+}
+{ $see-also %store-memory-imm } ;
 
 HELP: ##vector>scalar
 { $class-description
diff --git a/basis/compiler/cfg/intrinsics/fixnum/fixnum-docs.factor b/basis/compiler/cfg/intrinsics/fixnum/fixnum-docs.factor
new file mode 100644 (file)
index 0000000..948d26d
--- /dev/null
@@ -0,0 +1,6 @@
+USING: compiler.cfg.instructions help.markup help.syntax ;
+IN: compiler.cfg.intrinsics.fixnum
+
+HELP: emit-fixnum-comparison
+{ $values { "cc" "comparison symbol" } }
+{ $description "Emits a " { $link ##compare-integer } " instruction to the make sequence." } ;
index dde89bc9b91e1149d3ea5e6f05143068a5e57ace..a74e5f33ddf1fc92e4ec3b0ca33ce8d39a042b0c 100644 (file)
@@ -27,3 +27,7 @@ HELP: optimize-basic-block
 HELP: simple-analysis
 { $values { "cfg" cfg } { "quot" quotation } }
 { $description "Applies a quotation to each sequence of instructions in each " { $link basic-block } " in the cfg." } ;
+
+HELP: simple-optimization
+{ $values { "cfg" cfg } { "quot" quotation } }
+{ $description "Runs a quotation that optimizes each " { $link basic-block } " in the cfg, excluding the kill blocks. The quotation takes the blocks instruction sequence and returns them back in optimized form. The blocks are iterated in " { $link reverse-post-order } "." } ;
index 567dcfb6125a42d1bb031eb6ab01721fcc817c1e..cf0ec8749f76c0dff993f165dcca4c4be450007a 100644 (file)
@@ -1,4 +1,4 @@
-USING: compiler.codegen.relocation help.markup help.syntax ;
+USING: compiler.codegen.relocation help.markup help.syntax math ;
 IN: compiler.constants
 
 HELP: rt-cards-offset
@@ -9,7 +9,45 @@ HELP: rt-decks-offset
 { $description "Relocation offset type for the decks table." }
 { $see-also rel-decks-offset } ;
 
+HELP: string-offset
+{ $values { "n" integer } }
+{ $description "hm" } ;
 
-ARTICLE: "compiler.constants" "VM memory layout constants" "Common constants" ;
+
+ARTICLE: "compiler.constants" "VM memory layout constants"
+"Common constants."
+$nl
+"Constants that must match vm/memory.hpp:"
+{ $subsections card-bits card-mark deck-bits }
+"Constants that must match vm/layouts.hpp:"
+{ $subsections
+  alien-offset
+  array-start-offset
+  byte-array-offset
+  callstack-length-offset
+  callstack-top-offset
+  context-callstack-bottom-offset
+  context-callstack-save-offset
+  context-callstack-seg-offset
+  context-datastack-offset
+  context-callstack-top-offset
+  context-retainstack-offset
+  float-offset
+  profile-count-offset
+  quot-entry-point-offset
+  segment-end-offset
+  segment-size-offset
+  segment-start-offset
+  slot-offset
+  string-aux-offset
+  string-offset
+  tuple-class-offset
+  underlying-alien-offset
+  vm-context-offset
+  vm-fault-flag-offset
+  vm-signal-handler-addr-offset
+  vm-spare-context-offset
+  word-entry-point-offset
+} ;
 
 ABOUT: "compiler.constants"
index c044eddedc997c6e2050db271bedbb18207c6a6c..80aafc609a96b50f8f259e35cbec23acee189ac8 100644 (file)
@@ -4,12 +4,10 @@ USING: alien arrays byte-arrays kernel layouts literals math
 quotations sequences strings words ;
 IN: compiler.constants
 
-! These constants must match vm/memory.h
 CONSTANT: card-bits 8
 CONSTANT: deck-bits 18
 : card-mark ( -- n ) 0x40 0x80 bitor ; inline
 
-! These constants must match vm/layouts.h
 : slot-offset ( slot tag -- n ) [ bootstrap-cells ] dip - ; inline
 
 : float-offset ( -- n ) 8 float type-number - ; inline