From c42bed7452cb48f12b244fa3d1cc95613ec44cbb Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 1 Aug 2018 05:05:33 -0700 Subject: [PATCH] Update paths for the meta => meta-python rename. --- cranelift/docs/Makefile | 2 +- cranelift/docs/conf.py | 4 ++-- cranelift/docs/metaref.rst | 10 +++++----- cranelift/docs/testing.rst | 8 ++++---- cranelift/test-all.sh | 4 ++-- lib/codegen/src/constant_hash.rs | 6 +++--- lib/codegen/src/ir/builder.rs | 2 +- lib/codegen/src/ir/instructions.rs | 2 +- lib/codegen/src/ir/types.rs | 4 ++-- lib/codegen/src/isa/arm32/settings.rs | 4 ++-- lib/codegen/src/isa/arm64/settings.rs | 4 ++-- lib/codegen/src/isa/enc_tables.rs | 6 +++--- lib/codegen/src/isa/registers.rs | 6 +++--- lib/codegen/src/isa/riscv/settings.rs | 4 ++-- lib/codegen/src/isa/x86/settings.rs | 4 ++-- lib/codegen/src/legalizer/mod.rs | 2 +- lib/codegen/src/predicates.rs | 2 +- lib/codegen/src/settings.rs | 5 +++-- 18 files changed, 40 insertions(+), 39 deletions(-) diff --git a/cranelift/docs/Makefile b/cranelift/docs/Makefile index c66a99211d..082189bfa3 100644 --- a/cranelift/docs/Makefile +++ b/cranelift/docs/Makefile @@ -14,7 +14,7 @@ help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) autohtml: html - $(SPHINXABUILD) -z ../lib/codegen/meta --ignore '.*' -b html -E $(ALLSPHINXOPTS) $(BUILDDIR)/html + $(SPHINXABUILD) -z ../lib/codegen/meta-python --ignore '.*' -b html -E $(ALLSPHINXOPTS) $(BUILDDIR)/html .PHONY: help Makefile diff --git a/cranelift/docs/conf.py b/cranelift/docs/conf.py index 2220d72141..2ab7d8a8c5 100644 --- a/cranelift/docs/conf.py +++ b/cranelift/docs/conf.py @@ -21,9 +21,9 @@ import os import sys sys.path.insert(0, os.path.abspath('.')) -# Also add the meta directory to sys.path so autodoc can find the Cranelift meta +# Also add the meta-python directory to sys.path so autodoc can find the Cranelift meta # language definitions. -sys.path.insert(0, os.path.abspath('../lib/codegen/meta')) +sys.path.insert(0, os.path.abspath('../lib/codegen/meta-python')) # -- General configuration ------------------------------------------------ diff --git a/cranelift/docs/metaref.rst b/cranelift/docs/metaref.rst index a1b0dd1f32..361dca9172 100644 --- a/cranelift/docs/metaref.rst +++ b/cranelift/docs/metaref.rst @@ -11,7 +11,7 @@ domain specific language embedded in Python. This document describes the Python modules that form the embedded DSL. The meta language descriptions are Python modules under the -:file:`lib/codegen/meta` directory. The descriptions are processed in two +:file:`lib/codegen/meta-python` directory. The descriptions are processed in two steps: 1. The Python modules are imported. This has the effect of building static data @@ -23,8 +23,8 @@ steps: constant tables. The main driver for this source code generation process is the -:file:`lib/codegen/meta/build.py` script which is invoked as part of the build -process if anything in the :file:`lib/codegen/meta` directory has changed +:file:`lib/codegen/meta-python/build.py` script which is invoked as part of the build +process if anything in the :file:`lib/codegen/meta-python` directory has changed since the last build. @@ -38,7 +38,7 @@ of code generation. Each setting is defined in the meta language so a compact and consistent Rust representation can be generated. Shared settings are defined in the :mod:`base.settings` module. Some settings are specific to a target ISA, and defined in a :file:`settings.py` module under the appropriate -:file:`lib/codegen/meta/isa/*` directory. +:file:`lib/codegen/meta-python/isa/*` directory. Settings can take boolean on/off values, small numbers, or explicitly enumerated symbolic values. Each type is represented by a sub-class of :class:`Setting`: @@ -433,7 +433,7 @@ architectures. Each ISA is represented by a :py:class:`cdsl.isa.TargetISA` insta .. autoclass:: TargetISA The definitions for each supported target live in a package under -:file:`lib/codegen/meta/isa`. +:file:`lib/codegen/meta-python/isa`. .. automodule:: isa :members: diff --git a/cranelift/docs/testing.rst b/cranelift/docs/testing.rst index d1107b6f67..345940c772 100644 --- a/cranelift/docs/testing.rst +++ b/cranelift/docs/testing.rst @@ -1,6 +1,6 @@ -**************** +***************** Testing Cranelift -**************** +***************** Cranelift is tested at multiple levels of abstraction and integration. When possible, Rust unit tests are used to verify single functions and types. When @@ -109,7 +109,7 @@ header: isa_spec : "isa" isa_name { `option` } "\n" The options given on the ``isa`` line modify the ISA-specific settings defined in -:file:`lib/codegen/meta/isa/*/settings.py`. +:file:`lib/codegen/meta-python/isa/*/settings.py`. All types of tests allow shared Cranelift settings to be modified: @@ -119,7 +119,7 @@ All types of tests allow shared Cranelift settings to be modified: option : flag | setting "=" value The shared settings available for all target ISAs are defined in -:file:`lib/codegen/meta/base/settings.py`. +:file:`lib/codegen/meta-python/base/settings.py`. The ``set`` lines apply settings cumulatively:: diff --git a/cranelift/test-all.sh b/cranelift/test-all.sh index 580c41d47b..fb17e35d82 100755 --- a/cranelift/test-all.sh +++ b/cranelift/test-all.sh @@ -43,13 +43,13 @@ fi # Check if any Python files have changed since we last checked them. tsfile="$topdir/target/meta-checked" if [ -f "$tsfile" ]; then - needcheck=$(find "$topdir/lib/codegen/meta" -name '*.py' -newer "$tsfile") + needcheck=$(find "$topdir/lib/codegen/meta-python" -name '*.py' -newer "$tsfile") else needcheck=yes fi if [ -n "$needcheck" ]; then banner "Checking python source files" - "$topdir/lib/codegen/meta/check.sh" + "$topdir/lib/codegen/meta-python/check.sh" touch "$tsfile" || echo no target directory fi diff --git a/lib/codegen/src/constant_hash.rs b/lib/codegen/src/constant_hash.rs index 2bfeaf58c3..553543ec60 100644 --- a/lib/codegen/src/constant_hash.rs +++ b/lib/codegen/src/constant_hash.rs @@ -1,6 +1,6 @@ //! Runtime support for precomputed constant hash tables. //! -//! The `lib/codegen/meta/constant_hash.py` Python module can generate constant hash tables using +//! The `lib/codegen/meta-python/constant_hash.py` Python module can generate constant hash tables using //! open addressing and quadratic probing. The hash tables are arrays that are guaranteed to: //! //! - Have a power-of-two size. @@ -56,7 +56,7 @@ pub fn probe + ?Sized>( } /// A primitive hash function for matching opcodes. -/// Must match `lib/codegen/meta/constant_hash.py`. +/// Must match `lib/codegen/meta-python/constant_hash.py`. pub fn simple_hash(s: &str) -> usize { let mut h: u32 = 5381; for c in s.chars() { @@ -71,7 +71,7 @@ mod tests { #[test] fn basic() { - // c.f. `meta/constant_hash.py` tests. + // c.f. `meta-python/constant_hash.py` tests. assert_eq!(simple_hash("Hello"), 0x2fa70c01); assert_eq!(simple_hash("world"), 0x5b0c31d5); } diff --git a/lib/codegen/src/ir/builder.rs b/lib/codegen/src/ir/builder.rs index 48cbf03238..5cd2bfe36d 100644 --- a/lib/codegen/src/ir/builder.rs +++ b/lib/codegen/src/ir/builder.rs @@ -32,7 +32,7 @@ pub trait InstBuilderBase<'f>: Sized { fn build(self, data: InstructionData, ctrl_typevar: Type) -> (Inst, &'f mut DataFlowGraph); } -// Include trait code generated by `lib/codegen/meta/gen_instr.py`. +// Include trait code generated by `lib/codegen/meta-python/gen_instr.py`. // // This file defines the `InstBuilder` trait as an extension of `InstBuilderBase` with methods per // instruction format and per opcode. diff --git a/lib/codegen/src/ir/instructions.rs b/lib/codegen/src/ir/instructions.rs index c9abb67f3d..e709aa01c1 100644 --- a/lib/codegen/src/ir/instructions.rs +++ b/lib/codegen/src/ir/instructions.rs @@ -28,7 +28,7 @@ pub type ValueList = entity::EntityList; /// Memory pool for holding value lists. See `ValueList`. pub type ValueListPool = entity::ListPool; -// Include code generated by `lib/codegen/meta/gen_instr.py`. This file contains: +// Include code generated by `lib/codegen/meta-python/gen_instr.py`. This file contains: // // - The `pub enum InstructionFormat` enum with all the instruction formats. // - The `pub enum InstructionData` enum with all the instruction data fields. diff --git a/lib/codegen/src/ir/types.rs b/lib/codegen/src/ir/types.rs index edaee867da..195d90968a 100644 --- a/lib/codegen/src/ir/types.rs +++ b/lib/codegen/src/ir/types.rs @@ -24,13 +24,13 @@ pub struct Type(u8); /// a SIMD vector. pub const VOID: Type = Type(0); -/// Start of the lane types. See also `meta/cdsl.types.py`. +/// Start of the lane types. See also `meta-python/cdsl.types.py`. const LANE_BASE: u8 = 0x70; /// Start of the 2-lane vector types. const VECTOR_BASE: u8 = LANE_BASE + 16; -// Include code generated by `lib/codegen/meta/gen_types.py`. This file contains constant +// Include code generated by `lib/codegen/meta-python/gen_types.py`. This file contains constant // definitions for all the scalar types as well as common vector types for 64, 128, 256, and // 512-bit SIMD vectors. include!(concat!(env!("OUT_DIR"), "/types.rs")); diff --git a/lib/codegen/src/isa/arm32/settings.rs b/lib/codegen/src/isa/arm32/settings.rs index ed7dd01281..a5075597d9 100644 --- a/lib/codegen/src/isa/arm32/settings.rs +++ b/lib/codegen/src/isa/arm32/settings.rs @@ -3,7 +3,7 @@ use settings::{self, detail, Builder}; use std::fmt; -// Include code generated by `lib/codegen/meta/gen_settings.py`. This file contains a public +// Include code generated by `lib/codegen/meta-python/gen_settings.py`. This file contains a public // `Flags` struct with an impl for all of the settings defined in -// `lib/codegen/meta/isa/arm32/settings.py`. +// `lib/codegen/meta-python/isa/arm32/settings.py`. include!(concat!(env!("OUT_DIR"), "/settings-arm32.rs")); diff --git a/lib/codegen/src/isa/arm64/settings.rs b/lib/codegen/src/isa/arm64/settings.rs index cdaa129b2d..6d51aed6ad 100644 --- a/lib/codegen/src/isa/arm64/settings.rs +++ b/lib/codegen/src/isa/arm64/settings.rs @@ -3,7 +3,7 @@ use settings::{self, detail, Builder}; use std::fmt; -// Include code generated by `lib/codegen/meta/gen_settings.py`. This file contains a public +// Include code generated by `lib/codegen/meta-python/gen_settings.py`. This file contains a public // `Flags` struct with an impl for all of the settings defined in -// `lib/codegen/meta/isa/arm64/settings.py`. +// `lib/codegen/meta-python/isa/arm64/settings.py`. include!(concat!(env!("OUT_DIR"), "/settings-arm64.rs")); diff --git a/lib/codegen/src/isa/enc_tables.rs b/lib/codegen/src/isa/enc_tables.rs index b3deb85de1..0a98ace71a 100644 --- a/lib/codegen/src/isa/enc_tables.rs +++ b/lib/codegen/src/isa/enc_tables.rs @@ -1,7 +1,7 @@ //! Support types for generated encoding tables. //! //! This module contains types and functions for working with the encoding tables generated by -//! `lib/codegen/meta/gen_encoding.py`. +//! `lib/codegen/meta-python/gen_encoding.py`. use constant_hash::{probe, Table}; use ir::{Function, InstructionData, Opcode, Type}; @@ -164,10 +164,10 @@ where /// Encoding lists are represented as sequences of u16 words. pub type EncListEntry = u16; -/// Number of bits used to represent a predicate. c.f. `meta/gen_encoding.py`. +/// Number of bits used to represent a predicate. c.f. `meta-python/gen_encoding.py`. const PRED_BITS: u8 = 12; const PRED_MASK: usize = (1 << PRED_BITS) - 1; -/// First code word representing a predicate check. c.f. `meta/gen_encoding.py`. +/// First code word representing a predicate check. c.f. `meta-python/gen_encoding.py`. const PRED_START: usize = 0x1000; /// An iterator over legal encodings for the instruction. diff --git a/lib/codegen/src/isa/registers.rs b/lib/codegen/src/isa/registers.rs index a78dfac60c..9296b70af5 100644 --- a/lib/codegen/src/isa/registers.rs +++ b/lib/codegen/src/isa/registers.rs @@ -17,19 +17,19 @@ pub type RegUnit = u16; /// The size of this type is determined by the target ISA that has the most register units defined. /// Currently that is arm32 which has 64+16 units. /// -/// This type should be coordinated with meta/cdsl/registers.py. +/// This type should be coordinated with meta-python/cdsl/registers.py. pub type RegUnitMask = [u32; 3]; /// A bit mask indexed by register classes. /// /// The size of this type is determined by the ISA with the most register classes. /// -/// This type should be coordinated with meta/cdsl/isa.py. +/// This type should be coordinated with meta-python/cdsl/isa.py. pub type RegClassMask = u32; /// Guaranteed maximum number of top-level register classes with pressure tracking in any ISA. /// -/// This can be increased, but should be coordinated with meta/cdsl/isa.py. +/// This can be increased, but should be coordinated with meta-python/cdsl/isa.py. pub const MAX_TRACKED_TOPRCS: usize = 4; /// The register units in a target ISA are divided into disjoint register banks. Each bank covers a diff --git a/lib/codegen/src/isa/riscv/settings.rs b/lib/codegen/src/isa/riscv/settings.rs index a5bdd6b850..972f5c6b5f 100644 --- a/lib/codegen/src/isa/riscv/settings.rs +++ b/lib/codegen/src/isa/riscv/settings.rs @@ -3,9 +3,9 @@ use settings::{self, detail, Builder}; use std::fmt; -// Include code generated by `lib/codegen/meta/gen_settings.py`. This file contains a public +// Include code generated by `lib/codegen/meta-python/gen_settings.py`. This file contains a public // `Flags` struct with an impl for all of the settings defined in -// `lib/codegen/meta/isa/riscv/settings.py`. +// `lib/codegen/meta-python/isa/riscv/settings.py`. include!(concat!(env!("OUT_DIR"), "/settings-riscv.rs")); #[cfg(test)] diff --git a/lib/codegen/src/isa/x86/settings.rs b/lib/codegen/src/isa/x86/settings.rs index 84d0e96f06..66699b1289 100644 --- a/lib/codegen/src/isa/x86/settings.rs +++ b/lib/codegen/src/isa/x86/settings.rs @@ -3,9 +3,9 @@ use settings::{self, detail, Builder}; use std::fmt; -// Include code generated by `lib/codegen/meta/gen_settings.py`. This file contains a public +// Include code generated by `lib/codegen/meta-python/gen_settings.py`. This file contains a public // `Flags` struct with an impl for all of the settings defined in -// `lib/codegen/meta/isa/x86/settings.py`. +// `lib/codegen/meta-python/isa/x86/settings.py`. include!(concat!(env!("OUT_DIR"), "/settings-x86.rs")); #[cfg(test)] diff --git a/lib/codegen/src/legalizer/mod.rs b/lib/codegen/src/legalizer/mod.rs index f6ca7efeec..f11a652828 100644 --- a/lib/codegen/src/legalizer/mod.rs +++ b/lib/codegen/src/legalizer/mod.rs @@ -110,7 +110,7 @@ pub fn legalize_function(func: &mut ir::Function, cfg: &mut ControlFlowGraph, is } // Include legalization patterns that were generated by `gen_legalizer.py` from the `XForms` in -// `lib/codegen/meta/base/legalize.py`. +// `lib/codegen/meta-python/base/legalize.py`. // // Concretely, this defines private functions `narrow()`, and `expand()`. include!(concat!(env!("OUT_DIR"), "/legalizer.rs")); diff --git a/lib/codegen/src/predicates.rs b/lib/codegen/src/predicates.rs index 96cf0f38c6..58ae0a40fb 100644 --- a/lib/codegen/src/predicates.rs +++ b/lib/codegen/src/predicates.rs @@ -1,7 +1,7 @@ //! Predicate functions for testing instruction fields. //! //! This module defines functions that are used by the instruction predicates defined by -//! `lib/codegen/meta/cdsl/predicates.py` classes. +//! `lib/codegen/meta-python/cdsl/predicates.py` classes. //! //! The predicates the operate on integer fields use `Into` as a shared trait bound. This //! bound is implemented by all the native integer types as well as `Imm64`. diff --git a/lib/codegen/src/settings.rs b/lib/codegen/src/settings.rs index aaa11e3d8c..da0ac133aa 100644 --- a/lib/codegen/src/settings.rs +++ b/lib/codegen/src/settings.rs @@ -310,8 +310,9 @@ pub mod detail { } } -// Include code generated by `meta/gen_settings.py`. This file contains a public `Flags` struct -// with an impl for all of the settings defined in `lib/codegen/meta/base/settings.py`. +// Include code generated by `meta-python/gen_settings.py`. This file contains a public `Flags` +// struct with an impl for all of the settings defined in +// `lib/codegen/meta-python/base/settings.py`. include!(concat!(env!("OUT_DIR"), "/settings.rs")); /// Wrapper containing flags and optionally a `TargetIsa` trait object.