[Mesa-dev] RFC: New TGSI->LLVM conversion interface

Tom Stellard tstellar at gmail.com
Sun Jan 15 18:38:46 PST 2012


Hi,

The following patches add a new TGSI->LLVM interface to Gallium and adapt
lp_bld_tgsi_soa.c to use the new interface.  You can also find an updated
version of the r600g LLVM backend that uses this interface here:

git://people.freedesktop.org/~tstellar/mesa r600g-llvm-shader-Jan15-2012

Just a quick overview of the interface, implementors can:

+ Write functions for converting TGSI loads and stores to LLVM IR
  (lp_build_tgsi_context::emit_fetch_functions[TGSI_FILE_COUNT],
  lp_build_tgsi_context::emit_store)

+ Define "Opcode Actions (struct lp_build_opcode_action)" for generating
  LLVM IR from TGSI opcodes.  Most TGSI opcodes have default "Opcode
  Actions" defined, so the implementor can reuse them or write his or
  her own.

+ Optionally define functions (lp_build_tgsi_context::emit_prologue,
  lp_build_tgsi_context:emit_epilogue) for inserting LLVM IR at the
  beginning or end of programs.

Looking forward to questions and comments.

Thanks,
Tom Stellard




More information about the mesa-dev mailing list