1 #include<DD-AVX_internal.hpp>
3 using namespace ddavx_core;
11 if(size() != vec1.
size() || size() != vec2.
size()){
12 std::cerr <<
"error bad vector size" << std::endl;
17 #pragma omp parallel private(regs)
20 get_isie(size(), is, ie);
21 for(i = is; i < (ie-SIMD_Length+1); i += SIMD_Length){
22 reg a_hi = load(hi[i]);
23 reg a_lo = load(lo[i]);
25 reg b_hi = load(vec1.
hi[i]);
26 reg b_lo = load(vec1.
lo[i]);
28 reg c_hi = load(vec2.
hi[i]);
29 reg c_lo = load(vec2.
lo[i]);
31 Add(a_hi, a_lo, b_hi, b_lo, c_hi, c_lo, regs);
37 Add(hi[i], lo[i], vec1.
hi[i], vec1.
lo[i], vec2.
hi[i], vec2.
lo[i]);
44 if(size() != vec1.size() || size() != vec2.
size()){
45 std::cerr <<
"error bad vector size" << std::endl;
50 #pragma omp parallel private(regs)
53 get_isie(size(), is, ie);
54 for(i = is; i < (ie-SIMD_Length+1); i += SIMD_Length){
55 reg a_hi = load(hi[i]);
56 reg a_lo = load(lo[i]);
58 reg b_hi = load(vec1.data()[i]);
59 reg b_lo = regs.zeros;
61 reg c_hi = load(vec2.
hi[i]);
62 reg c_lo = load(vec2.
lo[i]);
64 Add(a_hi, a_lo, b_hi, b_lo, c_hi, c_lo, regs);
70 Add(hi[i], lo[i], vec1.data()[i], 0.0, vec2.
hi[i], vec2.
lo[i]);
83 if(size() != vec1.size() || size() != vec2.size()){
84 std::cerr <<
"error bad vector size" << std::endl;
89 #pragma omp parallel private(regs)
92 get_isie(size(), is, ie);
93 for(i = is; i < (ie-SIMD_Length+1); i += SIMD_Length){
94 reg a_hi = load(hi[i]);
95 reg a_lo = load(lo[i]);
97 reg b_hi = load(vec1.data()[i]);
98 reg b_lo = regs.zeros;
100 reg c_hi = load(vec2.data()[i]);
101 reg c_lo = regs.zeros;
103 Add(a_hi, a_lo, b_hi, b_lo, c_hi, c_lo, regs);
109 Add(hi[i], lo[i], vec1.data()[i], 0.0, vec2.data()[i], 0.0);
Double precision vector class, This class is almost same as std::vector<double>
Double-double precision vector class.
dd_real_vector operator+=(dd_real_vector &vec)
all elemetnt arithmetic function
dd_real_vector operator+(dd_real_vector &vec)
all elemetnt arithmetic function
void add(dd_real_vector &vec1, dd_real_vector &vec2)
all elemetnt arithmetic function