summaryrefslogtreecommitdiff
path: root/src/zisp/value.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/zisp/value.zig')
-rw-r--r--src/zisp/value.zig29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/zisp/value.zig b/src/zisp/value.zig
index 1a63349..f075b35 100644
--- a/src/zisp/value.zig
+++ b/src/zisp/value.zig
@@ -73,12 +73,13 @@ pub const none = Value{ .misc = .{ .value = .none } };
// zig fmt: on
/// A plain (unpacked, untagged, uncompressed) pointer into the main heap.
-pub const HeapPtr = *align(8) anyopaque;
+pub const HeapPtr = *align(16) anyopaque;
/// Values for the 8 type bits on main heap pointers.
pub const HeapType = enum(u8) {
/// Pair (car, cdr)
pair,
+
/// Array of various types: see `ArrayPtr`.
array,
@@ -115,13 +116,11 @@ pub const hi16_list = hi16(0b0000);
pub const hi16_hptr = hi16(0b0001);
pub const hi16_istr = hi16(0b0010);
pub const hi16_sstr = hi16(0b0011);
-pub const hi16_rpos = hi16(0b0100);
-pub const hi16_rneg = hi16(0b0101);
-pub const hi16_ndef = hi16(0b0110);
+pub const hi16_srat = hi16(0b0100);
+pub const hi16_ndf1 = hi16(0b0101);
+pub const hi16_ndf2 = hi16(0b0110);
pub const hi16_rune = hi16(0b0111);
-pub const hi15_srat: u15 = @intCast(hi16(0b0100) >> 1);
-
pub const hi16_const_list = hi16(0b1000);
pub const hi16_const_hptr = hi16(0b1001);
pub const hi16_const_istr = hi16(0b1010);
@@ -195,15 +194,21 @@ pub const Value = packed union {
/// Small rat (rational number)
srat: packed struct {
- q: u24,
- p: i25,
- _hi: u15 = hi15_srat,
+ p: i32,
+ q: u16,
+ _hi: u16 = hi16_srat,
+ },
+
+ /// Undefined 1
+ ndf1: packed struct {
+ _: u48,
+ _hi: u16 = hi16_ndf1,
},
- /// Undefined, for now
- ndef: packed struct {
+ /// Undefined 2
+ ndf2: packed struct {
_: u48,
- _hi: u16 = hi16_ndef,
+ _hi: u16 = hi16_ndf2,
},
/// Rune (6-byte ASCII string)