brw_eu_debug.c

Go to the documentation of this file.
00001 /*
00002  Copyright (C) Intel Corp.  2006.  All Rights Reserved.
00003  Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
00004  develop this 3D driver.
00005  
00006  Permission is hereby granted, free of charge, to any person obtaining
00007  a copy of this software and associated documentation files (the
00008  "Software"), to deal in the Software without restriction, including
00009  without limitation the rights to use, copy, modify, merge, publish,
00010  distribute, sublicense, and/or sell copies of the Software, and to
00011  permit persons to whom the Software is furnished to do so, subject to
00012  the following conditions:
00013  
00014  The above copyright notice and this permission notice (including the
00015  next paragraph) shall be included in all copies or substantial
00016  portions of the Software.
00017  
00018  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00019  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00020  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00021  IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
00022  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00023  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00024  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00025  
00026  **********************************************************************/
00027  /*
00028   * Authors:
00029   *   Keith Whitwell <keith@tungstengraphics.com>
00030   */
00031     
00032 
00033 #include "pipe/p_debug.h"
00034 
00035 #include "brw_eu.h"
00036 
00037 void brw_print_reg( struct brw_reg hwreg )
00038 {
00039    static const char *file[] = {
00040       "arf",
00041       "grf",
00042       "msg",
00043       "imm"
00044    };
00045 
00046    static const char *type[] = {
00047       "ud",
00048       "d",
00049       "uw",
00050       "w",
00051       "ub",
00052       "vf",
00053       "hf",
00054       "f"
00055    };
00056 
00057    debug_printf("%s%s", 
00058                 hwreg.abs ? "abs/" : "",
00059                 hwreg.negate ? "-" : "");
00060      
00061    if (hwreg.file == BRW_GENERAL_REGISTER_FILE &&
00062        hwreg.nr % 2 == 0 &&
00063        hwreg.subnr == 0 &&
00064        hwreg.vstride == BRW_VERTICAL_STRIDE_8 &&
00065        hwreg.width == BRW_WIDTH_8 &&
00066        hwreg.hstride == BRW_HORIZONTAL_STRIDE_1 &&
00067        hwreg.type == BRW_REGISTER_TYPE_F) {
00068       debug_printf("vec%d", hwreg.nr);
00069    }
00070    else if (hwreg.file == BRW_GENERAL_REGISTER_FILE &&
00071             hwreg.vstride == BRW_VERTICAL_STRIDE_0 &&
00072             hwreg.width == BRW_WIDTH_1 &&
00073             hwreg.hstride == BRW_HORIZONTAL_STRIDE_0 &&
00074             hwreg.type == BRW_REGISTER_TYPE_F) {      
00075       debug_printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4);
00076    }
00077    else {
00078       debug_printf("%s%d.%d<%d;%d,%d>:%s", 
00079                    file[hwreg.file],
00080                    hwreg.nr,
00081                    hwreg.subnr / type_sz(hwreg.type),
00082                    hwreg.vstride ? (1<<(hwreg.vstride-1)) : 0,
00083                    1<<hwreg.width,
00084                    hwreg.hstride ? (1<<(hwreg.hstride-1)) : 0,          
00085                    type[hwreg.type]);
00086    }
00087 }
00088 
00089 
00090 

Generated on Tue Sep 29 06:25:16 2009 for Gallium3D by  doxygen 1.5.4