xed icon indicating copy to clipboard operation
xed copied to clipboard

Add documentation about the format of files in datafiles/

Open dlespiau opened this issue 7 years ago • 4 comments

I may have totally missed it, but it would be super nice to have some information on how those files should be parsed.

The idea is that one could reuse this data set, parse those files and generate their own tables to support encoders/decoders written in different languages. I've noticed that other people have had that idea as well, in this thread, Russ Cox, a golang developer, mentions it for the Go compiler.

Of course, it's possible to look - or even modify - the python parser, but having a document with at least the overview of the process would help a lot.

dlespiau avatar Apr 18 '17 14:04 dlespiau

i know it is not what you are requesting but read_xed_db.py is suggested way to read the tables if one wanted to generate something else.

i guess i can try to document the syntax briefly. there is not a lot going on there complexity-wise

markcharney avatar Apr 19 '17 19:04 markcharney

Thanks, that already helps! armed with the PRMs and reading read_xed_db.py should go a long way.

In case that helps, the view of someone looking at the project for the first time: I think that an high level overview, for instance describing the relationship between the files (state_bits, instructions, widths, element_types) would be quite useful as an introduction to that database. It seems that some fields describing the instructions have a small language encoding various constraints. In the cases it's not obvious to derive what information is encoded by looking at the PRMs, some details could be useful too. But maybe all this just shows how little I know about the encoding of x86 instructions :)

dlespiau avatar Apr 19 '17 20:04 dlespiau

Just created #42 with a start on this (and some other stuff)

markcharney avatar May 05 '17 02:05 markcharney

I pushed #42 ... It is only a start, so I'm not closing this quite yet.

markcharney avatar May 05 '17 02:05 markcharney