2016-08-14 22:07:17 -04:00
|
|
|
/* Copyright holders: Sarah Walker
|
|
|
|
|
see COPYING for more details
|
|
|
|
|
*/
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_d8_a16(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_d8_a16[(fetchdat >> 3) & 0x1f](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_d8_a32(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_d8_a32[(fetchdat >> 3) & 0x1f](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_d9_a16(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_d9_a16[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_d9_a32(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_d9_a32[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_da_a16(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_da_a16[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_da_a32(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_da_a32[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_db_a16(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_db_a16[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_db_a32(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_db_a32[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_dc_a16(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_dc_a16[(fetchdat >> 3) & 0x1f](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_dc_a32(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_dc_a32[(fetchdat >> 3) & 0x1f](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_dd_a16(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_dd_a16[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_dd_a32(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_dd_a32[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_de_a16(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_de_a16[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_de_a32(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_de_a32[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_df_a16(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_df_a16[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
|
|
|
|
opESCAPE_df_a32(uint32_t fetchdat)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2025-04-22 09:13:38 +02:00
|
|
|
x87_op = ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
2022-11-19 10:40:32 -05:00
|
|
|
return x86_opcodes_df_a32[fetchdat & 0xff](fetchdat);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2022-11-19 10:40:32 -05:00
|
|
|
static int
|
2025-01-26 15:15:53 -05:00
|
|
|
opWAIT(UNUSED(uint32_t fetchdat))
|
2022-11-19 10:40:32 -05:00
|
|
|
{
|
|
|
|
|
if ((cr0 & 0xa) == 0xa) {
|
|
|
|
|
x86_int(7);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2023-04-29 18:56:57 +02:00
|
|
|
|
2023-05-07 00:24:57 +02:00
|
|
|
if (fpu_softfloat) {
|
2023-04-29 18:56:57 +02:00
|
|
|
if (fpu_state.swd & FPU_SW_Summary) {
|
2025-01-19 09:06:39 +01:00
|
|
|
if (cr0 & 0x20)
|
|
|
|
|
new_ne = 1;
|
2024-12-14 00:59:52 +01:00
|
|
|
else
|
|
|
|
|
picint(1 << 13);
|
|
|
|
|
return 1;
|
2023-04-29 18:56:57 +02:00
|
|
|
}
|
|
|
|
|
}
|
2022-11-19 10:40:32 -05:00
|
|
|
CLOCK_CYCLES(4);
|
|
|
|
|
return 0;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|