Giovanni,
Before you start going to that kind of effort, take a look at
julia> @code_native 3+5
.text
Filename: int.jl
Source line: 12
push RBP
mov RBP, RSP
Source line: 12
add RDI, RSI
mov RAX, RDI
pop RBP
ret
I think you're going to have a pretty hard time finding a C compiler that does
better than this :-). Especially since it gets inlined at the call site.
Best,
--Tim
On Tuesday, February 24, 2015 01:13:52 AM [email protected] wrote:
> Hello,
>
> I am a beginner to Julia and would like to try out some features. I would
> like to improve performances of some bottleneck functions by translating
> them into C.
> A simple example is :
> main.jl
>
> a ::Int64 = 20
> b ::Int64 = 10
> ccall(:do_sum, Int64, (Int64, Int64), a, b)
>
>
>
> test.c
> #include <stdio.h>
>
> int do_sum (int a,int b)
> {
> int c;
> c = a+b;
> printf("f\n:",c);
> return c;
> }
>
> where should I put the C file ?
>
> Thanks,
> G.