i965: Rename intel_asm_printer -> intel_asm_annotation.
authorMatt Turner <mattst88@gmail.com>
Mon, 30 Jun 2014 01:09:35 +0000 (18:09 -0700)
committerMatt Turner <mattst88@gmail.com>
Sun, 6 Jul 2014 05:42:30 +0000 (22:42 -0700)
The #ifndef include guards already said the right thing :)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/Makefile.sources
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_compact.c
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_shader.h
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/intel_asm_annotation.c [new file with mode: 0644]
src/mesa/drivers/dri/i965/intel_asm_annotation.h [new file with mode: 0644]
src/mesa/drivers/dri/i965/intel_asm_printer.c [deleted file]
src/mesa/drivers/dri/i965/intel_asm_printer.h [deleted file]

index 6c513e20da8542dbc66af3634a7f6e912880801b..eb5ba60a28a945732a944003730a9a7a75e8d729 100644 (file)
@@ -3,7 +3,7 @@ i965_INCLUDES = \
        $(MESA_TOP)/src/mesa/drivers/dri/intel
 
 i965_FILES = \
-       intel_asm_printer.c \
+       intel_asm_annotation.c \
        intel_batchbuffer.c \
        intel_blit.c \
        intel_buffer_objects.c \
index 48ef2984f9ba34cabbe70578e25f237f4a6f5cd4..3164c80897daf95fd8f9d2a0c579bcb0c623f09c 100644 (file)
@@ -38,7 +38,7 @@
 #include "brw_structs.h"
 #include "brw_defines.h"
 #include "brw_reg.h"
-#include "intel_asm_printer.h"
+#include "intel_asm_annotation.h"
 #include "program/prog_instruction.h"
 
 #ifdef __cplusplus
index b9a6500ecda48924fc440df137d6dbb136d482cd..eec645426839c7bf3c8884e7e57f3c64a4b5b47d 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "brw_context.h"
 #include "brw_eu.h"
-#include "intel_asm_printer.h"
+#include "intel_asm_annotation.h"
 
 static const uint32_t gen6_control_index_table[32] = {
    0b00000000000000000,
index fdb0efec39cbf7c9f07e3e884f6e8b6b82208991..537f10eabb34a174a9865d107343d4802e98329d 100644 (file)
@@ -46,7 +46,7 @@ extern "C" {
 #include "brw_eu.h"
 #include "brw_wm.h"
 #include "brw_shader.h"
-#include "intel_asm_printer.h"
+#include "intel_asm_annotation.h"
 }
 #include "gen8_generator.h"
 #include "glsl/glsl_types.h"
index f8662495108875f13953e898c9e2668f34408513..a9224878a4daa85b2d8a447399188f9f9d30c2c5 100644 (file)
@@ -26,7 +26,7 @@
 #include "brw_defines.h"
 #include "main/compiler.h"
 #include "glsl/ir.h"
-#include "intel_asm_printer.h"
+#include "intel_asm_annotation.h"
 
 #pragma once
 
index 247d591fae1fd219a13e2d588765381dc16fb653..9d76beaf2afe55f732a59bdc2563593ece0e7780 100644 (file)
@@ -36,7 +36,7 @@ extern "C" {
 
 #include "brw_context.h"
 #include "brw_eu.h"
-#include "intel_asm_printer.h"
+#include "intel_asm_annotation.h"
 
 #ifdef __cplusplus
 }; /* extern "C" */
diff --git a/src/mesa/drivers/dri/i965/intel_asm_annotation.c b/src/mesa/drivers/dri/i965/intel_asm_annotation.c
new file mode 100644 (file)
index 0000000..a7bb2e1
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright © 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "brw_cfg.h"
+#include "brw_eu.h"
+#include "intel_asm_annotation.h"
+#include "program/prog_print.h"
+#include "program/prog_instruction.h"
+
+void
+dump_assembly(void *assembly, int num_annotations, struct annotation *annotation,
+              struct brw_context *brw, const struct gl_program *prog)
+{
+   const char *last_annotation_string = NULL;
+   const void *last_annotation_ir = NULL;
+
+   for (int i = 0; i < num_annotations; i++) {
+      int start_offset = annotation[i].offset;
+      int end_offset = annotation[i + 1].offset;
+
+      if (annotation[i].block_start) {
+         fprintf(stderr, "   START B%d", annotation[i].block_start->block_num);
+         foreach_list_typed(struct bblock_link, predecessor_link, link,
+                            &annotation[i].block_start->parents) {
+            struct bblock_t *predecessor_block = predecessor_link->block;
+            fprintf(stderr, " <-B%d", predecessor_block->block_num);
+         }
+         fprintf(stderr, "\n");
+      }
+
+      if (last_annotation_ir != annotation[i].ir) {
+         last_annotation_ir = annotation[i].ir;
+         if (last_annotation_ir) {
+            fprintf(stderr, "   ");
+            if (!prog->Instructions)
+               fprint_ir(stderr, annotation[i].ir);
+            else {
+               const struct prog_instruction *pi =
+                  (const struct prog_instruction *)annotation[i].ir;
+               fprintf(stderr, "%d: ",
+                       (int)(pi - prog->Instructions));
+               _mesa_fprint_instruction_opt(stderr,
+                                            pi,
+                                            0, PROG_PRINT_DEBUG, NULL);
+            }
+            fprintf(stderr, "\n");
+         }
+      }
+
+      if (last_annotation_string != annotation[i].annotation) {
+         last_annotation_string = annotation[i].annotation;
+         if (last_annotation_string)
+            fprintf(stderr, "   %s\n", last_annotation_string);
+      }
+
+      brw_disassemble(brw, assembly, start_offset, end_offset, stderr);
+
+      if (annotation[i].block_end) {
+         fprintf(stderr, "   END B%d", annotation[i].block_end->block_num);
+         foreach_list_typed(struct bblock_link, successor_link, link,
+                            &annotation[i].block_end->children) {
+            struct bblock_t *successor_block = successor_link->block;
+            fprintf(stderr, " ->B%d", successor_block->block_num);
+         }
+         fprintf(stderr, "\n");
+      }
+   }
+   fprintf(stderr, "\n");
+}
diff --git a/src/mesa/drivers/dri/i965/intel_asm_annotation.h b/src/mesa/drivers/dri/i965/intel_asm_annotation.h
new file mode 100644 (file)
index 0000000..50ed21a
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright © 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef _INTEL_ASM_ANNOTATION_H
+#define _INTEL_ASM_ANNOTATION_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bblock_t;
+struct brw_context;
+struct gl_program;
+
+struct annotation {
+   int offset;
+
+   /* Pointers to the basic block in the CFG if the instruction group starts
+    * or ends a basic block.
+    */
+   struct bblock_t *block_start;
+   struct bblock_t *block_end;
+
+   /* Annotation for the generated IR.  One of the two can be set. */
+   const void *ir;
+   const char *annotation;
+};
+
+struct annotation_info {
+   void *mem_ctx;
+   struct annotation *ann;
+   int ann_count;
+   int ann_size;
+
+   /** Block index in the cfg. */
+   int cur_block;
+};
+
+void
+dump_assembly(void *assembly, int num_annotations, struct annotation *annotation,
+              struct brw_context *brw, const struct gl_program *prog);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _INTEL_ASM_ANNOTATION_H */
diff --git a/src/mesa/drivers/dri/i965/intel_asm_printer.c b/src/mesa/drivers/dri/i965/intel_asm_printer.c
deleted file mode 100644 (file)
index 3c2d256..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright © 2014 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include "brw_cfg.h"
-#include "brw_eu.h"
-#include "intel_asm_printer.h"
-#include "program/prog_print.h"
-#include "program/prog_instruction.h"
-
-void
-dump_assembly(void *assembly, int num_annotations, struct annotation *annotation,
-              struct brw_context *brw, const struct gl_program *prog)
-{
-   const char *last_annotation_string = NULL;
-   const void *last_annotation_ir = NULL;
-
-   for (int i = 0; i < num_annotations; i++) {
-      int start_offset = annotation[i].offset;
-      int end_offset = annotation[i + 1].offset;
-
-      if (annotation[i].block_start) {
-         fprintf(stderr, "   START B%d", annotation[i].block_start->block_num);
-         foreach_list_typed(struct bblock_link, predecessor_link, link,
-                            &annotation[i].block_start->parents) {
-            struct bblock_t *predecessor_block = predecessor_link->block;
-            fprintf(stderr, " <-B%d", predecessor_block->block_num);
-         }
-         fprintf(stderr, "\n");
-      }
-
-      if (last_annotation_ir != annotation[i].ir) {
-         last_annotation_ir = annotation[i].ir;
-         if (last_annotation_ir) {
-            fprintf(stderr, "   ");
-            if (!prog->Instructions)
-               fprint_ir(stderr, annotation[i].ir);
-            else {
-               const struct prog_instruction *pi =
-                  (const struct prog_instruction *)annotation[i].ir;
-               fprintf(stderr, "%d: ",
-                       (int)(pi - prog->Instructions));
-               _mesa_fprint_instruction_opt(stderr,
-                                            pi,
-                                            0, PROG_PRINT_DEBUG, NULL);
-            }
-            fprintf(stderr, "\n");
-         }
-      }
-
-      if (last_annotation_string != annotation[i].annotation) {
-         last_annotation_string = annotation[i].annotation;
-         if (last_annotation_string)
-            fprintf(stderr, "   %s\n", last_annotation_string);
-      }
-
-      brw_disassemble(brw, assembly, start_offset, end_offset, stderr);
-
-      if (annotation[i].block_end) {
-         fprintf(stderr, "   END B%d", annotation[i].block_end->block_num);
-         foreach_list_typed(struct bblock_link, successor_link, link,
-                            &annotation[i].block_end->children) {
-            struct bblock_t *successor_block = successor_link->block;
-            fprintf(stderr, " ->B%d", successor_block->block_num);
-         }
-         fprintf(stderr, "\n");
-      }
-   }
-   fprintf(stderr, "\n");
-}
diff --git a/src/mesa/drivers/dri/i965/intel_asm_printer.h b/src/mesa/drivers/dri/i965/intel_asm_printer.h
deleted file mode 100644 (file)
index 50ed21a..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright © 2014 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef _INTEL_ASM_ANNOTATION_H
-#define _INTEL_ASM_ANNOTATION_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bblock_t;
-struct brw_context;
-struct gl_program;
-
-struct annotation {
-   int offset;
-
-   /* Pointers to the basic block in the CFG if the instruction group starts
-    * or ends a basic block.
-    */
-   struct bblock_t *block_start;
-   struct bblock_t *block_end;
-
-   /* Annotation for the generated IR.  One of the two can be set. */
-   const void *ir;
-   const char *annotation;
-};
-
-struct annotation_info {
-   void *mem_ctx;
-   struct annotation *ann;
-   int ann_count;
-   int ann_size;
-
-   /** Block index in the cfg. */
-   int cur_block;
-};
-
-void
-dump_assembly(void *assembly, int num_annotations, struct annotation *annotation,
-              struct brw_context *brw, const struct gl_program *prog);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* _INTEL_ASM_ANNOTATION_H */