Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-codegen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Christian Heinigk
dune-codegen
Commits
808f7084
Commit
808f7084
authored
7 years ago
by
Dominic Kempf
Browse files
Options
Downloads
Patches
Plain Diff
Update vector class library + Patch
parent
488faabb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/perftool/vectorclass
+1
-1
1 addition, 1 deletion
dune/perftool/vectorclass
patches/vectorclass/0001-Better-implementation-of-horizontal_add.patch
+32
-0
32 additions, 0 deletions
...rclass/0001-Better-implementation-of-horizontal_add.patch
with
33 additions
and
1 deletion
vectorclass
@
8d52f136
Compare
4e11d282
...
8d52f136
Subproject commit
4e11d28201c90f357771c98af790eccfaea2103d
Subproject commit
8d52f13665adbfe4b93bbf076b79828d03563ce1
This diff is collapsed.
Click to expand it.
patches/vectorclass/0001-Better-implementation-of-horizontal_add.patch
0 → 100644
+
32
−
0
View file @
808f7084
From 69f4ea4dcd018eb74c39a076a60fc27c0496e1dd Mon Sep 17 00:00:00 2001
From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de>
Date: Mon, 19 Jun 2017 13:07:22 +0200
Subject: [PATCH] Better implementation of horizontal_add
---
vectorf256.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/vectorf256.h b/vectorf256.h
index db509f8..2bbd9de 100644
--- a/vectorf256.h
+++ b/vectorf256.h
@@ -1692,10 +1692,11 @@
static inline Vec4d if_mul (Vec4db const & f, Vec4d const & a, Vec4d const & b)
// Horizontal add: Calculates the sum of all vector elements.
static inline double horizontal_add (Vec4d const & a) {
- __m256d t1 = _mm256_hadd_pd(a,a);
- __m128d t2 = _mm256_extractf128_pd(t1,1);
- __m128d t3 = _mm_add_sd(_mm256_castpd256_pd128(t1),t2);
- return _mm_cvtsd_f64(t3);
+ const __m128d valupper = _mm256_extractf128_pd(val, 1);
+ const __m128d vallower = _mm256_castpd256_pd128(val);
+ const __m128d valval = _mm_add_pd(valupper, vallower);
+ const __m128d res = _mm_add_pd(_mm_permute_pd(valval,1), valval);
+ return _mm_cvtsd_f64(res);
}
// function max: a > b ? a : b
--
2.1.4
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment