aco: optimize 16-bit and 64-bit float comparisons
[mesa.git] / src / amd / compiler / aco_print_ir.cpp
index e3c8cd81add857dfe33aa57b590bfdd629f4a5aa..3daa60b71c14574b6e3130cb4961aa4b8161e17a 100644 (file)
@@ -15,11 +15,9 @@ static const char *reduce_ops[] = {
    [imul16] = "imul16",
    [imul32] = "imul32",
    [imul64] = "imul64",
-   [fadd8] = "fadd8",
    [fadd16] = "fadd16",
    [fadd32] = "fadd32",
    [fadd64] = "fadd64",
-   [fmul8] = "fmul8",
    [fmul16] = "fmul16",
    [fmul32] = "fmul32",
    [fmul64] = "fmul64",
@@ -39,11 +37,9 @@ static const char *reduce_ops[] = {
    [umax16] = "umax16",
    [umax32] = "umax32",
    [umax64] = "umax64",
-   [fmin8] = "fmin8",
    [fmin16] = "fmin16",
    [fmin32] = "fmin32",
    [fmin64] = "fmin64",
-   [fmax8] = "fmax8",
    [fmax16] = "fmax16",
    [fmax32] = "fmax32",
    [fmax64] = "fmax64",
@@ -59,7 +55,6 @@ static const char *reduce_ops[] = {
    [ixor16] = "ixor16",
    [ixor32] = "ixor32",
    [ixor64] = "ixor64",
-   [gfx10_wave64_bpermute] = "gfx10_wave64_bpermute",
 };
 
 static void print_reg_class(const RegClass rc, FILE *output)
@@ -158,8 +153,13 @@ static void print_constant(uint8_t reg, FILE *output)
 
 static void print_operand(const Operand *operand, FILE *output)
 {
-   if (operand->isLiteral()) {
-      fprintf(output, "0x%x", operand->constantValue());
+   if (operand->isLiteral() || (operand->isConstant() && operand->bytes() == 1)) {
+      if (operand->bytes() == 1)
+         fprintf(output, "0x%.2x", operand->constantValue());
+      else if (operand->bytes() == 2)
+         fprintf(output, "0x%.4x", operand->constantValue());
+      else
+         fprintf(output, "0x%x", operand->constantValue());
    } else if (operand->isConstant()) {
       print_constant(operand->physReg().reg(), output);
    } else if (operand->isUndefined()) {
@@ -179,6 +179,8 @@ static void print_operand(const Operand *operand, FILE *output)
 static void print_definition(const Definition *definition, FILE *output)
 {
    print_reg_class(definition->regClass(), output);
+   if (definition->isPrecise())
+      fprintf(output, "(precise)");
    fprintf(output, "%%%d", definition->tempId());
 
    if (definition->isFixed())