1//===-- SparcTargetTransformInfo.cpp - SPARC specific TTI -----------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "SparcTargetTransformInfo.h"
10#include "llvm/Support/MathExtras.h"
11
12using namespace llvm;
13
14#define DEBUG_TYPE "sparctti"
15
16TargetTransformInfo::PopcntSupportKind
17SparcTTIImpl::getPopcntSupport(unsigned TyWidth) const {
18 assert(isPowerOf2_32(TyWidth) && "Type width must be power of 2");
19 if (ST->usePopc())
20 return TTI::PSK_FastHardware;
21 return TTI::PSK_Software;
22}
23