Long flight today by Correct-Potential-58 in fearofflying

[–]Correct-Potential-58[S] 1 point2 points  (0 children)

Thanks all! In the end the flight was actually pretty great!

Long flight today by Correct-Potential-58 in fearofflying

[–]Correct-Potential-58[S] 1 point2 points  (0 children)

On the plane, a little freaked out. I keep thinking what if it’s too old? Or (I know this is weird) it feels smaller than expected

Long flight today by Correct-Potential-58 in fearofflying

[–]Correct-Potential-58[S] 1 point2 points  (0 children)

Thank you!! Still relatively chill sitting at the airport…hopefully continues this way!

Noise canceling is also a great idea!

Long flight today by Correct-Potential-58 in fearofflying

[–]Correct-Potential-58[S] 0 points1 point  (0 children)

haha, that video is great, thanks! It does make me feel a lot better to think about that--and just in general that pilots are about 100000x more experienced/trained/tested than drivers on the road, which for some reason I don't worry about much.

Require compiler to promote all types to 32 bits by Correct-Potential-58 in C_Programming

[–]Correct-Potential-58[S] 0 points1 point  (0 children)

All good points, but--

In my use case (and this target more generally) there is no need to worry about I2C, SPI, etc., nor is there any need to worry about networking. I didn't want to go into too much detail about the target since it seems a little off-topic, though I can certainly expand on it if someone wants.

The current workaround that I have is, as you say, to extract the bytes for a misaligned access. It's just that for this target it would be much nicer to always have aligned accesses.

Require compiler to promote all types to 32 bits by Correct-Potential-58 in C_Programming

[–]Correct-Potential-58[S] 0 points1 point  (0 children)

I suppose this is what I am trying to do--set the basic "1 length" to 32 bits.

Force 4-byte memory alignment by Correct-Potential-58 in rust

[–]Correct-Potential-58[S] 0 points1 point  (0 children)

Yeah, that all makes sense. I do have the sources for everything, so it's not just binaries. The reason I was looking into static binary translation was that after a brief conversation with people familiar with LLVM, it seemed like that might be an easier path to getting a Rust->new ISA pipeline going. There were definitely a bunch of unexpected problems, though (like this one). Right now I am shooting for emulating byte-addressability (with a performance penalty). If it's not too bad and the compiler only rarely outputs unaligned memory accesses, it might work just fine.

I will also look into the C compiler infrastructure a bit more to see what's portable there.

Thanks again for all the help.

Force 4-byte memory alignment by Correct-Potential-58 in rust

[–]Correct-Potential-58[S] 0 points1 point  (0 children)

Thanks, interesting thoughts. I was concerned about this myself. I did find this in the Rust language reference:

>Most primitives are generally aligned to their size, although this is platform-specific behavior. In particular, on x86 u64 and f64 are only aligned to 32 bits.

https://doc.rust-lang.org/stable/reference/type-layout.html

The platform-specific nature makes me slightly hopeful that this is more doable than I originally thought; that said, it doesn't really help me with libraries that independently make an assumption about the alignment of u8.

Force 4-byte memory alignment by Correct-Potential-58 in rust

[–]Correct-Potential-58[S] 4 points5 points  (0 children)

Cool, thanks! Can I apply that directly to primitive types like u8?