blob: 559932f5fb48951e8b08cc2ef4ec433385b41789 [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001//===-- 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"
19using namespace llvm;
20
21#define DEBUG_TYPE "wasmtti"
22
23TargetTransformInfo::PopcntSupportKind
Dan Gohman01612f62015-08-24 16:51:46 +000024WebAssemblyTTIImpl::getPopcntSupport(unsigned TyWidth) const {
Dan Gohman10e730a2015-06-29 23:51:55 +000025 assert(isPowerOf2_32(TyWidth) && "Ty width must be power of 2");
Dan Gohman01612f62015-08-24 16:51:46 +000026 return TargetTransformInfo::PSK_FastHardware;
27}
28
29bool
30WebAssemblyTTIImpl::haveFastSqrt(Type *Ty) const {
31 assert(Ty->isFPOrFPVectorTy() && "Ty must be floating point");
32 return true;
Dan Gohman10e730a2015-06-29 23:51:55 +000033}