1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-29 12:50:28 +00:00

Test tw, twi.

This commit is contained in:
Thomas Harte 2022-04-02 10:09:35 -04:00
parent d5967f7834
commit 20b4736a1f

View File

@ -263,6 +263,31 @@ NSString *condition(uint32_t code) {
NSAssert(FALSE, @"Didn't handle rlwinmx %@", line); NSAssert(FALSE, @"Didn't handle rlwinmx %@", line);
} break; } break;
case Operation::tw:
AssertEqualOperationName(operation, @"tw");
XCTAssertEqual([columns[3] intValue], instruction.to());
AssertEqualR(columns[4], instruction.rA());
AssertEqualR(columns[5], instruction.rB());
break;
case Operation::twi:
AssertEqualOperationName(operation, @"twi");
XCTAssertEqual([columns[3] intValue], instruction.to());
AssertEqualR(columns[4], instruction.rA());
XCTAssertEqual([columns[5] hexInt], instruction.simm());
break;
#define NoArg(x) \
case Operation::x: \
AssertEqualOperationName(operation, @#x); \
break;
NoArg(isync);
NoArg(sync);
NoArg(eieio);
#undef NoArg
#define Shift(x) \ #define Shift(x) \
case Operation::x: \ case Operation::x: \
AssertEqualOperationNameE(operation, @#x, instruction); \ AssertEqualOperationNameE(operation, @#x, instruction); \
@ -535,16 +560,6 @@ NSString *condition(uint32_t code) {
if(addConditionToOperand) { if(addConditionToOperand) {
expectedCR = condition(instruction.bi()); expectedCR = condition(instruction.bi());
// NSString *suffix;
// switch(Condition(instruction.bi() & 3)) {
// default: break;
// case Condition::Negative: suffix = @"lt"; break;
// case Condition::Positive: suffix = @"gt"; break;
// case Condition::Zero: suffix = @"eq"; break;
// case Condition::SummaryOverflow: suffix = @"so"; break;
// }
//
// expectedCR = [NSString stringWithFormat:@"4*cr%d+%@", instruction.bi() >> 2, suffix];
} else { } else {
expectedCR = [NSString stringWithFormat:@"cr%d", instruction.bi() >> 2]; expectedCR = [NSString stringWithFormat:@"cr%d", instruction.bi() >> 2];
} }