2022-11-15 15:36:04 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright (c) 2022 merryhime <https://mary.rs>
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
void BFC(WReg wd, Imm<5> lsb, Imm<5> width)
|
|
|
|
{
|
|
|
|
if (width.value() == 0 || width.value() > (32 - lsb.value()))
|
2023-04-27 22:20:30 +01:00
|
|
|
throw OaknutException{ExceptionType::InvalidBitWidth};
|
2024-01-28 14:56:59 +00:00
|
|
|
emit<"0011001100rrrrrrssssss11111ddddd", "d", "r", "s">(wd, (~lsb.value() + 1) & 31, width.value() - 1);
|
2022-11-15 15:36:04 +00:00
|
|
|
}
|
|
|
|
void BFC(XReg xd, Imm<6> lsb, Imm<6> width)
|
|
|
|
{
|
|
|
|
if (width.value() == 0 || width.value() > (64 - lsb.value()))
|
2023-04-27 22:20:30 +01:00
|
|
|
throw OaknutException{ExceptionType::InvalidBitWidth};
|
2024-01-28 14:56:59 +00:00
|
|
|
emit<"1011001101rrrrrrssssss11111ddddd", "d", "r", "s">(xd, (~lsb.value() + 1) & 63, width.value() - 1);
|
2022-11-15 15:36:04 +00:00
|
|
|
}
|
|
|
|
void ESB()
|
|
|
|
{
|
|
|
|
emit<"11010101000000110010001000011111">();
|
|
|
|
}
|
|
|
|
void PSB()
|
|
|
|
{
|
|
|
|
emit<"11010101000000110010001000111111">();
|
|
|
|
}
|