2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
4 develop this 3D driver.
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
14 The above copyright notice and this permission notice (including the
15 next paragraph) shall be included in all copies or substantial
16 portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **********************************************************************/
29 * Keith Whitwell <keith@tungstengraphics.com>
34 void brw_print_reg( struct brw_reg hwreg )
36 static const char *file[] = {
43 static const char *type[] = {
55 hwreg.abs ? "abs/" : "",
56 hwreg.negate ? "-" : "");
58 if (hwreg.file == BRW_GENERAL_REGISTER_FILE &&
61 hwreg.vstride == BRW_VERTICAL_STRIDE_8 &&
62 hwreg.width == BRW_WIDTH_8 &&
63 hwreg.hstride == BRW_HORIZONTAL_STRIDE_1 &&
64 hwreg.type == BRW_REGISTER_TYPE_F) {
66 printf("vec%d", hwreg.nr);
68 else if (hwreg.file == BRW_GENERAL_REGISTER_FILE &&
69 hwreg.vstride == BRW_VERTICAL_STRIDE_0 &&
70 hwreg.width == BRW_WIDTH_1 &&
71 hwreg.hstride == BRW_HORIZONTAL_STRIDE_0 &&
72 hwreg.type == BRW_REGISTER_TYPE_F) {
73 /* "scalar" register */
74 printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4);
76 else if (hwreg.file == BRW_IMMEDIATE_VALUE) {
77 printf("imm %f", hwreg.dw1.f);
80 printf("%s%d.%d<%d;%d,%d>:%s",
83 hwreg.subnr / type_sz(hwreg.type),
84 hwreg.vstride ? (1<<(hwreg.vstride-1)) : 0,
86 hwreg.hstride ? (1<<(hwreg.hstride-1)) : 0,