i965/disasm: Simplify the URB opcode printing with ?:.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 8 Apr 2016 20:38:54 +0000 (13:38 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 10 Apr 2016 04:10:11 +0000 (21:10 -0700)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
src/mesa/drivers/dri/i965/brw_disasm.c

index 09eb2392836eba8d09674eba3613af3832c1219d..0ae237d9782a83f8192413af969440e89662a482 100644 (file)
@@ -1509,13 +1509,12 @@ brw_disassemble_inst(FILE *file, const struct brw_device_info *devinfo,
             format(file, " %ld", brw_inst_urb_global_offset(devinfo, inst));
 
             space = 1;
-            if (devinfo->gen >= 7) {
-               err |= control(file, "urb opcode", gen7_urb_opcode,
-                              brw_inst_urb_opcode(devinfo, inst), &space);
-            } else if (devinfo->gen >= 5) {
-               err |= control(file, "urb opcode", gen5_urb_opcode,
-                              brw_inst_urb_opcode(devinfo, inst), &space);
-            }
+
+            err |= control(file, "urb opcode",
+                           devinfo->gen >= 7 ? gen7_urb_opcode
+                                             : gen5_urb_opcode,
+                           brw_inst_urb_opcode(devinfo, inst), &space);
+
             err |= control(file, "urb swizzle", urb_swizzle,
                            brw_inst_urb_swizzle_control(devinfo, inst), &space);
             if (devinfo->gen < 7) {