Thanks for the suggestions, all. I ended up just writing it in C with inline assembly, because that was the quickest way to do something. I ought to try ccall, both to learn how to use it, and to see what sort of overhead julia imposes for the kind of stuff I'm looking at, if any. As it is, I'm outputting a .csv that I import into something else to do graphing, etc., and it would be nice to just be able to output a graph.
PAPI looks nice. I should learn how to use that so that I can write portable code that other people can actually read. But I've spent enough time working on the hardware side of this stuff that it's much easier for me to do this in assembly than to learn some C API. Maybe one day. Dan P.S. Stefan, I don't know how you could have possibly gotten the idea that I'm adventurous. What has Leah been saying about me!? :P On Thu, Dec 26, 2013 at 12:18 AM, Stefan Karpinski <[email protected]> wrote: > Dan Luu was born feeling adventurous ;-) > > But seriously, if you're writing x86 assembly inside of LLVM IR, why not > just write x86 inside of C and call the C using ccall? Seems easier to me. > > On Dec 26, 2013, at 12:34 AM, Isaiah Norton <[email protected]> wrote: > > There is no way to do this right now. The most pragmatic thing would be to > ignore the rest of my email and do one of the other suggestions :) > > But if you are feeling adventurous you might be able to cobble it together > starting from: > > - https://github.com/JuliaLang/julia/pull/5046 (inline IR support for Julia) > - Another PR adding MCJIT support. AFAIK the legacy JIT doesn't support > inlining. > > The final issue would be that rdpmc and related instructions are not > supported by LLVM (at least as of Sep., per the todo-list; haven't checked > further - there is a chance the list is out of sync with the current > codebase). So you would need to write inline assembly, inside of inline IR, > inside of a Julia function. Have fun! > > > On Tue, Dec 24, 2013 at 4:19 PM, Dan Luu <[email protected]> wrote: >> >> Is there way to write inline assembly or otherwise emit the rdpmc >> instruction? >> >> There are some simple TLB/cache performance experiments I want to run. >> Julia seems as good as C for this, except that I want to be able to >> look at perf counters and probably the TSC, too, and I can't find >> documentation on how to do this. >> >> >> Thanks, >> Dan > >
