Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/turnt_brilirs.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
command = "bril2json < {filename} | cargo +nightly run --manifest-path ../brilirs/Cargo.toml --quiet -- -p {args}"
command = "bril2json < {filename} | cargo run --manifest-path ../brilirs/Cargo.toml --quiet -- -p {args}"
output.out = "-"
output.prof = "2"
4 changes: 2 additions & 2 deletions brilirs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ benchmark:

.PHONY: release
release:
RUSTFLAGS="-C target-cpu=native" cargo +nightly build --release
RUSTFLAGS="-C target-cpu=native" cargo build --release

.PHONY: compare
compare: release
Expand All @@ -26,4 +26,4 @@ compare: release
# This is primarily used for running examples and debuging a bril program
.PHONY: example
example:
bril2json < ../benchmarks/sqrt.bril | cargo +nightly run
bril2json < ../benchmarks/sqrt.bril | cargo run
2 changes: 0 additions & 2 deletions brilirs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(or_patterns)]

use error::InterpError;

mod basic_block;
Expand Down
6 changes: 3 additions & 3 deletions docs/tools/brilirs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ Fast Interpreter in Rust
========================

The `brilirs` directory contains a fast Bril interpreter written in [Rust][].
It is a drop-in replacement for the [reference interpreter](interp.md) that prioritizes speed over completeness and hacakability.
It is a drop-in replacement for the [reference interpreter](interp.md) that prioritizes speed over completeness and hackability.
It implements [core Bril](../lang/core.md) and the [SSA][], [memory][], and [floating point][float] extensions.

Read [more about the implementation][blog], which is originally by Wil Thomason and Daniel Glus.

Install
-------
To use `brilirs` you will need to [install Rust](https://www.rust-lang.org/tools/install) and add the nightly channel with `rustup toolchain install nightly`. Use `echo $PATH` to check that `$HOME/.cargo/bin` is on your [path](https://unix.stackexchange.com/a/26059/61192).
To use `brilirs` you will need to [install Rust](https://www.rust-lang.org/tools/install). Use `echo $PATH` to check that `$HOME/.cargo/bin` is on your [path](https://unix.stackexchange.com/a/26059/61192).

In the `brilirs` directory, build the interpreter with:

cargo +nightly install --path .
cargo install --path .

Run a program by piping a JSON Bril program into it:

Expand Down
2 changes: 1 addition & 1 deletion test/fail/turnt_brilirs.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
command = "bril2json < {filename} | cargo +nightly run --manifest-path ../../brilirs/Cargo.toml -- {args}"
command = "bril2json < {filename} | cargo run --manifest-path ../../brilirs/Cargo.toml -- {args}"
return_code = 2
2 changes: 1 addition & 1 deletion test/interp-error/turnt_brilirs.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
command = "bril2json < {filename} | cargo +nightly run --manifest-path ../../brilirs/Cargo.toml -- {args}"
command = "bril2json < {filename} | cargo run --manifest-path ../../brilirs/Cargo.toml -- {args}"
return_code = 2
output.err = "2"
2 changes: 1 addition & 1 deletion test/interp/turnt_brilirs.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
command = "bril2json < {filename} | cargo +nightly run --manifest-path ../../brilirs/Cargo.toml -- {args}"
command = "bril2json < {filename} | cargo run --manifest-path ../../brilirs/Cargo.toml -- {args}"
2 changes: 1 addition & 1 deletion test/mem/turnt_brilirs.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
command = "bril2json < {filename} | cargo +nightly run --manifest-path ../../brilirs/Cargo.toml -- {args}"
command = "bril2json < {filename} | cargo run --manifest-path ../../brilirs/Cargo.toml -- {args}"