Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
6bf6c5f9
Commit
6bf6c5f9
authored
Nov 08, 2013
by
Davis King
Browse files
Added conversions from simd4f to simd4i.
parent
ca5eeb80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
dlib/simd/simd4f.h
dlib/simd/simd4f.h
+9
-0
No files found.
dlib/simd/simd4f.h
View file @
6bf6c5f9
...
@@ -31,6 +31,9 @@ namespace dlib
...
@@ -31,6 +31,9 @@ namespace dlib
operator
__m128
()
const
{
return
x
;
}
operator
__m128
()
const
{
return
x
;
}
// truncate to 32bit integers
operator
__m128i
()
const
{
return
_mm_cvttps_epi32
(
x
);
}
void
load_aligned
(
const
type
*
ptr
)
{
x
=
_mm_load_ps
(
ptr
);
}
void
load_aligned
(
const
type
*
ptr
)
{
x
=
_mm_load_ps
(
ptr
);
}
void
store_aligned
(
type
*
ptr
)
const
{
_mm_store_ps
(
ptr
,
x
);
}
void
store_aligned
(
type
*
ptr
)
const
{
_mm_store_ps
(
ptr
,
x
);
}
void
load
(
const
type
*
ptr
)
{
x
=
_mm_loadu_ps
(
ptr
);
}
void
load
(
const
type
*
ptr
)
{
x
=
_mm_loadu_ps
(
ptr
);
}
...
@@ -79,6 +82,12 @@ namespace dlib
...
@@ -79,6 +82,12 @@ namespace dlib
simd4f
(
float
r0
,
float
r1
,
float
r2
,
float
r3
)
{
x
[
0
]
=
r0
;
x
[
1
]
=
r1
;
x
[
2
]
=
r2
;
x
[
3
]
=
r3
;}
simd4f
(
float
r0
,
float
r1
,
float
r2
,
float
r3
)
{
x
[
0
]
=
r0
;
x
[
1
]
=
r1
;
x
[
2
]
=
r2
;
x
[
3
]
=
r3
;}
simd4f
(
const
simd4i
&
val
)
{
x
[
0
]
=
val
[
0
];
x
[
1
]
=
val
[
1
];
x
[
2
]
=
val
[
2
];
x
[
3
]
=
val
[
3
];}
simd4f
(
const
simd4i
&
val
)
{
x
[
0
]
=
val
[
0
];
x
[
1
]
=
val
[
1
];
x
[
2
]
=
val
[
2
];
x
[
3
]
=
val
[
3
];}
// truncate to 32bit integers
operator
simd4i
()
const
{
return
simd4i
((
int32
)
x
[
0
],
(
int32
)
x
[
1
],
(
int32
)
x
[
2
],
(
int32
)
x
[
3
]);
}
void
load_aligned
(
const
type
*
ptr
)
void
load_aligned
(
const
type
*
ptr
)
{
{
x
[
0
]
=
ptr
[
0
];
x
[
0
]
=
ptr
[
0
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment