tgsi_info.h revision df169457909e1985c65e8a19c245133d2f5f013d
1/************************************************************************** 2 * 3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. 4 * All Rights Reserved. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a 7 * 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, sub license, 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: 13 * 14 * The above copyright notice and this permission notice (including the 15 * next paragraph) shall be included in all copies or substantial portions 16 * of the Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR 22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 * 26 **************************************************************************/ 27 28#ifndef TGSI_INFO_H 29#define TGSI_INFO_H 30 31#include "pipe/p_compiler.h" 32#include "pipe/p_shader_tokens.h" 33 34#if defined __cplusplus 35extern "C" { 36#endif 37 38/* This enum describes how an opcode calculates its result. */ 39enum tgsi_output_mode { 40 /** The opcode produces no result. */ 41 TGSI_OUTPUT_NONE = 0, 42 43 /** When this opcode writes to a channel of the destination register, 44 * it takes as arguments values from the same channel of the source 45 * register(s). 46 * 47 * Example: TGSI_OPCODE_ADD 48 */ 49 TGSI_OUTPUT_COMPONENTWISE = 1, 50 51 /** This opcode writes the same value to all enabled channels of the 52 * destination register. 53 * 54 * Example: TGSI_OPCODE_RSQ 55 */ 56 TGSI_OUTPUT_REPLICATE = 2, 57 58 /** The operation performed by this opcode is dependent on which channel 59 * of the destination register is being written. 60 * 61 * Example: TGSI_OPCODE_LOG 62 */ 63 TGSI_OUTPUT_CHAN_DEPENDENT = 3, 64 65 /** 66 * Example: TGSI_OPCODE_TEX 67 */ 68 TGSI_OUTPUT_OTHER = 4 69}; 70 71struct tgsi_opcode_info 72{ 73 unsigned num_dst:3; 74 unsigned num_src:3; 75 unsigned is_tex:1; 76 unsigned is_branch:1; 77 int pre_dedent:2; 78 int post_indent:2; 79 enum tgsi_output_mode output_mode:3; 80 const char *mnemonic; 81 uint opcode; 82}; 83 84const struct tgsi_opcode_info * 85tgsi_get_opcode_info( uint opcode ); 86 87const char * 88tgsi_get_opcode_name( uint opcode ); 89 90const char * 91tgsi_get_processor_name( uint processor ); 92 93 94#if defined __cplusplus 95} 96#endif 97 98#endif /* TGSI_INFO_H */ 99