mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00
Summary: The patch includes all declarations, and also implements the following features: * ABI. * narrowing-conversion related SFIANE, including simd<> ctors and (static_)simd_cast. Reviewers: mclow.lists, EricWF Subscribers: lichray, sanjoy, MaskRay, cfe-commits Differential Revision: https://reviews.llvm.org/D41148 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330627 91177308-0d34-0410-b5e6-96231b3b80d8
39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
// Source Licenses. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// UNSUPPORTED: c++98, c++03
|
|
|
|
// <experimental/simd>
|
|
//
|
|
// [simd.casts]
|
|
// template <class T, class U, class Abi> see below static_simd_cast(const simd<U, Abi>&);
|
|
|
|
#include <experimental/simd>
|
|
#include <cstdint>
|
|
|
|
using namespace std::experimental::parallelism_v2;
|
|
|
|
static_assert(
|
|
std::is_same<decltype(static_simd_cast<float>(native_simd<int>())),
|
|
native_simd<float>>::value,
|
|
"");
|
|
|
|
static_assert(std::is_same<decltype(static_simd_cast<fixed_size_simd<float, 1>>(
|
|
simd<int, simd_abi::scalar>())),
|
|
fixed_size_simd<float, 1>>::value,
|
|
"");
|
|
|
|
static_assert(
|
|
std::is_same<decltype(static_simd_cast<simd<float, simd_abi::scalar>>(
|
|
fixed_size_simd<int, 1>())),
|
|
simd<float, simd_abi::scalar>>::value,
|
|
"");
|
|
|
|
int main() {}
|