1*700637cbSDimitry Andric //===--- Xtensa.cpp - Implement Xtensa target feature support -------------===// 2*700637cbSDimitry Andric // 3*700637cbSDimitry Andric // The LLVM Compiler Infrastructure 4*700637cbSDimitry Andric // 5*700637cbSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 6*700637cbSDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 7*700637cbSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 8*700637cbSDimitry Andric // 9*700637cbSDimitry Andric //===----------------------------------------------------------------------===// 10*700637cbSDimitry Andric // 11*700637cbSDimitry Andric // This file implements Xtensa TargetInfo objects. 12*700637cbSDimitry Andric // 13*700637cbSDimitry Andric //===----------------------------------------------------------------------===// 14*700637cbSDimitry Andric 15*700637cbSDimitry Andric #include "Xtensa.h" 16*700637cbSDimitry Andric #include "clang/Basic/Builtins.h" 17*700637cbSDimitry Andric #include "clang/Basic/MacroBuilder.h" 18*700637cbSDimitry Andric 19*700637cbSDimitry Andric using namespace clang; 20*700637cbSDimitry Andric using namespace clang::targets; 21*700637cbSDimitry Andric getTargetDefines(const LangOptions & Opts,MacroBuilder & Builder) const22*700637cbSDimitry Andricvoid XtensaTargetInfo::getTargetDefines(const LangOptions &Opts, 23*700637cbSDimitry Andric MacroBuilder &Builder) const { 24*700637cbSDimitry Andric Builder.defineMacro("__xtensa__"); 25*700637cbSDimitry Andric Builder.defineMacro("__XTENSA__"); 26*700637cbSDimitry Andric if (BigEndian) 27*700637cbSDimitry Andric Builder.defineMacro("__XTENSA_EB__"); 28*700637cbSDimitry Andric else 29*700637cbSDimitry Andric Builder.defineMacro("__XTENSA_EL__"); 30*700637cbSDimitry Andric Builder.defineMacro("__XCHAL_HAVE_BE", BigEndian ? "1" : "0"); 31*700637cbSDimitry Andric Builder.defineMacro("__XCHAL_HAVE_ABS"); // core arch 32*700637cbSDimitry Andric Builder.defineMacro("__XCHAL_HAVE_ADDX"); // core arch 33*700637cbSDimitry Andric Builder.defineMacro("__XCHAL_HAVE_L32R"); // core arch 34*700637cbSDimitry Andric } 35