1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

Resolve REPNE and whitespace issues.

This commit is contained in:
Thomas Harte 2023-09-28 15:41:57 -04:00
parent 6936cf1819
commit 245919e67d
2 changed files with 6 additions and 4 deletions

View File

@ -526,6 +526,8 @@ constexpr bool supports(Operation operation, Repetition repetition) {
case Operation::OUTS:
return repetition == Repetition::RepE;
case Operation::Invalid: // Retain context here; it's used as an intermediate
// state sometimes.
case Operation::CMPS:
case Operation::LODS:
case Operation::MOVS:

View File

@ -146,7 +146,7 @@ std::string to_string(
- (NSArray<NSString *> *)testFiles {
NSString *path = [NSString stringWithUTF8String:TestSuiteHome];
NSSet *allowList = [NSSet setWithArray:@[
// @"E4.json.gz",
// @"F6.7.json.gz",
]];
// Unofficial opcodes; ignored for now.
@ -283,7 +283,7 @@ std::string to_string(
break;
}
return [NSString stringWithUTF8String:operation.c_str()];
return [[NSString stringWithUTF8String:operation.c_str()] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
}
- (bool)applyDecodingTest:(NSDictionary *)test file:(NSString *)file {
@ -346,7 +346,7 @@ std::string to_string(
// Also, the decoder treats INT3 and INT 3 as the same thing. So allow for a meshing of those.
int adjustment = 7;
while(!isEqual && adjustment) {
NSString *alteredName = test[@"name"];
NSString *alteredName = [test[@"name"] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
if(adjustment & 4) {
alteredName = [alteredName stringByReplacingOccurrencesOfString:@"bp+si" withString:@"bp+di"];
@ -355,7 +355,7 @@ std::string to_string(
alteredName = [alteredName stringByReplacingOccurrencesOfString:@"shl" withString:@"sal"];
}
if(adjustment & 1) {
alteredName = [alteredName stringByReplacingOccurrencesOfString:@"int3 " withString:@"int 03h"];
alteredName = [alteredName stringByReplacingOccurrencesOfString:@"int3" withString:@"int 03h"];
}
isEqual = compare_decoding(alteredName);