Where's the no-op?

2005-07-31 Thread rocko
I think I might have gotten my x86-64 code generator up in the most minimal
sense possible.  I managed to build parrot in such a way that it used my own
JIT implementation.  I implemented Parrot_noop along with Parrot_jit_normal_op.
 My plan was to test some noop's first before opening up to all benchmarks to
test Parrot_normal_op.  Unfortunately, I discovered Parrot doesn't have a no-op
in the pasm syntax!

I'm going by the pasm document on parrotcode, and I'm not seeing it there.  I
did a recursive grep of the parrot docs looking for noop, no-op, and no
op, but didn't see anything indicating I could actually write some noops in
pasm.  Am I missing something here?

On the positive side, it looks like Parrot_jit_normal_op actually works, since
the hanoi.pasm file ran.  I'd be impressed if the couple hundred lines of code
I wrote were perfectly fine--having managed to figure out how to compile the
jit_emit.h file!


In need of somebody who wrote a jit_emit.h implementation

2005-07-20 Thread rocko
I've been slowing banging away at an x86_64 code generator.  I'm just trying to
get the basics down for now, generating NOP's; but even that's nontrivial. 
While compiling my code additions into Parrot, I've been running into this and
that.  This function is redefined a million times, while that one isn't defined
at all.  While redefined functions are likely from some stupidity I missed, it
looks like I am outright missing important functions just to get the basic code
generation working.

I'm hoping somebody that wrote a jit_emit.h implementation for one of the
architectures could help me deduce some of my errors so that I can get rolling.
 My intended focus was in generating all the opcodes and filling in as many of
the JIT routines as possible.  So far, it's been a chore just getting a
framework in place.  I don't want to burden the mailing list with the little
particulars.

I'll respond better to direct emails at adam.preble (at) gmail.com -- I've been
getting swamped with spam on this account recently.  If somebody is more
willing to hang around IRC instead, then I will catch them there instead.


Re: Perl 6 and Parrot VM presentation slides

2005-05-24 Thread rocko

Post them anyways.

We have a Frenchman in my group that would normally be able to translate.
However, he is on vacation (holiday?) in France and might not be back in time
for the presentation.  I'll take the slides anyway and see what magic I can
attempt.  I know somebody I suspect grew up in Quebec who might help.

Quoting chris [EMAIL PROTECTED]:


I have power point slides I did use for a course on parrot machine and
assembly language for my students. With many examples.
They are in french. I can send you the file if you want.

-- __
   \|||/
   (o o)
 +--ooO-( )-Ooo--+
 |  Christian Aperghis-Tramoni   |
 |   |
 | Case Postale 901  Tel : (33) 04 91 82 92 49   |
 | 163 Avenue de Luminy  SFR : (33) 06 18 93 10 70   |
 | 13288 Marseille Cedex 09  Fax : (33) 04 91 82 92 75   |
 | FranceMel : [EMAIL PROTECTED] |
/) [EMAIL PROTECTED](Ä
   / ) WEB : http://www.dil.univ-mrs.fr/~chris   ( Ä
  ( (+---+) )
 ((\ \)  / )   / ) (/ //)
 (\\\ \_/ /\ \_/ ///)
  \ /\ /
___\___/__\___/
print join('',map({$i=1-$i;$a=$i?10*$_.\b\b:packc,$a+$_+0x16}split
(//,5110789279758710838810587992861093898779948387799310)),...\n);
___








Re: Perl 6 and Parrot VM presentation slides

2005-05-24 Thread rocko

Quoting Jens Rieks [EMAIL PROTECTED]:


On Tuesday 24 May 2005 07:13, [EMAIL PROTECTED] wrote:

I am curious if there are any recent slides and notes for recent talks
about Perl 6, language, how it will work, and the same for Parrot.  I've
caught a few old slides from almost a year ago for a few things, but not
much.  I am preparing a little presentation over here, and I'm trying to
determine if I'm missing anything important worth presenting.  Slides and
notes would also be a concise way to catch up on details I think I'm
missing -- particularly the VM details.

I'am preparing a (german) presentation about Perl6, for the austrian perl
workshop. The basic outline should be ready within the next few days, I can
then mail you a copy if you want; it has nothing todo with parrot's VM,
though.
There are two other perl 6 presentations at
http://svn.openfoundry.org/pugs/docs/talks/

Perl 6 The Ultimate (Chinese) by Autrijus Tang and
Perl 6, genau jetzt! (German) by Ingo Blechschmidt.



I distinctly get the impression that I'm on of the few dumb Americans
participating in all this.  So far, there hasn't been a single 
English-language

presentation offered.  Anyhow, I know somebody who can translate German, and a
few that could translate Chinese.  I'll see what they can manage with these
files.  However, I'm completely unfamiliar with the .spork format, and I'm
fraid of what google will tell me it is.



Perl 6 and Parrot VM presentation slides

2005-05-23 Thread rocko
I am curious if there are any recent slides and notes for recent talks about
Perl 6, language, how it will work, and the same for Parrot.  I've caught a few
old slides from almost a year ago for a few things, but not much.  I am
preparing a little presentation over here, and I'm trying to determine if I'm
missing anything important worth presenting.  Slides and notes would also be a
concise way to catch up on details I think I'm missing -- particularly the VM
details.


Building an incomplete code generator into Parrot

2005-04-23 Thread rocko
Well I started the AMD64 code generator.  I don't have much available yet --
just enough for what seems to be necessary to run anything at all. 
Parrot_jit_begin makes calls to MOV instructions that are implemented, and I
have a NOP implemented.  Is this the bare minimum?

I was hoping for some insights into how I can incorporate this into a build and
get the VM to recognize my code generator for trivial test programs I want to
send it.  I haven't been able to test if any of this works yet.

As of right now, I still have the i386 code.jit file, and I don't know how that
works when I don't have all the requisite instructions implemented.  Can the
core.jit only list the opcodes I currently support?  Do I need stubs for all
the opcodes?


Re: I wish to understand the JIT machine code generator

2005-04-13 Thread rocko
Quoting Leopold Toetsch [EMAIL PROTECTED]:
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I have been trying to examine the i386 code generator to see how
feasible it would be to create an AMD64 code generator.
Unfortunately, the code is uncommented, and I haven't yet found any
documentation to explain how it works on Parrot.  So far I've
determined there's relevant stuff in jit/i386.  I don't understand the
.jit extension on core.jit.  Is that not actually heavily templated C
code?
jit/*/jit_emit.h defines basically a bunch of macros that emit opcodes.
There are additionally some interface functions like
Parrot_jit_begin(), Parrot_jit_normal_op and the register move functions
called from src/jit.c to copy registers from Parrot to CPU and back.
i386 has additional code to emit NCI stubs and direct vtable calls,
which all is optional. docs/jit.pod has some more details on the
interface functions.
The format of jit/*/core.jit is also covered by doc/jit.pod. It defines
JITted opcode functions which, when called by the code generator in
src/jit.c, emit code for the function. It makes use of templates to
generate the final code in src/jit_cpu.c and src/exec_cpu.c.
Please have a look at these generated files and the docs. If there are
some more questions, please just ask.
leo
Thank you.  The POD is a little thick, and I'll be printing it out so I can
follow along.  I'm going to copy the i386 path to an a64 path and have at it.
I'm hoping it won't be much of a stretch to get 64-bit code generated --
although REASONABLE 64-bit code is another problem.  But first I want 
to ask if
anybody else is doing this already.  I don't know what I'm getting 
myself into,
other than at least modifying ~5,000 lines of code.



I wish to understand the JIT machine code generator

2005-04-12 Thread rocko
I have been trying to examine the i386 code generator to see how feasible it
would be to create an AMD64 code generator.  Unfortunately, the code is
uncommented, and I haven't yet found any documentation to explain how it works
on Parrot.  So far I've determined there's relevant stuff in jit/i386.  I don't
understand the .jit extension on core.jit.  Is that not actually heavily
templated C code?

I'm curious if there's other sources to study.  Preferably, I'd like to get some
advice on how to study this code generator so I can at least improve it.  I'd
prefer to become knowledgeable enough to add an AMD64 generator sometime. 
However, I'll gladly advise only if somebody has already started it.