Hi all. I'm writing a remote 2D graphics API for embedded devices. It includes a little GLSL 1.0-esque shader language, which is compiled to executable SSE code at runtime. Is LLVM a good fit for this sort of thing? At the moment I'm compiling NASM into my code, but it doesn't do any register allocation (which is why I'm considering LLVM). I don't want to add too much bloat to the final compiled binaries, nor do I wish to restructure my build system to match LLVM's. Thanks, Joe
Hi Joe, If you're not doing many optimizations in your current compiler you may find that LLVM improves the quality of your generated code. The cost (in terms of binary size and performance of your compiler) will depend on exactly how much of LLVM you pull in, what optimizations you use, etc, but if your existing compiler is relatively simple I'd expect you to see an increase in both binary size and shader compile-time. I doubt you'll need to restructure your build system. Most JIT clients that I know of build LLVM as a separate project and just add a dependence on LLVM's headers and libraries to their existing project. - Lang. On Sun, May 22, 2016 at 12:17 PM, Joe Eagar via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi all. I'm writing a remote 2D graphics API for embedded devices. > It includes a little GLSL 1.0-esque shader language, which is compiled > to executable SSE code at runtime. > > Is LLVM a good fit for this sort of thing? At the moment I'm > compiling NASM into my code, but it doesn't do any register allocation > (which is why I'm considering LLVM). I don't want to add too much > bloat to the final compiled binaries, nor do I wish to restructure my > build system to match LLVM's. > > Thanks, > Joe > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160523/068ba618/attachment.html>
On Sun, May 22, 2016 at 12:17:24PM -0700, Joe Eagar via llvm-dev wrote:> Hi all. I'm writing a remote 2D graphics API for embedded devices. > It includes a little GLSL 1.0-esque shader language, which is compiled > to executable SSE code at runtime. >You should take a look at the Mesa Project: http://www.mesa3d.org/ One of its drivers (llvmpipe) is a software rasterizer that uses LLVM to generate shader code for x86 and other CPUs. -Tom> Is LLVM a good fit for this sort of thing? At the moment I'm > compiling NASM into my code, but it doesn't do any register allocation > (which is why I'm considering LLVM). I don't want to add too much > bloat to the final compiled binaries, nor do I wish to restructure my > build system to match LLVM's. > > Thanks, > Joe > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> On May 22, 2016, at 12:17 PM, Joe Eagar via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi all. I'm writing a remote 2D graphics API for embedded devices. > It includes a little GLSL 1.0-esque shader language, which is compiled > to executable SSE code at runtime. > > Is LLVM a good fit for this sort of thing? At the moment I'm > compiling NASM into my code, but it doesn't do any register allocation > (which is why I'm considering LLVM). I don't want to add too much > bloat to the final compiled binaries,It depends what you mean by "bloat", LLVM with only X86 configured is probably 20-25MB.> nor do I wish to restructure my > build system to match LLVM's.Well, somehow you'll have to integrate with LLVM libraries (includes/link). -- Mehdi
Possibly Parallel Threads
- [LLVMdev] [GSoC] "Microsoft Direct3D shader bytecode backend" proposal
- [LLVMdev] [GSoC] "Microsoft Direct3D shader bytecode backend" proposal
- [LLVMdev] [GSoC] "Microsoft Direct3D shader bytecode backend" proposal
- Skyrim Shader Model 3 error
- [LLVMdev] [GSoC] "Microsoft Direct3D shader bytecode backend" proposal