Mehdi Akiki

Posts tagged "x86"

  • Published on
    Rust 1.99.0 forgot one attribute on FFI functions that return bool on x86_64 Linux, and C callers got 16 where Rust computed false. I rebuilt the bug with three toolchains, gcc and clang, to see what this value does in C and how to tell a compiler bug from my own ABI mistake.
  • Published on

    Investigation · Part 8 of 10 · Types under the hood

    The Processor Has No Types: What add Does to Bits It Does Not Understand

    I compiled the same operations for i32 and u32. Addition produced one shared function, comparison used the same compare instruction with a different flag, and division and shifting used different instructions. Where the sign lives in the machine code is not where most people expect.