mirror of
https://github.com/pound-emu/ballistic.git
synced 2026-01-31 01:15:21 +01:00
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:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user