Skip to content

Commit 35afbd4

Browse files
author
Jorge Aparicio
committed
regenerate the examples
1 parent 0ce1175 commit 35afbd4

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/examples/fpu.rs

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Auto-generated. Do not modify this file! Instead modify examples/fpu.rs
2+
//! You can do fast, single precision, floating point math as well
3+
//!
4+
//! ``` rust,no_run
5+
//! #![feature(asm)]
6+
//! #![no_main]
7+
//! #![no_std]
8+
//!
9+
//! #[macro_use]
10+
//! extern crate f3;
11+
//!
12+
//! #[export_name = "main"]
13+
//! pub extern "C" fn main() -> ! {
14+
//! let x = black_box(2_f32);
15+
//! let y = black_box(3_f32);
16+
//! let z = black_box(x * y);
17+
//!
18+
//! iprintln!("{} * {} = {}", x, y, z);
19+
//!
20+
//! loop {}
21+
//! }
22+
//!
23+
//! // Magic to prevent optimizations like "constant folding" which is when LLVM
24+
//! // performs arithmetic at compile time. This is a copy of `test::black_box`.
25+
//! fn black_box<T>(x: T) -> T {
26+
//! unsafe {
27+
//! asm!("" :: "r"(&x));
28+
//! }
29+
//!
30+
//! x
31+
//! }
32+
//! ```

src/examples/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//! Examples
33
44
pub mod exception;
5+
pub mod fpu;
56
pub mod itm;
67
pub mod led_roulette;
78
pub mod minimal;

0 commit comments

Comments
 (0)