util: prevent optimizer from removing endian-swapped writes
This commit is contained in:
1 parent
a975689c59
commit
36bdb83cfc
1 file changed
+2
-2
@@ -144,12 +144,12 @@ namespace ams::util {
|
|||||||
|
|
||||||
template<std::integral T>
|
template<std::integral T>
|
||||||
constexpr ALWAYS_INLINE void StoreBigEndian(T *ptr, T val) {
|
constexpr ALWAYS_INLINE void StoreBigEndian(T *ptr, T val) {
|
||||||
*ptr = ConvertToBigEndian<T>(val);
|
*static_cast<volatile T *>(ptr) = ConvertToBigEndian<T>(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<std::integral T>
|
template<std::integral T>
|
||||||
constexpr ALWAYS_INLINE void StoreLittleEndian(T *ptr, T val) {
|
constexpr ALWAYS_INLINE void StoreLittleEndian(T *ptr, T val) {
|
||||||
*ptr = ConvertToLittleEndian<T>(val);
|
*static_cast<volatile T *>(ptr) = ConvertToLittleEndian<T>(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user