On Sunday 28 September 2008 14:34:53 Stephane Marchesin wrote: > Hi, > > I'm working on llvm integration in gallium,
Ah, that's great. > but I have a small problem > with the current design. Basically, the tgsi to llvm translator > currently generates calls to library functions (abs(), exp(), log(), > ...) at translation time, and now I want to be able to regarget llvm > to GPUs. Yea, that's not its design, just an implementation bug :) The design is that gallivm_ir was supposed to be completely target independent. During the gallivm_ir_compile call we wanted to have a hook that allows the driver to figure out how the target-independent representation is handled. > As you can imagine library calls won't work on a GPU, so I > think I'm going to change the tgsi to llvm translator to generate new > ops for what used to be library calls (i.e. for all the call* methods > of the Instructions class) and then have the gallium_cpu turn those > new ops into calls. > Does anyone object that ? No! That's exactly how it was always supposed to work =) The gallivm_ir was supposed to be populated with just tokens that were then either lowered or used as intrinsics (as required by the driver). (In general I think it might be easiest to treat all tgsi opcodes as intrinsics since that would make it easier to handle them. Maybe just add some helper function to lower some of them, e.g. driver could request to automatically lower 'lit' instead of treating is as an opcode). z ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev