From af89006b09e91517e98947827adf37e7dba430eb Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Mon, 8 Jan 2018 16:18:10 -0800 Subject: [PATCH] Fix some markdown issues. Work around some cases where the old markdown parser differs from the new Pulldown parser for the documentation. --- lib/cretonne/src/ir/dfg.rs | 2 +- lib/cretonne/src/ir/immediates.rs | 4 +- lib/cretonne/src/ir/types.rs | 5 +- lib/cretonne/src/result.rs | 6 +-- lib/cretonne/src/verifier/mod.rs | 78 +++++++++++++++---------------- lib/filecheck/src/lib.rs | 2 + lib/wasm/src/func_translator.rs | 5 +- 7 files changed, 53 insertions(+), 49 deletions(-) diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index e2328e46dc..50842b3fa5 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -705,7 +705,7 @@ impl DataFlowGraph { /// Returns the position of `val` before removal. /// /// *Important*: to ensure O(1) deletion, this method swaps the removed parameter with the - /// last `ebb`` parameter. This can disrupt all the branch instructions jumping to this + /// last `ebb` parameter. This can disrupt all the branch instructions jumping to this /// `ebb` for which you have to change the branch argument order if necessary. /// /// Panics if `val` is not an EBB parameter. diff --git a/lib/cretonne/src/ir/immediates.rs b/lib/cretonne/src/ir/immediates.rs index fb55c97006..69607754a2 100644 --- a/lib/cretonne/src/ir/immediates.rs +++ b/lib/cretonne/src/ir/immediates.rs @@ -526,7 +526,7 @@ impl Ieee32 { Ieee32(x) } - /// Create an `Ieee32` number representing 2.0^n. + /// Create an `Ieee32` number representing `2.0^n`. pub fn pow2>(n: I) -> Ieee32 { let n = n.into(); let w = 8; @@ -578,7 +578,7 @@ impl Ieee64 { Ieee64(x) } - /// Create an `Ieee64` number representing 2.0^n. + /// Create an `Ieee64` number representing `2.0^n`. pub fn pow2>(n: I) -> Ieee64 { let n = n.into(); let w = 11; diff --git a/lib/cretonne/src/ir/types.rs b/lib/cretonne/src/ir/types.rs index 8b93e82267..f8774250ec 100644 --- a/lib/cretonne/src/ir/types.rs +++ b/lib/cretonne/src/ir/types.rs @@ -265,8 +265,9 @@ impl Type { } /// True iff: - /// 1) self.lane_count() == other.lane_count() and - /// 2) self.lane_bits() >= other.lane_bits() + /// + /// 1. `self.lane_count() == other.lane_count()` and + /// 2. `self.lane_bits() >= other.lane_bits()` pub fn wider_or_equal(self, other: Type) -> bool { self.lane_count() == other.lane_count() && self.lane_bits() >= other.lane_bits() } diff --git a/lib/cretonne/src/result.rs b/lib/cretonne/src/result.rs index b5e9861f95..387eaa9a2a 100644 --- a/lib/cretonne/src/result.rs +++ b/lib/cretonne/src/result.rs @@ -23,10 +23,10 @@ pub enum CtonError { /// An implementation limit was exceeded. /// - /// Cretonne can compile very large and complicated functions, but the implementation has - /// limits that cause compilation to fail when they are exceeded. + /// Cretonne can compile very large and complicated functions, but the [implementation has + /// limits][limits] that cause compilation to fail when they are exceeded. /// - /// See http://cretonne.readthedocs.io/en/latest/langref.html#implementation-limits + /// [limits]: http://cretonne.readthedocs.io/en/latest/langref.html#implementation-limits ImplLimitExceeded, /// The code size for the function is too large. diff --git a/lib/cretonne/src/verifier/mod.rs b/lib/cretonne/src/verifier/mod.rs index ef534bcd87..affd8a3ec6 100644 --- a/lib/cretonne/src/verifier/mod.rs +++ b/lib/cretonne/src/verifier/mod.rs @@ -1,59 +1,59 @@ //! A verifier for ensuring that functions are well formed. //! It verifies: //! -//! EBB integrity +//! EBB integrity //! -//! - All instructions reached from the `ebb_insts` iterator must belong to -//! the EBB as reported by `inst_ebb()`. -//! - Every EBB must end in a terminator instruction, and no other instruction -//! can be a terminator. -//! - Every value in the `ebb_params` iterator belongs to the EBB as reported by `value_ebb`. +//! - All instructions reached from the `ebb_insts` iterator must belong to +//! the EBB as reported by `inst_ebb()`. +//! - Every EBB must end in a terminator instruction, and no other instruction +//! can be a terminator. +//! - Every value in the `ebb_params` iterator belongs to the EBB as reported by `value_ebb`. //! -//! Instruction integrity +//! Instruction integrity //! -//! - The instruction format must match the opcode. -//! - All result values must be created for multi-valued instructions. -//! - All referenced entities must exist. (Values, EBBs, stack slots, ...) -//! - Instructions must not reference (eg. branch to) the entry block. +//! - The instruction format must match the opcode. +//! - All result values must be created for multi-valued instructions. +//! - All referenced entities must exist. (Values, EBBs, stack slots, ...) +//! - Instructions must not reference (eg. branch to) the entry block. //! -//! SSA form +//! SSA form //! -//! - Values must be defined by an instruction that exists and that is inserted in -//! an EBB, or be an argument of an existing EBB. -//! - Values used by an instruction must dominate the instruction. +//! - Values must be defined by an instruction that exists and that is inserted in +//! an EBB, or be an argument of an existing EBB. +//! - Values used by an instruction must dominate the instruction. //! -//! Control flow graph and dominator tree integrity: +//! Control flow graph and dominator tree integrity: //! -//! - All predecessors in the CFG must be branches to the EBB. -//! - All branches to an EBB must be present in the CFG. -//! - A recomputed dominator tree is identical to the existing one. +//! - All predecessors in the CFG must be branches to the EBB. +//! - All branches to an EBB must be present in the CFG. +//! - A recomputed dominator tree is identical to the existing one. //! -//! Type checking +//! Type checking //! -//! - Compare input and output values against the opcode's type constraints. -//! For polymorphic opcodes, determine the controlling type variable first. -//! - Branches and jumps must pass arguments to destination EBBs that match the -//! expected types exactly. The number of arguments must match. -//! - All EBBs in a jump_table must take no arguments. -//! - Function calls are type checked against their signature. -//! - The entry block must take arguments that match the signature of the current -//! function. -//! - All return instructions must have return value operands matching the current -//! function signature. +//! - Compare input and output values against the opcode's type constraints. +//! For polymorphic opcodes, determine the controlling type variable first. +//! - Branches and jumps must pass arguments to destination EBBs that match the +//! expected types exactly. The number of arguments must match. +//! - All EBBs in a jump_table must take no arguments. +//! - Function calls are type checked against their signature. +//! - The entry block must take arguments that match the signature of the current +//! function. +//! - All return instructions must have return value operands matching the current +//! function signature. //! -//! Global variables +//! Global variables //! -//! - Detect cycles in deref(base) declarations. +//! - Detect cycles in deref(base) declarations. //! //! TODO: -//! Ad hoc checking +//! Ad hoc checking //! -//! - Stack slot loads and stores must be in-bounds. -//! - Immediate constraints for certain opcodes, like `udiv_imm v3, 0`. -//! - `Insertlane` and `extractlane` instructions have immediate lane numbers that must be in -//! range for their polymorphic type. -//! - Swizzle and shuffle instructions take a variable number of lane arguments. The number -//! of arguments must match the destination type, and the lane indexes must be in range. +//! - Stack slot loads and stores must be in-bounds. +//! - Immediate constraints for certain opcodes, like `udiv_imm v3, 0`. +//! - `Insertlane` and `extractlane` instructions have immediate lane numbers that must be in +//! range for their polymorphic type. +//! - Swizzle and shuffle instructions take a variable number of lane arguments. The number +//! of arguments must match the destination type, and the lane indexes must be in range. use dbg::DisplayList; use dominator_tree::DominatorTree; diff --git a/lib/filecheck/src/lib.rs b/lib/filecheck/src/lib.rs index 8cca73736b..a189acebdb 100644 --- a/lib/filecheck/src/lib.rs +++ b/lib/filecheck/src/lib.rs @@ -10,6 +10,7 @@ //! # Directives //! //! These are the directives recognized by *filecheck*: +//! //!
 //! check: <pattern>
 //! sameln: <pattern>
@@ -18,6 +19,7 @@
 //! not: <pattern>
 //! regex: <variable>=<regex>
 //! 
+//! //! Each directive is described in more detail below. //! //! ## Example diff --git a/lib/wasm/src/func_translator.rs b/lib/wasm/src/func_translator.rs index 36c1b58a17..5e8555c194 100644 --- a/lib/wasm/src/func_translator.rs +++ b/lib/wasm/src/func_translator.rs @@ -43,8 +43,9 @@ impl FuncTranslator { /// - The declaration of *locals*, and /// - The function *body* as an expression. /// - /// See [the WebAssembly specification] - /// (http://webassembly.github.io/spec/binary/modules.html#code-section). + /// See [the WebAssembly specification][wasm]. + /// + /// [wasm]: http://webassembly.github.io/spec/binary/modules.html#code-section /// /// The Cretonne IR function `func` should be completely empty except for the `func.signature` /// and `func.name` fields. The signature may contain special-purpose arguments which are not