From 1f19141746c0edc881a21120e171bfee4fb3c25b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 11 Oct 2022 16:19:47 -0400 Subject: [PATCH] Eliminate `BiggerInt`. --- .../Implementation/PerformImplementation.hpp | 12 ----------- .../68000ComparativeTests.mm | 21 ++++++++++++------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/InstructionSets/M68k/Implementation/PerformImplementation.hpp b/InstructionSets/M68k/Implementation/PerformImplementation.hpp index 9452acaa1..b2b3cf090 100644 --- a/InstructionSets/M68k/Implementation/PerformImplementation.hpp +++ b/InstructionSets/M68k/Implementation/PerformImplementation.hpp @@ -22,18 +22,6 @@ namespace M68k { namespace Primitive { -/// Provides a type alias, @c type, which is an unsigned int bigger than @c IntT. -template struct BiggerInt {}; -template <> struct BiggerInt { - using type = uint16_t; -}; -template <> struct BiggerInt { - using type = uint32_t; -}; -template <> struct BiggerInt { - using type = uint64_t; -}; - /// @returns An int of type @c IntT with only the most-significant bit set. template constexpr IntT top_bit() { static_assert(!std::numeric_limits::is_signed); diff --git a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm index 94c6cddce..47b30b9b3 100644 --- a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm @@ -307,7 +307,8 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler { if(!address || !value) break; XCTAssertEqual(test68000->ram[address.integerValue ^ 1], value.integerValue, @"%@: Memory at location %@ inconsistent", name, address); - if(test68000->ram[address.integerValue ^ 1] != value.integerValue) [_failures addObject:name]; + if(test68000->ram[address.integerValue ^ 1] != value.integerValue) + [_failures addObject:name]; } // Consider collating extra detail. @@ -359,7 +360,8 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler { NSNumber *const value = [enumerator nextObject]; if(!address || !value) break; - if(_testExecutor->ram[address.integerValue] != value.integerValue) [_failures addObject:name]; + if(_testExecutor->ram[address.integerValue] != value.integerValue) + [_failures addObject:name]; } // If this test is now in the failures set, add the corresponding opcode for @@ -425,12 +427,17 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler { const NSString *dX = [@"d" stringByAppendingFormat:@"%d", c]; const NSString *aX = [@"a" stringByAppendingFormat:@"%d", c]; - if(registers.data[c] != [finalState[dX] integerValue]) [_failures addObject:name]; - if(c < 7 && registers.address[c] != [finalState[aX] integerValue]) [_failures addObject:name]; + if(registers.data[c] != [finalState[dX] integerValue]) + [_failures addObject:name]; + if(c < 7 && registers.address[c] != [finalState[aX] integerValue]) + [_failures addObject:name]; } - if(registers.supervisor_stack_pointer != [finalState[@"a7"] integerValue]) [_failures addObject:name]; - if(registers.user_stack_pointer != [finalState[@"usp"] integerValue]) [_failures addObject:name]; - if(registers.program_counter + pcOffset != [finalState[@"pc"] integerValue]) [_failures addObject:name]; + if(registers.supervisor_stack_pointer != [finalState[@"a7"] integerValue]) + [_failures addObject:name]; + if(registers.user_stack_pointer != [finalState[@"usp"] integerValue]) + [_failures addObject:name]; + if(registers.program_counter + pcOffset != [finalState[@"pc"] integerValue]) + [_failures addObject:name]; const uint16_t correctSR = [finalState[@"sr"] integerValue]; if(registers.status != correctSR) {