• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2 * Copyright (C) 2014-2015 Intel Corporation.   All Rights Reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 * @file builder.h
24 *
25 * @brief Includes all the builder related functionality
26 *
27 * Notes:
28 *
29 ******************************************************************************/
30 #pragma once
31 
32 #include "JitManager.h"
33 #include "common/formats.h"
34 
35 namespace SwrJit
36 {
37     using namespace llvm;
38     struct Builder
39     {
40         Builder(JitManager *pJitMgr);
IRBBuilder41         IRBuilder<> *IRB() { return mpIRBuilder; };
JMBuilder42         JitManager *JM() { return mpJitMgr; }
43 
44         JitManager *mpJitMgr;
45         IRBuilder<> *mpIRBuilder;
46 
47         uint32_t             mVWidth;   // vector width simd8
48         uint32_t             mVWidth16; // vector width simd16
49 
50         // Built in types: scalar
51 
52         Type*                mVoidTy;
53         Type*                mInt1Ty;
54         Type*                mInt8Ty;
55         Type*                mInt16Ty;
56         Type*                mInt32Ty;
57         Type*                mInt64Ty;
58         Type*                mIntPtrTy;
59         Type*                mFP16Ty;
60         Type*                mFP32Ty;
61         Type*                mFP32PtrTy;
62         Type*                mDoubleTy;
63         Type*                mInt8PtrTy;
64         Type*                mInt16PtrTy;
65         Type*                mInt32PtrTy;
66 
67         // Built in types: simd8
68 
69         Type*                mSimdFP16Ty;
70         Type*                mSimdFP32Ty;
71         Type*                mSimdInt1Ty;
72         Type*                mSimdInt16Ty;
73         Type*                mSimdInt32Ty;
74         Type*                mSimdInt64Ty;
75         Type*                mSimdIntPtrTy;
76         Type*                mSimdVectorTy;
77         Type*                mSimdVectorTRTy;
78 
79         // Built in types: simd16
80 
81         Type*                mSimd16FP16Ty;
82         Type*                mSimd16FP32Ty;
83         Type*                mSimd16Int1Ty;
84         Type*                mSimd16Int16Ty;
85         Type*                mSimd16Int32Ty;
86         Type*                mSimd16Int64Ty;
87         Type*                mSimd16IntPtrTy;
88         Type*                mSimd16VectorTy;
89         Type*                mSimd16VectorTRTy;
90 
91 #include "gen_builder.hpp"
92 #include "gen_builder_x86.hpp"
93 #include "builder_misc.h"
94 #include "builder_math.h"
95     };
96 }
97