summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorLioncash <mai.iam2048@gmail.com>2023-12-12 19:21:33 -0500
committerLioncash <mai.iam2048@gmail.com>2023-12-13 13:02:51 -0500
commitbced5fac183b953d9ddd2f488c7ac3917eabee1a (patch)
treed138b17d9651da313899cb5eb5ba2bc536a178db /Source/Core/Common
parent7b57a4a37d7897fcc47412e32d0e9e280f59fe4c (diff)
Common/Crypto/AES: Resolve -Wignored-attributes warnings
The alias for __m128i is typically something like: typedef long long __m128i __attribute__((__vector_size__(16), __may_alias__)); and the part that ends up not getting preserved is the __may_alias__ attribute specifier. So, in order to preserve that, we can just use a wrapper struct, so the data type itself isn't being passed through the template.
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Crypto/AES.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/Core/Common/Crypto/AES.cpp b/Source/Core/Common/Crypto/AES.cpp
index 3fc9a80a56..272341ecca 100644
--- a/Source/Core/Common/Crypto/AES.cpp
+++ b/Source/Core/Common/Crypto/AES.cpp
@@ -250,7 +250,19 @@ public:
}
private:
- std::array<__m128i, NUM_ROUND_KEYS> round_keys;
+ // Ensures alignment specifiers are respected.
+ struct XmmReg
+ {
+ __m128i data;
+
+ XmmReg& operator=(const __m128i& m)
+ {
+ data = m;
+ return *this;
+ }
+ operator __m128i() const { return data; }
+ };
+ std::array<XmmReg, NUM_ROUND_KEYS> round_keys;
};
#endif