add morphisms

- unicode
- value delimited seq
- zigzag encoding (still lacking any way to get to signed integer yet'..)
This commit is contained in:
Michael Sippel 2025-03-15 18:49:06 +01:00
parent 630948139b
commit d0118b56b1
Signed by: senvas
GPG key ID: F96CF119C34B64A6
3 changed files with 190 additions and 0 deletions

View file

@ -0,0 +1,26 @@
```
```
morph_i64_as_twos_complement_to_zigzag ()
~ x86.Int64
--> ~ ZigZagInt ~ ~ x86.UInt64
```
if( *src >= 0 ) {
*dst = (2 * (uint64_t)*src)
} else {
*dst = (2 * (uint64_t)(- *src)) - 1;
}
return 0;
```
morph_i64_as_zigzag_to_twos_complement ()
~ ZigZagInt ~ ~ x86.UInt64
--> ~ x86.Int64
```
if( *src % 2 == 0 ) {
*dst = *src / 2;
} else {
*dst = - ((*src+1) / 2);
}
```