[Mesa-dev] [PATCH 1/6] glsl: rename lower_int64 to lower_64bit.

Dave Airlie airlied at gmail.com
Mon Mar 12 05:14:16 UTC 2018


From: Elie Tournier <tournier.elie at gmail.com>

This can also be used to lower some double ops.

[airlied:
this is extract from Elie's work into a standalone patch]
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/compiler/Makefile.sources                          | 2 +-
 src/compiler/glsl/ir_optimization.h                    | 4 ++--
 src/compiler/glsl/{lower_int64.cpp => lower_64bit.cpp} | 6 +++---
 src/compiler/glsl/meson.build                          | 2 +-
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp             | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)
 rename src/compiler/glsl/{lower_int64.cpp => lower_64bit.cpp} (98%)

diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
index 37340ba..b29218e 100644
--- a/src/compiler/Makefile.sources
+++ b/src/compiler/Makefile.sources
@@ -81,6 +81,7 @@ LIBGLSL_FILES = \
 	glsl/loop_analysis.cpp \
 	glsl/loop_analysis.h \
 	glsl/loop_unroll.cpp \
+	glsl/lower_64bit.cpp \
 	glsl/lower_blend_equation_advanced.cpp \
 	glsl/lower_buffer_access.cpp \
 	glsl/lower_buffer_access.h \
@@ -91,7 +92,6 @@ LIBGLSL_FILES = \
 	glsl/lower_distance.cpp \
 	glsl/lower_if_to_cond_assign.cpp \
 	glsl/lower_instructions.cpp \
-	glsl/lower_int64.cpp \
 	glsl/lower_jumps.cpp \
 	glsl/lower_mat_op_to_vec.cpp \
 	glsl/lower_noise.cpp \
diff --git a/src/compiler/glsl/ir_optimization.h b/src/compiler/glsl/ir_optimization.h
index 81049a4..931bffb 100644
--- a/src/compiler/glsl/ir_optimization.h
+++ b/src/compiler/glsl/ir_optimization.h
@@ -177,7 +177,7 @@ ir_variable *compare_index_block(ir_builder::ir_factory &body,
                                  ir_variable *index,
                                  unsigned base, unsigned components);
 
-bool lower_64bit_integer_instructions(exec_list *instructions,
-                                      unsigned what_to_lower);
+bool lower_64bit_instructions(exec_list *instructions,
+                              unsigned what_to_lower);
 
 #endif /* GLSL_IR_OPTIMIZATION_H */
diff --git a/src/compiler/glsl/lower_int64.cpp b/src/compiler/glsl/lower_64bit.cpp
similarity index 98%
rename from src/compiler/glsl/lower_int64.cpp
rename to src/compiler/glsl/lower_64bit.cpp
index 2d4fdbb..ac62d1d 100644
--- a/src/compiler/glsl/lower_int64.cpp
+++ b/src/compiler/glsl/lower_64bit.cpp
@@ -22,7 +22,7 @@
  */
 
 /**
- * \file lower_int64.cpp
+ * \file lower_64bit.cpp
  *
  * Lower 64-bit operations to 32-bit operations.  Each 64-bit value is lowered
  * to a uvec2.  For each operation that can be lowered, there is a function
@@ -132,8 +132,8 @@ private:
 #define lowering(x) (this->lower & x)
 
 bool
-lower_64bit_integer_instructions(exec_list *instructions,
-                                 unsigned what_to_lower)
+lower_64bit_instructions(exec_list *instructions,
+                         unsigned what_to_lower)
 {
    if (instructions->is_empty())
       return false;
diff --git a/src/compiler/glsl/meson.build b/src/compiler/glsl/meson.build
index 26ab4f1..ec2b5be 100644
--- a/src/compiler/glsl/meson.build
+++ b/src/compiler/glsl/meson.build
@@ -122,6 +122,7 @@ files_libglsl = files(
   'loop_analysis.cpp',
   'loop_analysis.h',
   'loop_unroll.cpp',
+  'lower_64bit.cpp',
   'lower_blend_equation_advanced.cpp',
   'lower_buffer_access.cpp',
   'lower_buffer_access.h',
@@ -132,7 +133,6 @@ files_libglsl = files(
   'lower_distance.cpp',
   'lower_if_to_cond_assign.cpp',
   'lower_instructions.cpp',
-  'lower_int64.cpp',
   'lower_jumps.cpp',
   'lower_mat_op_to_vec.cpp',
   'lower_noise.cpp',
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 911c855..b608635 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -7029,7 +7029,7 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
       }
 
       if (!pscreen->get_param(pscreen, PIPE_CAP_INT64_DIVMOD))
-         lower_64bit_integer_instructions(ir, DIV64 | MOD64);
+         lower_64bit_instructions(ir, DIV64 | MOD64);
 
       if (ctx->Extensions.ARB_shading_language_packing) {
          unsigned lower_inst = LOWER_PACK_SNORM_2x16 |
-- 
2.9.5



More information about the mesa-dev mailing list