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(data()[i]);
24 reg b_hi = load(vec1.
hi[i]);
25 reg b_lo = load(vec1.
lo[i]);
27 reg c_hi = load(vec2.
hi[i]);
28 reg c_lo = load(vec2.
lo[i]);
32 Add(a_hi, b_hi, b_lo, c_hi, c_lo, regs);
34 store(data()[i], a_hi);
37 Add(data()[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;
51 #pragma omp parallel private(regs)
54 get_isie(size(), is, ie);
55 for(i = is; i < (ie-SIMD_Length+1); i += SIMD_Length){
56 reg a_hi = load(data()[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]);
66 Add(a_hi, b_hi, b_lo, c_hi, c_lo, regs);
68 store(data()[i], a_hi);
71 Add(data()[i], vec1.data()[i], 0.0, -1 * vec2.
hi[i], -1 * vec2.
lo[i]);
78 if(size() != vec1.
size() || size() != vec2.size()){
79 std::cerr <<
"error bad vector size" << std::endl;
85 #pragma omp parallel private(regs)
88 get_isie(size(), is, ie);
89 for(i = is; i < (ie-SIMD_Length+1); i += SIMD_Length){
90 reg a_hi = load(data()[i]);
92 reg b_hi = load(vec1.
hi[i]);
93 reg b_lo = load(vec1.
lo[i]);
95 reg c_hi = load(vec2.data()[i]);
96 reg c_lo = regs.zeros;
101 Add(a_hi, b_hi, b_lo, c_hi, c_lo, regs);
103 store(data()[i], a_hi);
106 Add(data()[i], vec1.
hi[i], vec1.
lo[i], -1 * vec2.data()[i], -1 * 0.0);
113 if(size() != vec1.size() || size() != vec2.size()){
114 std::cout <<
"error vecvor size is" << size() << vec1.size() << vec2.size() << std::endl;
118 #pragma omp parallel for
119 for(
int i = 0; i < size(); i++){
120 data()[i] = vec1.data()[i] - vec2.data()[i];
Double precision vector class, This class is almost same as std::vector<double>
void sub(dd_real_vector &vec1, dd_real_vector &vec2)
all elemetnt arithmetic function
d_real_vector operator-=(dd_real_vector &vec)
all elemetnt arithmetic function
d_real_vector operator-()
sign
Double-double precision vector class.