1 /**************************************************************************
3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
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:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
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.
26 **************************************************************************/
31 #include "pipe/p_compiler.h"
32 #include "pipe/p_shader_tokens.h"
33 #include "util/u_format.h"
35 #if defined __cplusplus
39 /* This enum describes how an opcode calculates its result. */
40 enum tgsi_output_mode
{
41 /** The opcode produces no result. */
44 /** When this opcode writes to a channel of the destination register,
45 * it takes as arguments values from the same channel of the source
48 * Example: TGSI_OPCODE_ADD
50 TGSI_OUTPUT_COMPONENTWISE
= 1,
52 /** This opcode writes the same value to all enabled channels of the
53 * destination register.
55 * Example: TGSI_OPCODE_RSQ
57 TGSI_OUTPUT_REPLICATE
= 2,
59 /** The operation performed by this opcode is dependent on which channel
60 * of the destination register is being written.
62 * Example: TGSI_OPCODE_LOG
64 TGSI_OUTPUT_CHAN_DEPENDENT
= 3,
67 * Example: TGSI_OPCODE_TEX
72 struct tgsi_opcode_info
80 enum tgsi_output_mode output_mode
:3;
85 const struct tgsi_opcode_info
*
86 tgsi_get_opcode_info( uint opcode
);
89 tgsi_get_opcode_name( uint opcode
);
92 tgsi_get_processor_name( uint processor
);
94 enum tgsi_opcode_type
{
95 TGSI_TYPE_UNTYPED
, /* for MOV */
103 enum tgsi_opcode_type
104 tgsi_opcode_infer_src_type( uint opcode
);
106 enum tgsi_opcode_type
107 tgsi_opcode_infer_dst_type( uint opcode
);
109 #if defined __cplusplus
113 #endif /* TGSI_INFO_H */