mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-09 02:31:22 +00:00
Test lwzux.
This commit is contained in:
parent
33c31eb798
commit
3d48183753
@ -151,7 +151,15 @@ enum class Operation: uint8_t {
|
|||||||
fnabsx, fnegx, fnmaddx, fnmaddsx, fnmsubx, fnmsubsx, frspx, fsubx, fsubsx,
|
fnabsx, fnegx, fnmaddx, fnmaddsx, fnmsubx, fnmsubsx, frspx, fsubx, fsubsx,
|
||||||
icbi, isync, lbz, lbzu, lbzux, lbzx, lfd, lfdu, lfdux, lfdx, lfs, lfsu,
|
icbi, isync, lbz, lbzu, lbzux, lbzx, lfd, lfdu, lfdux, lfdx, lfs, lfsu,
|
||||||
lfsux, lfsx, lha, lhau, lhaux, lhax, lhbrx, lhz, lhzu, lhzux, lhzx, lmw,
|
lfsux, lfsx, lha, lhau, lhaux, lhax, lhbrx, lhz, lhzu, lhzux, lhzx, lmw,
|
||||||
lswi, lswx, lwarx, lwbrx, lwz, lwzu, lwzux,
|
lswi, lswx, lwarx, lwbrx, lwz, lwzu,
|
||||||
|
|
||||||
|
/// Load word and zero with Update Indexed.
|
||||||
|
///
|
||||||
|
/// rD() = [ rA()|0 + rB() ]; and rA() is set to the calculated address.
|
||||||
|
///
|
||||||
|
/// PowerPC defines rA=0 and rA=rD to be invalid forms; the MPC601
|
||||||
|
/// will suppress the update if rA=0 or rA=rD.
|
||||||
|
lwzux,
|
||||||
|
|
||||||
/// Load word and zero indexed.
|
/// Load word and zero indexed.
|
||||||
///
|
///
|
||||||
|
@ -19,6 +19,15 @@ using namespace InstructionSet::PowerPC;
|
|||||||
|
|
||||||
@implementation DingusdevPowerPCTests
|
@implementation DingusdevPowerPCTests
|
||||||
|
|
||||||
|
- (void)testABDInstruction:(Instruction)instruction columns:(NSArray<NSString *> *)columns testZero:(BOOL)testZero {
|
||||||
|
NSString *const rA = (instruction.rA() || !testZero) ? [NSString stringWithFormat:@"r%d", instruction.rA()] : @"0";
|
||||||
|
NSString *const rB = [NSString stringWithFormat:@"r%d", instruction.rB()];
|
||||||
|
NSString *const rD = [NSString stringWithFormat:@"r%d", instruction.rD()];
|
||||||
|
XCTAssertEqualObjects(rD, columns[3]);
|
||||||
|
XCTAssertEqualObjects(rA, columns[4]);
|
||||||
|
XCTAssertEqualObjects(rB, columns[5]);
|
||||||
|
}
|
||||||
|
|
||||||
- (void)testDecoding {
|
- (void)testDecoding {
|
||||||
NSData *const testData =
|
NSData *const testData =
|
||||||
[NSData dataWithContentsOfURL:
|
[NSData dataWithContentsOfURL:
|
||||||
@ -53,15 +62,15 @@ using namespace InstructionSet::PowerPC;
|
|||||||
NSAssert(FALSE, @"Didn't handle %@", line);
|
NSAssert(FALSE, @"Didn't handle %@", line);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Operation::lwzx: {
|
case Operation::lwzux:
|
||||||
|
XCTAssertEqualObjects(operation, @"lwzux");
|
||||||
|
[self testABDInstruction:instruction columns:columns testZero:YES];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Operation::lwzx:
|
||||||
XCTAssertEqualObjects(operation, @"lwzx");
|
XCTAssertEqualObjects(operation, @"lwzx");
|
||||||
NSString *const rA = instruction.rA() ? [NSString stringWithFormat:@"r%d", instruction.rA()] : @"0";
|
[self testABDInstruction:instruction columns:columns testZero:YES];
|
||||||
NSString *const rB = [NSString stringWithFormat:@"r%d", instruction.rB()];
|
break;
|
||||||
NSString *const rD = [NSString stringWithFormat:@"r%d", instruction.rD()];
|
|
||||||
XCTAssertEqualObjects(rD, columns[3]);
|
|
||||||
XCTAssertEqualObjects(rA, columns[4]);
|
|
||||||
XCTAssertEqualObjects(rB, columns[5]);
|
|
||||||
} break;
|
|
||||||
|
|
||||||
case Operation::bcx:
|
case Operation::bcx:
|
||||||
case Operation::bclrx:
|
case Operation::bclrx:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user