1 /**************************************************************************
3 * Copyright 2007 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 **************************************************************************/
46 StorageSoa(llvm::BasicBlock
*block
,
52 void addImmediate(float *vec
);
54 llvm::Value
* addrElement(int idx
) const;
56 std::vector
<llvm::Value
*> inputElement(int idx
, int swizzle
, llvm::Value
*indIdx
=0);
57 std::vector
<llvm::Value
*> constElement(int idx
, int swizzle
, llvm::Value
*indIdx
=0);
58 std::vector
<llvm::Value
*> outputElement(int idx
, int swizzle
, llvm::Value
*indIdx
=0);
59 std::vector
<llvm::Value
*> tempElement(int idx
, int swizzle
, llvm::Value
*indIdx
=0);
60 std::vector
<llvm::Value
*> immediateElement(int idx
, int swizzle
);
62 llvm::Value
*extractIndex(llvm::Value
*vec
);
64 void storeOutput(int dstIdx
, const std::vector
<llvm::Value
*> &val
,
66 void storeTemp(int idx
, const std::vector
<llvm::Value
*> &val
,
68 void storeAddress(int idx
, const std::vector
<llvm::Value
*> &val
,
71 llvm::Value
*elementPointer(llvm::Value
*ptr
, int index
,
73 llvm::Value
*element(llvm::Value
*ptr
, int index
,
75 const char *name(const char *prefix
) const;
76 llvm::ConstantInt
*constantInt(int) const;
78 llvm::BasicBlock
*m_block
;
81 llvm::Value
*m_output
;
82 llvm::Value
*m_consts
;
85 mutable std::map
<int, llvm::ConstantInt
*> m_constInts
;
86 mutable char m_name
[32];