foot/emulator/tests/srsh-instruction.cpp
shylie 6007426eb3
Some checks failed
Test / build (push) Failing after 4s
Add vcd waveform tracing
2026-03-25 01:43:20 -04:00

59 lines
980 B
C++

#include "test-common.h"
int main(int argc, char** argv)
{
// CNST
// dst - 0, Direct
// imm - 0x4567
//
// SRSH
// dst - 0, Direct
// a - 0, Direct
// b - 2, Immediate
{
foot::Emulator emu = run_instructions({ 0x00204567, 0x06200220 });
if (!check(0x4567 >> 2, emu.register_at(0)))
{
return 1;
}
}
// ARNG
// dst - 0, Direct
// a - 4, Immediate
//
// SRSH
// dst - 0, Direct
// a - 0, Direct
{
foot::Emulator emu = run_instructions({ 0x01200204, 0x06200220 });
if (!check((-2) >> 2, emu.register_at(0)))
{
return 1;
}
}
// CNST
// dst - 0, Direct
// imm - 0x8686
//
// CNST
// dst - 1, Direct
// imm - 0x1122
//
// SRSH - 4-bit SIMD
// dst - 0, Direct
// a - 0, Direct
// b - 1, Direct
{
foot::Emulator emu
= run_instructions({ 0x00208686, 0x00211122, 0x06A021A0 });
if (!check(0x4321, emu.register_at(0)))
{
return 1;
}
}
return 0;
}