amino
Lightweight Robot Utility Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
avx.h
1
/* -*- mode: C; c-basic-offset: 4 -*- */
2
/* ex: set shiftwidth=4 tabstop=4 expandtab: */
3
/*
4
* Copyright (c) 2013, Georgia Tech Research Corporation
5
* All rights reserved.
6
*
7
* Author(s): Neil T. Dantam <ntd@gatech.edu>
8
* Georgia Tech Humanoid Robotics Lab
9
* Under Direction of Prof. Mike Stilman <mstilman@cc.gatech.edu>
10
*
11
*
12
* This file is provided under the following "BSD-style" License:
13
*
14
*
15
* Redistribution and use in source and binary forms, with or
16
* without modification, are permitted provided that the following
17
* conditions are met:
18
*
19
* * Redistributions of source code must retain the above copyright
20
* notice, this list of conditions and the following disclaimer.
21
*
22
* * Redistributions in binary form must reproduce the above
23
* copyright notice, this list of conditions and the following
24
* disclaimer in the documentation and/or other materials provided
25
* with the distribution.
26
*
27
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
28
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
29
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
35
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
36
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39
* POSSIBILITY OF SUCH DAMAGE.
40
*
41
*/
42
43
#ifndef AA_AMINO_ARCH_AVX_H
44
#define AA_AMINO_ARCH_AVX_H
45
46
/* /\** Load a vec4 from memory *\/ */
47
/* static inline aa_vec_4d */
48
/* aa_vec_4d_ld( const double src[4] ) { */
49
/* //const double *a = __builtin_assume_aligned(src, 32); */
50
/* return *(aa_vec_4d*)src; */
51
/* //aa_vec_4d dst = a; */
52
/* /\* dst[0] = a[0]; *\/ */
53
/* /\* dst[1] = a[1]; *\/ */
54
/* /\* dst[2] = a[2]; *\/ */
55
/* /\* dst[3] = a[3]; *\/ */
56
/* //return dst; */
57
58
/* //return __builtin_ia32_loadupd256(src); */
59
/* } */
60
61
/* /\** Store a vec4 to memory *\/ */
62
/* static inline void */
63
/* aa_vec_4d_st( double dst[4], const aa_vec_4d src ) { */
64
/* __builtin_ia32_storeupd256( dst, src ); */
65
/* } */
66
67
69
static
inline
aa_vec_4d
70
aa_vec_3d_ld(
const
double
src[3] ) {
71
aa_vec_2d d2 = __builtin_ia32_loadupd(src);
72
aa_vec_4d d4;
73
d4[0] = d2[0];
74
d4[1] = d2[1];
75
d4[2] = src[2];
76
return
d4;
77
}
78
79
80
#endif //AA_AMINO_ARCH_AVX_H