Skip to content

Commit

Permalink
Cleanup available CPU options
Browse files Browse the repository at this point in the history
  • Loading branch information
FeralChild64 committed Feb 28, 2024
1 parent ddc25f7 commit 4e1f1e2
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 59 deletions.
2 changes: 0 additions & 2 deletions include/fpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ struct FPU_rec {
bool use_regs_memcpy[9] = {};
#endif
FPU_P_Reg p_regs[9] = {};
#if C_MMX
MMX_reg mmx_regs[8] = {};
#endif
FPU_Tag tags[9] = {};
uint16_t cw = 0;
uint16_t cw_mask_all = 0;
Expand Down
4 changes: 0 additions & 4 deletions include/mmx.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#ifndef DOSBOX_MMX_H
#define DOSBOX_MMX_H

#if C_MMX

typedef union {
uint64_t q;

Expand Down Expand Up @@ -83,5 +81,3 @@ extern MMX_reg* lookupRMregMM[256];
void setFPUTagEmpty();

#endif

#endif
1 change: 0 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@ conf_data.set10('C_MT32EMU', get_option('use_mt32emu'))
conf_data.set10('C_TRACY', get_option('tracy'))
conf_data.set10('C_FPU', true)
conf_data.set10('C_FPU_X86', host_machine.cpu_family() in ['x86', 'x86_64'])
conf_data.set10('C_MMX', get_option('emulate_mmx'))

if get_option('enable_debugger') != 'none'
conf_data.set10('C_DEBUG', true)
Expand Down
7 changes: 0 additions & 7 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ option(
description: 'Enable profiling using Tracy',
)

option(
'emulate_mmx',
type: 'boolean',
value: true,
description: 'Enable Pentium MMX CPU emulation',
)

# This option exists only for rare situations when Linux developer cannot
# install ALSA library headers on their machine.
#
Expand Down
3 changes: 0 additions & 3 deletions src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@
// Define to 1 to use fpu core implemented in x86 assembler
#mesondefine C_FPU_X86

// Define to 1 to enable MMX emulation
#mesondefine C_MMX

// TODO Define to 1 to use inlined memory functions in cpu core
#define C_CORE_INLINE 1

Expand Down
3 changes: 0 additions & 3 deletions src/cpu/core_dyn_x86/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
#include "inout.h"

#define X86_INLINED_MEMACCESS

#if C_MMX
#define X86_DYNREC_MMX_ENABLED
#endif

enum REP_Type {
REP_NONE=0,REP_NZ,REP_Z
Expand Down
4 changes: 0 additions & 4 deletions src/cpu/core_normal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
*/
#include "dosbox.h"

#if C_MMX
// Needed for std::isnan in simde
#include <cmath>
#endif

#include "callback.h"
#include "cpu.h"
Expand All @@ -34,9 +32,7 @@
#include "pic.h"
#include "tracy.h"

#if C_MMX
#include "simde/x86/mmx.h"
#endif

#if C_DEBUG
#include "debug.h"
Expand Down
2 changes: 0 additions & 2 deletions src/cpu/core_normal/prefix_0f.h
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,6 @@
if (CPU_ArchitectureType<ArchitectureType::Intel486OldSlow) goto illegal_opcode;
BSWAPW(reg_di);break;

#if C_MMX
#define CASE_0F_MMX(x) CASE_0F_W(x)
#include "prefix_0f_mmx.h"
#undef CASE_0F_MMX
#endif
2 changes: 0 additions & 2 deletions src/cpu/core_normal/prefix_66_0f.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,6 @@
if (CPU_ArchitectureType<ArchitectureType::Intel486OldSlow) goto illegal_opcode;
BSWAPD(reg_edi);break;

#if C_MMX
#define CASE_0F_MMX(x) CASE_0F_D(x)
#include "prefix_0f_mmx.h"
#undef CASE_0F_MMX
#endif
4 changes: 0 additions & 4 deletions src/cpu/core_prefetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@

#include <cstdio>

#if C_MMX
// Needed for std::isnan in simde
#include <cmath>
#endif

#include "callback.h"
#include "cpu.h"
Expand All @@ -35,9 +33,7 @@
#include "paging.h"
#include "pic.h"

#if C_MMX
#include "simde/x86/mmx.h"
#endif

#if C_DEBUG
#include "debug.h"
Expand Down
4 changes: 0 additions & 4 deletions src/cpu/core_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
*/
#include "dosbox.h"

#if C_MMX
// Needed for std::isnan in simde
#include <cmath>
#endif

#include "callback.h"
#include "cpu.h"
Expand All @@ -34,9 +32,7 @@
#include "pic.h"
#include "tracy.h"

#if C_MMX
#include "simde/x86/mmx.h"
#endif

#if C_DEBUG
#include "debug.h"
Expand Down
10 changes: 4 additions & 6 deletions src/cpu/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2057,13 +2057,11 @@ bool CPU_CPUID(void) {
#endif
reg_ebx = 0; // Not supported
reg_ecx = 0; // No features
#if C_MMX
} else if (CPU_ArchitectureType == ArchitectureType::PentiumMmx) {
reg_eax = 0x543; // Intel Pentium MMX
reg_ebx = 0; // Not supported
reg_ecx = 0; // No features
reg_edx = 0x00800011; // FPU + Time Stamp Counter (RDTSC) + MMX
#endif
} else {
return false;
}
Expand Down Expand Up @@ -2381,7 +2379,7 @@ class CPU final : public Module_base {
std::string cputype(section->Get_string("cputype"));
if (cputype == "auto") {
CPU_ArchitectureType = ArchitectureType::Mixed;
} else if (cputype == "386") {
} else if (cputype == "386_fast") {
CPU_ArchitectureType = ArchitectureType::Intel386Fast;
} else if (cputype == "386_prefetch") {
CPU_ArchitectureType = ArchitectureType::Intel386Fast;
Expand All @@ -2395,9 +2393,9 @@ class CPU final : public Module_base {
} else {
E_Exit("prefetch queue emulation requires the normal core setting.");
}
} else if (cputype == "386_slow") {
} else if (cputype == "386") {
CPU_ArchitectureType = ArchitectureType::Intel386Slow;
} else if (cputype == "486_slow") {
} else if (cputype == "486") {
CPU_ArchitectureType = ArchitectureType::Intel486OldSlow;
} else if (cputype == "486_prefetch") {
CPU_ArchitectureType = ArchitectureType::Intel486NewSlow;
Expand All @@ -2411,7 +2409,7 @@ class CPU final : public Module_base {
} else {
E_Exit("prefetch queue emulation requires the normal core setting.");
}
} else if (cputype == "pentium_slow") {
} else if (cputype == "pentium") {
CPU_ArchitectureType = ArchitectureType::Pentium;
} else if (cputype == "pentium_mmx") {
CPU_ArchitectureType = ArchitectureType::PentiumMmx;
Expand Down
8 changes: 0 additions & 8 deletions src/cpu/mmx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
#include "mem.h"
#include "mmx.h"

#if C_MMX

#ifndef C_FPU
#error "MMX emulation requires FPU!"
#endif

MMX_reg* reg_mmx[8] = {
&fpu.mmx_regs[0],
&fpu.mmx_regs[1],
Expand Down Expand Up @@ -126,5 +120,3 @@ void setFPUTagEmpty()
fpu.tags[7] = TAG_Empty;
fpu.tags[8] = TAG_Valid; // is only used by us
}

#endif
15 changes: 9 additions & 6 deletions src/dosbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,18 @@ void DOSBOX_Init()
pstring->Set_help("CPU core used in emulation ('auto' by default). 'auto' will switch to dynamic\n"
"if available and appropriate.");

const char* cputype_values[] = { "auto", "386", "386_slow", "486_slow", "pentium_slow",
#if C_MMX
"pentium_mmx",
#endif
"386_prefetch", nullptr};
const char* cputype_values[] = { "auto", "386", "386_fast", "386_prefetch",
"486", "pentium", "pentium_mmx",
nullptr };
pstring = secprop->Add_string("cputype", always, "auto");
pstring->Set_values(cputype_values);
pstring->Set_help(
"CPU type used in emulation ('auto' by default). 'auto' is the fastest choice.");
"CPU type used in emulation ('auto' by default). 'auto' is the fastest choice.\n"
"Prefetch variant emulates the prefetch queue and requires the 'normal' core.");
pstring->SetDeprecatedWithAlternateValue("386_slow", "386");
pstring->SetDeprecatedWithAlternateValue("486_slow", "486");
pstring->SetDeprecatedWithAlternateValue("486_prefetch", "486");
pstring->SetDeprecatedWithAlternateValue("pentium_slow", "pentium");

pmulti_remain = secprop->AddMultiValRemain("cycles", always, " ");
pmulti_remain->Set_help(
Expand Down
3 changes: 0 additions & 3 deletions src/platform/visualc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@
/* Define to 1 to use x86 assembly fpu core. Requires Clang toolchain for x64 */
#define C_FPU_X86 1

// Define to 1 to enable MMX emulation
#define C_MMX 1

/* Define to 1 to use a unaligned memory access */
#define C_UNALIGNED_MEMORY 1

Expand Down

0 comments on commit 4e1f1e2

Please sign in to comment.