ir: fix incorrect instruction bitfield size

An instruction is suppose to have 17-bit operands but it was actually
18-bit. So I reduce the bitfields by one bit and give the remaining bits
to opcode. An opcode is now 13 bits.

Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
Ronald Caesar
2026-01-17 04:15:46 -04:00
parent a507a5d53e
commit 5e73e88145
2 changed files with 4 additions and 4 deletions

View File

@@ -53,7 +53,7 @@ uint32_t instruction_count;
## Instruction Encoding ## Instruction Encoding
```text ```text
63 53 52 35 34 17 16 00 63 51 50 34 33 17 16 00
|-----------------| |----------| |----------| |----------| |-----------------| |----------| |----------| |----------|
opc src1 src2 src3 opc src1 src2 src3
``` ```
@@ -66,7 +66,7 @@ uint32_t instruction_count;
<**src1**> 17-bit index for `ssa` arrays. <**src1**> 17-bit index for `ssa` arrays.
<**opc**> 11-bit opcode. <**opc**> 13-bit opcode.
### Operational Information ### Operational Information

View File

@@ -1,8 +1,8 @@
#include "bal_ir_emitter.h" #include "bal_ir_emitter.h"
#include <stdbool.h> #include <stdbool.h>
#define BAL_OPCODE_SHIFT_POSITION 53U #define BAL_OPCODE_SHIFT_POSITION 51U
#define BAL_SOURCE1_SHIFT_POSITION 35U #define BAL_SOURCE1_SHIFT_POSITION 34U
#define BAL_SOURCE2_SHIFT_POSITION 17U #define BAL_SOURCE2_SHIFT_POSITION 17U
#define BAL_IS_CONSTANT_BIT_POSITION (1U << 16U) #define BAL_IS_CONSTANT_BIT_POSITION (1U << 16U)