mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-10 01:59:02 +00:00
Arm64Emitter: Add additional assertions to BFI/UBFIZ
This commit is contained in:
parent
75d92ad628
commit
8aa2013a2d
1 changed files with 2 additions and 2 deletions
|
@ -1658,7 +1658,7 @@ void ARM64XEmitter::UBFM(ARM64Reg Rd, ARM64Reg Rn, u32 immr, u32 imms)
|
||||||
void ARM64XEmitter::BFI(ARM64Reg Rd, ARM64Reg Rn, u32 lsb, u32 width)
|
void ARM64XEmitter::BFI(ARM64Reg Rd, ARM64Reg Rn, u32 lsb, u32 width)
|
||||||
{
|
{
|
||||||
u32 size = Is64Bit(Rn) ? 64 : 32;
|
u32 size = Is64Bit(Rn) ? 64 : 32;
|
||||||
ASSERT_MSG(DYNA_REC, (lsb + width) <= size,
|
ASSERT_MSG(DYNA_REC, lsb < size && width >= 1 && width <= size - lsb,
|
||||||
"%s passed lsb %d and width %d which is greater than the register size!", __func__,
|
"%s passed lsb %d and width %d which is greater than the register size!", __func__,
|
||||||
lsb, width);
|
lsb, width);
|
||||||
BFM(Rd, Rn, (size - lsb) % size, width - 1);
|
BFM(Rd, Rn, (size - lsb) % size, width - 1);
|
||||||
|
@ -1674,7 +1674,7 @@ void ARM64XEmitter::BFXIL(ARM64Reg Rd, ARM64Reg Rn, u32 lsb, u32 width)
|
||||||
void ARM64XEmitter::UBFIZ(ARM64Reg Rd, ARM64Reg Rn, u32 lsb, u32 width)
|
void ARM64XEmitter::UBFIZ(ARM64Reg Rd, ARM64Reg Rn, u32 lsb, u32 width)
|
||||||
{
|
{
|
||||||
u32 size = Is64Bit(Rn) ? 64 : 32;
|
u32 size = Is64Bit(Rn) ? 64 : 32;
|
||||||
ASSERT_MSG(DYNA_REC, (lsb + width) <= size,
|
ASSERT_MSG(DYNA_REC, lsb < size && width >= 1 && width <= size - lsb,
|
||||||
"%s passed lsb %d and width %d which is greater than the register size!", __func__,
|
"%s passed lsb %d and width %d which is greater than the register size!", __func__,
|
||||||
lsb, width);
|
lsb, width);
|
||||||
UBFM(Rd, Rn, (size - lsb) % size, width - 1);
|
UBFM(Rd, Rn, (size - lsb) % size, width - 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue