Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
5bc1cb4a
Commit
5bc1cb4a
authored
4 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
A few small changes until we're ready to go all-in on c++17 over-aligned allocation
parent
c2f3847f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/llmath/llmatrix4a.h
+23
-3
23 additions, 3 deletions
indra/llmath/llmatrix4a.h
indra/llmath/llsimdtypes.h
+0
-5
0 additions, 5 deletions
indra/llmath/llsimdtypes.h
indra/llmath/llvector4a.h
+43
-2
43 additions, 2 deletions
indra/llmath/llvector4a.h
with
66 additions
and
10 deletions
indra/llmath/llmatrix4a.h
+
23
−
3
View file @
5bc1cb4a
...
...
@@ -32,10 +32,10 @@
#include
"m4math.h"
#include
"m3math.h"
class
alignas
(
16
)
LLMatrix4a
LL_ALIGN_PREFIX
(
16
)
class
LLMatrix4a
{
public:
LL
Vector4a
mMatrix
[
4
]
;
LL
_ALIGN_PREFIX
(
16
)
LLVector4a
mMatrix
[
4
]
LL_ALIGN_POSTFIX
(
16
)
;
public:
enum
{
...
...
@@ -45,6 +45,26 @@ class alignas(16) LLMatrix4a
ROW_TRANS
};
void
*
operator
new
(
size_t
size
)
{
return
ll_aligned_malloc_16
(
size
);
}
void
*
operator
new
[](
size_t
size
)
{
return
ll_aligned_malloc_16
(
size
);
}
void
operator
delete
(
void
*
ptr
)
{
ll_aligned_free_16
(
ptr
);
}
void
operator
delete
[](
void
*
ptr
)
{
ll_aligned_free_16
(
ptr
);
}
LLMatrix4a
()
=
default
;
LLMatrix4a
(
const
LLQuad
&
q1
,
const
LLQuad
&
q2
,
const
LLQuad
&
q3
,
const
LLQuad
&
q4
)
{
...
...
@@ -767,7 +787,7 @@ class alignas(16) LLMatrix4a
return
_mm_movemask_epi8
(
_mm_castps_si128
(
_mm_and_ps
(
mask1
,
mask2
)))
==
0xFFFF
;
}
};
}
LL_ALIGN_POSTFIX
(
16
)
;
#ifndef SHOW_ASSERT
static_assert
(
std
::
is_trivial
<
LLMatrix4a
>::
value
,
"LLMatrix4a must be a trivial type"
);
...
...
This diff is collapsed.
Click to expand it.
indra/llmath/llsimdtypes.h
+
0
−
5
View file @
5bc1cb4a
...
...
@@ -66,11 +66,6 @@ class LLSimdScalar
mQ
=
_mm_set_ss
(
f
);
}
static
inline
LLSimdScalar
getZero
()
{
return
_mm_setzero_ps
();
}
inline
F32
getF32
()
const
;
inline
LLBool32
isApproximatelyEqual
(
const
LLSimdScalar
&
rhs
,
F32
tolerance
=
F_APPROXIMATELY_ZERO
)
const
;
...
...
This diff is collapsed.
Click to expand it.
indra/llmath/llvector4a.h
+
43
−
2
View file @
5bc1cb4a
...
...
@@ -94,6 +94,26 @@ struct alignas(16) LLVector4a
static
void
memcpyNonAliased16
(
F32
*
__restrict
dst
,
const
F32
*
__restrict
src
,
size_t
bytes
);
void
*
operator
new
(
size_t
size
)
{
return
ll_aligned_malloc_16
(
size
);
}
void
*
operator
new
[](
size_t
size
)
{
return
ll_aligned_malloc_16
(
size
);
}
void
operator
delete
(
void
*
ptr
)
{
ll_aligned_free_16
(
ptr
);
}
void
operator
delete
[](
void
*
ptr
)
{
ll_aligned_free_16
(
ptr
);
}
////////////////////////////////////
// CONSTRUCTORS
////////////////////////////////////
...
...
@@ -380,7 +400,8 @@ inline std::ostream& operator<<(std::ostream& s, const LLVector4a& v)
return
s
;
}
struct
alignas
(
16
)
LLIVector4a
LL_ALIGN_PREFIX
(
16
)
struct
LLIVector4a
{
friend
struct
LLVector4a
;
...
...
@@ -391,6 +412,26 @@ struct alignas(16) LLIVector4a
return
_mm_setzero_si128
();
}
void
*
operator
new
(
size_t
size
)
{
return
ll_aligned_malloc_16
(
size
);
}
void
*
operator
new
[](
size_t
size
)
{
return
ll_aligned_malloc_16
(
size
);
}
void
operator
delete
(
void
*
ptr
)
{
ll_aligned_free_16
(
ptr
);
}
void
operator
delete
[](
void
*
ptr
)
{
ll_aligned_free_16
(
ptr
);
}
////////////////////////////////////
// CONSTRUCTORS
////////////////////////////////////
...
...
@@ -498,7 +539,7 @@ struct alignas(16) LLIVector4a
}
LLIQuad
mQ
;
};
}
LL_ALIGN_POSTFIX
(
16
)
;
static_assert
(
std
::
is_trivial
<
LLIVector4a
>
{},
"LLIVector4a must be a trivial type"
);
static_assert
(
std
::
is_standard_layout
<
LLIVector4a
>
{},
"LLIVector4a must be a standard layout type"
);
...
...
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