Merge remote-tracking branch 'origin/master' into no_std

This commit is contained in:
Dan Gohman
2018-04-18 17:17:43 -07:00
92 changed files with 508 additions and 295 deletions

View File

@@ -1,7 +1,7 @@
[package]
name = "cretonne-tools"
authors = ["The Cretonne Project Developers"]
version = "0.5.0"
version = "0.5.1"
description = "Binaries for testing the Cretonne libraries"
license = "Apache-2.0"
documentation = "https://cretonne.readthedocs.io/"
@@ -13,16 +13,16 @@ name = "cton-util"
path = "src/cton-util.rs"
[dependencies]
cretonne-codegen = { path = "lib/codegen", version = "0.5.0" }
cretonne-reader = { path = "lib/reader", version = "0.5.0" }
cretonne-frontend = { path = "lib/frontend", version = "0.5.0" }
cretonne-wasm = { path = "lib/wasm", version = "0.5.0" }
cretonne-native = { path = "lib/native", version = "0.5.0" }
cretonne-filetests = { path = "lib/filetests", version = "0.5.0" }
cretonne-module = { path = "lib/module", version = "0.5.0" }
cretonne-faerie = { path = "lib/faerie", version = "0.5.0" }
cretonne-simplejit = { path = "lib/simplejit", version = "0.5.0" }
cretonne = { path = "lib/umbrella", version = "0.5.0" }
cretonne-codegen = { path = "lib/codegen", version = "0.5.1" }
cretonne-reader = { path = "lib/reader", version = "0.5.1" }
cretonne-frontend = { path = "lib/frontend", version = "0.5.1" }
cretonne-wasm = { path = "lib/wasm", version = "0.5.1" }
cretonne-native = { path = "lib/native", version = "0.5.1" }
cretonne-filetests = { path = "lib/filetests", version = "0.5.1" }
cretonne-module = { path = "lib/module", version = "0.5.1" }
cretonne-faerie = { path = "lib/faerie", version = "0.5.1" }
cretonne-simplejit = { path = "lib/simplejit", version = "0.5.1" }
cretonne = { path = "lib/umbrella", version = "0.5.1" }
filecheck = "0.2.1"
docopt = "0.8.0"
serde = "1.0.8"

View File

@@ -34,6 +34,19 @@ Rust Crate Documentation
This crate translates from Cretonne IR's text format into Cretonne IR
in in-memory data structures.
`cretonne-module <https://docs.rs/cretonne-module/>`_
This crate manages compiling multiple functions and data objects
together.
`cretonne-faerie <https://docs.rs/cretonne-faerie/>`_
This crate provides a faerie-based backend for `cretonne-module`, which
emits native object files using the
`faerie <https://crates.io/crates/faerie/>`_ library.
`cretonne-simplejit <https://docs.rs/cretonne-simplejit/>`_
This crate provides a simple JIT backend for `cretonne-module`, which
emits code and data into memory.
Indices and tables
==================

View File

@@ -477,7 +477,7 @@ ebb0:
; Colocated functions.
; asm: call bar
; call fn1() ; bin: e8 PCRel4(%bar-4) 00000000
call fn1() ; bin: e8 PCRel4(%bar-4) 00000000
; asm: lea 0x0(%rip), %rcx
[-,%rcx] v400 = func_addr.i64 fn1 ; bin: 48 8d 0d PCRel4(%bar-4) 00000000

View File

@@ -0,0 +1,15 @@
; Test legalization of a non-colocated call in 64-bit non-PIC mode.
test legalizer
set is_64bit
set is_compressed
isa x86 haswell
function %call() {
fn0 = %foo()
ebb0:
call fn0()
return
}
; check: v0 = func_addr.i64 fn0
; nextln: call_indirect sig0, v0()

View File

@@ -4,7 +4,7 @@ cd $(dirname "$0")
topdir="$(pwd)"
# All the cretonne-* crates have the same version number
version="0.5.0"
version="0.5.1"
# Update all of the Cargo.toml files.
#

View File

@@ -96,19 +96,18 @@ fn handle_module(
for (func, _) in test_file.functions {
let mut context = Context::new();
context.func = func;
let size = context.compile(isa).map_err(|err| {
pretty_error(&context.func, Some(isa), err)
})?;
if flag_print {
println!("{}", context.func.display(isa));
}
// Encode the result as machine code.
// Compile and encode the result to machine code.
let mut mem = Vec::new();
let mut relocs = PrintRelocs { flag_print };
let mut traps = PrintTraps { flag_print };
mem.resize(size as usize, 0);
context.emit_to_memory(mem.as_mut_ptr(), &mut relocs, &mut traps, &*isa);
context
.compile_and_emit(isa, &mut mem, &mut relocs, &mut traps)
.map_err(|err| pretty_error(&context.func, Some(isa), err))?;
if flag_print {
println!("{}", context.func.display(isa));
}
if flag_print {
print!(".byte ");

View File

@@ -1,3 +1,15 @@
#![deny(trivial_numeric_casts, unused_extern_crates)]
#![warn(unused_import_braces, unstable_features)]
#![cfg_attr(feature="cargo-clippy", warn(
float_arithmetic,
mut_mut,
nonminimal_bool,
option_map_unwrap_or,
option_map_unwrap_or_else,
unicode_not_nfc,
use_self,
))]
extern crate cretonne_codegen;
extern crate cretonne_filetests;
extern crate cretonne_reader;