Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 1 | //===-- WebAssemblyTargetTransformInfo.cpp - WebAssembly-specific TTI -----===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | /// |
| 10 | /// \file |
| 11 | /// \brief This file defines the WebAssembly-specific TargetTransformInfo |
| 12 | /// implementation. |
| 13 | /// |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #include "WebAssemblyTargetTransformInfo.h" |
| 17 | #include "llvm/Support/Debug.h" |
| 18 | #include "llvm/Target/CostTable.h" |
| 19 | using namespace llvm; |
| 20 | |
| 21 | #define DEBUG_TYPE "wasmtti" |
| 22 | |
| 23 | TargetTransformInfo::PopcntSupportKind |
Dan Gohman | 01612f6 | 2015-08-24 16:51:46 +0000 | [diff] [blame^] | 24 | WebAssemblyTTIImpl::getPopcntSupport(unsigned TyWidth) const { |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 25 | assert(isPowerOf2_32(TyWidth) && "Ty width must be power of 2"); |
Dan Gohman | 01612f6 | 2015-08-24 16:51:46 +0000 | [diff] [blame^] | 26 | return TargetTransformInfo::PSK_FastHardware; |
| 27 | } |
| 28 | |
| 29 | bool |
| 30 | WebAssemblyTTIImpl::haveFastSqrt(Type *Ty) const { |
| 31 | assert(Ty->isFPOrFPVectorTy() && "Ty must be floating point"); |
| 32 | return true; |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 33 | } |