-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PowerPC] [Clang] Port MMX intrinsics and basic test cases to Power
Port mmintrin.h which include x86 MMX intrinsics implementation to PowerPC platform (using Altivec). To make the include process correct, PowerPC's toolchain class is overrided to insert new headers directory (named ppc_wrappers) into the path. Basic test cases for several intrinsic functions are added. The header is mainly developed by Steven Munroe, with contributions from Paul Clarke, Bill Schmidt, Jinsong Ji and Zixuan Wu. Reviewed By: Jinsong Ji Differential Revision: https://reviews.llvm.org/D59924 llvm-svn: 358949
- Loading branch information
Showing
8 changed files
with
1,606 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| //===-- PPCLinux.cpp - PowerPC ToolChain Implementations --------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "PPCLinux.h" | ||
| #include "clang/Driver/Driver.h" | ||
| #include "clang/Driver/Options.h" | ||
| #include "llvm/Support/Path.h" | ||
|
|
||
| using namespace clang::driver::toolchains; | ||
| using namespace llvm::opt; | ||
|
|
||
| void PPCLinuxToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs, | ||
| ArgStringList &CC1Args) const { | ||
| // PPC wrapper headers are implementation of x86 intrinsics on PowerPC, which | ||
| // is not supported on PPC32 platform. | ||
| if (getArch() != llvm::Triple::ppc && | ||
| !DriverArgs.hasArg(clang::driver::options::OPT_nostdinc) && | ||
| !DriverArgs.hasArg(options::OPT_nobuiltininc)) { | ||
| const Driver &D = getDriver(); | ||
| SmallString<128> P(D.ResourceDir); | ||
| llvm::sys::path::append(P, "include", "ppc_wrappers"); | ||
| addSystemInclude(DriverArgs, CC1Args, P); | ||
| } | ||
|
|
||
| Linux::AddClangSystemIncludeArgs(DriverArgs, CC1Args); | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| //===--- PPCLinux.h - PowerPC ToolChain Implementations ---------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_PPC_LINUX_H | ||
| #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_PPC_LINUX_H | ||
|
|
||
| #include "Linux.h" | ||
|
|
||
| namespace clang { | ||
| namespace driver { | ||
| namespace toolchains { | ||
|
|
||
| class LLVM_LIBRARY_VISIBILITY PPCLinuxToolChain : public Linux { | ||
| public: | ||
| PPCLinuxToolChain(const Driver &D, const llvm::Triple &Triple, | ||
| const llvm::opt::ArgList &Args) | ||
| : Linux(D, Triple, Args) {} | ||
|
|
||
| void | ||
| AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, | ||
| llvm::opt::ArgStringList &CC1Args) const override; | ||
| }; | ||
|
|
||
| } // end namespace toolchains | ||
| } // end namespace driver | ||
| } // end namespace clang | ||
|
|
||
| #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_PPC_LINUX_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.