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; 48 49 // Built in types. 50 Type* mVoidTy; 51 Type* mInt1Ty; 52 Type* mInt8Ty; 53 Type* mInt16Ty; 54 Type* mInt32Ty; 55 Type* mInt64Ty; 56 Type* mIntPtrTy; 57 Type* mFP16Ty; 58 Type* mFP32Ty; 59 Type* mDoubleTy; 60 Type* mInt8PtrTy; 61 Type* mInt16PtrTy; 62 Type* mInt32PtrTy; 63 Type* mSimdFP16Ty; 64 Type* mSimdFP32Ty; 65 Type* mSimdInt1Ty; 66 Type* mSimdInt16Ty; 67 Type* mSimdInt32Ty; 68 Type* mSimdInt64Ty; 69 Type* mSimdIntPtrTy; 70 Type* mSimdVectorTy; 71 Type* mSimdVectorTRTy; 72 StructType* mV4FP32Ty; 73 StructType* mV4Int32Ty; 74 75 #include "builder_gen.h" 76 #include "builder_x86.h" 77 #include "builder_misc.h" 78 #include "builder_math.h" 79 }; 80 } 81