octave-maintainers
[Top][All Lists]
Advanced

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

Re: Question of JITC


From: Max Brister
Subject: Re: Question of JITC
Date: Mon, 22 Jul 2013 21:51:59 -0700




On Mon, Jul 22, 2013 at 10:37 AM, lyh.kernel <address@hidden> wrote:
Hello Max,

I would like to remove interrupt handler of JITC linear IR because I want to focus on your implementation rather than distracted by interrupt handler.

The interrupt handler is part of the implementation. For example, the interrupt check is added for the for loop here[1]. You can see the code generation (octave linear IR -> LLVM IR) here[2]. If you wanted to remove the interrupt check from LLVM, I guess you could comment out the switch statement at [2].
 
I have add switch statement support. However I haven't push my code onto public repository because I am struggling with Mercurial.

What sort of problems are you having? You should contact Michael or Jordi to try to get this sorted out. Reading your blog posts, it looks like you have put a lot of work into JIT so far. It would be horrible if you were to lose your work (make sure you have backups!)
 
I have post my execution result on my GSoC blog (http://octave-jitc.blogspot.tw/). You may take a look. Any suggestion is welcomed.


That is great! I'm glad to see you have made significant progress adding functionality to JIT.

For the switch statement, you did the correct thing by treating it like a series of if statements. Remember, we still run LLVMs optimization passes, it seems to me like the correct location for the implementation of bit tests, binary trees, ect would be an LLVM optimization pass. In fact, LLVM probably already has these implemented as an optimization pass, we might need to enable it though. (I wouldn't worry about that to much now, however).

 
On the other hand. I read the GSoC report of you and I know you have support some other types rather than scalar (double). But I have no idea how to test it. Would you mind to tell me? It is important for me to trace your implementation if I want to add integer type support.


In order to add a new type, most of the work is done in jit-typeinfo.h/jit-typeinfo.cc. Currently, all of the types are put into two massive files, I'm a little embarrassed by this, but until we get a few more types I'm not entirely sure how jit-typeinfo should be broken up.

Adding an integer type should be similar to adding support for doubles (called scalar in the code). The integer types are currently constructed [3], they just do not have much functionality yet. In order to support basic functionality, the following needs to be done

- Add overloads for the binary operators for each integer type [4]
- Add casts for integer types [5]
- Support applicable builtin functions [6]

The nice part about the implementation here, is that if you don't implement part of the functionality, it isn't fatal to Octave. We just fall back to the interpreter.

Please keep the questions coming.
 
Thanks a lot

LYH


[1] http://hg.savannah.gnu.org/hgweb/octave/file/08f0e372d006/libinterp/corefcn/pt-jit.cc#l436
[2] http://hg.savannah.gnu.org/hgweb/octave/file/08f0e372d006/libinterp/corefcn/pt-jit.cc#l1399
[3] http://hg.savannah.gnu.org/hgweb/octave/file/08f0e372d006/libinterp/corefcn/jit-typeinfo.cc#l1117
[3] http://hg.savannah.gnu.org/hgweb/octave/file/08f0e372d006/libinterp/corefcn/jit-typeinfo.cc#l1237
[4] http://hg.savannah.gnu.org/hgweb/octave/file/08f0e372d006/libinterp/corefcn/jit-typeinfo.cc#l1773
[5] http://hg.savannah.gnu.org/hgweb/octave/file/08f0e372d006/libinterp/corefcn/jit-typeinfo.cc#l1822

Good luck,
Max Brister

reply via email to

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