mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-09 07:58:16 +01:00
imm: compiler bug: MSVC 19.12 with /permissive- flag doesn't support fold expressions
This commit is contained in:
parent
b34c6616d4
commit
26da149639
2 changed files with 31 additions and 2 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include "common/assert.h"
|
||||
#include "common/bit_util.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/math_util.h"
|
||||
|
||||
namespace Dynarmic {
|
||||
namespace A64 {
|
||||
|
|
@ -85,13 +86,13 @@ bool operator!=(const Imm<bit_size>& a, u32 b) {
|
|||
* This is equivalent to a:b:...:z in ASL.
|
||||
*/
|
||||
template <size_t first_bit_size, size_t ...rest_bit_sizes>
|
||||
auto concatenate(Imm<first_bit_size> first, Imm<rest_bit_sizes> ...rest) -> Imm<(first_bit_size + ... + rest_bit_sizes)> {
|
||||
auto concatenate(Imm<first_bit_size> first, Imm<rest_bit_sizes> ...rest) {
|
||||
if constexpr (sizeof...(rest) == 0) {
|
||||
return first;
|
||||
} else {
|
||||
const auto concat_rest = concatenate(rest...);
|
||||
const u32 value = (first.ZeroExtend() << concat_rest.bit_size) | concat_rest.ZeroExtend();
|
||||
return Imm<(first_bit_size + ... + rest_bit_sizes)>{value};
|
||||
return Imm<Common::Sum(first_bit_size, rest_bit_sizes...)>{value};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue