From 5f581fd7366b2a8be261de44ac2a2c1172d7a51d Mon Sep 17 00:00:00 2001 From: vjackson725 Date: Sat, 18 Aug 2018 15:02:20 +1000 Subject: [PATCH 1/4] rewrite to give a helpful error message when missing qemu-arm --- newlib-generator/src/macros.rs | 45 ++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/newlib-generator/src/macros.rs b/newlib-generator/src/macros.rs index 84315a777..00f875169 100644 --- a/newlib-generator/src/macros.rs +++ b/newlib-generator/src/macros.rs @@ -59,11 +59,16 @@ pub fn __errno() -> *mut i32 {{ .success() ); - let mut qemu = Command::new("qemu-arm") - .arg("math/target/thumbv7em-none-eabi/release/math") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn()?; + let mut qemu = match { + Command::new("qemu-arm") + .arg("math/target/thumbv7em-none-eabi/release/math") + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + } { + Ok(qemu) => qemu, + Err(_) => panic!("missing qemu-arm!") + }; qemu.stdin.as_mut().take().unwrap().write_all(F32)?; @@ -142,11 +147,16 @@ pub fn __errno() -> *mut i32 {{ .success() ); - let mut qemu = Command::new("qemu-arm") - .arg("math/target/thumbv7em-none-eabi/release/math") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn()?; + let mut qemu = match { + Command::new("qemu-arm") + .arg("math/target/thumbv7em-none-eabi/release/math") + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + } { + Ok(qemu) => qemu, + Err(_) => panic!("missing qemu-arm!") + }; qemu.stdin.as_mut().take().unwrap().write_all(F32)?; @@ -228,11 +238,16 @@ pub fn __errno() -> *mut i32 {{ .success() ); - let mut qemu = Command::new("qemu-arm") - .arg("math/target/thumbv7em-none-eabi/release/math") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn()?; + let mut qemu = match { + Command::new("qemu-arm") + .arg("math/target/thumbv7em-none-eabi/release/math") + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + } { + Ok(qemu) => qemu, + Err(_) => panic!("missing qemu-arm!") + }; qemu.stdin.as_mut().take().unwrap().write_all(F32)?; From af8ac7d38fcd3fd35b84fab1867b5d5068488d92 Mon Sep 17 00:00:00 2001 From: vjackson725 Date: Sat, 18 Aug 2018 15:07:37 +1000 Subject: [PATCH 2/4] fix issues due to to/from_bytes rename --- input-generator/src/main.rs | 34 ++++++++++++----------- musl-generator/src/macros.rs | 16 +++++------ musl-generator/src/main.rs | 2 ++ newlib-generator/src/macros.rs | 24 ++++++++++------ shared/src/lib.rs | 50 +++++++++++++++++----------------- 5 files changed, 68 insertions(+), 58 deletions(-) diff --git a/input-generator/src/main.rs b/input-generator/src/main.rs index b4a6ad142..082b691f6 100644 --- a/input-generator/src/main.rs +++ b/input-generator/src/main.rs @@ -1,3 +1,5 @@ +#![feature(int_to_from_bytes)] + extern crate rand; use std::collections::BTreeSet; @@ -43,7 +45,7 @@ fn f32(rng: &mut XorShiftRng) -> Result<(), Box> { let mut f = File::create("bin/input/f32")?; for i in set { - f.write_all(&i.to_bytes())?; + f.write_all(&i.to_ne_bytes())?; } Ok(()) @@ -61,8 +63,8 @@ fn f32f32(rng: &mut XorShiftRng) -> Result<(), Box> { } i += 1; - f.write_all(&x0.to_bits().to_bytes())?; - f.write_all(&x1.to_bits().to_bytes())?; + f.write_all(&x0.to_bits().to_ne_bytes())?; + f.write_all(&x1.to_bits().to_ne_bytes())?; } Ok(()) @@ -80,8 +82,8 @@ fn f32i16(rng: &mut XorShiftRng) -> Result<(), Box> { } i += 1; - f.write_all(&x0.to_bits().to_bytes())?; - f.write_all(&x1.to_bytes())?; + f.write_all(&x0.to_bits().to_ne_bytes())?; + f.write_all(&x1.to_ne_bytes())?; } Ok(()) @@ -100,9 +102,9 @@ fn f32f32f32(rng: &mut XorShiftRng) -> Result<(), Box> { } i += 1; - f.write_all(&x0.to_bits().to_bytes())?; - f.write_all(&x1.to_bits().to_bytes())?; - f.write_all(&x2.to_bits().to_bytes())?; + f.write_all(&x0.to_bits().to_ne_bytes())?; + f.write_all(&x1.to_bits().to_ne_bytes())?; + f.write_all(&x2.to_bits().to_ne_bytes())?; } Ok(()) @@ -123,7 +125,7 @@ fn f64(rng: &mut XorShiftRng) -> Result<(), Box> { let mut f = File::create("bin/input/f64")?; for i in set { - f.write_all(&i.to_bytes())?; + f.write_all(&i.to_ne_bytes())?; } Ok(()) @@ -141,8 +143,8 @@ fn f64f64(rng: &mut XorShiftRng) -> Result<(), Box> { } i += 1; - f.write_all(&x0.to_bits().to_bytes())?; - f.write_all(&x1.to_bits().to_bytes())?; + f.write_all(&x0.to_bits().to_ne_bytes())?; + f.write_all(&x1.to_bits().to_ne_bytes())?; } Ok(()) @@ -161,9 +163,9 @@ fn f64f64f64(rng: &mut XorShiftRng) -> Result<(), Box> { } i += 1; - f.write_all(&x0.to_bits().to_bytes())?; - f.write_all(&x1.to_bits().to_bytes())?; - f.write_all(&x2.to_bits().to_bytes())?; + f.write_all(&x0.to_bits().to_ne_bytes())?; + f.write_all(&x1.to_bits().to_ne_bytes())?; + f.write_all(&x2.to_bits().to_ne_bytes())?; } Ok(()) @@ -181,8 +183,8 @@ fn f64i16(rng: &mut XorShiftRng) -> Result<(), Box> { } i += 1; - f.write_all(&x0.to_bits().to_bytes())?; - f.write_all(&x1.to_bytes())?; + f.write_all(&x0.to_bits().to_ne_bytes())?; + f.write_all(&x1.to_ne_bytes())?; } Ok(()) diff --git a/musl-generator/src/macros.rs b/musl-generator/src/macros.rs index 16ba99d64..55f779500 100644 --- a/musl-generator/src/macros.rs +++ b/musl-generator/src/macros.rs @@ -16,7 +16,7 @@ macro_rules! f32 { $fun(*x) }; - $fun.write_all(&y.to_bits().to_bytes())?; + $fun.write_all(&y.to_bits().to_ne_bytes())?; )+ } }}; @@ -40,7 +40,7 @@ macro_rules! f32f32 { $fun(*x0, *x1) }; - $fun.write_all(&y.to_bits().to_bytes())?; + $fun.write_all(&y.to_bits().to_ne_bytes())?; )+ } }}; @@ -64,7 +64,7 @@ macro_rules! f32f32f32 { $fun(*x0, *x1, *x2) }; - $fun.write_all(&y.to_bits().to_bytes())?; + $fun.write_all(&y.to_bits().to_ne_bytes())?; )+ } }}; @@ -88,7 +88,7 @@ macro_rules! f32i32 { $fun(*x0, *x1 as i32) }; - $fun.write_all(&y.to_bits().to_bytes())?; + $fun.write_all(&y.to_bits().to_ne_bytes())?; )+ } }}; @@ -112,7 +112,7 @@ macro_rules! f64 { $fun(*x) }; - $fun.write_all(&y.to_bits().to_bytes())?; + $fun.write_all(&y.to_bits().to_ne_bytes())?; )+ } }}; @@ -136,7 +136,7 @@ macro_rules! f64f64 { $fun(*x0, *x1) }; - $fun.write_all(&y.to_bits().to_bytes())?; + $fun.write_all(&y.to_bits().to_ne_bytes())?; )+ } }}; @@ -160,7 +160,7 @@ macro_rules! f64f64f64 { $fun(*x0, *x1, *x2) }; - $fun.write_all(&y.to_bits().to_bytes())?; + $fun.write_all(&y.to_bits().to_ne_bytes())?; )+ } }}; @@ -184,7 +184,7 @@ macro_rules! f64i32 { $fun(*x0, *x1 as i32) }; - $fun.write_all(&y.to_bits().to_bytes())?; + $fun.write_all(&y.to_bits().to_ne_bytes())?; )+ } }}; diff --git a/musl-generator/src/main.rs b/musl-generator/src/main.rs index 6e57e856d..4ff1ff81d 100644 --- a/musl-generator/src/main.rs +++ b/musl-generator/src/main.rs @@ -1,3 +1,5 @@ +#![feature(int_to_from_bytes)] + extern crate libm; extern crate shared; diff --git a/newlib-generator/src/macros.rs b/newlib-generator/src/macros.rs index 00f875169..6d214c65d 100644 --- a/newlib-generator/src/macros.rs +++ b/newlib-generator/src/macros.rs @@ -6,6 +6,8 @@ macro_rules! f32 { fs::create_dir_all("math/src")?; let main = format!(" +#![feature(int_to_from_bytes)] + #![no_main] #![no_std] @@ -33,10 +35,10 @@ fn run() -> Result<(), usize> {{ let mut buf = [0; 4]; while let Ok(()) = io::Stdin.read_exact(&mut buf) {{ - let x = f32::from_bits(u32::from_bytes(buf)); + let x = f32::from_bits(u32::from_ne_bytes(buf)); let y = unsafe {{ {0}(x) }}; - io::Stdout.write_all(&y.to_bits().to_bytes())?; + io::Stdout.write_all(&y.to_bits().to_ne_bytes())?; }} Ok(()) @@ -88,6 +90,8 @@ macro_rules! f32f32 { fs::create_dir_all("math/src")?; let main = format!(" +#![feature(int_to_from_bytes)] + #![no_main] #![no_std] @@ -117,14 +121,14 @@ fn run() -> Result<(), usize> {{ while let Ok(()) = io::Stdin.read_exact(&mut chunk) {{ let mut buf = [0; 4]; buf.copy_from_slice(&chunk[..4]); - let x0 = f32::from_bits(u32::from_bytes(buf)); + let x0 = f32::from_bits(u32::from_ne_bytes(buf)); buf.copy_from_slice(&chunk[4..]); - let x1 = f32::from_bits(u32::from_bytes(buf)); + let x1 = f32::from_bits(u32::from_ne_bytes(buf)); let y = unsafe {{ {0}(x0, x1) }}; - io::Stdout.write_all(&y.to_bits().to_bytes())?; + io::Stdout.write_all(&y.to_bits().to_ne_bytes())?; }} Ok(()) @@ -176,6 +180,8 @@ macro_rules! f32f32f32 { fs::create_dir_all("math/src")?; let main = format!(" +#![feature(int_to_from_bytes)] + #![no_main] #![no_std] @@ -205,17 +211,17 @@ fn run() -> Result<(), usize> {{ while let Ok(()) = io::Stdin.read_exact(&mut chunk) {{ let mut buf = [0; 4]; buf.copy_from_slice(&chunk[..4]); - let x0 = f32::from_bits(u32::from_bytes(buf)); + let x0 = f32::from_bits(u32::from_ne_bytes(buf)); buf.copy_from_slice(&chunk[4..8]); - let x1 = f32::from_bits(u32::from_bytes(buf)); + let x1 = f32::from_bits(u32::from_ne_bytes(buf)); buf.copy_from_slice(&chunk[8..]); - let x2 = f32::from_bits(u32::from_bytes(buf)); + let x2 = f32::from_bits(u32::from_ne_bytes(buf)); let y = unsafe {{ {0}(x0, x1, x2) }}; - io::Stdout.write_all(&y.to_bits().to_bytes())?; + io::Stdout.write_all(&y.to_bits().to_ne_bytes())?; }} Ok(()) diff --git a/shared/src/lib.rs b/shared/src/lib.rs index 84676f94f..8c00f5ef6 100644 --- a/shared/src/lib.rs +++ b/shared/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(exact_chunks)] +#![feature(exact_chunks, int_to_from_bytes)] #[macro_use] extern crate lazy_static; @@ -12,7 +12,7 @@ lazy_static! { .map(|chunk| { let mut buf = [0; 4]; buf.copy_from_slice(chunk); - f32::from_bits(u32::from_le(u32::from_bytes(buf))) + f32::from_bits(u32::from_le(u32::from_ne_bytes(buf))) }) .collect() }; @@ -28,8 +28,8 @@ lazy_static! { x1.copy_from_slice(&chunk[4..]); ( - f32::from_bits(u32::from_le(u32::from_bytes(x0))), - f32::from_bits(u32::from_le(u32::from_bytes(x1))), + f32::from_bits(u32::from_le(u32::from_ne_bytes(x0))), + f32::from_bits(u32::from_le(u32::from_ne_bytes(x1))), ) }) .collect() @@ -48,9 +48,9 @@ lazy_static! { x2.copy_from_slice(&chunk[8..]); ( - f32::from_bits(u32::from_le(u32::from_bytes(x0))), - f32::from_bits(u32::from_le(u32::from_bytes(x1))), - f32::from_bits(u32::from_le(u32::from_bytes(x2))), + f32::from_bits(u32::from_le(u32::from_ne_bytes(x0))), + f32::from_bits(u32::from_le(u32::from_ne_bytes(x1))), + f32::from_bits(u32::from_le(u32::from_ne_bytes(x2))), ) }) .collect() @@ -67,8 +67,8 @@ lazy_static! { x1.copy_from_slice(&chunk[4..]); ( - f32::from_bits(u32::from_le(u32::from_bytes(x0))), - i16::from_le(i16::from_bytes(x1)) as i32, + f32::from_bits(u32::from_le(u32::from_ne_bytes(x0))), + i16::from_le(i16::from_ne_bytes(x1)) as i32, ) }) .collect() @@ -81,7 +81,7 @@ lazy_static! { .map(|chunk| { let mut buf = [0; 8]; buf.copy_from_slice(chunk); - f64::from_bits(u64::from_le(u64::from_bytes(buf))) + f64::from_bits(u64::from_le(u64::from_ne_bytes(buf))) }) .collect() }; @@ -97,8 +97,8 @@ lazy_static! { x1.copy_from_slice(&chunk[8..]); ( - f64::from_bits(u64::from_le(u64::from_bytes(x0))), - f64::from_bits(u64::from_le(u64::from_bytes(x1))), + f64::from_bits(u64::from_le(u64::from_ne_bytes(x0))), + f64::from_bits(u64::from_le(u64::from_ne_bytes(x1))), ) }) .collect() @@ -117,9 +117,9 @@ lazy_static! { x2.copy_from_slice(&chunk[16..]); ( - f64::from_bits(u64::from_le(u64::from_bytes(x0))), - f64::from_bits(u64::from_le(u64::from_bytes(x1))), - f64::from_bits(u64::from_le(u64::from_bytes(x2))), + f64::from_bits(u64::from_le(u64::from_ne_bytes(x0))), + f64::from_bits(u64::from_le(u64::from_ne_bytes(x1))), + f64::from_bits(u64::from_le(u64::from_ne_bytes(x2))), ) }) .collect() @@ -136,8 +136,8 @@ lazy_static! { x1.copy_from_slice(&chunk[8..]); ( - f64::from_bits(u64::from_le(u64::from_bytes(x0))), - i16::from_le(i16::from_bytes(x1)) as i32, + f64::from_bits(u64::from_le(u64::from_ne_bytes(x0))), + i16::from_le(i16::from_ne_bytes(x1)) as i32, ) }) .collect() @@ -155,7 +155,7 @@ macro_rules! f32 { .map(|chunk| { let mut buf = [0; 4]; buf.copy_from_slice(chunk); - f32::from_bits(u32::from_le(u32::from_bytes(buf))) + f32::from_bits(u32::from_le(u32::from_ne_bytes(buf))) }) .collect::>(); @@ -194,7 +194,7 @@ macro_rules! f32f32 { .map(|chunk| { let mut buf = [0; 4]; buf.copy_from_slice(chunk); - f32::from_bits(u32::from_le(u32::from_bytes(buf))) + f32::from_bits(u32::from_le(u32::from_ne_bytes(buf))) }) .collect::>(); @@ -235,7 +235,7 @@ macro_rules! f32f32f32 { .map(|chunk| { let mut buf = [0; 4]; buf.copy_from_slice(chunk); - f32::from_bits(u32::from_le(u32::from_bytes(buf))) + f32::from_bits(u32::from_le(u32::from_ne_bytes(buf))) }) .collect::>(); @@ -277,7 +277,7 @@ macro_rules! f32i32 { .map(|chunk| { let mut buf = [0; 4]; buf.copy_from_slice(chunk); - f32::from_bits(u32::from_le(u32::from_bytes(buf))) + f32::from_bits(u32::from_le(u32::from_ne_bytes(buf))) }) .collect::>(); @@ -318,7 +318,7 @@ macro_rules! f64 { .map(|chunk| { let mut buf = [0; 8]; buf.copy_from_slice(chunk); - f64::from_bits(u64::from_le(u64::from_bytes(buf))) + f64::from_bits(u64::from_le(u64::from_ne_bytes(buf))) }) .collect::>(); @@ -357,7 +357,7 @@ macro_rules! f64f64 { .map(|chunk| { let mut buf = [0; 8]; buf.copy_from_slice(chunk); - f64::from_bits(u64::from_le(u64::from_bytes(buf))) + f64::from_bits(u64::from_le(u64::from_ne_bytes(buf))) }) .collect::>(); @@ -398,7 +398,7 @@ macro_rules! f64f64f64 { .map(|chunk| { let mut buf = [0; 8]; buf.copy_from_slice(chunk); - f64::from_bits(u64::from_le(u64::from_bytes(buf))) + f64::from_bits(u64::from_le(u64::from_ne_bytes(buf))) }) .collect::>(); @@ -440,7 +440,7 @@ macro_rules! f64i32 { .map(|chunk| { let mut buf = [0; 8]; buf.copy_from_slice(chunk); - f64::from_bits(u64::from_le(u64::from_bytes(buf))) + f64::from_bits(u64::from_le(u64::from_ne_bytes(buf))) }) .collect::>(); From 9e62344a057483b98f4918648c3a8415c1b15d5e Mon Sep 17 00:00:00 2001 From: vjackson725 Date: Sun, 26 Aug 2018 12:12:18 +1000 Subject: [PATCH 3/4] use from_le_bytes instead of from_ne then from_le --- shared/src/lib.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/shared/src/lib.rs b/shared/src/lib.rs index 8c00f5ef6..6189c0daa 100644 --- a/shared/src/lib.rs +++ b/shared/src/lib.rs @@ -12,7 +12,7 @@ lazy_static! { .map(|chunk| { let mut buf = [0; 4]; buf.copy_from_slice(chunk); - f32::from_bits(u32::from_le(u32::from_ne_bytes(buf))) + f32::from_bits(u32::from_le_bytes(buf)) }) .collect() }; @@ -28,8 +28,8 @@ lazy_static! { x1.copy_from_slice(&chunk[4..]); ( - f32::from_bits(u32::from_le(u32::from_ne_bytes(x0))), - f32::from_bits(u32::from_le(u32::from_ne_bytes(x1))), + f32::from_bits(u32::from_le_bytes(x0)), + f32::from_bits(u32::from_le_bytes(x1)), ) }) .collect() @@ -48,9 +48,9 @@ lazy_static! { x2.copy_from_slice(&chunk[8..]); ( - f32::from_bits(u32::from_le(u32::from_ne_bytes(x0))), - f32::from_bits(u32::from_le(u32::from_ne_bytes(x1))), - f32::from_bits(u32::from_le(u32::from_ne_bytes(x2))), + f32::from_bits(u32::from_le_bytes(x0)), + f32::from_bits(u32::from_le_bytes(x1)), + f32::from_bits(u32::from_le_bytes(x2)), ) }) .collect() @@ -67,7 +67,7 @@ lazy_static! { x1.copy_from_slice(&chunk[4..]); ( - f32::from_bits(u32::from_le(u32::from_ne_bytes(x0))), + f32::from_bits(u32::from_le_bytes(x0)), i16::from_le(i16::from_ne_bytes(x1)) as i32, ) }) @@ -155,7 +155,7 @@ macro_rules! f32 { .map(|chunk| { let mut buf = [0; 4]; buf.copy_from_slice(chunk); - f32::from_bits(u32::from_le(u32::from_ne_bytes(buf))) + f32::from_bits(u32::from_le_bytes(buf)) }) .collect::>(); @@ -194,7 +194,7 @@ macro_rules! f32f32 { .map(|chunk| { let mut buf = [0; 4]; buf.copy_from_slice(chunk); - f32::from_bits(u32::from_le(u32::from_ne_bytes(buf))) + f32::from_bits(u32::from_le_bytes(buf)) }) .collect::>(); @@ -235,7 +235,7 @@ macro_rules! f32f32f32 { .map(|chunk| { let mut buf = [0; 4]; buf.copy_from_slice(chunk); - f32::from_bits(u32::from_le(u32::from_ne_bytes(buf))) + f32::from_bits(u32::from_le_bytes(buf)) }) .collect::>(); @@ -277,7 +277,7 @@ macro_rules! f32i32 { .map(|chunk| { let mut buf = [0; 4]; buf.copy_from_slice(chunk); - f32::from_bits(u32::from_le(u32::from_ne_bytes(buf))) + f32::from_bits(u32::from_le_bytes(buf)) }) .collect::>(); From aee82e8ade8a0707b19756768a5b8803190fa90c Mon Sep 17 00:00:00 2001 From: vjackson725 Date: Sun, 26 Aug 2018 13:12:19 +1000 Subject: [PATCH 4/4] make the quem-arm missing error handling nicer --- newlib-generator/src/macros.rs | 48 +++++++++++++--------------------- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/newlib-generator/src/macros.rs b/newlib-generator/src/macros.rs index 6d214c65d..c9cf8d877 100644 --- a/newlib-generator/src/macros.rs +++ b/newlib-generator/src/macros.rs @@ -61,16 +61,12 @@ pub fn __errno() -> *mut i32 {{ .success() ); - let mut qemu = match { - Command::new("qemu-arm") - .arg("math/target/thumbv7em-none-eabi/release/math") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - } { - Ok(qemu) => qemu, - Err(_) => panic!("missing qemu-arm!") - }; + let mut qemu = Command::new("qemu-arm") + .arg("math/target/thumbv7em-none-eabi/release/math") + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + .map_err(|_| "missing qemu-arm!")?; qemu.stdin.as_mut().take().unwrap().write_all(F32)?; @@ -151,16 +147,12 @@ pub fn __errno() -> *mut i32 {{ .success() ); - let mut qemu = match { - Command::new("qemu-arm") - .arg("math/target/thumbv7em-none-eabi/release/math") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - } { - Ok(qemu) => qemu, - Err(_) => panic!("missing qemu-arm!") - }; + let mut qemu = Command::new("qemu-arm") + .arg("math/target/thumbv7em-none-eabi/release/math") + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + .map_err(|_| "missing qemu-arm!")?; qemu.stdin.as_mut().take().unwrap().write_all(F32)?; @@ -244,16 +236,12 @@ pub fn __errno() -> *mut i32 {{ .success() ); - let mut qemu = match { - Command::new("qemu-arm") - .arg("math/target/thumbv7em-none-eabi/release/math") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - } { - Ok(qemu) => qemu, - Err(_) => panic!("missing qemu-arm!") - }; + let mut qemu = Command::new("qemu-arm") + .arg("math/target/thumbv7em-none-eabi/release/math") + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + .map_err(|_| "missing qemu-arm!")?; qemu.stdin.as_mut().take().unwrap().write_all(F32)?;