mirrored from git://gcc.gnu.org/git/gcc.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2015-11-09 Igor Zamyatin <igor.zamyatin@intel.com> PR target/66326 * runtime/config/x86/os-unix-sysdep.c (sysdep_save_fp_ctrl_state): Use fnstcw instead fnstsw. gcc/testsuite 2015-11-09 Igor Zamyatin <igor.zamyatin@intel.com> PR target/66326 * g++.dg/cilk-plus/CK/pr66326.cc: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230008 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
ienkovich
committed
Nov 9, 2015
1 parent
716c563
commit 405a4bd
Showing
4 changed files
with
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* { dg-options "-fcilkplus" } */ | ||
/* { dg-do run { target i?86-*-* x86_64-*-* } } */ | ||
/* { dg-options "-fcilkplus -lcilkrts" { target { i?86-*-* x86_64-*-* } } } */ | ||
|
||
#include <cilk/cilk.h> | ||
#include <vector> | ||
#include <random> | ||
|
||
template <class T> | ||
void do_not_optimize_away(T&& x) { | ||
asm volatile("" : "+r"(x)); | ||
} | ||
|
||
const int N = 1'000'000; | ||
|
||
auto compute() { | ||
std::vector<double> v(N); | ||
auto rng = std::mt19937{std::random_device{}()}; | ||
std::uniform_real_distribution<double> dist(0, 1); | ||
for (int i = 0; i < N; ++i) v[i] = std::log(std::sqrt(dist(rng))); | ||
return v; | ||
} | ||
|
||
int main() { | ||
std::vector<double> v1, v2, v3; | ||
cilk_spawn [&] { v1 = compute(); }(); | ||
cilk_spawn [&] { v2 = compute(); }(); | ||
v3 = compute(); | ||
do_not_optimize_away(v1.data()); | ||
do_not_optimize_away(v2.data()); | ||
do_not_optimize_away(v3.data()); | ||
return 0; | ||
} |
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