@@ -19,7 +19,7 @@ class HyperCPU::CPU::CPU_InstrImpl {
1919 static_assert (std::is_same_v<T1 , T2 >); // Locked by current CPU specification
2020
2121 cpu.ovf = AdditionWillOverflow (op1.deref <T1 >(), op2.deref <T2 >());
22- op1.deref <T1 >() = HyperALU::__hcpu_add (op1.deref <T1 >(), HyperCPU::bit_cast_from<T2 >(op2.ptr <T2 >()));
22+ op1.deref <T1 >() = HyperALU::__hcpu_add< T1 > (op1.deref <T1 >(), HyperCPU::bit_cast_from<T1 >(op2.ptr <T2 >()));
2323
2424 if (cpu.crf )
2525 ++op1.deref <T1 >();
@@ -34,7 +34,7 @@ class HyperCPU::CPU::CPU_InstrImpl {
3434 T1 val = cpu.mem_controller ->Read <T1 >(ptr);
3535 cpu.ovf = AdditionWillOverflow (op1.deref <T1 >(), val);
3636
37- op1.deref <T1 >() = HyperALU::__hcpu_add (op1.deref <T1 >(), val);
37+ op1.deref <T1 >() = HyperALU::__hcpu_add< T1 > (op1.deref <T1 >(), val);
3838
3939 if (cpu.crf )
4040 ++op1.deref <T1 >();
@@ -49,7 +49,7 @@ class HyperCPU::CPU::CPU_InstrImpl {
4949 T1 val = cpu.mem_controller ->Read <T1 >(ptr);
5050 cpu.ovf = AdditionWillOverflow (op1.deref <T1 >(), val);
5151
52- op1.deref <T1 >() = HyperALU::__hcpu_add (op1.deref <T1 >(), val);
52+ op1.deref <T1 >() = HyperALU::__hcpu_add< T1 > (op1.deref <T1 >(), val);
5353
5454 if (cpu.crf )
5555 ++op1.deref <T1 >();
@@ -62,26 +62,28 @@ class HyperCPU::CPU::CPU_InstrImpl {
6262
6363 T1 val = HyperCPU::bit_cast<T1 >(op2);
6464 cpu.ovf = AdditionWillOverflow (op1.deref <T1 >(), val);
65- op1.deref <T1 >() = HyperALU::__hcpu_add (op1.deref <T1 >(), val);
65+ op1.deref <T1 >() = HyperALU::__hcpu_add< T1 > (op1.deref <T1 >(), val);
6666
6767 if (cpu.crf )
6868 ++op1.deref <T1 >();
6969 }
7070};
7171
72+ /*
7273template<typename T1, typename TImpl>
7374[[gnu::always_inline]]
7475void ResolveOP2Mode(HyperCPU::Mode md2, HyperCPU::OperandContainer& op1, HyperCPU::OperandContainer& op2, HyperCPU::CPU& cpu) {
7576 TImpl impl;
7677
7778 switch (md2) {
78- case HyperCPU::Mode::b8: impl. template invoke <T1 , std::uint8_t >(op1, op2, cpu); break ;
79- case HyperCPU::Mode::b16: impl. template invoke <T1 , std::uint16_t >(op1, op2, cpu); break ;
80- case HyperCPU::Mode::b32: impl. template invoke <T1 , std::uint32_t >(op1, op2, cpu); break ;
81- case HyperCPU::Mode::b64: impl. template invoke <T1 , std::uint64_t >(op1, op2, cpu); break ;
79+ case HyperCPU::Mode::b8: CPU_InstrImpl:: template invoke<T1, std::uint8_t>(op1, op2, cpu); break;
80+ case HyperCPU::Mode::b16: CPU_InstrImpl:: template invoke<T1, std::uint16_t>(op1, op2, cpu); break;
81+ case HyperCPU::Mode::b32: CPU_InstrImpl:: template invoke<T1, std::uint32_t>(op1, op2, cpu); break;
82+ case HyperCPU::Mode::b64: CPU_InstrImpl:: template invoke<T1, std::uint64_t>(op1, op2, cpu); break;
8283 default: std::abort();
8384 }
8485}
86+ */
8587
8688void HyperCPU::CPU::ExecADC (const IInstruction& instr, OperandContainer op1, OperandContainer op2) {
8789 CPU_InstrImpl impl;
@@ -96,16 +98,16 @@ void HyperCPU::CPU::ExecADC(const IInstruction& instr, OperandContainer op1, Ope
9698 /* ADC R_R does not support different register sizes - we can call implementation directly */
9799 switch (instr.m_opcode_mode .md1 ) {
98100 case Mode::b8:
99- impl. __hcpu_adc_rr_impl <std::uint8_t , std::uint8_t >(op1, op2, *this );
101+ CPU_InstrImpl:: __hcpu_adc_rr_impl<std::uint8_t , std::uint8_t >(op1, op2, *this );
100102 break ;
101103 case Mode::b16:
102- impl. __hcpu_adc_rr_impl <std::uint16_t , std::uint16_t >(op1, op2, *this );
104+ CPU_InstrImpl:: __hcpu_adc_rr_impl<std::uint16_t , std::uint16_t >(op1, op2, *this );
103105 break ;
104106 case Mode::b32:
105- impl. __hcpu_adc_rr_impl <std::uint32_t , std::uint32_t >(op1, op2, *this );
107+ CPU_InstrImpl:: __hcpu_adc_rr_impl<std::uint32_t , std::uint32_t >(op1, op2, *this );
106108 break ;
107109 case Mode::b64:
108- impl. __hcpu_adc_rr_impl <std::uint64_t , std::uint64_t >(op1, op2, *this );
110+ CPU_InstrImpl:: __hcpu_adc_rr_impl<std::uint64_t , std::uint64_t >(op1, op2, *this );
109111 break ;
110112 }
111113 break ;
@@ -120,16 +122,16 @@ void HyperCPU::CPU::ExecADC(const IInstruction& instr, OperandContainer op1, Ope
120122 /* ADC R_RM does not support different register sizes - we can call implementation directly */
121123 switch (instr.m_opcode_mode .md1 ) {
122124 case Mode::b8:
123- impl. __hcpu_adc_rrm_impl <std::uint8_t , std::uint64_t >(op1, op2, *this );
125+ CPU_InstrImpl:: __hcpu_adc_rrm_impl<std::uint8_t , std::uint64_t >(op1, op2, *this );
124126 break ;
125127 case Mode::b16:
126- impl. __hcpu_adc_rrm_impl <std::uint16_t , std::uint64_t >(op1, op2, *this );
128+ CPU_InstrImpl:: __hcpu_adc_rrm_impl<std::uint16_t , std::uint64_t >(op1, op2, *this );
127129 break ;
128130 case Mode::b32:
129- impl. __hcpu_adc_rrm_impl <std::uint32_t , std::uint64_t >(op1, op2, *this );
131+ CPU_InstrImpl:: __hcpu_adc_rrm_impl<std::uint32_t , std::uint64_t >(op1, op2, *this );
130132 break ;
131133 case Mode::b64:
132- impl. __hcpu_adc_rrm_impl <std::uint64_t , std::uint64_t >(op1, op2, *this );
134+ CPU_InstrImpl:: __hcpu_adc_rrm_impl<std::uint64_t , std::uint64_t >(op1, op2, *this );
133135 break ;
134136 }
135137 break ;
@@ -144,16 +146,16 @@ void HyperCPU::CPU::ExecADC(const IInstruction& instr, OperandContainer op1, Ope
144146 /* ADC R_RM does not support different register sizes - we can call implementation directly */
145147 switch (instr.m_opcode_mode .md1 ) {
146148 case Mode::b8:
147- impl. __hcpu_adc_rm_impl <std::uint8_t , std::uint64_t >(op1, op2, *this );
149+ CPU_InstrImpl:: __hcpu_adc_rm_impl<std::uint8_t , std::uint64_t >(op1, op2, *this );
148150 break ;
149151 case Mode::b16:
150- impl. __hcpu_adc_rm_impl <std::uint16_t , std::uint64_t >(op1, op2, *this );
152+ CPU_InstrImpl:: __hcpu_adc_rm_impl<std::uint16_t , std::uint64_t >(op1, op2, *this );
151153 break ;
152154 case Mode::b32:
153- impl. __hcpu_adc_rm_impl <std::uint32_t , std::uint64_t >(op1, op2, *this );
155+ CPU_InstrImpl:: __hcpu_adc_rm_impl<std::uint32_t , std::uint64_t >(op1, op2, *this );
154156 break ;
155157 case Mode::b64:
156- impl. __hcpu_adc_rm_impl <std::uint64_t , std::uint64_t >(op1, op2, *this );
158+ CPU_InstrImpl:: __hcpu_adc_rm_impl<std::uint64_t , std::uint64_t >(op1, op2, *this );
157159 break ;
158160 }
159161 break ;
@@ -168,16 +170,16 @@ void HyperCPU::CPU::ExecADC(const IInstruction& instr, OperandContainer op1, Ope
168170 /* ADC R_RM does not support different register sizes - we can call implementation directly */
169171 switch (instr.m_opcode_mode .md1 ) {
170172 case Mode::b8:
171- impl. __hcpu_adc_rimm_impl <std::uint8_t , std::uint8_t >(op1, op2, *this );
173+ CPU_InstrImpl:: __hcpu_adc_rimm_impl<std::uint8_t , std::uint8_t >(op1, op2, *this );
172174 break ;
173175 case Mode::b16:
174- impl. __hcpu_adc_rimm_impl <std::uint16_t , std::uint16_t >(op1, op2, *this );
176+ CPU_InstrImpl:: __hcpu_adc_rimm_impl<std::uint16_t , std::uint16_t >(op1, op2, *this );
175177 break ;
176178 case Mode::b32:
177- impl. __hcpu_adc_rimm_impl <std::uint32_t , std::uint32_t >(op1, op2, *this );
179+ CPU_InstrImpl:: __hcpu_adc_rimm_impl<std::uint32_t , std::uint32_t >(op1, op2, *this );
178180 break ;
179181 case Mode::b64:
180- impl. __hcpu_adc_rimm_impl <std::uint64_t , std::uint64_t >(op1, op2, *this );
182+ CPU_InstrImpl:: __hcpu_adc_rimm_impl<std::uint64_t , std::uint64_t >(op1, op2, *this );
181183 break ;
182184 }
183185 break ;
0 commit comments