www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Gauging Interest

reply SealabJaster <sealabjaster gmail.com> writes:
Hi, I've been thinking about going back to a project, but feeling 
a bit demotivated, so I wanted to ask here if there's any 
potential interest in it before deciding whether to work on it 
some more, or just drop it completely.

Basically, it's a library to provide a statically typed way to 
construct x86_64 instructions, and then emit the machine code for 
them.

So given a description of the instructions: 
https://github.com/BradleyChatha/jupiter/blob/master/views/isa/x86_64.txt

It'll spit out code based off of those descriptions: 
https://github.com/BradleyChatha/jupiter/blob/master/source/jupiter/x86_64/ir.d#L297

(You can then use something like SumType to easily encapsulate 
all the instructions under one type.)

It's currently missing support for encoding VEX and EVEX, which 
is probably the first thing I want to do if I go back to the 
project because I've already had to skip a decent amount of 
instructions due to not supporting it, and I'm only up to the 
letter C in terms of mnemonics ;_;

But my main question is, does anyone see this as useful at all? 
Is this a project worth pursuing? Is there anything in particular 
you'd like to see to make this useful?

(Completely useless but fun fact: This project was originally an 
assembler, before I decided I needed a library just to help 
describe the machine code so that the assembler itself could be 
made sanely, so once this is in a good state I might go back to 
making an assembler)

The *very* long term goal of this project was to provide a 
similar interface for different architectures. Again, is this 
something worth pursuing?
Feb 27 2022
next sibling parent rikki cattermole <rikki cattermole.co.nz> writes:
I tried doing something similar ~5 years ago.

https://github.com/rikkimax/alphacodegen/tree/master/manuscript/targets/x86/instructions

I found the instruction database to be one of the hardest parts to it.
Feb 27 2022
prev sibling parent max haughton <maxhaton gmail.com> writes:
On Monday, 28 February 2022 at 00:34:50 UTC, SealabJaster wrote:
 Hi, I've been thinking about going back to a project, but 
 feeling a bit demotivated, so I wanted to ask here if there's 
 any potential interest in it before deciding whether to work on 
 it some more, or just drop it completely.

 [...]
dmd could use an up to date table of X86 instructions to unify it's mishmash of partially complete X86 tables for various features.
Feb 28 2022