AsmBB

Power
Login Register

Data Structures in Assembly Language
0

#16399 (ツ) dapperdrake
Created 26.08.2024, read: 200 times

Here goes a newbie question:

<rant>

Have been trying to dig up information on data structures in assembly language as opposed to C language (long story, mostly annoyances with undefined behavior in C. K&R C seems acceptable. In a recent interview on YouTube Brian Kernighan seems like a humble person who pays attention. ANSI C, ISO C, and compilers made by word-thinkers less so. Plan 9's system-oriented C compiler cc8 seems to have fallen by the wayside, as well. GCC since around 2000 is busy breaking code. They broke x87 floating point settings in Python 3's gevent library via "-Ofast" ignoring "-fno-fast-math". Via shared object files this pollutes a huge amount of the numerical stack in Python 3. Library gevent doesn't even need IEEE 754 floating point. Idiots. And GNU binutils also fails at reading static library ".a" files as most other people use them: https://sourceware.org/bugzilla/show_bug.cgi?id=32006)

</rant>

The best I have come up with so far, is Donald Ervin Knuth's The Art of Computer Programming, especially with his focus on MIX and MMIX.

What about practical experience with different data structures in amd64/x86_64 (?) It took me a while to grok, that the call-stack frames on Linux x86_64 are kind of like pairs of pointers and build a linked list if you squint just right.

Am messing around with structures of arrays vs arrays of structures (SoA vs. AoS). Mainly, because I am poking at understanding caches, prefetchers, and SIMD.

Thank you for sharing your time

dapperdrake

#16400 (ツ) dapperdrake
Created 13.09.2024, read: 36 times

Upon further searching and sleuthing, there seems to be a good read-world example of extensive data juggling in assembly language in VideoLAN's and FFmpeg's AV1 decoder. It came up, because some people are trying to port the 50k lines of C-code to Rust. The bulk seems to be 250k lines of assembly, though. AV1 decoding seems to require data and thread juggling that may be of interest, if the writers were sufficiently good.

Rust port from C

Lobste.rs comments on Rust port from C

Data Structures in Assembly Language
0

AsmBB v3.0 (check-in: a316dab8b98d07d9); SQLite v3.42.0 (check-in: 831d0fb2836b71c9);
©2016..2023 John Found; Licensed under EUPL. Powered by Assembly language Created with Fresh IDE