> ## Content Index
> Fetch the complete content index at: https://jahans.blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# Merry Christmas 🎄
- URL: https://jahans.blog/merry-christmas/
- Published: 2025-12-25T17:44:55.000Z
- Updated: 2026-01-25T05:43:45.000Z
- Author: Jahan Addison
- Tags: credence, algorithm, compiler, computer science, IR, language design, PLT, #Import 2026-09-13 01:33

I finished the x86-64 code generation for Linux and BSD in [credence](https://github.com/jahan-addison/credence?ref=jahans.blog) on Christmas morning, just in time to step away and spend time with family! ARM64 work has already started, and it's turning out to be even more exciting.

The final test was the translation of `switch` control structures from my IR, the `JMP_E` [ITA statement](https://github.com/jahan-addison/credence/tree/master/credence/ir?ref=jahans.blog#intermediate-representation). 

![](https://jahans.blog/content/images/2025/12/image-2.png)

If you're interested in what the machine code looks like, you should take a look at the [test suite](https://github.com/jahan-addison/credence/blob/master/test/x86%5F64/generator.cc?ref=jahans.blog#L1299). 

---

So far, the most challenging part has been designing the Intermediate Representation. Unlike other sections, its design was purely academic - there is no specification to follow. The last time I was in this position was when I needed to re-create left-recursion in a PEG grammar for work, for which I needed a paper from Microsoft to complete.

[I am very thankful for this lecture at Stanford](https://web.stanford.edu/class/archive/cs/cs143/cs143.1128/lectures/13/Slides13.pdf?ref=jahans.blog) \- it gave me a lot of inspiration. Here is a snippet of the IR for the switch program above:

```
__main():
 BeginFunc ;
    LOCL x;
    LOCL y;
    x = (10:int:4);
_L2:
    _t5 = x >= (5:int:4);
    IF _t5 GOTO _L4;
...
_L1:
    LEAVE;
_L4:
    _t6 = CMP x;
    JMP_E _t6 (10:int:4) _L8;
    JMP_E _t6 (6:int:4) _L16;
...

_L18:
    x = (5:int:4);
    GOTO _L17;
 EndFunc ;

```

Support for ARM64 will be much quicker, and I've already finished the [template classes and pure virtual methods for platform-agnostic code generation](https://github.com/jahan-addison/credence/blob/master/credence/target/readme.md?ref=jahans.blog).

Until then, catch you soon 🤘

![](https://jahans.blog/content/images/2025/12/20251102-IMG_8009-2.jpg)