vc4: Add support for 16-bit signed/unsigned norm/scaled vertex attrs.
[mesa.git] / src / gallium / drivers / r600 / r600_isa.c
index e3a29c3cdeec7e22c9e20930c20475edfc6a36d6..4ea71035c7939435113aa1dd6f1dc5b7ee861af9 100644 (file)
 #include "r600_isa.h"
 
 int r600_isa_init(struct r600_context *ctx, struct r600_isa *isa) {
+       unsigned i;
 
-       assert(ctx->chip_class >= R600 && ctx->chip_class <= CAYMAN);
-       isa->hw_class = ctx->chip_class - R600;
+       assert(ctx->b.chip_class >= R600 && ctx->b.chip_class <= CAYMAN);
+       isa->hw_class = ctx->b.chip_class - R600;
 
-       assert(isa->hw_class >= ISA_CC_R600 && isa->hw_class <= ISA_CC_EVERGREEN);
-
-       /* reverse lookup maps are required for bytecode parsing only,
-        * currently it's needed for handling the bytestream from llvm backend */
-#if defined R600_USE_LLVM || defined HAVE_OPENCL
-       unsigned i, use_llvm;
-
-       use_llvm = debug_get_bool_option("R600_LLVM", TRUE);
-
-       if (!use_llvm)
-               return 0;
+       /* reverse lookup maps are required for bytecode parsing */
 
        isa->alu_op2_map = calloc(256, sizeof(unsigned));
        if (!isa->alu_op2_map)
@@ -90,7 +81,6 @@ int r600_isa_init(struct r600_context *ctx, struct r600_isa *isa) {
                isa->cf_map[opc] = i + 1;
        }
 
-#endif
        return 0;
 }
 
@@ -99,14 +89,10 @@ int r600_isa_destroy(struct r600_isa *isa) {
        if (!isa)
                return 0;
 
-       if (isa->alu_op2_map)
-               free(isa->alu_op2_map);
-       if (isa->alu_op3_map)
-               free(isa->alu_op3_map);
-       if (isa->fetch_map)
-               free(isa->fetch_map);
-       if (isa->cf_map)
-               free(isa->cf_map);
+       free(isa->alu_op2_map);
+       free(isa->alu_op3_map);
+       free(isa->fetch_map);
+       free(isa->cf_map);
 
        free(isa);
        return 0;