r600g/sb: move chip & class name functions to sb_context
authorVadim Girlin <vadimgirlin@gmail.com>
Tue, 16 Jul 2013 10:45:29 +0000 (14:45 +0400)
committerVadim Girlin <vadimgirlin@gmail.com>
Wed, 17 Jul 2013 14:27:30 +0000 (18:27 +0400)
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
src/gallium/drivers/r600/sb/sb_bc.h
src/gallium/drivers/r600/sb/sb_context.cpp
src/gallium/drivers/r600/sb/sb_shader.cpp
src/gallium/drivers/r600/sb/sb_shader.h

index 0e951920e732763ffb26be738b22346157dc8cbb..ad1b862fd57548555bc8cd120e0655a8ae606b36 100644 (file)
@@ -683,6 +683,9 @@ public:
                return ((sel >= 128 && sel < 192) || (sel >= 256 && sel < 320));
        }
 
+       const char * get_hw_class_name();
+       const char * get_hw_chip_name();
+
 };
 
 #define SB_DUMP_STAT(a) do { if (sb_context::dump_stat) { a } } while (0)
index 78b26d5cae886a0fe4c671b0e0a79cb67304af84..9474f74e89fe4a10576325d51592d46695ce8f3a 100644 (file)
@@ -83,4 +83,54 @@ int sb_context::init(r600_isa *isa, sb_hw_chip chip, sb_hw_class cclass) {
        return 0;
 }
 
+const char* sb_context::get_hw_class_name() {
+       switch (hw_class) {
+#define TRANSLATE_HW_CLASS(c) case HW_CLASS_##c: return #c
+               TRANSLATE_HW_CLASS(R600);
+               TRANSLATE_HW_CLASS(R700);
+               TRANSLATE_HW_CLASS(EVERGREEN);
+               TRANSLATE_HW_CLASS(CAYMAN);
+#undef TRANSLATE_HW_CLASS
+               default:
+                       assert(!"unknown chip class");
+                       return "INVALID_CHIP_CLASS";
+       }
 }
+
+const char* sb_context::get_hw_chip_name() {
+       switch (hw_chip) {
+#define TRANSLATE_CHIP(c) case HW_CHIP_##c: return #c
+               TRANSLATE_CHIP(R600);
+               TRANSLATE_CHIP(RV610);
+               TRANSLATE_CHIP(RV630);
+               TRANSLATE_CHIP(RV670);
+               TRANSLATE_CHIP(RV620);
+               TRANSLATE_CHIP(RV635);
+               TRANSLATE_CHIP(RS780);
+               TRANSLATE_CHIP(RS880);
+               TRANSLATE_CHIP(RV770);
+               TRANSLATE_CHIP(RV730);
+               TRANSLATE_CHIP(RV710);
+               TRANSLATE_CHIP(RV740);
+               TRANSLATE_CHIP(CEDAR);
+               TRANSLATE_CHIP(REDWOOD);
+               TRANSLATE_CHIP(JUNIPER);
+               TRANSLATE_CHIP(CYPRESS);
+               TRANSLATE_CHIP(HEMLOCK);
+               TRANSLATE_CHIP(PALM);
+               TRANSLATE_CHIP(SUMO);
+               TRANSLATE_CHIP(SUMO2);
+               TRANSLATE_CHIP(BARTS);
+               TRANSLATE_CHIP(TURKS);
+               TRANSLATE_CHIP(CAICOS);
+               TRANSLATE_CHIP(CAYMAN);
+               TRANSLATE_CHIP(ARUBA);
+#undef TRANSLATE_CHIP
+
+               default:
+                       assert(!"unknown chip");
+                       return "INVALID_CHIP";
+       }
+}
+
+} // namespace r600_sb
index 32760ec056fcdca09b0232c4bfbc086f567b2440..9fc47ae4044f222db3faa9e924eac08081c13e1a 100644 (file)
@@ -426,61 +426,12 @@ cf_node* shader::create_cf(unsigned op) {
 std::string shader::get_full_target_name() {
        std::string s = get_shader_target_name();
        s += "/";
-       s += get_hw_chip_name();
+       s += ctx.get_hw_chip_name();
        s += "/";
-       s += get_hw_class_name();
+       s += ctx.get_hw_class_name();
        return s;
 }
 
-const char* shader::get_hw_class_name() {
-       switch (ctx.hw_class) {
-#define TRANSLATE_HW_CLASS(c) case HW_CLASS_##c: return #c
-               TRANSLATE_HW_CLASS(R600);
-               TRANSLATE_HW_CLASS(R700);
-               TRANSLATE_HW_CLASS(EVERGREEN);
-               TRANSLATE_HW_CLASS(CAYMAN);
-#undef TRANSLATE_HW_CLASS
-               default:
-                       return "INVALID_CHIP_CLASS";
-       }
-}
-
-const char* shader::get_hw_chip_name() {
-       switch (ctx.hw_chip) {
-#define TRANSLATE_CHIP(c) case HW_CHIP_##c: return #c
-               TRANSLATE_CHIP(R600);
-               TRANSLATE_CHIP(RV610);
-               TRANSLATE_CHIP(RV630);
-               TRANSLATE_CHIP(RV670);
-               TRANSLATE_CHIP(RV620);
-               TRANSLATE_CHIP(RV635);
-               TRANSLATE_CHIP(RS780);
-               TRANSLATE_CHIP(RS880);
-               TRANSLATE_CHIP(RV770);
-               TRANSLATE_CHIP(RV730);
-               TRANSLATE_CHIP(RV710);
-               TRANSLATE_CHIP(RV740);
-               TRANSLATE_CHIP(CEDAR);
-               TRANSLATE_CHIP(REDWOOD);
-               TRANSLATE_CHIP(JUNIPER);
-               TRANSLATE_CHIP(CYPRESS);
-               TRANSLATE_CHIP(HEMLOCK);
-               TRANSLATE_CHIP(PALM);
-               TRANSLATE_CHIP(SUMO);
-               TRANSLATE_CHIP(SUMO2);
-               TRANSLATE_CHIP(BARTS);
-               TRANSLATE_CHIP(TURKS);
-               TRANSLATE_CHIP(CAICOS);
-               TRANSLATE_CHIP(CAYMAN);
-               TRANSLATE_CHIP(ARUBA);
-#undef TRANSLATE_CHIP
-
-               default:
-                       assert(!"unknown chip");
-                       return "INVALID_CHIP";
-       }
-}
-
 const char* shader::get_shader_target_name() {
        switch (target) {
                case TARGET_VS: return "VS";
index 040dbf46667ed6eed31d95612ef044fb31244737..e515d312d804e01fef380bcc06c55080e5c2bdbc 100644 (file)
@@ -367,8 +367,6 @@ public:
        alu_node* create_mov(value* dst, value* src);
        alu_node* create_copy_mov(value *dst, value *src, unsigned affcost = 1);
 
-       const char * get_hw_class_name();
-       const char * get_hw_chip_name();
        const char * get_shader_target_name();
 
        std::string get_full_target_name();