[PATCH] D93597: [X86][SSE] Enable constexpr on some basic SSE intrinsics (RFC)

2021-01-04 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. In D93597#2477890 , @tschuett wrote: > But LLVM is C++14: > https://github.com/llvm/llvm-project/blob/main/llvm/docs/CodingStandards.rst#id13 The compiler _IS_ compiled with C++14, but the tests are not necessarily compiled as

[PATCH] D93597: [X86][SSE] Enable constexpr on some basic SSE intrinsics (RFC)

2021-01-04 Thread Thorsten via Phabricator via cfe-commits
tschuett added a comment. But LLVM is C++14: https://github.com/llvm/llvm-project/blob/main/llvm/docs/CodingStandards.rst#id13 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93597/new/ https://reviews.llvm.org/D93597 ___

[PATCH] D93597: [X86][SSE] Enable constexpr on some basic SSE intrinsics (RFC)

2021-01-04 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon added inline comments. Comment at: clang/test/CodeGen/X86/sse-builtins.c:815 +// Test constexpr handling. +#if defined(__cplusplus) && (__cplusplus >= 201103L) +constexpr __m128 test_constexpr_mm_add_ps(__m128 A, __m128 B) { pengfei wrote: > What are thes

[PATCH] D93597: [X86][SSE] Enable constexpr on some basic SSE intrinsics (RFC)

2021-01-04 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/test/CodeGen/X86/sse-builtins.c:815 +// Test constexpr handling. +#if defined(__cplusplus) && (__cplusplus >= 201103L) +constexpr __m128 test_constexpr_mm_add_ps(__m128 A, __m128 B) { What are these tests testing f

[PATCH] D93597: [X86][SSE] Enable constexpr on some basic SSE intrinsics (RFC)

2021-01-04 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon added a comment. Does anyone have any feedback before I expand this to cover all the SSE2/AVX equivalents? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93597/new/ https://reviews.llvm.org/D93597 __

[PATCH] D93597: [X86][SSE] Enable constexpr on some basic SSE intrinsics (RFC)

2020-12-21 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon updated this revision to Diff 313038. RKSimon added a comment. I've added the static_assert constexpr methods - this requires C++14 so I've left the existing constexpr wrapper tests with C++11 coverage as well. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D93597: [X86][SSE] Enable constexpr on some basic SSE intrinsics (RFC)

2020-12-20 Thread Thorsten via Phabricator via cfe-commits
tschuett added a comment. constexpr bool test() { float A = 1,0; float B = 2,0; float C = 3.0; float D = 4,0; __m128 AV; __m128 BV; __m128 result = _mm_setr_ps(A, B, C, D); result = _mm_setzero_ps(); result = _mm_xor_ps(AV, BV); return true; } It should help you to test,

[PATCH] D93597: [X86][SSE] Enable constexpr on some basic SSE intrinsics (RFC)

2020-12-20 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon added a comment. In D93597#2464870 , @tschuett wrote: > libcxx uses a function test and calls test() and static_assert(test()), see > below > https://github.com/llvm/llvm-project/blob/d86a00d8febd0138a21f92d1420c4b62d7acb0ca/libcxx/test/std/utilit

[PATCH] D93597: [X86][SSE] Enable constexpr on some basic SSE intrinsics (RFC)

2020-12-20 Thread Thorsten via Phabricator via cfe-commits
tschuett added a comment. libcxx uses a function test and calls test() and static_assert(test()), see below https://github.com/llvm/llvm-project/blob/d86a00d8febd0138a21f92d1420c4b62d7acb0ca/libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp#L102-126 Repository: rG LLVM G

[PATCH] D93597: [X86][SSE] Enable constexpr on some basic SSE intrinsics (RFC)

2020-12-20 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon updated this revision to Diff 312979. RKSimon added a comment. missing newline Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93597/new/ https://reviews.llvm.org/D93597 Files: clang/lib/Headers/xmmintrin.h clang/test/CodeGen/X86/sse-bui

[PATCH] D93597: [X86][SSE] Enable constexpr on some basic SSE intrinsics (RFC)

2020-12-20 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon created this revision. RKSimon added reviewers: craig.topper, pengfei, rsmith, erichkeane, spatel. RKSimon requested review of this revision. Herald added a project: clang. This is an initial exploratory patch towards making some (basic initialization and arithmetic) SSE/AVX intrinsics us