mamot.fr is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mamot.fr est un serveur Mastodon francophone, géré par La Quadrature du Net.

Server stats:

3.3K
active users

#compiler

10 posts10 participants0 posts today

I just made a post about the intricacies of the coding language I'm developing. This post is meant to notify people because I forgot to include the hash tags in my original post, so I don't think many people saw it.

I highly encourage everyone to check out my last post. It's got a lot of info on there I'd hate to go to waste

"Calypsi" is a collection of compilers and assemblers that run under Windows, Linux and macOS and can generate code for various retro platforms - 6502 and 68000 processors are supported, among others. Although the project is hosted on Github, the source code is not freely available and use of the tools is only permitted for private purposes. Now version 5.10 is available. Changes:

amiga-news.de/en/news/AN-2025-

www.amiga-news.deamiga-news.de - Cross-compiler/assembler: Calypsi 5.10

#Apple M1 / M2 / M3 Core Support Might Soon Be Merged For The #GCC #Compiler
When it comes to compiler support for #AppleSilicon and their hardware at large, Apple has long been focused on the LLVM/Clang toolchain given their long history with it, employing many of the developers, and Xcode being based on LLVM. The GNU Compiler Collection (GCC) though may soon see upstream support for the newer Apple Cores
phoronix.com/news/Apple-Cores-

www.phoronix.comApple M1 / M2 / M3 Core Support Might Soon Be Merged For The GCC Compiler

Today's been a fun ride down weird #MSVC #cpp #compiler land, for some values of "fun".

I'm still flabbergasted that it generates multiple SIMD rounds of packed doubles/singles conversions with a half full xmm register for a seemingly innocuous line of math and a call to std::exp2f. Like, why not use regular math instructions if you want to vectorize with N=1 width? Are these lines really "optimized"?

This is some frackin' dark #compiler magic.
godbolt.org/z/6ans5YGnW

When I pay attention, I'm used to seeing `-Os` nibble at the edges to make the program's footprint smaller -- remove dead code, remove functions that don't get called, inline called-once functions, etc.

I'm not surprised that it was able to achieve some amazing compression given the structure of the `switch` statements (and the pattern of values in the nested array) -- but wow. It replaced both 34-entry jump tables with a single 34-element array, and replaced the nested array with code to compute the array's elements. When I say it like that, it seems (as I said) not surprising, but it's still frickin' amazing.

(For those wondering why I use this implementation instead of the commented-out simpler implementation, it's starter code for an assignment in which students need to scan a matrix keypad, replacing the library call -- giving them this in the starter code gets better results than giving them the simpler version in the starter code.)

godbolt.orgCompiler Explorer - C #define KEYPAD (1) char cowpi_get_keypress(void); uint8_t cowpi_debounce_byte(uint8_t byte, uint8_t device); static const uint8_t keys[4][4] = { {0x1, 0x2, 0x3, 0xA}, {0x4, 0x5, 0x6, 0xB}, {0x7, 0x8, 0x9, 0xC}, {0xF, 0x0, 0xE, 0xD} }; uint8_t get_keypress(void) { int8_t row, column; char key = cowpi_get_keypress(); switch (key) { case '1': case '2': case '3': case 'A': row = 0; break; case '4': case '5': case '6': case 'B': row = 1; break; case '7': case '8': case '9': case 'C': row = 2; break; case '*': case '#': case '0': case 'D': row = 3; break; default: row = -1; } switch (key) { case '1': case '4': case '7': case '*': column = 0; break; case '2': case '5': case '8': case '0': column = 1; break; case '3': case '6': case '9': case '#': column = 2; break; case 'A': case 'B': case 'C': case 'D': column = 3; break; default: column = -1; } if (row == -1 || column == -1) { return cowpi_debounce_byte(0xFF, KEYPAD); } else { return cowpi_debounce_byte(keys[row][column], KEYPAD); } } // uint8_t simpler_implementation(void) { // char key = cowpi_get_keypress(); // uint8_t value; // if ('0' <= key && key <= '9') { // value = key - '0'; // } else if (key == '#') { // value = 0xE; // } else if (key == '*') { // value = 0xF; // } else { // value = 0xFF; // } // return cowpi_debounce_byte(value, KEYPAD); // }

#dailyreport #rust #linux #gentoo #opensource #compiler
#security
I compiled Rust from sources with alternative compiler
Mrustc (C++) without any binary blobs.

As you may know Rust compiler distributed as Rust sources
meant to be build by older "snapshot" of itself. Which
violate open source paradigm.

I was able to solve this in Gentoo GNU/Linux OS with
reproducible way. First I compile Rust 1.74 version and
then in chain I compile all versions to 1.84.

All steps took approximately 8 hours, but after it is fast
to compile new version, without blobs.

Dusting off my little 32bit RISC ISA aimed at being extremely friendly for emulators and toolchains and human inspection.

Unlike RISC-V the instruction encoding is tuned for software ease of implementation and understanding, not worrying about 16bit encodings, wider-than-32bit machines, etc.

It does try to match RV32I in functionality so that if you generate these instructions but with the RV32 immediate width constraints, the mapping is almost always 1:1.

Time to set aside the cross #compiler for a while and switch to #house and #garden projects.

I should be working on mixing rice hulls into the soil of our raised garden beds, but I worked on the open source energy monitoring project. Made progress, but it's not tracking our usage yet.

Tomorrow I hope I can get some rice hulls in between working for the @coopartisans, meeting with my local elected representative, and helping cook meals for this week.