Mesa (master): r600g: Add support for reading native instructions from the LLVM bytestream

Tom Stellard tstellar at kemper.freedesktop.org
Wed May 2 15:57:54 UTC 2012


Module: Mesa
Branch: master
Commit: 6f50f939ef85bb058c1401b5dad8340aa4f96aec
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f50f939ef85bb058c1401b5dad8340aa4f96aec

Author: Tom Stellard <thomas.stellard at amd.com>
Date:   Mon Feb 27 15:47:34 2012 -0500

r600g: Add support for reading native instructions from the LLVM bytestream

Signed-off-by: Tom Stellard <thomas.stellard at amd.com>

---

 src/gallium/drivers/r600/r600_shader.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 5e22b35..e6cb3fa 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -405,6 +405,7 @@ static void r600_bytecode_from_byte_stream(struct r600_shader_ctx *ctx,
 				unsigned char * bytes,	unsigned num_bytes)
 {
 	unsigned bytes_read = 0;
+	unsigned i, byte;
 	while (bytes_read < num_bytes) {
 		char inst_type = bytes[bytes_read++];
 		switch (inst_type) {
@@ -420,6 +421,15 @@ static void r600_bytecode_from_byte_stream(struct r600_shader_ctx *ctx,
 			bytes_read = r600_fc_from_byte_stream(ctx, bytes,
 								bytes_read);
 			break;
+		case 3:
+			r600_bytecode_add_cfinst(ctx->bc, CF_NATIVE);
+			for (i = 0; i < 2; i++) {
+				for (byte = 0 ; byte < 4; byte++) {
+					ctx->bc->cf_last->isa[i] |=
+					(bytes[bytes_read++] << (byte * 8));
+				}
+			}
+			break;
 		default:
 			/* XXX: Error here */
 			break;




More information about the mesa-commit mailing list