From b443fbd8f71cd5b229e860e74a1a5d1af89bc6a4 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 28 Dec 2017 04:46:27 +0000 Subject: [PATCH] runtime: remove #[repr(simd)] hack. --- artiq/firmware/runtime/analyzer.rs | 12 ++---------- artiq/firmware/runtime/lib.rs | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/artiq/firmware/runtime/analyzer.rs b/artiq/firmware/runtime/analyzer.rs index 1e2909a37..f3330fc11 100644 --- a/artiq/firmware/runtime/analyzer.rs +++ b/artiq/firmware/runtime/analyzer.rs @@ -5,18 +5,13 @@ use analyzer_proto::*; const BUFFER_SIZE: usize = 512 * 1024; -// hack until https://github.com/rust-lang/rust/issues/33626 is fixed -#[repr(simd)] -struct Align64(u64, u64, u64, u64, u64, u64, u64, u64); - +#[repr(align(64))] struct Buffer { data: [u8; BUFFER_SIZE], - __alignment: [Align64; 0] } static mut BUFFER: Buffer = Buffer { - data: [0; BUFFER_SIZE], - __alignment: [] + data: [0; BUFFER_SIZE] }; fn arm() { @@ -68,9 +63,6 @@ fn worker(stream: &mut TcpStream) -> io::Result<()> { } pub fn thread(io: Io) { - // verify that the hack above works - assert!(::core::mem::align_of::() == 64); - let listener = TcpListener::new(&io, 65535); listener.listen(1382).expect("analyzer: cannot listen"); diff --git a/artiq/firmware/runtime/lib.rs b/artiq/firmware/runtime/lib.rs index 049d8c12a..b167cd2a3 100644 --- a/artiq/firmware/runtime/lib.rs +++ b/artiq/firmware/runtime/lib.rs @@ -1,5 +1,5 @@ #![no_std] -#![feature(compiler_builtins_lib, alloc, repr_simd, lang_items, const_fn, global_allocator)] +#![feature(compiler_builtins_lib, alloc, lang_items, global_allocator, repr_align, attr_literals)] extern crate compiler_builtins; extern crate alloc;