lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lightning] Runtime assembler in C++


From: Paolo Bonzini
Subject: Re: [Lightning] Runtime assembler in C++
Date: Thu, 05 Jun 2008 17:39:56 +0200
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

Pippijn van Steenhoven wrote:
I do not yet
have differently sized types. Everything that is an immediate is passed
as int32_t. This might cause breakage on 64 bit platforms but I don't
know how to do the differently sized types, yet. I do not use the macros
directly, anymore. Instead, for each mnemonic, I use a C++ function. This
has produced many error messages. I fixed some, but I don't know whether
the fixes are correct. As far as I can remember (unfortunately I didn't
document my changes, so I'll probably redo them with documentation), I
added an _s32P macro which was used but missing and the LEAQmr
instruction for x86_64 which looks like this:

  #define LEAQmr(MD, MB, MI, MS, RD)      (_REXQmr(MB, MI, RD),           
_OO_r_X         (0x8d                ,_r8(RD)           ,MD,MB,MI,MS            
))

These two I will look at.

 There is a long list of instructions that do not work on
x86_64 because they do not exist or some other macro is being used
incorrectly. I am aware that x86_64 support is new, but even on i386-32,
many instructions do not exist. If you are interested, I can generate
this list.

Yes, thanks! This can indeed be helpful, if only to stress test the back-ends.

By the way, is there any reason to have more than one "variable"?
Variables are integers returned by an instruction. Currently, the only
instructions that do this in my assembler are the lightning arg_*
instructions.

Yes, I don't remember other instructions that return arbitrary integers. I don't understand your question exactly, but: 1) there can be >1 argument to a function; 2) you could use fixed names like $1, $2, $3 -- but then, checking that these fixed names were actually defined is almost as complicated as keeping the map<>.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]