another whitespace cleanup by Sebastien

This commit is contained in:
Stanislav Shwartsman 2008-02-05 22:33:35 +00:00
parent fb0ce45d28
commit eebd96e2d7
48 changed files with 1092 additions and 1092 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: dbg_main.cc,v 1.110 2008-01-17 15:39:45 sshwarts Exp $
// $Id: dbg_main.cc,v 1.111 2008-02-05 22:33:33 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -168,7 +168,7 @@ int bx_dbg_main(void)
dbg_cpu_list = (bx_list_c*) SIM->get_param("cpu0", SIM->get_bochs_root());
// Open debugger log file if needed
if ((strlen(SIM->get_param_string(BXPN_DEBUGGER_LOG_FILENAME)->getptr()) > 0)
if ((strlen(SIM->get_param_string(BXPN_DEBUGGER_LOG_FILENAME)->getptr()) > 0)
&& (strcmp(SIM->get_param_string(BXPN_DEBUGGER_LOG_FILENAME)->getptr(), "-") != 0)) {
debugger_log = fopen(SIM->get_param_string(BXPN_DEBUGGER_LOG_FILENAME)->getptr(), "w");
if (!debugger_log) {
@ -467,7 +467,7 @@ void bx_dbg_exception(unsigned cpu, Bit8u vector, Bit16u error_code)
{
if (BX_CPU(dbg_cpu)->trace || bx_dbg.exceptions)
{
dbg_printf("CPU %d: Exception 0x%02x occured (error_code=0x%04x)\n",
dbg_printf("CPU %d: Exception 0x%02x occured (error_code=0x%04x)\n",
cpu, vector, error_code);
}
}
@ -476,7 +476,7 @@ void bx_dbg_interrupt(unsigned cpu, Bit8u vector, Bit16u error_code)
{
if (BX_CPU(dbg_cpu)->trace || bx_dbg.interrupts)
{
dbg_printf("CPU %d: Interrupt 0x%02x occured (error_code=0x%04x)\n",
dbg_printf("CPU %d: Interrupt 0x%02x occured (error_code=0x%04x)\n",
cpu, vector, error_code);
}
}
@ -758,14 +758,14 @@ void bx_dbg_quit_command(void)
void bx_dbg_trace_command(bx_bool enable)
{
BX_CPU(dbg_cpu)->trace = enable;
dbg_printf("Tracing %s for %s\n", enable ? "enabled" : "disabled",
dbg_printf("Tracing %s for %s\n", enable ? "enabled" : "disabled",
BX_CPU(dbg_cpu)->name);
}
void bx_dbg_trace_reg_command(bx_bool enable)
{
BX_CPU(dbg_cpu)->trace_reg = enable;
dbg_printf("Register-Tracing %s for %s\n", enable ? "enabled" : "disabled",
dbg_printf("Register-Tracing %s for %s\n", enable ? "enabled" : "disabled",
BX_CPU(dbg_cpu)->name);
}
@ -942,7 +942,7 @@ void bx_dbg_modebp_command()
{
BX_CPU(dbg_cpu)->dbg_cpu_mode = BX_CPU(dbg_cpu)->get_cpu_mode();
BX_CPU(dbg_cpu)->mode_break = !BX_CPU(dbg_cpu)->mode_break;
dbg_printf(" mode switch break %s\n",
dbg_printf(" mode switch break %s\n",
BX_CPU(dbg_cpu)->mode_break ? "enabled" : "disabled");
}
@ -1234,7 +1234,7 @@ void bx_dbg_show_param_command(char *param)
}
// return non zero to cause a stop
int bx_dbg_show_symbolic(void)
int bx_dbg_show_symbolic(void)
{
static unsigned last_cpu_mode = 0;
static bx_phy_address last_cr3 = 0;
@ -1242,14 +1242,14 @@ int bx_dbg_show_symbolic(void)
/* modes & address spaces */
if (dbg_show_mask & BX_DBG_SHOW_MODE) {
if(BX_CPU(dbg_cpu)->get_cpu_mode() != last_cpu_mode) {
dbg_printf (FMT_TICK ": switched from '%s' to '%s'\n",
dbg_printf (FMT_TICK ": switched from '%s' to '%s'\n",
bx_pc_system.time_ticks(),
cpu_mode_string(last_cpu_mode),
cpu_mode_string(BX_CPU(dbg_cpu)->get_cpu_mode()));
}
if(last_cr3 != BX_CPU(dbg_cpu)->cr3)
dbg_printf(FMT_TICK ": address space switched. CR3: 0x08x\n",
dbg_printf(FMT_TICK ": address space switched. CR3: 0x08x\n",
bx_pc_system.time_ticks(), BX_CPU(dbg_cpu)->cr3);
}
@ -1263,7 +1263,7 @@ int bx_dbg_show_symbolic(void)
dbg_printf("\n");
}
}
if (dbg_show_mask & BX_DBG_SHOW_EXTINT) {
if((BX_CPU(dbg_cpu)->show_flag & Flag_intsig) && !(BX_CPU(dbg_cpu)->show_flag & Flag_softint)) {
dbg_printf(FMT_TICK ": exception (not softint) ", bx_pc_system.time_ticks());
@ -1322,7 +1322,7 @@ void bx_dbg_print_stack_command(unsigned nwords)
linear_sp = BX_CPU(dbg_cpu)->get_reg64(BX_64BIT_REG_RSP);
len = 8;
}
else
else
#endif
{
if (BX_CPU(dbg_cpu)->sregs[BX_SEG_REG_SS].cache.u.segment.d_b) {
@ -1343,20 +1343,20 @@ void bx_dbg_print_stack_command(unsigned nwords)
if (! bx_dbg_read_linear(dbg_cpu, linear_sp, len, buf)) break;
#if BX_SUPPORT_X86_64
if (len == 8) {
dbg_printf(" | STACK 0x%08x%08x [0x%08x:0x%08x]\n",
dbg_printf(" | STACK 0x%08x%08x [0x%08x:0x%08x]\n",
GET32H(linear_sp), GET32L(linear_sp),
(unsigned) conv_4xBit8u_to_Bit32u(buf+4),
(unsigned) conv_4xBit8u_to_Bit32u(buf+4),
(unsigned) conv_4xBit8u_to_Bit32u(buf));
}
else
#endif
{
if (len == 4) {
dbg_printf(" | STACK 0x%08x [0x%08x]\n",
dbg_printf(" | STACK 0x%08x [0x%08x]\n",
(unsigned) linear_sp, (unsigned) conv_4xBit8u_to_Bit32u(buf));
}
else {
dbg_printf(" | STACK 0x%04x [0x%04x]\n",
dbg_printf(" | STACK 0x%04x [0x%04x]\n",
(unsigned) linear_sp, (unsigned) conv_4xBit8u_to_Bit32u(buf));
}
}
@ -1452,7 +1452,7 @@ one_more:
// cpu_loop exits so that another processor can be simulated
// for a few cycles. With a single processor, the quantum
// setting should have no effect, although a low setting does
// lead to poor performance because cpu_loop is returning and
// lead to poor performance because cpu_loop is returning and
// getting called again, over and over.
#define BX_DBG_DEFAULT_ICOUNT_QUANTUM 5
@ -1495,7 +1495,7 @@ one_more:
if (BX_CPU(cpu)->guard_found.icount > max_executed)
max_executed = BX_CPU(cpu)->guard_found.icount;
}
// potential deadlock if all processors are halted. Then
// potential deadlock if all processors are halted. Then
// max_executed will be 0, tick will be incremented by zero, and
// there will never be a timed event to wake them up. To avoid this,
// always tick by a minimum of 1.
@ -1574,7 +1574,7 @@ void bx_dbg_disassemble_current(int which_cpu, int print_time)
{
unsigned ilen = bx_disassemble.disasm(BX_CPU(which_cpu)->guard_found.is_32bit_code,
BX_CPU(which_cpu)->guard_found.is_64bit_code,
BX_CPU(which_cpu)->get_segment_base(BX_SEG_REG_CS),
BX_CPU(which_cpu)->get_segment_base(BX_SEG_REG_CS),
BX_CPU(which_cpu)->guard_found.eip, bx_disasm_ibuf, bx_disasm_tbuf);
// Note: it would be nice to display only the modified registers here, the easy
@ -1590,18 +1590,18 @@ void bx_dbg_disassemble_current(int which_cpu, int print_time)
dbg_printf("(%u) ", which_cpu);
if (BX_CPU(which_cpu)->protected_mode()) {
dbg_printf("[0x%08x] %04x:" FMT_ADDRX " (%s): ",
dbg_printf("[0x%08x] %04x:" FMT_ADDRX " (%s): ",
phy, BX_CPU(which_cpu)->guard_found.cs,
BX_CPU(which_cpu)->guard_found.eip,
bx_dbg_symbolic_address((BX_CPU(which_cpu)->cr3) >> 12,
BX_CPU(which_cpu)->guard_found.eip,
bx_dbg_symbolic_address((BX_CPU(which_cpu)->cr3) >> 12,
BX_CPU(which_cpu)->guard_found.eip,
BX_CPU(which_cpu)->get_segment_base(BX_SEG_REG_CS)));
}
else { // Real & V86 mode
dbg_printf("[0x%08x] %04x:%04x (%s): ",
dbg_printf("[0x%08x] %04x:%04x (%s): ",
phy, BX_CPU(which_cpu)->guard_found.cs,
(unsigned) BX_CPU(which_cpu)->guard_found.eip,
bx_dbg_symbolic_address_16bit(BX_CPU(which_cpu)->guard_found.eip,
bx_dbg_symbolic_address_16bit(BX_CPU(which_cpu)->guard_found.eip,
BX_CPU(which_cpu)->sregs[BX_SEG_REG_CS].selector.value));
}
dbg_printf("%-25s ; ", bx_disasm_tbuf);
@ -2281,7 +2281,7 @@ void bx_dbg_examine_command(char *command, char *format, bx_bool format_passed,
case 'u': dbg_printf("\t%u", (unsigned) data16); break;
case 'o': dbg_printf("\t%o", (unsigned) data16); break;
case 't': dbg_printf_binary("\t%s", data16, 16); break;
case 'c':
case 'c':
bx_print_char(data16>>8);
bx_print_char(data16 & 0xff);
break;
@ -2310,7 +2310,7 @@ void bx_dbg_examine_command(char *command, char *format, bx_bool format_passed,
case 'u': dbg_printf("\t%u", (unsigned) data32); break;
case 'o': dbg_printf("\t%o", (unsigned) data32); break;
case 't': dbg_printf_binary("\t%s", data32, 32); break;
case 'c':
case 'c':
bx_print_char(0xff & (data32>>24));
bx_print_char(0xff & (data32>>16));
bx_print_char(0xff & (data32>> 8));
@ -2452,7 +2452,7 @@ void bx_dbg_query_command(const char *what)
void bx_dbg_restore_command(const char *param_name, const char *restore_path)
{
const char *path = (restore_path == NULL) ? "." : restore_path;
dbg_printf("restoring param (%s) state from file (%s/%s)\n",
dbg_printf("restoring param (%s) state from file (%s/%s)\n",
param_name, path, param_name);
if (! SIM->restore_bochs_param(SIM->get_bochs_root(), path, param_name)) {
dbg_printf("Error: error occured during restore\n");
@ -2602,7 +2602,7 @@ void bx_dbg_print_descriptor(unsigned char desc[8], int verbose)
unsigned avl = (hi >> 20) & 0x01;
unsigned base_is_jump_addr;
if (s) {
// either a code or a data segment. bit 11 (type file MSB) then says
// either a code or a data segment. bit 11 (type file MSB) then says
// 0=data segment, 1=code seg
if (type&8) {
dbg_printf("Segment type: Code, %s%s%s\n",
@ -2642,10 +2642,10 @@ void bx_dbg_print_descriptor(unsigned char desc[8], int verbose)
// 32-bit trap gate, target=0010:c0108ec4, DPL=0, present=1
// code segment, base=0000:00cfffff, length=0xffff
if (s) {
// either a code or a data segment. bit 11 (type file MSB) then says
// either a code or a data segment. bit 11 (type file MSB) then says
// 0=data segment, 1=code seg
if (type&8) {
dbg_printf("Code segment, linearaddr=%08x, limit=%05x %s, %s%s%s, %d-bit\n",
dbg_printf("Code segment, linearaddr=%08x, limit=%05x %s, %s%s%s, %d-bit\n",
base, limit, g ? "* 4Kbytes" : "bytes",
(type&2)? "Execute/Read" : "Execute-Only",
(type&4)? ", Conforming" : "",
@ -2772,7 +2772,7 @@ void bx_dbg_info_ldt_command(unsigned from, unsigned to)
/*form RB list*/
static char* bx_dbg_ivt_desc(int intnum)
{
{
char* ret = "";
switch (intnum)
{ case 0x00 : ret = "DIVIDE ERROR" ; break;
@ -2821,7 +2821,7 @@ static char* bx_dbg_ivt_desc(int intnum)
}
void bx_dbg_info_ivt_command(unsigned from, unsigned to)
{
{
unsigned char buff[4];
Bit16u seg;
Bit16u off;
@ -2829,9 +2829,9 @@ void bx_dbg_info_ivt_command(unsigned from, unsigned to)
bx_dbg_global_sreg_t idtr;
BX_CPU(dbg_cpu)->dbg_get_idtr(&idtr);
if (! BX_CPU(dbg_cpu)->protected_mode())
{
{
if (to == (unsigned) EMPTY_ARG) {
to = from;
if(from == (unsigned) EMPTY_ARG) { from = 0; to = 255; all = 1; }
@ -2847,7 +2847,7 @@ void bx_dbg_info_ivt_command(unsigned from, unsigned to)
}
for (unsigned i = from; i <= to; i++)
{
{
BX_MEM(0)->dbg_fetch_mem(BX_CPU(dbg_cpu), idtr.base + i * 4, sizeof(buff), buff);
#ifdef BX_LITTLE_ENDIAN
seg = *(Bit16u*)(&buff[2]);
@ -3117,8 +3117,8 @@ void bx_dbg_dump_table(void)
printf("cr3: 0x08x\n", BX_CPU(dbg_cpu)->cr3);
lin = 0;
phy = 0;
lin = 0;
phy = 0;
start_lin = 1;
start_phy = 2;
@ -3149,7 +3149,7 @@ void bx_dbg_dump_table(void)
}
void bx_dbg_print_help(void)
{
{
dbg_printf("h|help - show list of debugger commands\n");
dbg_printf("h|help command - show short command description\n");
dbg_printf("-*- Debugger control -*-\n");
@ -3378,7 +3378,7 @@ void bx_dbg_step_over_command()
x86_insn insn = bx_disassemble.decode(BX_CPU(dbg_cpu)->guard_found.is_32bit_code,
BX_CPU(dbg_cpu)->guard_found.is_64bit_code,
BX_CPU(dbg_cpu)->get_segment_base(BX_SEG_REG_CS),
BX_CPU(dbg_cpu)->get_segment_base(BX_SEG_REG_CS),
BX_CPU(dbg_cpu)->guard_found.eip, bx_disasm_ibuf, bx_disasm_tbuf);
unsigned b1 = insn.b1;
@ -3401,7 +3401,7 @@ void bx_dbg_step_over_command()
case 0x7D:
case 0x7E:
case 0x7F:
// Jcc near
case 0x180:
case 0x181:
@ -3460,9 +3460,9 @@ void bx_dbg_step_over_command()
dbg_printf("bx_dbg_step_over_command:: Failed to set lbreakpoint !\n");
return;
}
bx_dbg_continue_command();
if (bx_dbg_del_lbreak (BpId))
bx_dbg_breakpoint_changed();
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: debug.h,v 1.36 2007-10-23 21:51:42 sshwarts Exp $
// $Id: debug.h,v 1.37 2008-02-05 22:33:33 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -261,7 +261,7 @@ void bx_dbg_quit_command(void);
#define BX_INFO_FPU_REGS 2
#define BX_INFO_MMX_REGS 4
#define BX_INFO_SSE_REGS 8
void bx_dbg_info_registers_command(int);
void bx_dbg_info_registers_command(int);
void bx_dbg_info_dirty_command(void);
void bx_dbg_info_ivt_command(unsigned from, unsigned to);
void bx_dbg_info_idt_command(unsigned from, unsigned to);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: linux.cc,v 1.8 2007-10-23 21:51:43 sshwarts Exp $
// $Id: linux.cc,v 1.9 2008-02-05 22:33:33 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
#include <stdio.h>
@ -60,10 +60,10 @@ void syscall_names_t::init ()
}
#define DEF_SYSCALL(num,name) syscall_names_linux[num] = name;
/* basically every line in the included file is a call to DEF_SYSCALL.
The preprocessor will turn each DEF_SYSCALL into an assignment
The preprocessor will turn each DEF_SYSCALL into an assignment
to syscall_names_linux[num]. */
#include "syscalls-linux.h"
/* now almost all the name entries have been initialized. If there
/* now almost all the name entries have been initialized. If there
are any gaps, they still point to "<unknown syscall>". */
#if (N_SYSCALLS > MAX_SYSCALLS)
@ -71,7 +71,7 @@ void syscall_names_t::init ()
#endif
}
char *syscall_names_t::get_name (int n)
char *syscall_names_t::get_name (int n)
{
static char buf[64];
if (n < 0 || n > N_SYSCALLS) {

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: symbols.cc,v 1.7 2006-10-11 14:54:40 akrisak Exp $
// $Id: symbols.cc,v 1.8 2008-02-05 22:33:33 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -193,7 +193,7 @@ symbol_entry_t* context_t::get_symbol_entry(const char *Symbol) const
symbol_entry_t probe;
probe.name=(char *)Symbol;
if (rsyms->empty ())
if (rsyms->empty ())
return 0;
set<symbol_entry_t*>::const_iterator iter;
@ -231,7 +231,7 @@ char* bx_dbg_symbolic_address(Bit32u context, Bit32u eip, Bit32u base)
static char buf[80];
#if 0
// bbd: I don't see why we shouldn't allow symbol lookups on
// segments with a nonzero base. I need to trace user
// segments with a nonzero base. I need to trace user
// processes in Linux, which have a base of 0xc0000000.
if (base != 0) {
snprintf (buf, 80, "non-zero base");
@ -249,7 +249,7 @@ char* bx_dbg_symbolic_address(Bit32u context, Bit32u eip, Bit32u base)
}
}
// full linear address not only eip (for nonzero based segments)
symbol_entry_t* entr = cntx->get_symbol_entry(base+eip);
symbol_entry_t* entr = cntx->get_symbol_entry(base+eip);
if (!entr) {
snprintf (buf, 80, "no symbol");
return buf;
@ -269,7 +269,7 @@ char* bx_dbg_disasm_symbolic_address(Bit32u eip, Bit32u base)
}
// full linear address not only eip (for nonzero based segments)
symbol_entry_t* entr = cntx->get_symbol_entry(base+eip);
symbol_entry_t* entr = cntx->get_symbol_entry(base+eip);
if (!entr) {
return 0;
}
@ -297,7 +297,7 @@ void bx_dbg_symbol_command(char* filename, bx_bool global, Bit32u offset)
// Install symbols in correct context (page table)
// The file format should be
// address symbol (example '00002afe _StartLoseNT')
context_t* cntx = (global) ? context_t::get_context(0)
: context_t::get_context((BX_CPU(dbg_cpu)->cr3) >> 12);
@ -315,7 +315,7 @@ void bx_dbg_symbol_command(char* filename, bx_bool global, Bit32u offset)
while (fgets(buf, 200, fp)) {
// Parse
char* sym_name = buf;
for (int i = 0; i < 200 && buf[i]; i++) {
if (buf[i] == ' ') {
buf[i] = '\0';

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: data_xfer16.cc,v 1.56 2008-01-29 17:13:06 sshwarts Exp $
// $Id: data_xfer16.cc,v 1.57 2008-02-05 22:33:33 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -77,7 +77,7 @@ void BX_CPU_C::MOV_EwSwR(bxInstruction_c *i)
Bit16u seg_reg = BX_CPU_THIS_PTR sregs[i->nnn()].selector.value;
if ( i->os32L() ) {
if (i->os32L()) {
BX_WRITE_32BIT_REGZ(i->rm(), seg_reg);
}
else {

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: dis_decode.cc,v 1.42 2007-11-17 16:19:14 sshwarts Exp $
// $Id: dis_decode.cc,v 1.43 2008-02-05 22:33:33 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@ -15,21 +15,21 @@
static const unsigned char instruction_has_modrm[512] = {
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* ------------------------------- */
/* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
/* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
/* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
/* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
/* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,
/* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
/* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* A0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* B0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* C0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,
/* D0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,
/* E0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
/* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
/* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
/* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
/* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,
/* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
/* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* A0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* B0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* C0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,
/* D0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,
/* E0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* F0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* ------------------------------- */
@ -213,7 +213,7 @@ x86_insn disassembler::decode(bx_bool is_32, bx_bool is_64, bx_address base, bx_
}
int attr = entry->Attr;
while(attr)
while(attr)
{
switch(attr) {
case _GROUPN:
@ -222,7 +222,7 @@ x86_insn disassembler::decode(bx_bool is_32, bx_bool is_64, bx_address base, bx_
case _GRPSSE:
if(sse_prefix) insn.prefixes--;
/* For SSE opcodes, look into another 4 entries table
/* For SSE opcodes, look into another 4 entries table
with the opcode prefixes (NONE, 0x66, 0xF2, 0xF3) */
entry = &(OPCODE_TABLE(entry)[sse_prefix]);
break;
@ -296,7 +296,7 @@ x86_insn disassembler::decode(bx_bool is_32, bx_bool is_64, bx_address base, bx_
if ((insn.b1 >= 0x070 && insn.b1 <= 0x07F) ||
(insn.b1 >= 0x180 && insn.b1 <= 0x18F))
{
if (prefix_byte == BRANCH_NOT_TAKEN || prefix_byte == BRANCH_TAKEN)
if (prefix_byte == BRANCH_NOT_TAKEN || prefix_byte == BRANCH_TAKEN)
branch_hint = prefix_byte;
}
}
@ -326,7 +326,7 @@ x86_insn disassembler::decode(bx_bool is_32, bx_bool is_64, bx_address base, bx_
{
dis_sprintf(", taken");
}
insn.ilen = (unsigned)(instruction - instruction_begin);
return insn;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: dis_groups.cc,v 1.39 2007-12-30 18:02:22 sshwarts Exp $
// $Id: dis_groups.cc,v 1.40 2008-02-05 22:33:33 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@ -71,8 +71,8 @@ void disassembler::Td(const x86_insn *insn)
}
// control register
void disassembler::Cd(const x86_insn *insn)
{
void disassembler::Cd(const x86_insn *insn)
{
if (intel_mode)
dis_sprintf ("cr%d", insn->nnn);
else
@ -82,7 +82,7 @@ void disassembler::Cd(const x86_insn *insn)
void disassembler::Cq(const x86_insn *insn) { Cd(insn); }
// debug register
void disassembler::Dd(const x86_insn *insn)
void disassembler::Dd(const x86_insn *insn)
{
if (intel_mode)
dis_sprintf ("db%d", insn->nnn);
@ -94,9 +94,9 @@ void disassembler::Dq(const x86_insn *insn) { Dd(insn); }
// 8-bit general purpose register
void disassembler::R8(const x86_insn *insn)
{
{
unsigned reg = (insn->b1 & 7) | insn->rex_b;
if (reg < 4 || insn->extend8b)
dis_sprintf("%s", general_8bit_regname_rex[reg]);
else
@ -105,24 +105,24 @@ void disassembler::R8(const x86_insn *insn)
// 16-bit general purpose register
void disassembler::RX(const x86_insn *insn)
{
{
dis_sprintf("%s", general_16bit_regname[(insn->b1 & 7) | insn->rex_b]);
}
// 32-bit general purpose register
void disassembler::ERX(const x86_insn *insn)
{
{
dis_sprintf("%s", general_32bit_regname[(insn->b1 & 7) | insn->rex_b]);
}
// 64-bit general purpose register
void disassembler::RRX(const x86_insn *insn)
{
{
dis_sprintf("%s", general_64bit_regname[(insn->b1 & 7) | insn->rex_b]);
}
// general purpose register or memory operand
void disassembler::Eb(const x86_insn *insn)
void disassembler::Eb(const x86_insn *insn)
{
if (insn->mod == 3) {
if (insn->rm < 4 || insn->extend8b)
@ -134,7 +134,7 @@ void disassembler::Eb(const x86_insn *insn)
(this->*resolve_modrm)(insn, B_SIZE);
}
void disassembler::Ew(const x86_insn *insn)
void disassembler::Ew(const x86_insn *insn)
{
if (insn->mod == 3)
dis_sprintf("%s", general_16bit_regname[insn->rm]);
@ -142,7 +142,7 @@ void disassembler::Ew(const x86_insn *insn)
(this->*resolve_modrm)(insn, W_SIZE);
}
void disassembler::Ed(const x86_insn *insn)
void disassembler::Ed(const x86_insn *insn)
{
if (insn->mod == 3)
dis_sprintf("%s", general_32bit_regname[insn->rm]);
@ -150,7 +150,7 @@ void disassembler::Ed(const x86_insn *insn)
(this->*resolve_modrm)(insn, D_SIZE);
}
void disassembler::Eq(const x86_insn *insn)
void disassembler::Eq(const x86_insn *insn)
{
if (insn->mod == 3)
dis_sprintf("%s", general_64bit_regname[insn->rm]);
@ -158,7 +158,7 @@ void disassembler::Eq(const x86_insn *insn)
(this->*resolve_modrm)(insn, Q_SIZE);
}
void disassembler::Hbd(const x86_insn *insn)
void disassembler::Hbd(const x86_insn *insn)
{
if (insn->mod == 3)
dis_sprintf("%s", general_32bit_regname[insn->nnn]);
@ -166,7 +166,7 @@ void disassembler::Hbd(const x86_insn *insn)
(this->*resolve_modrm)(insn, B_SIZE);
}
void disassembler::Hwd(const x86_insn *insn)
void disassembler::Hwd(const x86_insn *insn)
{
if (insn->mod == 3)
dis_sprintf("%s", general_32bit_regname[insn->nnn]);
@ -174,7 +174,7 @@ void disassembler::Hwd(const x86_insn *insn)
(this->*resolve_modrm)(insn, W_SIZE);
}
void disassembler::Hd(const x86_insn *insn)
void disassembler::Hd(const x86_insn *insn)
{
if (insn->mod == 3)
dis_sprintf("%s", general_32bit_regname[insn->nnn]);
@ -182,7 +182,7 @@ void disassembler::Hd(const x86_insn *insn)
(this->*resolve_modrm)(insn, D_SIZE);
}
void disassembler::Hq(const x86_insn *insn)
void disassembler::Hq(const x86_insn *insn)
{
if (insn->mod == 3)
dis_sprintf("%s", general_32bit_regname[insn->nnn]);
@ -191,7 +191,7 @@ void disassembler::Hq(const x86_insn *insn)
}
// general purpose register
void disassembler::Gb(const x86_insn *insn)
void disassembler::Gb(const x86_insn *insn)
{
if (insn->nnn < 4 || insn->extend8b)
dis_sprintf("%s", general_8bit_regname_rex[insn->nnn]);
@ -199,41 +199,41 @@ void disassembler::Gb(const x86_insn *insn)
dis_sprintf("%s", general_8bit_regname[insn->nnn]);
}
void disassembler::Gw(const x86_insn *insn)
void disassembler::Gw(const x86_insn *insn)
{
dis_sprintf("%s", general_16bit_regname[insn->nnn]);
}
void disassembler::Gd(const x86_insn *insn)
void disassembler::Gd(const x86_insn *insn)
{
dis_sprintf("%s", general_32bit_regname[insn->nnn]);
}
void disassembler::Gq(const x86_insn *insn)
void disassembler::Gq(const x86_insn *insn)
{
dis_sprintf("%s", general_64bit_regname[insn->nnn]);
}
// immediate
void disassembler::I1(const x86_insn *insn)
{
void disassembler::I1(const x86_insn *insn)
{
if (! intel_mode) dis_putc('$');
dis_putc ('1');
}
void disassembler::Ib(const x86_insn *insn)
void disassembler::Ib(const x86_insn *insn)
{
if (! intel_mode) dis_putc('$');
dis_sprintf("0x%02x", (unsigned) fetch_byte());
}
void disassembler::Iw(const x86_insn *insn)
void disassembler::Iw(const x86_insn *insn)
{
if (! intel_mode) dis_putc('$');
dis_sprintf("0x%04x", (unsigned) fetch_word());
}
void disassembler::IbIb(const x86_insn *insn)
void disassembler::IbIb(const x86_insn *insn)
{
Bit8u ib1 = fetch_byte();
Bit8u ib2 = fetch_byte();
@ -246,7 +246,7 @@ void disassembler::IbIb(const x86_insn *insn)
}
}
void disassembler::IwIb(const x86_insn *insn)
void disassembler::IwIb(const x86_insn *insn)
{
Bit16u iw = fetch_word();
Bit8u ib = fetch_byte();
@ -259,13 +259,13 @@ void disassembler::IwIb(const x86_insn *insn)
}
}
void disassembler::Id(const x86_insn *insn)
void disassembler::Id(const x86_insn *insn)
{
if (! intel_mode) dis_putc('$');
dis_sprintf("0x%08x", (unsigned) fetch_dword());
}
void disassembler::Iq(const x86_insn *insn)
void disassembler::Iq(const x86_insn *insn)
{
Bit64u value = fetch_qword();
@ -274,7 +274,7 @@ void disassembler::Iq(const x86_insn *insn)
}
// sign extended immediate
void disassembler::sIbw(const x86_insn *insn)
void disassembler::sIbw(const x86_insn *insn)
{
if (! intel_mode) dis_putc('$');
Bit16u imm16 = (Bit8s) fetch_byte();
@ -282,7 +282,7 @@ void disassembler::sIbw(const x86_insn *insn)
}
// sign extended immediate
void disassembler::sIbd(const x86_insn *insn)
void disassembler::sIbd(const x86_insn *insn)
{
if (! intel_mode) dis_putc('$');
Bit32u imm32 = (Bit8s) fetch_byte();
@ -290,7 +290,7 @@ void disassembler::sIbd(const x86_insn *insn)
}
// sign extended immediate
void disassembler::sIbq(const x86_insn *insn)
void disassembler::sIbq(const x86_insn *insn)
{
if (! intel_mode) dis_putc('$');
Bit64u imm64 = (Bit8s) fetch_byte();
@ -298,7 +298,7 @@ void disassembler::sIbq(const x86_insn *insn)
}
// sign extended immediate
void disassembler::sIdq(const x86_insn *insn)
void disassembler::sIdq(const x86_insn *insn)
{
if (! intel_mode) dis_putc('$');
Bit64u imm64 = (Bit32s) fetch_dword();
@ -307,15 +307,15 @@ void disassembler::sIdq(const x86_insn *insn)
// floating point
void disassembler::ST0(const x86_insn *insn)
{
{
if (intel_mode)
dis_sprintf ("st(0)");
else
dis_sprintf("%%st(0)");
}
void disassembler::STi(const x86_insn *insn)
{
void disassembler::STi(const x86_insn *insn)
{
if (intel_mode)
dis_sprintf ("st(%d)", insn->rm);
else
@ -534,7 +534,7 @@ void disassembler::OP_X(const x86_insn *insn, unsigned size)
else
rsi = general_16bit_regname[rSI_REG];
}
if (insn->is_seg_override())
seg = segment_name[insn->seg_override];
else
@ -566,7 +566,7 @@ void disassembler::OP_Y(const x86_insn *insn, unsigned size)
else
rdi = general_16bit_regname[rDI_REG];
}
print_datasize(size);
if (intel_mode)

View File

@ -37,7 +37,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupSSE_0f13[4] = {
/* 66 */ { 0, &Ia_movlpd_Mq_Vpd },
/* F2 */ { 0, &Ia_Invalid },
/* F3 */ { 0, &Ia_Invalid }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupSSE_0f14[4] = {
/* -- */ { 0, &Ia_unpcklps_Vps_Wdq },
@ -573,7 +573,7 @@ static BxDisasmOpcodeTable_t BxDisasmGrpOs64B_pextr[3] = {
};
static BxDisasmOpcodeTable_t BxDisasmGroupSSE_0f3a16[4] = {
/* -- */ { 0, &Ia_Invalid },
/* -- */ { 0, &Ia_Invalid },
/* 66 */ { GR64BIT(pextr) }, // SSE4
/* F2 */ { 0, &Ia_Invalid },
/* F3 */ { 0, &Ia_Invalid }
@ -730,7 +730,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupSSE_0f59[4] = {
/* 66 */ { 0, &Ia_mulpd_Vpd_Wpd },
/* F2 */ { 0, &Ia_mulsd_Vsd_Wsd },
/* F3 */ { 0, &Ia_mulss_Vss_Wss }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupSSE_0f5a[4] = {
/* -- */ { 0, &Ia_cvtps2pd_Vpd_Wps },
@ -1287,7 +1287,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupSSE_0ff0[4] = {
/* 66 */ { 0, &Ia_Invalid },
/* F2 */ { 0, &Ia_lddqu_Vdq_Mdq },
/* F3 */ { 0, &Ia_Invalid }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupSSE_0ff1[4] = {
/* -- */ { 0, &Ia_psllw_Pq_Qq },
@ -1481,7 +1481,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG1EwIw[8] = {
/* 5 */ { 0, &Ia_subw_Ew_Iw },
/* 6 */ { 0, &Ia_xorw_Ew_Iw },
/* 7 */ { 0, &Ia_cmpw_Ew_Iw }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG1EdId[8] = {
/* 0 */ { 0, &Ia_addl_Ed_Id },
@ -1492,7 +1492,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG1EdId[8] = {
/* 5 */ { 0, &Ia_subl_Ed_Id },
/* 6 */ { 0, &Ia_xorl_Ed_Id },
/* 7 */ { 0, &Ia_cmpl_Ed_Id }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG1EqId[8] = {
/* 0 */ { 0, &Ia_addq_Eq_sId },
@ -1503,10 +1503,10 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG1EqId[8] = {
/* 5 */ { 0, &Ia_subq_Eq_sId },
/* 6 */ { 0, &Ia_xorq_Eq_sId },
/* 7 */ { 0, &Ia_cmpq_Eq_sId }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG1EwIb[8] = {
/* 0 */ { 0, &Ia_addw_Ew_sIb }, // sign-extend byte
/* 0 */ { 0, &Ia_addw_Ew_sIb }, // sign-extend byte
/* 1 */ { 0, &Ia_orw_Ew_sIb },
/* 2 */ { 0, &Ia_adcw_Ew_sIb },
/* 3 */ { 0, &Ia_sbbw_Ew_sIb },
@ -1514,10 +1514,10 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG1EwIb[8] = {
/* 5 */ { 0, &Ia_subw_Ew_sIb },
/* 6 */ { 0, &Ia_xorw_Ew_sIb },
/* 7 */ { 0, &Ia_cmpw_Ew_sIb }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG1EdIb[8] = {
/* 0 */ { 0, &Ia_addl_Ed_sIb }, // sign-extend byte
/* 0 */ { 0, &Ia_addl_Ed_sIb }, // sign-extend byte
/* 1 */ { 0, &Ia_orl_Ed_sIb },
/* 2 */ { 0, &Ia_adcl_Ed_sIb },
/* 3 */ { 0, &Ia_sbbl_Ed_sIb },
@ -1525,10 +1525,10 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG1EdIb[8] = {
/* 5 */ { 0, &Ia_subl_Ed_sIb },
/* 6 */ { 0, &Ia_xorl_Ed_sIb },
/* 7 */ { 0, &Ia_cmpl_Ed_sIb }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG1EqIb[8] = {
/* 0 */ { 0, &Ia_addq_Eq_sIb }, // sign-extend byte
/* 0 */ { 0, &Ia_addq_Eq_sIb }, // sign-extend byte
/* 1 */ { 0, &Ia_orq_Eq_sIb },
/* 2 */ { 0, &Ia_adcq_Eq_sIb },
/* 3 */ { 0, &Ia_sbbq_Eq_sIb },
@ -1536,7 +1536,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG1EqIb[8] = {
/* 5 */ { 0, &Ia_subq_Eq_sIb },
/* 6 */ { 0, &Ia_xorq_Eq_sIb },
/* 7 */ { 0, &Ia_cmpq_Eq_sIb }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2Eb[8] = {
/* 0 */ { 0, &Ia_rolb_Eb_Ib },
@ -1547,7 +1547,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2Eb[8] = {
/* 5 */ { 0, &Ia_shrb_Eb_Ib },
/* 6 */ { 0, &Ia_shlb_Eb_Ib },
/* 7 */ { 0, &Ia_sarb_Eb_Ib }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2EbI1[8] = {
/* 0 */ { 0, &Ia_rolb_Eb_I1 },
@ -1558,7 +1558,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2EbI1[8] = {
/* 5 */ { 0, &Ia_shrb_Eb_I1 },
/* 6 */ { 0, &Ia_shlb_Eb_I1 },
/* 7 */ { 0, &Ia_sarb_Eb_I1 }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2EbCL[8] = {
/* 0 */ { 0, &Ia_rolb_Eb_CL },
@ -1569,7 +1569,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2EbCL[8] = {
/* 5 */ { 0, &Ia_shrb_Eb_CL },
/* 6 */ { 0, &Ia_shlb_Eb_CL },
/* 7 */ { 0, &Ia_sarb_Eb_CL }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2Ew[8] = {
/* 0 */ { 0, &Ia_rolw_Ew_Ib },
@ -1580,7 +1580,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2Ew[8] = {
/* 5 */ { 0, &Ia_shrw_Ew_Ib },
/* 6 */ { 0, &Ia_shlw_Ew_Ib },
/* 7 */ { 0, &Ia_sarw_Ew_Ib }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2Ed[8] = {
/* 0 */ { 0, &Ia_roll_Ed_Ib },
@ -1591,7 +1591,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2Ed[8] = {
/* 5 */ { 0, &Ia_shrl_Ed_Ib },
/* 6 */ { 0, &Ia_shll_Ed_Ib },
/* 7 */ { 0, &Ia_sarl_Ed_Ib }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2Eq[8] = {
/* 0 */ { 0, &Ia_rolq_Eq_Ib },
@ -1602,7 +1602,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2Eq[8] = {
/* 5 */ { 0, &Ia_shrq_Eq_Ib },
/* 6 */ { 0, &Ia_shlq_Eq_Ib },
/* 7 */ { 0, &Ia_sarq_Eq_Ib }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2EwI1[8] = {
/* 0 */ { 0, &Ia_rolw_Ew_I1 },
@ -1613,7 +1613,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2EwI1[8] = {
/* 5 */ { 0, &Ia_shrw_Ew_I1 },
/* 6 */ { 0, &Ia_shlw_Ew_I1 },
/* 7 */ { 0, &Ia_sarw_Ew_I1 }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2EdI1[8] = {
/* 0 */ { 0, &Ia_roll_Ed_I1 },
@ -1624,7 +1624,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2EdI1[8] = {
/* 5 */ { 0, &Ia_shrl_Ed_I1 },
/* 6 */ { 0, &Ia_shll_Ed_I1 },
/* 7 */ { 0, &Ia_sarl_Ed_I1 }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2EqI1[8] = {
/* 0 */ { 0, &Ia_rolq_Eq_I1 },
@ -1635,7 +1635,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2EqI1[8] = {
/* 5 */ { 0, &Ia_shrq_Eq_I1 },
/* 6 */ { 0, &Ia_shlq_Eq_I1 },
/* 7 */ { 0, &Ia_sarq_Eq_I1 }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2EwCL[8] = {
/* 0 */ { 0, &Ia_rolw_Ew_CL },
@ -1646,7 +1646,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2EwCL[8] = {
/* 5 */ { 0, &Ia_shrw_Ew_CL },
/* 6 */ { 0, &Ia_shlw_Ew_CL },
/* 7 */ { 0, &Ia_sarw_Ew_CL }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2EdCL[8] = {
/* 0 */ { 0, &Ia_roll_Ed_CL },
@ -1657,7 +1657,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2EdCL[8] = {
/* 5 */ { 0, &Ia_shrl_Ed_CL },
/* 6 */ { 0, &Ia_shll_Ed_CL },
/* 7 */ { 0, &Ia_sarl_Ed_CL }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG2EqCL[8] = {
/* 0 */ { 0, &Ia_rolq_Eq_CL },
@ -1668,7 +1668,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG2EqCL[8] = {
/* 5 */ { 0, &Ia_shrq_Eq_CL },
/* 6 */ { 0, &Ia_shlq_Eq_CL },
/* 7 */ { 0, &Ia_sarq_Eq_CL }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG3Eb[8] = {
/* 0 */ { 0, &Ia_testb_Eb_Ib },
@ -1679,7 +1679,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG3Eb[8] = {
/* 5 */ { 0, &Ia_imulb_AL_Eb },
/* 6 */ { 0, &Ia_divb_AL_Eb },
/* 7 */ { 0, &Ia_idivb_AL_Eb }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG3Ew[8] = {
/* 0 */ { 0, &Ia_testw_Ew_Iw },
@ -1690,7 +1690,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG3Ew[8] = {
/* 5 */ { 0, &Ia_imulw_AX_Ew },
/* 6 */ { 0, &Ia_divw_AX_Ew },
/* 7 */ { 0, &Ia_idivw_AX_Ew }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG3Ed[8] = {
/* 0 */ { 0, &Ia_testl_Ed_Id },
@ -1701,7 +1701,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG3Ed[8] = {
/* 5 */ { 0, &Ia_imull_EAX_Ed },
/* 6 */ { 0, &Ia_divl_EAX_Ed },
/* 7 */ { 0, &Ia_idivl_EAX_Ed }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG3Eq[8] = {
/* 0 */ { 0, &Ia_testq_Eq_sId },
@ -1712,7 +1712,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG3Eq[8] = {
/* 5 */ { 0, &Ia_imulq_RAX_Eq },
/* 6 */ { 0, &Ia_divq_RAX_Eq },
/* 7 */ { 0, &Ia_idivq_RAX_Eq }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG4[8] = {
/* 0 */ { 0, &Ia_incb_Eb },
@ -1723,7 +1723,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG4[8] = {
/* 5 */ { 0, &Ia_Invalid },
/* 6 */ { 0, &Ia_Invalid },
/* 7 */ { 0, &Ia_Invalid }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG5w[8] = {
/* 0 */ { 0, &Ia_incw_Ew },
@ -1734,7 +1734,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG5w[8] = {
/* 5 */ { 0, &Ia_ljmp_Mp },
/* 6 */ { 0, &Ia_pushw_Ew },
/* 7 */ { 0, &Ia_Invalid }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG5d[8] = {
/* 0 */ { 0, &Ia_incl_Ed },
@ -1745,7 +1745,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG5d[8] = {
/* 5 */ { 0, &Ia_ljmp_Mp },
/* 6 */ { 0, &Ia_pushl_Ed },
/* 7 */ { 0, &Ia_Invalid }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroup64G5w[8] = {
/* 0 */ { 0, &Ia_incw_Ew },
@ -1756,7 +1756,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroup64G5w[8] = {
/* 5 */ { 0, &Ia_ljmp_Mp },
/* 6 */ { 0, &Ia_pushw_Ew },
/* 7 */ { 0, &Ia_Invalid }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroup64G5d[8] = {
/* 0 */ { 0, &Ia_incl_Ed },
@ -1767,7 +1767,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroup64G5d[8] = {
/* 5 */ { 0, &Ia_ljmp_Mp },
/* 6 */ { 0, &Ia_pushq_Eq },
/* 7 */ { 0, &Ia_Invalid }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroup64G5q[8] = {
/* 0 */ { 0, &Ia_incq_Eq },
@ -1778,7 +1778,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroup64G5q[8] = {
/* 5 */ { 0, &Ia_ljmp_Mp },
/* 6 */ { 0, &Ia_pushq_Eq },
/* 7 */ { 0, &Ia_Invalid }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG6[8] = {
/* 0 */ { 0, &Ia_sldt },
@ -1789,7 +1789,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG6[8] = {
/* 5 */ { 0, &Ia_verw },
/* 6 */ { 0, &Ia_Invalid },
/* 7 */ { 0, &Ia_Invalid }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG7M[8] = {
/* 0 */ { 0, &Ia_sgdt },
@ -1869,7 +1869,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG8EwIb[8] = {
/* 5 */ { 0, &Ia_btsw_Ew_Ib },
/* 6 */ { 0, &Ia_btrw_Ew_Ib },
/* 7 */ { 0, &Ia_btcw_Ew_Ib }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG8EdIb[8] = {
/* 0 */ { 0, &Ia_Invalid },
@ -1880,7 +1880,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG8EdIb[8] = {
/* 5 */ { 0, &Ia_btsl_Ed_Ib },
/* 6 */ { 0, &Ia_btrl_Ed_Ib },
/* 7 */ { 0, &Ia_btcl_Ed_Ib }
};
};
static BxDisasmOpcodeTable_t BxDisasmGroupG8EqIb[8] = {
/* 0 */ { 0, &Ia_Invalid },
@ -1891,7 +1891,7 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG8EqIb[8] = {
/* 5 */ { 0, &Ia_btsq_Eq_Ib },
/* 6 */ { 0, &Ia_btrq_Eq_Ib },
/* 7 */ { 0, &Ia_btcq_Eq_Ib }
};
};
/* VMX */
static BxDisasmOpcodeTable_t BxDisasmGroupSSE_G9VMX6[4] = {
@ -1961,11 +1961,11 @@ static BxDisasmOpcodeTable_t BxDisasmGroupG14[8] = {
/* 4 */ { 0, &Ia_Invalid },
/* 5 */ { 0, &Ia_Invalid },
/* 6 */ { GRPSSE(G1406) },
/* 7 */ { GRPSSE(G1407) }
/* 7 */ { GRPSSE(G1407) }
};
static BxDisasmOpcodeTable_t BxDisasmGroupModCFLUSH[2] = {
/* R */ { 0, &Ia_sfence },
/* R */ { 0, &Ia_sfence },
/* M */ { 0, &Ia_cflush }
};
@ -2253,7 +2253,7 @@ static BxDisasmOpcodeTable_t BxDisasm3DNowGroup[256] = {
/* FD */ { 0, &Ia_Invalid },
/* FE */ { 0, &Ia_Invalid },
/* FF */ { 0, &Ia_Invalid }
};
};
/* ************************************************************************ */
/* FPU Opcodes */
@ -2263,7 +2263,7 @@ static BxDisasmOpcodeTable_t BxDisasm3DNowGroup[256] = {
// the modrm byte. (the first byte is D8-DF)
// D8 (modrm is outside 00h - BFh) (mod != 11)
static BxDisasmOpcodeTable_t BxDisasmFPGroupD8[8] = {
static BxDisasmOpcodeTable_t BxDisasmFPGroupD8[8] = {
/* 0 */ { 0, &Ia_fadds_Md },
/* 1 */ { 0, &Ia_fmuls_Md },
/* 2 */ { 0, &Ia_fcoms_Md },
@ -2275,7 +2275,7 @@ static BxDisasmOpcodeTable_t BxDisasmFPGroupD8[8] = {
};
// D9 (modrm is outside 00h - BFh) (mod != 11)
static BxDisasmOpcodeTable_t BxDisasmFPGroupD9[8] = {
static BxDisasmOpcodeTable_t BxDisasmFPGroupD9[8] = {
/* 0 */ { 0, &Ia_flds_Md },
/* 1 */ { 0, &Ia_Invalid },
/* 2 */ { 0, &Ia_fsts_Md },
@ -2287,7 +2287,7 @@ static BxDisasmOpcodeTable_t BxDisasmFPGroupD9[8] = {
};
// DA (modrm is outside 00h - BFh) (mod != 11)
static BxDisasmOpcodeTable_t BxDisasmFPGroupDA[8] = {
static BxDisasmOpcodeTable_t BxDisasmFPGroupDA[8] = {
/* 0 */ { 0, &Ia_fiaddl_Md },
/* 1 */ { 0, &Ia_fimull_Md },
/* 2 */ { 0, &Ia_ficoml_Md },
@ -2299,7 +2299,7 @@ static BxDisasmOpcodeTable_t BxDisasmFPGroupDA[8] = {
};
// DB (modrm is outside 00h - BFh) (mod != 11)
static BxDisasmOpcodeTable_t BxDisasmFPGroupDB[8] = {
static BxDisasmOpcodeTable_t BxDisasmFPGroupDB[8] = {
/* 0 */ { 0, &Ia_fildl_Md },
/* 1 */ { 0, &Ia_fisttpl_Md },
/* 2 */ { 0, &Ia_fistl_Md },
@ -2311,7 +2311,7 @@ static BxDisasmOpcodeTable_t BxDisasmFPGroupDB[8] = {
};
// DC (modrm is outside 00h - BFh) (mod != 11)
static BxDisasmOpcodeTable_t BxDisasmFPGroupDC[8] = {
static BxDisasmOpcodeTable_t BxDisasmFPGroupDC[8] = {
/* 0 */ { 0, &Ia_faddl_Mq },
/* 1 */ { 0, &Ia_fmull_Mq },
/* 2 */ { 0, &Ia_fcoml_Mq },
@ -2323,7 +2323,7 @@ static BxDisasmOpcodeTable_t BxDisasmFPGroupDC[8] = {
};
// DD (modrm is outside 00h - BFh) (mod != 11)
static BxDisasmOpcodeTable_t BxDisasmFPGroupDD[8] = {
static BxDisasmOpcodeTable_t BxDisasmFPGroupDD[8] = {
/* 0 */ { 0, &Ia_fldl_Mq },
/* 1 */ { 0, &Ia_fisttpq_Mq },
/* 2 */ { 0, &Ia_fstl_Mq },
@ -2335,7 +2335,7 @@ static BxDisasmOpcodeTable_t BxDisasmFPGroupDD[8] = {
};
// DE (modrm is outside 00h - BFh) (mod != 11)
static BxDisasmOpcodeTable_t BxDisasmFPGroupDE[8] = {
static BxDisasmOpcodeTable_t BxDisasmFPGroupDE[8] = {
/* 0 */ { 0, &Ia_fiadds_Mw },
/* 1 */ { 0, &Ia_fimuls_Mw },
/* 2 */ { 0, &Ia_ficoms_Mw },
@ -2347,7 +2347,7 @@ static BxDisasmOpcodeTable_t BxDisasmFPGroupDE[8] = {
};
// DF (modrm is outside 00h - BFh) (mod != 11)
static BxDisasmOpcodeTable_t BxDisasmFPGroupDF[8] = {
static BxDisasmOpcodeTable_t BxDisasmFPGroupDF[8] = {
/* 0 */ { 0, &Ia_filds_Mw },
/* 1 */ { 0, &Ia_fisttps_Mw },
/* 2 */ { 0, &Ia_fists_Mw },
@ -2358,8 +2358,8 @@ static BxDisasmOpcodeTable_t BxDisasmFPGroupDF[8] = {
/* 7 */ { 0, &Ia_fistpq_Mq }
};
// 512 entries for second byte of floating point instructions. (when mod==11b)
static BxDisasmOpcodeTable_t BxDisasmOpcodeInfoFP[512] = {
// 512 entries for second byte of floating point instructions. (when mod==11b)
static BxDisasmOpcodeTable_t BxDisasmOpcodeInfoFP[512] = {
// D8 (modrm is outside 00h - BFh) (mod == 11)
/* D8 C0 */ { 0, &Ia_fadd_ST0_STi },
/* D8 C1 */ { 0, &Ia_fadd_ST0_STi },
@ -2425,7 +2425,7 @@ static BxDisasmOpcodeTable_t BxDisasmOpcodeInfoFP[512] = {
/* D8 FD */ { 0, &Ia_fdivr_ST0_STi },
/* D8 FE */ { 0, &Ia_fdivr_ST0_STi },
/* D8 FF */ { 0, &Ia_fdivr_ST0_STi },
// D9 (modrm is outside 00h - BFh) (mod == 11)
/* D9 C0 */ { 0, &Ia_fld_STi },
/* D9 C1 */ { 0, &Ia_fld_STi },
@ -2491,7 +2491,7 @@ static BxDisasmOpcodeTable_t BxDisasmOpcodeInfoFP[512] = {
/* D9 FD */ { 0, &Ia_fscale },
/* D9 FE */ { 0, &Ia_fsin },
/* D9 FF */ { 0, &Ia_fcos },
// DA (modrm is outside 00h - BFh) (mod == 11)
/* DA C0 */ { 0, &Ia_fcmovb_ST0_STi },
/* DA C1 */ { 0, &Ia_fcmovb_ST0_STi },

View File

@ -106,12 +106,12 @@ struct BxDisasmOpcodeTable_t
// branch hint attribute
#define BRANCH_HINT 0x1000
struct x86_insn
struct x86_insn
{
public:
x86_insn(bx_bool is32, bx_bool is64);
bx_bool is_seg_override() const {
bx_bool is_seg_override() const {
return (seg_override != NO_SEG_OVERRIDE);
}
@ -291,60 +291,60 @@ private:
public:
/*
/*
* Codes for Addressing Method:
* ---------------------------
* A - Direct address. The instruction has no ModR/M byte; the address
* of the operand is encoded in the instruction; and no base register,
* A - Direct address. The instruction has no ModR/M byte; the address
* of the operand is encoded in the instruction; and no base register,
* index register, or scaling factor can be applied.
* C - The reg field of the ModR/M byte selects a control register.
* D - The reg field of the ModR/M byte selects a debug register.
* E - A ModR/M byte follows the opcode and specifies the operand. The
* operand is either a general-purpose register or a memory address.
* E - A ModR/M byte follows the opcode and specifies the operand. The
* operand is either a general-purpose register or a memory address.
* In case of the register operand, the R/M field of the ModR/M byte
* selects a general register.
* F - Flags Register.
* G - The reg field of the ModR/M byte selects a general register.
* H - A ModR/M byte follows the opcode and specifies the operand. The
* operand is either a general-purpose register or a memory address.
* In case of the register operand, the reg field of the ModR/M byte
* H - A ModR/M byte follows the opcode and specifies the operand. The
* operand is either a general-purpose register or a memory address.
* In case of the register operand, the reg field of the ModR/M byte
* selects a general register.
* I - Immediate data. The operand value is encoded in subsequent bytes of
* I - Immediate data. The operand value is encoded in subsequent bytes of
* the instruction.
* J - The instruction contains a relative offset to be added to the
* J - The instruction contains a relative offset to be added to the
* instruction pointer register.
* M - The ModR/M byte may refer only to memory.
* N - The R/M field of the ModR/M byte selects a packed-quadword MMX
* N - The R/M field of the ModR/M byte selects a packed-quadword MMX
technology register.
* O - The instruction has no ModR/M byte; the offset of the operand is
* coded as a word or double word (depending on address size attribute)
* in the instruction. No base register, index register, or scaling
* O - The instruction has no ModR/M byte; the offset of the operand is
* coded as a word or double word (depending on address size attribute)
* in the instruction. No base register, index register, or scaling
* factor can be applied.
* P - The reg field of the ModR/M byte selects a packed quadword MMX
* P - The reg field of the ModR/M byte selects a packed quadword MMX
* technology register.
* Q - A ModR/M byte follows the opcode and specifies the operand. The
* operand is either an MMX technology register or a memory address.
* If it is a memory address, the address is computed from a segment
* register and any of the following values: a base register, an
* Q - A ModR/M byte follows the opcode and specifies the operand. The
* operand is either an MMX technology register or a memory address.
* If it is a memory address, the address is computed from a segment
* register and any of the following values: a base register, an
* index register, a scaling factor, and a displacement.
* R - The mod field of the ModR/M byte may refer only to a general register.
* S - The reg field of the ModR/M byte selects a segment register.
* T - The reg field of the ModR/M byte selects a test register.
* U - The R/M field of the ModR/M byte selects a 128-bit XMM register.
* V - The reg field of the ModR/M byte selects a 128-bit XMM register.
* W - A ModR/M byte follows the opcode and specifies the operand. The
* operand is either a 128-bit XMM register or a memory address. If
* it is a memory address, the address is computed from a segment
* W - A ModR/M byte follows the opcode and specifies the operand. The
* operand is either a 128-bit XMM register or a memory address. If
* it is a memory address, the address is computed from a segment
* register and any of the following values: a base register, an
* index register, a scaling factor, and a displacement.
* X - Memory addressed by the DS:rSI register pair.
* Y - Memory addressed by the ES:rDI register pair.
*/
*/
/*
/*
* Codes for Operand Type:
* ----------------------
* a - Two one-word operands in memory or two double-word operands in
* a - Two one-word operands in memory or two double-word operands in
* memory, depending on operand-size attribute (used only by the BOUND
* instruction).
* b - Byte, regardless of operand-size attribute.

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: resolve.cc,v 1.16 2007-11-14 22:49:51 sshwarts Exp $
// $Id: resolve.cc,v 1.17 2008-02-05 22:33:33 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@ -210,10 +210,10 @@ void disassembler::resolve32_mod0_rm4(const x86_insn *insn, unsigned mode)
base = general_32bit_regname[insn->base];
else
disp32 = insn->displacement.displ32;
if (insn->index != 4)
index = general_32bit_regname[insn->index];
print_memory_access(mode, seg, base, index, insn->scale, disp32);
}
@ -260,7 +260,7 @@ void disassembler::resolve64_mod1or2(const x86_insn *insn, unsigned mode)
else
seg = sreg_mod01or10_rm32[insn->rm];
print_memory_access(mode, seg,
print_memory_access(mode, seg,
general_64bit_regname[insn->rm], NULL, 0, (Bit32s) insn->displacement.displ32, 1);
}
@ -278,10 +278,10 @@ void disassembler::resolve64_mod0_rm4(const x86_insn *insn, unsigned mode)
base = general_64bit_regname[insn->base];
else
disp32 = (Bit32s) insn->displacement.displ32;
if (insn->index != 4)
index = general_64bit_regname[insn->index];
print_memory_access(mode, seg, base, index, insn->scale, disp32, 1);
}
@ -332,7 +332,7 @@ void disassembler::print_datasize(unsigned size)
};
}
void disassembler::print_memory_access16(int datasize,
void disassembler::print_memory_access16(int datasize,
const char *seg, const char *index, Bit16u disp)
{
print_datasize(datasize);
@ -367,13 +367,13 @@ void disassembler::print_memory_access16(int datasize,
}
}
void disassembler::print_memory_access(int datasize,
void disassembler::print_memory_access(int datasize,
const char *seg, const char *base, const char *index, int scale, Bit32s disp, bx_bool disp64)
{
print_datasize(datasize);
scale = 1 << scale;
if (intel_mode)
{
if (base == NULL)
@ -436,7 +436,7 @@ void disassembler::print_memory_access(int datasize,
{
if (disp != 0) {
if (disp64) {
dis_sprintf("%s:[%s+%s*%d+0x%08x%08x]", seg, base, index, scale,
dis_sprintf("%s:[%s+%s*%d+0x%08x%08x]", seg, base, index, scale,
GET32H(disp), GET32L(disp));
}
else {

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: syntax.cc,v 1.12 2007-11-18 21:29:17 sshwarts Exp $
// $Id: syntax.cc,v 1.13 2008-02-05 22:33:33 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@ -54,13 +54,13 @@ static const char *intel_segment_name[8] = {
};
static const char *intel_index16[8] = {
"bx+si",
"bx+di",
"bp+si",
"bp+di",
"si",
"di",
"bp",
"bx+si",
"bx+di",
"bp+si",
"bp+di",
"si",
"di",
"bp",
"bx"
};
@ -112,13 +112,13 @@ static const char *att_segment_name[8] = {
};
static const char *att_index16[8] = {
"%bx, %si",
"%bx, %di",
"%bp, %si",
"%bp, %di",
"%si",
"%di",
"%bp",
"%bx, %si",
"%bx, %di",
"%bp, %si",
"%bp, %di",
"%si",
"%di",
"%bp",
"%bx"
};
@ -241,7 +241,7 @@ void disassembler::print_disassembly_intel(const x86_insn *insn, const BxDisasmO
//////////////////
// AT&T STYLE
//////////////////
void disassembler::set_syntax_att()
{
intel_mode = 0;
@ -269,11 +269,11 @@ void disassembler::print_disassembly_att(const x86_insn *insn, const BxDisasmOpc
// print opcode
dis_sprintf("%s ", entry->AttOpcode);
if (entry->Operand4) {
if (entry->Operand4) {
(this->*entry->Operand4)(insn);
dis_sprintf(", ");
}
if (entry->Operand3) {
if (entry->Operand3) {
(this->*entry->Operand3)(insn);
dis_sprintf(", ");
}

View File

@ -1,6 +1,6 @@
###################################################################
# doc/docbook/Makefile
# $Id: Makefile.in,v 1.21 2007-04-22 17:11:12 vruppert Exp $
# $Id: Makefile.in,v 1.22 2008-02-05 22:33:34 sshwarts Exp $
#
# Builds documentation in various formats from SGML source, and
# allows easy update to the Bochs web site.
@ -46,7 +46,7 @@ user/index.html: $(srcdir)/user/user.dbk
documentation/index.html: $(srcdir)/documentation/documentation.dbk
-mkdir -p documentation
$(DOCBOOK2HTML) -o documentation $(srcdir)/documentation/documentation.dbk
$(DOCBOOK2HTML) -o documentation $(srcdir)/documentation/documentation.dbk
development/index.html: $(srcdir)/development/development.dbk
-mkdir -p development

View File

@ -1,4 +1,4 @@
This is the base directory for the DocBook documents for the Bochs project.
This is the base directory for the DocBook documents for the Bochs project.
It has been broken down into the following directories:
user - The Bochs User Guide - describes how to setup and use Bochs
@ -6,7 +6,7 @@ user - The Bochs User Guide - describes how to setup and use Bochs
development - The Bochs Development Guide - contains development information and
how to contribute to the Bochs project
documentation - The Bochs Documentation Guide - contains information on how to
documentation - The Bochs Documentation Guide - contains information on how to
contribute to the documentation of the the Bochs project
images - pictures that may be reused in any of the three books. They can

View File

@ -1,7 +1,7 @@
<!--
================================================================
doc/docbook/development/development.dbk
$Id: development.dbk,v 1.26 2007-09-28 19:51:44 sshwarts Exp $
$Id: development.dbk,v 1.27 2008-02-05 22:33:34 sshwarts Exp $
This is the top level file for the Bochs Developers Manual.
================================================================
@ -55,7 +55,7 @@ yourself. The links below should help you get going.
<listitem> <para> A free version of secure shell called OpenSSH is at <ulink url="http://www.openssh.org">www.openssh.org</ulink>. </para> </listitem>
<listitem> <para> OpenSSH requires a library called OpenSSL from <ulink url="http://www.openssl.org">www.openssl.org</ulink>. Be sure to install OpenSSL before trying to compile OpenSSH. </para> </listitem>
</itemizedlist>
</section>
</section>
<section><title>ssh to cvs.sf.net</title>
<para>
@ -74,18 +74,18 @@ this step again, ever.
<para>
Replace <replaceable>sfusername</replaceable> with your Source Forge username,
of course. The first time, you will probably get a message like
of course. The first time, you will probably get a message like
<screen>
The authenticity of host 'cvs.sf.net' can't be established.
Are you sure you want to continue?</screen>
Just type yes. When it asks for a password, be sure to type your source
Just type yes. When it asks for a password, be sure to type your source
forge password. If you have trouble logging in, be sure to use your SOURCE
FORGE username and password in the ssh line, which isn't necessarily the same
as your local username and password. Add the "-v" option to ssh to see more
information about what is failing. If you have ssh version 2, it is possible
that you might need to add "-1" to the ssh command to force it to use the
version 1 protocol. </para> </section>
version 1 protocol. </para> </section>
<section><title>Set CVS_RSH environment variable to ssh</title>
<para>
@ -117,7 +117,7 @@ overwrite it.
<para>
In the CVSROOT variable, replace <replaceable>sfusername</replaceable> with your SF username. There's
no need to add CVSROOT to your rc files because CVS will remember it
after the checkout. The -z3 (optional) just adds some compression to make
after the checkout. The -z3 (optional) just adds some compression to make
the checkout go faster. Once all the files have been downloaded, you will
have a Bochs directory which is checked out with write access!
</para>
@ -258,7 +258,7 @@ disassembler, tracer, instrumentation.
<section id="directory-structure"><title>Directory Structure</title>
<para>
<table>
<table>
<title>Directory structure</title>
<tgroup cols="2">
<thead>
@ -446,7 +446,7 @@ method returns the parameter value.
</para>
<para>
The table below shows all parameter types used by the Bochs configuration interface.
<table>
<table>
<title>Parameter types</title>
<tgroup cols="2">
<thead>
@ -508,7 +508,7 @@ special parameter type, so they are saved as separate files.
</para>
<para>
The table below shows the additional parameter types for save/restore.
<table>
<table>
<title>Save/restore parameter types</title>
<tgroup cols="2">
<thead>
@ -569,8 +569,8 @@ All devices can uses these two save/restore specific methods:
<section id="cmos-map"><title>Bochs's CMOS map</title>
<para>
In addition to the default CMOS RAM layout, the Bochs BIOS uses some additional
registers for harddisk parameters and the boot sequence. The following table
In addition to the default CMOS RAM layout, the Bochs BIOS uses some additional
registers for harddisk parameters and the boot sequence. The following table
shows all CMOS registers and their meaning.
</para>
<para>
@ -710,7 +710,7 @@ Bochs, however, so you can find everything you need here.
<para>
SB16 Emulation has been tested with several soundcards and versions of Linux. Please give
Josef <ulink url="mailto:jdrexler@julian.uwo.ca">feedback</ulink> on
Josef <ulink url="mailto:jdrexler@julian.uwo.ca">feedback</ulink> on
whether is does or doesn't work on your combination of software and hardware.
</para>
@ -758,8 +758,8 @@ respectively. A future version might have selectable output devices.
</para>
<para>
A wavetable synthesizer on /dev/midi00 and a working /dev/dsp if you want real time music and sound, otherwise output to midi and wave files is also possible.
Optionally, you can use a software midi interpreter, such as the midid program from the DosEmu project instead of /dev/midi00.
A wavetable synthesizer on /dev/midi00 and a working /dev/dsp if you want real time music and sound, otherwise output to midi and wave files is also possible.
Optionally, you can use a software midi interpreter, such as the midid program from the DosEmu project instead of /dev/midi00.
</para>
</section>
@ -842,7 +842,7 @@ header files to get an idea about how these things really work.
<section><title>Files</title>
<para>
The main include file is <emphasis>bochs.h</emphasis>. It has all definitions
The main include file is <emphasis>bochs.h</emphasis>. It has all definitions
for the system-independent functions that the SB16 emulation uses, which
are defined in <emphasis>sb16.h</emphasis>.
</para>
@ -854,7 +854,7 @@ to use that driver.
</para>
<para>
To actually make the emulator use any specific driver,
To actually make the emulator use any specific driver,
<emphasis>BX_SOUND_OUTPUT_C</emphasis> has to be set to the name of the respective
output class.
</para>
@ -889,15 +889,15 @@ the emulator whenever output is necessary.
</para></listitem>
<listitem><para>
<emphasis>bx_sound_OS_c</emphasis> is derived from
<emphasis>bx_sound_output_c</emphasis>. It contains the code to generate
output for the <emphasis>OS</emphasis> operating system.
<emphasis>bx_sound_OS_c</emphasis> is derived from
<emphasis>bx_sound_output_c</emphasis>. It contains the code to generate
output for the <emphasis>OS</emphasis> operating system.
It is necessary to override all
the methods defined in the base class, unless virtual functions
are used. Note that this should remain an option, so try to
override all methods, even if only as stubs. They should be
declared <emphasis>virtual</emphasis> if and only if <emphasis>BX_USE_SOUND_VIRTUAL</emphasis>
is defined, just as in the examples.
is defined, just as in the examples.
The constructor should call the inherited constructor
as usual, even though the current constructor does not do
anything yet.
@ -910,7 +910,7 @@ anything yet.
<para>
The following are the methods that the output class has to override.
All but constructor and destructor have to return either
<emphasis>BX_SOUND_OUTPUT_OK</emphasis> <emphasis>(0)</emphasis> if the function was successful,
<emphasis>BX_SOUND_OUTPUT_OK</emphasis> <emphasis>(0)</emphasis> if the function was successful,
or <emphasis>BX_SOUND_OUTPUT_ERR</emphasis> <emphasis>(1)</emphasis> if not. If any of the initialization
functions fail, output to that device is disabled until the emulator is restarted.
</para>
@ -928,17 +928,17 @@ Description of the parameter:
<itemizedlist>
<listitem><para>
<emphasis>sb16</emphasis> is a pointer to the emulator class.
<emphasis>sb16</emphasis> is a pointer to the emulator class.
This pointer can then be used to access for example the <emphasis>writelog</emphasis> function to generate
sound-related log messages. Apart from that, no access to the emulator
should be necessary.
</para></listitem>
<listitem><para>
The constructor should <emphasis>not</emphasis> allocate the output devices.
This shouldn't be done until the actual output occurs; in either
The constructor should <emphasis>not</emphasis> allocate the output devices.
This shouldn't be done until the actual output occurs; in either
<emphasis>initmidioutput()</emphasis> or <emphasis>initwaveoutput()</emphasis>.
Otherwise it would be impossible to have two copies of Bochs running
Otherwise it would be impossible to have two copies of Bochs running
concurrently (if anybody ever wants to do this).
</para></listitem>
</itemizedlist>
@ -990,7 +990,7 @@ before it is changed.
<para>
<emphasis>midiready()</emphasis> is called whenever the applications asks if the
midi queue can accept more data.
midi queue can accept more data.
</para>
<para>
@ -999,11 +999,11 @@ Return values:
<itemizedlist>
<listitem><para>
<emphasis>BX_SOUND_OUTPUT_OK</emphasis> if the midi output device is ready.
<emphasis>BX_SOUND_OUTPUT_OK</emphasis> if the midi output device is ready.
</para></listitem>
<listitem><para>
<emphasis>BX_SOUND_OUTPUT_ERR</emphasis> if it isn't ready.
<emphasis>BX_SOUND_OUTPUT_ERR</emphasis> if it isn't ready.
</para></listitem>
</itemizedlist>
@ -1064,7 +1064,7 @@ Note, it might be <emphasis>NULL</emphasis> if length==0.
<section><title>int closemidioutput()</title>
<para>
<emphasis>closemidioutput()</emphasis> is called before shutting down Bochs or
<emphasis>closemidioutput()</emphasis> is called before shutting down Bochs or
when the
emulator gets the <emphasis>stop_output</emphasis> command through the emulator port.
After this, no more output will be necessary until <emphasis>openmidioutput()</emphasis>
@ -1197,7 +1197,7 @@ of one sample.
</itemizedlist>
<para>
<table>
<table>
<title>format bits</title>
<tgroup cols="2">
<thead>
@ -1217,7 +1217,7 @@ of one sample.
</tgroup>
</table>
<table>
<table>
<title>codecs</title>
<tgroup cols="2">
<thead>
@ -1258,9 +1258,9 @@ is done or aborted.
<para>
It should return whether the output device is ready for another buffer
of <emphasis>BX_SOUND_OUTPUT_WAVEPACKETSIZE</emphasis> bytes.
of <emphasis>BX_SOUND_OUTPUT_WAVEPACKETSIZE</emphasis> bytes.
If <emphasis>BX_SOUND_OUTPUT_ERR</emphasis>
is returned, the emulator waits about 1/(frequency * bytes per sample) seconds
is returned, the emulator waits about 1/(frequency * bytes per sample) seconds
and then asks again. The DMA transfer is stalled during that time, but
the application keeps running, until the output device becomes ready.
</para>
@ -1314,7 +1314,7 @@ the data stream. It will never be larger than <emphasis>BX_SB16_WAVEPACKETSIZE</
<para>
The order of bytes in the data stream is the same as that in the Wave file format:
<table>
<table>
<title>wave output types</title>
<tgroup cols="2">
<thead>
@ -1383,7 +1383,7 @@ the future.
<section id="harddisk-redologs"><title>Harddisk Images based on redologs</title>
<para>
This section describes how the three new disk images "undoable", "growing", and "volatile" are
This section describes how the three new disk images "undoable", "growing", and "volatile" are
implemented in Bochs 2.1 :
</para>
<itemizedlist>
@ -1406,12 +1406,12 @@ volatile -> flat file, plus hidden growing redolog
Description
</title>
<para>
The idea behind volatile and undoable disk images
is to have a flat file, associated with one redolog file.
The idea behind volatile and undoable disk images
is to have a flat file, associated with one redolog file.
</para>
<para>
Reading a sector is done from the redolog file if it contains
the sector, or from the flat file otherwise.
Reading a sector is done from the redolog file if it contains
the sector, or from the flat file otherwise.
</para>
<para>
Sectors written go to the redolog,
@ -1426,7 +1426,7 @@ sectors are done in place. Redolog files can not shrink.
The redolog is a growing file that can be created on the fly.
</para>
<para>
Now, it turns out that if you only use a redolog without any
Now, it turns out that if you only use a redolog without any
flat file, you get a "growing" disk image.
</para>
<para>
@ -1442,7 +1442,7 @@ are implemented on top of a redolog class.
<para>
At the start of a redolog file, there is a header, so Bochs can check whether
a file is consistent.
a file is consistent.
This header could also be checked when we implement
automatic type and size detection.
</para>
@ -1459,7 +1459,7 @@ of entries of the catalog, the extent, bitmap and disk size are stored.
<para>
In a redolog, the disk image is divided in a number of equal size "extents".
Each extent is a collection of successive 512-bytes sectors of the disk image,
preceeded by a n*512bytes bitmap.
preceeded by a n*512bytes bitmap.
</para>
<para>
@ -1488,7 +1488,7 @@ to be reusable by other disk image types.
</para>
<para>
The header length is 512 bytes. It contains :
<table>
<table>
<title>Generic header description</title>
<tgroup cols="5">
<thead>
@ -1509,7 +1509,7 @@ The header length is 512 bytes. It contains :
</tbody>
</tgroup>
</table>
<table>
<table>
<title>Redolog specific header description</title>
<tgroup cols="5">
<thead>
@ -1558,7 +1558,7 @@ Each position is a Bit32u entity.
</title>
<para>
The following tables shows what parameters are used when creating redologs or creating "growing" images :
<table>
<table>
<title>
How number of entries in the catalog and number of blocks by extents are computed
</title>
@ -1699,20 +1699,20 @@ This constant is used in the catalog for an unwritten extent.
<emphasis>redolog_t();</emphasis> instanciates a new redolog.
</para>
<para>
<emphasis>int make_header (const char* type, Bit64u size);</emphasis> creates a header
<emphasis>int make_header (const char* type, Bit64u size);</emphasis> creates a header
structure in memory, and sets its <emphasis>type</emphasis> and parameters based on the
disk image <emphasis>size</emphasis>. Returns 0.
</para>
<para>
<emphasis>int create (const char* filename, const char* type, Bit64u size);</emphasis>
<emphasis>int create (const char* filename, const char* type, Bit64u size);</emphasis>
creates a new empty redolog file, with header and catalog, named <emphasis>filename</emphasis>
of type <emphasis>type</emphasis> for a <emphasis>size</emphasis> bytes image.
Returns 0 for OK or -1 if a problem occured.
</para>
<para>
<emphasis>int create (int filedes, const char* type, Bit64u size);</emphasis>
creates a new empty redolog file, with header and catalog, in a previously
opened file described by <emphasis>filedes</emphasis>, of type <emphasis>type</emphasis>
creates a new empty redolog file, with header and catalog, in a previously
opened file described by <emphasis>filedes</emphasis>, of type <emphasis>type</emphasis>
for a <emphasis>size</emphasis> bytes image.
Returns 0 for OK or -1 if a problem occured.
</para>
@ -1745,13 +1745,13 @@ has not previously be written to the redolog.
</para>
<para>
<emphasis>ssize_t write (const void* buf, size_t count);</emphasis>
writes <emphasis>count</emphasis> bytes of data from <emphasis>buf</emphasis>
writes <emphasis>count</emphasis> bytes of data from <emphasis>buf</emphasis>
to the redolog, at current logical offset.
<emphasis>count</emphasis> must be 512.
Returns the number of bytes written.
</para>
</section>
</section>
</section> <!-- Redolog class description -->
@ -1761,7 +1761,7 @@ Returns the number of bytes written.
</title>
<para>
"volatile" and "undoable" disk images are easily implemented
by instanciating a <emphasis>default_image_t</emphasis> object (flat image)
by instanciating a <emphasis>default_image_t</emphasis> object (flat image)
and a <emphasis>redolog_t</emphasis> object (redolog).
</para>
<para>
@ -1802,7 +1802,7 @@ undoable_image_t(Bit64u size, const char* redolog_name);
</emphasis>
instanciates a new <emphasis>undoable_image_t</emphasis>
object. This disk image logical length is <emphasis>size</emphasis> bytes and
the redolog filename is <emphasis>redolog_name</emphasis>.
the redolog filename is <emphasis>redolog_name</emphasis>.
</para>
<para>
@ -1811,7 +1811,7 @@ int open (const char* pathname);
</emphasis>
opens the flat disk image <emphasis>pathname</emphasis>,
as an undoable disk image. The associated redolog will
be named <emphasis>pathname</emphasis> with a
be named <emphasis>pathname</emphasis> with a
<emphasis>UNDOABLE_REDOLOG_EXTENSION</emphasis>
suffix, unless set in the constructor.
Returns 0 for OK or -1 if a problem occured.
@ -1829,7 +1829,7 @@ closes the flat image and its redolog.
off_t lseek (off_t offset, int whence);
</emphasis>
seeks at logical data position <emphasis>offset</emphasis> in
the undoable disk image.
the undoable disk image.
Only SEEK_SET is supported for <emphasis>whence</emphasis>.
Returns -1 if a problem occured, or the current logical
offset in the undoable disk image.
@ -1839,7 +1839,7 @@ offset in the undoable disk image.
<emphasis>
ssize_t read (void* buf, size_t count);
</emphasis>
reads <emphasis>count</emphasis> bytes of data
reads <emphasis>count</emphasis> bytes of data
from the undoable disk image, from current logical offset,
and copies it into <emphasis>buf</emphasis>.
<emphasis>count</emphasis> must be 512.
@ -1853,7 +1853,7 @@ otherwise.
<emphasis>
ssize_t write (const void* buf, size_t count);
</emphasis>
writes <emphasis>count</emphasis> bytes of data from <emphasis>buf</emphasis>
writes <emphasis>count</emphasis> bytes of data from <emphasis>buf</emphasis>
to the undoable disk image, at current logical offset.
<emphasis>count</emphasis> must be 512.
Returns the number of bytes written.
@ -1871,8 +1871,8 @@ volatile_image_t(Bit64u size, const char* redolog_name);
</emphasis>
instanciates a new <emphasis>volatile_image_t</emphasis>
object. This disk image logical length is <emphasis>size</emphasis> bytes and
the redolog filename is <emphasis>redolog_name</emphasis> plus a
random suffix.
the redolog filename is <emphasis>redolog_name</emphasis> plus a
random suffix.
</para>
<para>
@ -1881,7 +1881,7 @@ int open (const char* pathname);
</emphasis>
opens the flat disk image <emphasis>pathname</emphasis>,
as a volatile disk image. The associated redolog will
be named <emphasis>pathname</emphasis> with a
be named <emphasis>pathname</emphasis> with a
random suffix, unless set in the constructor.
Returns 0 for OK or -1 if a problem occured.
</para>
@ -1899,7 +1899,7 @@ The redolog is deleted/lost after close is called.
off_t lseek (off_t offset, int whence);
</emphasis>
seeks at logical data position <emphasis>offset</emphasis> in
the volatile disk image.
the volatile disk image.
Only SEEK_SET is supported for <emphasis>whence</emphasis>.
Returns -1 if a problem occured, or the current logical offset in
the volatile disk image.
@ -1909,7 +1909,7 @@ the volatile disk image.
<emphasis>
ssize_t read (void* buf, size_t count);
</emphasis>
reads <emphasis>count</emphasis> bytes of data
reads <emphasis>count</emphasis> bytes of data
from the volatile disk image, from current logical offset,
and copies it into <emphasis>buf</emphasis>.
<emphasis>count</emphasis> must be 512.
@ -1923,7 +1923,7 @@ otherwise.
<emphasis>
ssize_t write (const void* buf, size_t count);
</emphasis>
writes <emphasis>count</emphasis> bytes of data from <emphasis>buf</emphasis>
writes <emphasis>count</emphasis> bytes of data from <emphasis>buf</emphasis>
to the volatile disk image, at current logical offset.
<emphasis>count</emphasis> must be 512.
Returns the number of bytes written.
@ -1963,7 +1963,7 @@ closes the growing disk image.
off_t lseek (off_t offset, int whence);
</emphasis>
seeks at logical data position <emphasis>offset</emphasis> in
the growable disk image.
the growable disk image.
Only SEEK_SET is supported for <emphasis>whence</emphasis>.
Returns -1 if a problem occured, or the current logical offset in
the grwoing image.
@ -1973,7 +1973,7 @@ the grwoing image.
<emphasis>
ssize_t read (void* buf, size_t count);
</emphasis>
reads <emphasis>count</emphasis> bytes of data
reads <emphasis>count</emphasis> bytes of data
from the growing disk image, from current logical offset,
and copies it into <emphasis>buf</emphasis>.
<emphasis>count</emphasis> must be 512.
@ -1986,7 +1986,7 @@ has not been previously written to the growing image.
<emphasis>
ssize_t write (const void* buf, size_t count);
</emphasis>
writes <emphasis>count</emphasis> bytes of data from <emphasis>buf</emphasis>
writes <emphasis>count</emphasis> bytes of data from <emphasis>buf</emphasis>
to the growing disk image, at current logical offset.
<emphasis>count</emphasis> must be 512.
Returns the number of bytes written.
@ -2015,7 +2015,7 @@ The function must be "static Bit32u (*)(const char *)" typed, and must return
BX_KEYMAP_UNKNOWN if it can not translate the parameter string.
What you have to do is :
- call once "void loadKeymap(Bit32u (*)(const char*))",
- call once "void loadKeymap(Bit32u (*)(const char*))",
providing your translation function, to load the keymap
- call "Bit32u getBXKey(Bit32u)" that returns the BX_KEY_*
constant, for each key you want to map.
@ -2051,7 +2051,7 @@ as an example.
</section>
<section id="iodebug"><title>I/O Interface to Bochs Debugger</title>
<para>
This device was added by Dave Poirier (eks@void-core.2y.net).
This device was added by Dave Poirier (eks@void-core.2y.net).
</para>
<para>
Compiling Bochs with iodebug support
@ -2303,7 +2303,7 @@ These instructions require cygwin and MSVC++.
<para>
In Cygwin:
<screen>
sh .conf.win32-vcpp # runs configure
sh .conf.win32-vcpp # runs configure
make win32_snap # unzip workspace, make a win32 source ZIP
</screen>
Copy the source ZIP to a windows machine, if necessary.
@ -2353,7 +2353,7 @@ Now make the NSIS installer package (the current script is known to work with NS
<screen>
cd build/win32/nsis
</screen>
Unzip the binary ZIP file into bochs-$VERSION (must match Makefile) and
Unzip the binary ZIP file into bochs-$VERSION (must match Makefile) and
then run make.
<screen>
unzip ~/bochs-2.2.pre2.zip

View File

@ -1,7 +1,7 @@
<!--
================================================================
doc/docbook/documentation/documentation.dbk
$Id: documentation.dbk,v 1.15 2004-11-24 16:52:39 vruppert Exp $
$Id: documentation.dbk,v 1.16 2008-02-05 22:33:34 sshwarts Exp $
This is the top level file for the Bochs Documentation Manual.
================================================================
@ -43,7 +43,7 @@ The Bochs documentation is divided into three major divisions:
Documentation Guide: Describes how the documentation is organized, and how to render it, and how to add to it. This section is in the documentation guide.
</para>
</listitem>
</itemizedlist>
</itemizedlist>
</para>
<para>
@ -76,7 +76,7 @@ code to the rendered documentation on the web site, it will be pretty obvious
what all the codes are doing. HTML is very forgiving about breaking the syntax
rules, such as not putting &lt;/h1&gt; at then end of an &lt;h1&gt; section.
SGML is picky; if you forget that kind of thing in SGML, it will insist that
you fix it.
you fix it.
</para>
<para>
@ -143,8 +143,8 @@ anyone's system other than yours.
</para>
<para>
There are over 300 tags defined in the latest version of docbook, so
we won't try to list them all here. Once you get the idea, you can
There are over 300 tags defined in the latest version of docbook, so
we won't try to list them all here. Once you get the idea, you can
either find examples in the rest of the documentation that do what you
need, or look at Walsh and Muellner's
<ulink url="http://www.docbook.org/tdg/en/html/docbook.html">DocBook: The Definitive Guide</ulink>
@ -156,8 +156,8 @@ for more details.
<section id="references"><title>References and Other Tutorials</title>
<para>
Docbook was created more than 10 years ago, but since 1999, Docbook has been
under the guidance of the DocBook Technical Committee at OASIS. The
Docbook was created more than 10 years ago, but since 1999, Docbook has been
under the guidance of the DocBook Technical Committee at OASIS. The
<ulink url="http://www.oasis-open.org/committees/docbook">OASIS website</ulink>
distributes the official DocBook DTDs, and has pages on Docbook history,
samples, tools, and runs a few docbook mailing lists.
@ -187,7 +187,7 @@ HOWTO, also by Jorge Godoy</ulink>
An article on lwn.net called <ulink
url="http://lwn.net/2000/features/DocBook">Exploring SGML Docbook</ulink>
focuses mostly on installation of tools from scratch: openjade, Norman Walsh's
DSSSL stylesheets, and jade2tex. If you can get the tools from RPMs or
DSSSL stylesheets, and jade2tex. If you can get the tools from RPMs or
whatever package your OS uses, use that instead.
</para>
@ -265,8 +265,8 @@ along with a hint on how to spell them.
<chapter id="reading-writing"><title>Reading and Writing</title>
<para>
The DocBook source code -- user.dbk, for example -- is a plain text file that
can be directly edited and saved with any text editor such as emacs or vi.
The DocBook source code -- user.dbk, for example -- is a plain text file that
can be directly edited and saved with any text editor such as emacs or vi.
</para>
<tip>
@ -287,9 +287,9 @@ documentation.
<tip>
<para>
The rendering process is one-way. That is, the DocBook source files will be
The rendering process is one-way. That is, the DocBook source files will be
downloaded from CVS, edited, and uploaded to CVS as .dbk files. Along the
way, it will probably be necessary to render them into HTML, but only to
way, it will probably be necessary to render them into HTML, but only to
check one's work or to post them as part of a web page. (I hope I'm not the
only person to spend nine minutes trying to figure out how to 'compile' HTML
into DocBook format.)
@ -317,7 +317,7 @@ Here is what the Linux Documentation Project says about jade:
What does all this mean?
For purposes of Bochs documentation, jade reads the docbook source file and
writes out a HTML/PDF/PS file. Bochs documentation is in SGML format, though
apparantly jade can handle XML Docbooks as well. DSSSL stands for
apparantly jade can handle XML Docbooks as well. DSSSL stands for
<quote>Document Style Semantics and Specification Language</quote>, and it
tells jade how to translate the docbook tags into the target format. DSSSL
files are written in the Scheme programming language, which is a variant of
@ -386,8 +386,8 @@ writer the package names that you used so that we can include it in the docs.
<para>
If you cannot get jade to work using packages, you need to find and install
three things: the DocBook DTD version 4.1 from &OASIS;, the program
<ulink url="http://www.jclark.com/jade/">jade</ulink>
three things: the DocBook DTD version 4.1 from &OASIS;, the program
<ulink url="http://www.jclark.com/jade/">jade</ulink>
(or <ulink url="http://openjade.sourceforge.net/">openjade</ulink>), and the
<ulink url="http://sourceforge.net/projects/docbook/">Docbook DSSSL
stylesheets</ulink> for the formats that you want to render to. The whole
@ -434,7 +434,7 @@ one.
<title>Using jade directly</title>
<para>
If you don't have docbook2<replaceable>format</replaceable> scripts, you
can also run jade manually. The command is long, so you may want to make
can also run jade manually. The command is long, so you may want to make
your own script or edit your copy of the makefile. These commands assume that
you installed Norman Walsh's DSSSL stylesheets in <varname>$DSSSL</varname>.
To render the user's guide into HTML, type:
@ -482,7 +482,7 @@ that the document conforms to all the rules of the DTD.
A program called nsgmls, written by James Clark <email>jjc@jclark.com</email>,
can validate an SGML document such as our docbook. Although nsgmls can do many
other things, this command will validate the docbook against the DTD which
defines the syntax:
defines the syntax:
<cmdsynopsis>
<command>nsgmls</command>
<arg choice="plain">-s</arg>
@ -493,9 +493,9 @@ defines the syntax:
<para>
Nsgmls is part of SP, a "free object-oriented toolkit for SGML parsing and
entity management" by James Clark <email>jjc@jclark.com</email>. SP can be
found at
found at
<ulink url="http://www.jclark.com/sp">http://www.jclark.com/sp</ulink>.
There is a complete man page for nsgmls
There is a complete man page for nsgmls
<ulink url="http://www.jclark.com/sp/nsgmls.htm">here</ulink>.
</para>

View File

@ -1,14 +1,14 @@
<!--
================================================================
doc/docbook/include/defs.sgm
$Id: defs.sgm,v 1.7 2004-08-24 12:23:35 vruppert Exp $
$Id: defs.sgm,v 1.8 2008-02-05 22:33:34 sshwarts Exp $
This file is included by all Bochs docbook files, so that the
definitions can be used anywhere in the documentation.
================================================================
-->
<!--
<!--
Editing marks. FIXME is just a reminder for somebody to come back and
work on the section. NEEDHELP means that the author doesn't have enough
information to finish, and would like someone else to assist.

View File

@ -1,4 +1,4 @@
$Id: misc.txt,v 1.32 2005-03-28 08:56:06 vruppert Exp $
$Id: misc.txt,v 1.33 2008-02-05 22:33:34 sshwarts Exp $
This is a temporary place to paste in stuff that should go into the docs one
day. When it is transferred into docbook, let's remove it from misc.txt.
@ -10,7 +10,7 @@ day. When it is transferred into docbook, let's remove it from misc.txt.
Date: Thu, 15 Nov 2001 13:31:34 -0800
From: David Christy <davidc@davidc.biz>
To: bryce@tlw.com
Subject: usefull info for mounting
Subject: usefull info for mounting
I didn't see this in the doc's so I thought you might like a
@ -67,8 +67,8 @@ and may need significant hacking to make it work again.
------------------
Changes by Bryce Denney 4/5/2001:
I moved the contents of macutils.h into osdep.h, and macutils.c
into osdep.cc. There are functions missing on other platforms too,
I moved the contents of macutils.h into osdep.h, and macutils.c
into osdep.cc. There are functions missing on other platforms too,
so I wanted to bring them all into the same place.
The original macintosh.txt follows.
@ -310,7 +310,7 @@ login prompt. You are now running DLX Linux in a window!
<para>
Bochs simulates every instruction of an x86 CPU, so it is very memory- and
compute-intensive. The speed of your real CPU will make a big difference in
how fast the DLX Linux image boots. On a 1GHz Pentium, the sample Linux
how fast the DLX Linux image boots. On a 1GHz Pentium, the sample Linux
image takes about 10 seconds to boot.
</para>
@ -362,15 +362,15 @@ From: Jeremy Wilkins <jeb at jeremywilkins.freeserve.co.uk>
To: bochs-developers@lists.sourceforge.net
Subject: [Bochs-developers] Odd network errors with NT4 Guest OS
I'm having trouble transferring files over the network to the guest OS
(NT4 SP1). If I'm using SMB then the it errors out early on with a
session cancelled. The file is 36Mb (SP6). I've tried with various file
I'm having trouble transferring files over the network to the guest OS
(NT4 SP1). If I'm using SMB then the it errors out early on with a
session cancelled. The file is 36Mb (SP6). I've tried with various file
sizes, 3Meg files work, 5 meg files do not.
I've also tried shuffling the files over http with similar problems,
I've also tried shuffling the files over http with similar problems,
small files are fine (can browse websites) but large files just error out.
The system is a 1Ghz Windows XP SP1 box with bochs 2.02, guest OS is
The system is a 1Ghz Windows XP SP1 box with bochs 2.02, guest OS is
allocated 64Mb of RAM and running Windows NT4 SP1.
Any clues, anyone experiencing similar problems?
@ -382,7 +382,7 @@ To: Jeremy Wilkins <jeb at jeremywilkins.freeserve.co.uk>
Cc: bochs-developers@lists.sourceforge.net
Subject: Re: [Bochs-developers] Odd network errors with NT4 Guest OS
Did you try with a big IPS? start the guest clock applet and try to get
Did you try with a big IPS? start the guest clock applet and try to get
a more or less accurate time, with 1 Ghz should be in the 50 000 000 range.
IIRC NT timeout and abort before it send the whole packet.
@ -392,13 +392,13 @@ From: Jeremy Wilkins <jeb at jeremywilkins.freeserve.co.uk>
To: didier <dgautheron at magic.fr>, bochs-developers@lists.sourceforge.net
Subject: Re: [Bochs-developers] Odd network errors with NT4 Guest OS
Thanks, 60 000 000 seems to have done the trick (I can copy sp6 across
Thanks, 60 000 000 seems to have done the trick (I can copy sp6 across
anyway). My original guess of 4000000 IPS was probably a bit low :)
thanks again
------------------------------------------
TAP under FreeBSD
TAP under FreeBSD
Date: Fri, 14 Feb 2003 02:12:38 +0100
From: Ronald Klop <ronald at echteman.nl>

View File

@ -1,10 +1,10 @@
--- Bryce Denney <bryce@tlw.com> wrote:
> Hi Michael,
>
>
> I added some flesh to the skeleton. I tried to keep things in approximately
> the order that brand new user might need the information. It goes through
> the process of:
>
>
> 1. Is this thing worth looking at?
> 2. Ok, but will I be able to do X,Y,Z?
> 3. Fine, I'll download it. What should I download
@ -15,14 +15,14 @@
> 5. Now how do you change the settings, try a
> different disk image, make a
> disk, etc. Who do I ask for help?
>
>
> If they get to #5, they are a bochs user. And
> eventually...
>
>
> 6. Hey, I added USB support to talk to my scanner,
> anybody want to try it?
>
>
>
>
Here's the outline that the docbooks are organized by, basically.
@ -66,7 +66,7 @@ Bochs Users Guide
What to report if configure fails: Tar up config.* and send to
bochs-testing@tlw.com
Make
What to try if make fails: turn off configure options,
What to try if make fails: turn off configure options,
look at SF bugs and patches section to see if it's a known
problem, try to fix it yourself, if using CVS version try
a release source file instead, fix it yourself

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ bochsrc options on the command line or in the start menu.
.BI \-h,\ --help
Print a summary of the command line options for bochs and exit.
.LP
You can override the settings from the configuration file
You can override the settings from the configuration file
with command line arguments, using the same syntax as the
bochsrc file. If you have any spaces in your command line
arguments, they should be enclosed in single quotes.

View File

@ -15,7 +15,7 @@ the current directory before running Bochs or in your
home directory.
Starting with Bochs 1.3, you can use environment variables in
the bochsrc file, for example:
the bochsrc file, for example:
floppya: 1_44="$IMAGES/bootdisk.img", status=inserted
@ -23,7 +23,7 @@ Starting with version 2.0, two environment variables have a built-in
default value which is set at compile time. $BXSHARE points to the
"share" directory which is typically /usr/local/share/bochs on UNIX
machines. See the $(sharedir) variable in the Makefile for the exact
value. $BXSHARE is used by disk images to locate the directory where
value. $BXSHARE is used by disk images to locate the directory where
the BIOS images and keymaps can be found. If $BXSHARE is not defined, Bochs
will supply the default value. Also, $LTDL_LIBRARY_PATH points to a list of
directories (separated by colons if more than one) to search in for Bochs
@ -48,8 +48,8 @@ allows you to change all the settings that control Bochs's behavior.
There are two choices of configuration interface: a text mode version
called "textconfig" and a graphical version called "wx". The text
mode version uses stdin/stdout and is always compiled in. The graphical
version is only available when you use "--with-wx" on the configure
command. If you do not write a config_interface line, Bochs will
version is only available when you use "--with-wx" on the configure
command. If you do not write a config_interface line, Bochs will
choose a default for you.
.B NOTE:
@ -61,14 +61,14 @@ Example:
.TP
.I "display_library:"
The display library is the code that displays the Bochs VGA screen. Bochs
has a selection of about 10 different display library implementations for
different platforms. If you run configure with multiple --with-* options,
The display library is the code that displays the Bochs VGA screen. Bochs
has a selection of about 10 different display library implementations for
different platforms. If you run configure with multiple --with-* options,
the display_library command lets you choose which one you want to run with.
If you do not write a display_library line, Bochs will choose a default for
you.
The choices are:
The choices are:
x X windows interface, cross platform
win32 native win32 libraries
carbon Carbon library (for MacOS X)
@ -119,13 +119,13 @@ values different from 1.
quantum:
Maximum amount of instructions allowed to execute by processor before
returning control to another cpu. This option exists only in Bochs
returning control to another cpu. This option exists only in Bochs
binary compiled with SMP support.
reset_on_triple_fault:
Reset the CPU when triple fault occur (highly recommended) rather than
PANIC. Remember that if you trying to continue after triple fault the
PANIC. Remember that if you trying to continue after triple fault the
simulation will be completely bogus !
ips:
@ -162,7 +162,7 @@ Example:
.TP
.I "megs:"
Set the number of Megabytes of physical memory you want to emulate.
Set the number of Megabytes of physical memory you want to emulate.
The default is 32MB, most OS's won't need more than that.
The maximum amount of memory supported is 2048Mb.
@ -252,7 +252,7 @@ Examples:
.I "ata\fR[\fB0-3\fR]\fI-master: \fPor \fIata\fR[\fB0-3\fR]\fI-slave:"
This defines the type and characteristics of all attached ata devices:
type= type of attached device [disk|cdrom]
type= type of attached device [disk|cdrom]
path= path of the image
mode= image mode [flat|concat|external|dll|sparse|vmware3|undoable|growing|volatile], only valid for disks
cylinders= only valid for disks
@ -263,14 +263,14 @@ This defines the type and characteristics of all attached ata devices:
translation=type of translation of the bios, only for disks [none|lba|large|rechs|auto]
model= string returned by identify device command
journal= optional filename of the redolog for undoable and volatile disks
Point this at a hard disk image file, cdrom iso file,
or a physical cdrom device.
To create a hard disk image, try running bximage.
It will help you choose the size and then suggest a line that
or a physical cdrom device.
To create a hard disk image, try running bximage.
It will help you choose the size and then suggest a line that
works with it.
In UNIX it is possible to use a raw device as a Bochs hard disk,
In UNIX it is possible to use a raw device as a Bochs hard disk,
but WE DON'T RECOMMEND IT.
The path is always mandatory. Disk geometry autodetection works with images
@ -283,7 +283,7 @@ The mode option defines how the disk image is handled. Disks can be defined as:
- concat : multiple files layout
- external : developer's specific, through a C++ class
- dll : developer's specific, through a DLL
- sparse : stackable, commitable, rollbackable
- sparse : stackable, commitable, rollbackable
- vmware3 : vmware3 disk support
- undoable : flat file with commitable redolog
- growing : growing file
@ -381,7 +381,7 @@ You may use those special tokens :
%i : 8 hexadecimal digits of cpu0 current eip
%e : 1 character event type ('i'nfo, 'd'ebug, 'p'anic, 'e'rror)
%d : 5 characters string of the device, between brackets
Default : %t%e%d
Examples:
@ -453,7 +453,7 @@ ignore (do nothing). You should generally set
this to ignore, unless you are trying to
diagnose a particular problem.
.B NOTE:
.B NOTE:
When action=report, Bochs may spit out
thousands of debug messages per second, which
can impact performance and fill up your disk.
@ -572,7 +572,7 @@ Approximate time in microseconds between attempts to paste
characters to the keyboard controller. This leaves time for the
guest os to deal with the flow of characters. The ideal setting
depends on how your operating system processes characters. The
default of 100000 usec (.1 seconds) was chosen because it works
default of 100000 usec (.1 seconds) was chosen because it works
consistently in Windows.
If your OS is losing characters during a paste, increase the paste
@ -596,9 +596,9 @@ TO BE COMPLETED (see Greg explanation in feature request #536329)
time0
Specifies the start (boot) time of the virtual machine. Use a time
value as returned by the time(2) system call. If no time0 value is
set or if time0 equal to 1 (special case) or if time0 equal 'local',
Specifies the start (boot) time of the virtual machine. Use a time
value as returned by the time(2) system call. If no time0 value is
set or if time0 equal to 1 (special case) or if time0 equal 'local',
the simulation will be started at the current local host time.
If time0 equal to 2 (special case) or if time0 equal 'utc',
the simulation will be started at the current utc time.
@ -670,10 +670,10 @@ device ID of the PCI device you want to map within Bochs.
.I "ne2k:"
Defines the characteristics of an attached ne2000 isa card :
ioaddr=IOADDR,
irq=IRQ,
mac=MACADDR,
ethmod=MODULE,
ethdev=DEVICE,
irq=IRQ,
mac=MACADDR,
ethmod=MODULE,
ethdev=DEVICE,
script=SCRIPT
.B PROPERTIES FOR ne2k:
@ -745,8 +745,8 @@ If enabled, the keymap file must be specified.
.TP
.I "keyboard_type:"
Type of emulated keyboard sent back to the OS
to a "keyboard identify" command. It must be
one of "xt", "at" or "mf".
to a "keyboard identify" command. It must be
one of "xt", "at" or "mf".
Example:
keyboard_type: mf

View File

@ -25,7 +25,7 @@ if (address_is_within_this_CPUs_local_APIC_area)
do_local_APIC_access();
else if (address_is_within_an_I/O_APIC_area)
do_I/O_APIC_access();
else if (address_is_within_a_PCI_device_area)
else if (address_is_within_a_PCI_device_area)
do_PCI_access();
else if (address_is_within_RAM_area)
do_RAM_access();
@ -34,7 +34,7 @@ else printf("Bogus address!\n");
For an accesses originating from a PCI device (e.g. PCI bus masters), there
is no access to any CPUs local APIC. It'd go like:
if (address_is_within_an_I/O_APIC_area)
if (address_is_within_an_I/O_APIC_area)
do_I/O_APIC_access();
else if (address_is_within_a_PCI_device_area)
do_PCI_access();

View File

@ -1,6 +1,6 @@
look at http://www.ao.net/help/software/lps/disktools/INDEX
asbench.zip Benchmark for drives under a ASPI device driver
ataid011.zip ATA Identification. Echos Identify Drive data
ataid011.zip ATA Identification. Echos Identify Drive data
atrt4mb.exe AT Regression test
and most interesting of all:
ext2tool.zip Mount and use Ext2 filesystems from DOS

View File

@ -21,7 +21,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Written for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#define FLOAT128
@ -30,7 +30,7 @@ these four paragraphs for those parts of this code that are retained.
static const floatx80 floatx80_negone = packFloatx80(1, 0x3fff, BX_CONST64(0x8000000000000000));
static const floatx80 floatx80_neghalf = packFloatx80(1, 0x3ffe, BX_CONST64(0x8000000000000000));
static const float128 float128_ln2 =
static const float128 float128_ln2 =
packFloat128(BX_CONST64(0x3ffe62e42fefa39e), BX_CONST64(0xf35793c7673007e6));
#define LN2_SIG BX_CONST64(0xb17217f7d1cf79ac)
@ -78,7 +78,7 @@ static float128 poly_exp(float128 x, float_status_t &status)
// -- 2k -- 2k+1
// k=0 k=0
//
// x
// x
// e - 1 ~ x * [ p(x) + x * q(x) ]
//
*/
@ -110,7 +110,7 @@ floatx80 f2xm1(floatx80 a, float_status_t &status)
Bit64u zSig0, zSig1;
// handle unsupported extended double-precision floating encodings
if (floatx80_is_unsupported(a))
if (floatx80_is_unsupported(a))
{
float_raise(status, float_flag_invalid);
return floatx80_default_nan;
@ -119,7 +119,7 @@ floatx80 f2xm1(floatx80 a, float_status_t &status)
Bit64u aSig = extractFloatx80Frac(a);
Bit32s aExp = extractFloatx80Exp(a);
int aSign = extractFloatx80Sign(a);
if (aExp == 0x7FFF) {
if ((Bit64u) (aSig<<1))
return propagateFloatx80NaN(a, status);
@ -158,7 +158,7 @@ floatx80 f2xm1(floatx80 a, float_status_t &status)
x = poly_exp(x, status);
return float128_to_floatx80(x, status);
}
else
else
{
if ((a.exp == 0xBFFF) && (! (aSig<<1)))
return floatx80_neghalf;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ferr.cc,v 1.8 2007-03-23 21:27:12 sshwarts Exp $
// $Id: ferr.cc,v 1.9 2008-02-05 22:33:34 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -47,7 +47,7 @@ void BX_CPU_C::FPU_stack_underflow(int stnr, int pop_stack)
if (BX_CPU_THIS_PTR the_i387.is_IA_masked())
{
BX_WRITE_FPU_REGISTER_AND_TAG(floatx80_default_nan, FPU_Tag_Special, stnr);
if (pop_stack)
if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop();
}
FPU_exception(FPU_EX_Stack_Underflow);

View File

@ -21,7 +21,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Written for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#define FLOAT128
@ -31,16 +31,16 @@ these four paragraphs for those parts of this code that are retained.
#define FPATAN_ARR_SIZE 11
static const float128 float128_one =
static const float128 float128_one =
packFloat128(BX_CONST64(0x3fff000000000000), BX_CONST64(0x0000000000000000));
static const float128 float128_sqrt3 =
packFloat128(BX_CONST64(0x3fffbb67ae8584ca), BX_CONST64(0xa73b25742d7078b8));
static const floatx80 floatx80_pi =
static const floatx80 floatx80_pi =
packFloatx80(0, 0x4000, BX_CONST64(0xc90fdaa22168c235));
static const float128 float128_pi2 =
static const float128 float128_pi2 =
packFloat128(BX_CONST64(0x3fff921fb54442d1), BX_CONST64(0x8469898CC5170416));
static const float128 float128_pi4 =
static const float128 float128_pi4 =
packFloat128(BX_CONST64(0x3ffe921fb54442d1), BX_CONST64(0x8469898CC5170416));
static const float128 float128_pi6 =
packFloat128(BX_CONST64(0x3ffe0c152382d736), BX_CONST64(0x58465BB32E0F580F));
@ -123,7 +123,7 @@ static float128 poly_atan(float128 x1, float_status_t &status)
// atan(x) = PI/4 + atan( ----- )
// x+1
//
// x * sqrt(3) - 1
// x * sqrt(3) - 1
// atan(x) = PI/6 + atan( ----------------- )
// x + sqrt(3)
//
@ -150,7 +150,7 @@ floatx80 fpatan(floatx80 a, floatx80 b, float_status_t &status)
int bSign = extractFloatx80Sign(b);
int zSign = aSign ^ bSign;
if (bExp == 0x7FFF)
{
if ((Bit64u) (bSig<<1))
@ -161,16 +161,16 @@ floatx80 fpatan(floatx80 a, floatx80 b, float_status_t &status)
return propagateFloatx80NaN(a, b, status);
if (aSign) { /* return 3PI/4 */
return roundAndPackFloatx80(80, bSign,
return roundAndPackFloatx80(80, bSign,
FLOATX80_3PI4_EXP, FLOAT_3PI4_HI, FLOAT_3PI4_LO, status);
}
}
else { /* return PI/4 */
return roundAndPackFloatx80(80, bSign,
return roundAndPackFloatx80(80, bSign,
FLOATX80_PI4_EXP, FLOAT_PI_HI, FLOAT_PI_LO, status);
}
}
if (aSig && (aExp == 0))
if (aSig && (aExp == 0))
float_raise(status, float_flag_denormal);
/* return PI/2 */
@ -178,10 +178,10 @@ floatx80 fpatan(floatx80 a, floatx80 b, float_status_t &status)
}
if (aExp == 0x7FFF)
{
if ((Bit64u) (aSig<<1))
if ((Bit64u) (aSig<<1))
return propagateFloatx80NaN(a, b, status);
if (bSig && (bExp == 0))
if (bSig && (bExp == 0))
float_raise(status, float_flag_denormal);
return_PI_or_ZERO:
@ -216,7 +216,7 @@ return_PI_or_ZERO:
/* |a| = |b| ==> return PI/4 */
if (aSig == bSig && aExp == bExp)
return roundAndPackFloatx80(80, bSign, FLOATX80_PI4_EXP, FLOAT_PI_HI, FLOAT_PI_LO, status);
/* ******************************** */
/* using float128 for approximation */
/* ******************************** */
@ -242,7 +242,7 @@ return_PI_or_ZERO:
if (x.hi >= BX_CONST64(0x3ffe800000000000)) // 3/4 < x < 1
{
/*
/*
arctan(x) = arctan((x-1)/(x+1)) + pi/4
*/
float128 t1 = float128_sub(x, float128_one, status);
@ -253,9 +253,9 @@ return_PI_or_ZERO:
else
{
/* argument correction */
if (xExp >= 0x3FFD) // 1/4 < x < 3/4
{
/*
if (xExp >= 0x3FFD) // 1/4 < x < 3/4
{
/*
arctan(x) = arctan((x*sqrt(3)-1)/(x+sqrt(3))) + pi/6
*/
float128 t1 = float128_mul(x, float128_sqrt3, status);

View File

@ -21,7 +21,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Written for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#include "softfloatx80.h"
#include "softfloat-round-pack.h"
@ -67,7 +67,7 @@ static floatx80 do_fprem(floatx80 a, floatx80 b, Bit64u &q, int rounding_mode, f
if (aExp == 0x7FFF) {
if ((Bit64u) (aSig0<<1)
|| ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
|| ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
{
return propagateFloatx80NaN(a, b, status);
}
@ -105,7 +105,7 @@ static floatx80 do_fprem(floatx80 a, floatx80 b, Bit64u &q, int rounding_mode, f
if (expDiff < 0) {
if (expDiff < -1)
return (a.fraction & BX_CONST64(0x8000000000000000)) ?
return (a.fraction & BX_CONST64(0x8000000000000000)) ?
packFloatx80(aSign, aExp, aSig0) : a;
shift128Right(aSig0, 0, 1, &aSig0, &aSig1);
expDiff = 0;
@ -130,7 +130,7 @@ static floatx80 do_fprem(floatx80 a, floatx80 b, Bit64u &q, int rounding_mode, f
{
int lt = lt128(term0, term1, aSig0, aSig1);
int eq = eq128(aSig0, aSig1, term0, term1);
if ((eq && (q & 1)) || lt) {
aSign = !aSign;
++q;
@ -157,9 +157,9 @@ floatx80 floatx80_ieee754_remainder(floatx80 a, floatx80 b, Bit64u &q, float_sta
/*----------------------------------------------------------------------------
| Returns the remainder of the extended double-precision floating-point value
| `a' with respect to the corresponding value `b'. Unlike previous function
| the function does not compute the remainder specified in the IEC/IEEE
| the function does not compute the remainder specified in the IEC/IEEE
| Standard for Binary Floating-Point Arithmetic. This function operates
| differently from the previous function in the way that it rounds the
| differently from the previous function in the way that it rounds the
| quotient of 'a' divided by 'b' to an integer.
*----------------------------------------------------------------------------*/

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu.cc,v 1.32 2008-01-10 19:37:56 sshwarts Exp $
// $Id: fpu.cc,v 1.33 2008-02-05 22:33:34 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -34,7 +34,7 @@
#if BX_SUPPORT_FPU
void BX_CPU_C::prepareFPU(bxInstruction_c *i,
void BX_CPU_C::prepareFPU(bxInstruction_c *i,
bx_bool check_pending_exceptions, bx_bool update_last_instruction)
{
if (BX_CPU_THIS_PTR cr0.get_EM() || BX_CPU_THIS_PTR cr0.get_TS())
@ -143,7 +143,7 @@ int BX_CPU_C::fpu_save_environment(bxInstruction_c *i)
if (i->os32L() || i->os64L())
{
Bit32u tmp;
tmp = 0xffff0000 | BX_CPU_THIS_PTR the_i387.get_control_word();
write_virtual_dword(i->seg(), RMAddr(i), tmp);
tmp = 0xffff0000 | BX_CPU_THIS_PTR the_i387.get_status_word();
@ -183,8 +183,8 @@ int BX_CPU_C::fpu_save_environment(bxInstruction_c *i)
write_virtual_word(i->seg(), RMAddr(i) + 0x0c, tmp);
return 0x0e;
}
}
}
}
}
int BX_CPU_C::fpu_load_environment(bxInstruction_c *i)
@ -551,7 +551,7 @@ void BX_CPU_C::print_state_FPU()
#endif
fprintf(stderr, "%sFPR%d(%c): %.10f (raw 0x%04x:%08lx%08lx)\n",
i==tos?"=>":" ",
i,
i,
"v0s?"[BX_CPU_THIS_PTR the_i387.FPU_gettagi((i-tos)&7)],
f, fp.exp & 0xffff, fp.fraction >> 32, fp.fraction & 0xffffffff);
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_arith.cc,v 1.10 2007-12-20 20:58:38 sshwarts Exp $
// $Id: fpu_arith.cc,v 1.11 2008-02-05 22:33:34 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -34,7 +34,7 @@ float_status_t FPU_pre_exception_handling(Bit16u control_word)
float_status_t status;
int precision = control_word & FPU_CW_PC;
switch(precision)
{
case FPU_PR_32_BITS:
@ -47,8 +47,8 @@ float_status_t FPU_pre_exception_handling(Bit16u control_word)
status.float_rounding_precision = 80;
break;
default:
/* With the precision control bits set to 01 "(reserved)", a
real CPU behaves as if the precision control bits were
/* With the precision control bits set to 01 "(reserved)", a
real CPU behaves as if the precision control bits were
set to 11 "80 bits" */
status.float_rounding_precision = 80;
}
@ -78,7 +78,7 @@ void BX_CPU_C::FADD_ST0_STj(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = BX_READ_FPU_REG(i->rm());
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_add(a, b, status);
@ -110,7 +110,7 @@ void BX_CPU_C::FADD_STi_ST0(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(i->rm());
floatx80 b = BX_READ_FPU_REG(0);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_add(a, b, status);
@ -119,7 +119,7 @@ void BX_CPU_C::FADD_STi_ST0(bxInstruction_c *i)
return;
BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack)
if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop();
#else
BX_INFO(("FADD(P)_STi_ST0: required FPU, configure --enable-fpu"));
@ -141,10 +141,10 @@ void BX_CPU_C::FADD_SINGLE_REAL(bxInstruction_c *i)
float32 load_reg = read_virtual_dword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_add(BX_READ_FPU_REG(0),
floatx80 result = floatx80_add(BX_READ_FPU_REG(0),
float32_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -171,10 +171,10 @@ void BX_CPU_C::FADD_DOUBLE_REAL(bxInstruction_c *i)
float64 load_reg = read_virtual_qword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_add(BX_READ_FPU_REG(0),
floatx80 result = floatx80_add(BX_READ_FPU_REG(0),
float64_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -204,7 +204,7 @@ void BX_CPU_C::FIADD_WORD_INTEGER(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = int32_to_floatx80((Bit32s)(load_reg));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_add(a, b, status);
@ -236,7 +236,7 @@ void BX_CPU_C::FIADD_DWORD_INTEGER(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = int32_to_floatx80(load_reg);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_add(a, b, status);
@ -266,7 +266,7 @@ void BX_CPU_C::FMUL_ST0_STj(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = BX_READ_FPU_REG(i->rm());
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_mul(a, b, status);
@ -298,7 +298,7 @@ void BX_CPU_C::FMUL_STi_ST0(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(i->rm());
floatx80 b = BX_READ_FPU_REG(0);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_mul(a, b, status);
@ -307,7 +307,7 @@ void BX_CPU_C::FMUL_STi_ST0(bxInstruction_c *i)
return;
BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack)
if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop();
#else
BX_INFO(("FMUL(P)_STi_ST0: required FPU, configure --enable-fpu"));
@ -329,10 +329,10 @@ void BX_CPU_C::FMUL_SINGLE_REAL(bxInstruction_c *i)
float32 load_reg = read_virtual_dword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_mul(BX_READ_FPU_REG(0),
floatx80 result = floatx80_mul(BX_READ_FPU_REG(0),
float32_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -359,10 +359,10 @@ void BX_CPU_C::FMUL_DOUBLE_REAL(bxInstruction_c *i)
float64 load_reg = read_virtual_qword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_mul(BX_READ_FPU_REG(0),
floatx80 result = floatx80_mul(BX_READ_FPU_REG(0),
float64_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -392,7 +392,7 @@ void BX_CPU_C::FIMUL_WORD_INTEGER(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = int32_to_floatx80((Bit32s)(load_reg));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_mul(a, b, status);
@ -424,7 +424,7 @@ void BX_CPU_C::FIMUL_DWORD_INTEGER(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = int32_to_floatx80(load_reg);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_mul(a, b, status);
@ -454,7 +454,7 @@ void BX_CPU_C::FSUB_ST0_STj(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = BX_READ_FPU_REG(i->rm());
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(a, b, status);
@ -484,7 +484,7 @@ void BX_CPU_C::FSUBR_ST0_STj(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(i->rm());
floatx80 b = BX_READ_FPU_REG(0);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(a, b, status);
@ -516,7 +516,7 @@ void BX_CPU_C::FSUB_STi_ST0(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(i->rm());
floatx80 b = BX_READ_FPU_REG(0);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(a, b, status);
@ -526,7 +526,7 @@ void BX_CPU_C::FSUB_STi_ST0(bxInstruction_c *i)
BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack)
if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop();
#else
BX_INFO(("FSUB(P)_STi_ST0: required FPU, configure --enable-fpu"));
@ -551,7 +551,7 @@ void BX_CPU_C::FSUBR_STi_ST0(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = BX_READ_FPU_REG(i->rm());
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(a, b, status);
@ -561,7 +561,7 @@ void BX_CPU_C::FSUBR_STi_ST0(bxInstruction_c *i)
BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack)
if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop();
#else
BX_INFO(("FSUBR(P)_STi_ST0: required FPU, configure --enable-fpu"));
@ -583,10 +583,10 @@ void BX_CPU_C::FSUB_SINGLE_REAL(bxInstruction_c *i)
float32 load_reg = read_virtual_dword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(BX_READ_FPU_REG(0),
floatx80 result = floatx80_sub(BX_READ_FPU_REG(0),
float32_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -613,10 +613,10 @@ void BX_CPU_C::FSUBR_SINGLE_REAL(bxInstruction_c *i)
float32 load_reg = read_virtual_dword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(float32_to_floatx80(load_reg, status),
floatx80 result = floatx80_sub(float32_to_floatx80(load_reg, status),
BX_READ_FPU_REG(0), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -643,10 +643,10 @@ void BX_CPU_C::FSUB_DOUBLE_REAL(bxInstruction_c *i)
float64 load_reg = read_virtual_qword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(BX_READ_FPU_REG(0),
floatx80 result = floatx80_sub(BX_READ_FPU_REG(0),
float64_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -673,10 +673,10 @@ void BX_CPU_C::FSUBR_DOUBLE_REAL(bxInstruction_c *i)
float64 load_reg = read_virtual_qword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(float64_to_floatx80(load_reg, status),
floatx80 result = floatx80_sub(float64_to_floatx80(load_reg, status),
BX_READ_FPU_REG(0), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -706,7 +706,7 @@ void BX_CPU_C::FISUB_WORD_INTEGER(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = int32_to_floatx80((Bit32s)(load_reg));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(a, b, status);
@ -738,7 +738,7 @@ void BX_CPU_C::FISUBR_WORD_INTEGER(bxInstruction_c *i)
floatx80 a = int32_to_floatx80((Bit32s)(load_reg));
floatx80 b = BX_READ_FPU_REG(0);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(a, b, status);
@ -770,10 +770,10 @@ void BX_CPU_C::FISUB_DWORD_INTEGER(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = int32_to_floatx80(load_reg);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(BX_READ_FPU_REG(0),
floatx80 result = floatx80_sub(BX_READ_FPU_REG(0),
int32_to_floatx80(load_reg), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -803,7 +803,7 @@ void BX_CPU_C::FISUBR_DWORD_INTEGER(bxInstruction_c *i)
floatx80 a = int32_to_floatx80(load_reg);
floatx80 b = BX_READ_FPU_REG(0);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sub(a, b, status);
@ -833,7 +833,7 @@ void BX_CPU_C::FDIV_ST0_STj(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = BX_READ_FPU_REG(i->rm());
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(a, b, status);
@ -863,7 +863,7 @@ void BX_CPU_C::FDIVR_ST0_STj(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(i->rm());
floatx80 b = BX_READ_FPU_REG(0);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(a, b, status);
@ -895,7 +895,7 @@ void BX_CPU_C::FDIV_STi_ST0(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(i->rm());
floatx80 b = BX_READ_FPU_REG(0);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(a, b, status);
@ -904,7 +904,7 @@ void BX_CPU_C::FDIV_STi_ST0(bxInstruction_c *i)
return;
BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack)
if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop();
#else
BX_INFO(("FDIV(P)_STi_ST0: required FPU, configure --enable-fpu"));
@ -929,7 +929,7 @@ void BX_CPU_C::FDIVR_STi_ST0(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = BX_READ_FPU_REG(i->rm());
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(a, b, status);
@ -938,7 +938,7 @@ void BX_CPU_C::FDIVR_STi_ST0(bxInstruction_c *i)
return;
BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack)
if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop();
#else
BX_INFO(("FDIVR(P)_STi_ST0: required FPU, configure --enable-fpu"));
@ -960,10 +960,10 @@ void BX_CPU_C::FDIV_SINGLE_REAL(bxInstruction_c *i)
float32 load_reg = read_virtual_dword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(BX_READ_FPU_REG(0),
floatx80 result = floatx80_div(BX_READ_FPU_REG(0),
float32_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -990,10 +990,10 @@ void BX_CPU_C::FDIVR_SINGLE_REAL(bxInstruction_c *i)
float32 load_reg = read_virtual_dword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(float32_to_floatx80(load_reg, status),
floatx80 result = floatx80_div(float32_to_floatx80(load_reg, status),
BX_READ_FPU_REG(0), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -1020,10 +1020,10 @@ void BX_CPU_C::FDIV_DOUBLE_REAL(bxInstruction_c *i)
float64 load_reg = read_virtual_qword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(BX_READ_FPU_REG(0),
floatx80 result = floatx80_div(BX_READ_FPU_REG(0),
float64_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -1050,10 +1050,10 @@ void BX_CPU_C::FDIVR_DOUBLE_REAL(bxInstruction_c *i)
float64 load_reg = read_virtual_qword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(float64_to_floatx80(load_reg, status),
floatx80 result = floatx80_div(float64_to_floatx80(load_reg, status),
BX_READ_FPU_REG(0), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -1083,7 +1083,7 @@ void BX_CPU_C::FIDIV_WORD_INTEGER(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = int32_to_floatx80((Bit32s)(load_reg));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(a, b, status);
@ -1115,7 +1115,7 @@ void BX_CPU_C::FIDIVR_WORD_INTEGER(bxInstruction_c *i)
floatx80 a = int32_to_floatx80((Bit32s)(load_reg));
floatx80 b = BX_READ_FPU_REG(0);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(a, b, status);
@ -1147,7 +1147,7 @@ void BX_CPU_C::FIDIV_DWORD_INTEGER(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = int32_to_floatx80(load_reg);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(a, b, status);
@ -1179,7 +1179,7 @@ void BX_CPU_C::FIDIVR_DWORD_INTEGER(bxInstruction_c *i)
floatx80 a = int32_to_floatx80(load_reg);
floatx80 b = BX_READ_FPU_REG(0);
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_div(a, b, status);
@ -1205,7 +1205,7 @@ void BX_CPU_C::FSQRT(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_sqrt(BX_READ_FPU_REG(0), status);
@ -1232,7 +1232,7 @@ void BX_CPU_C::FRNDINT(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_round_to_int(BX_READ_FPU_REG(0), status);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_compare.cc,v 1.11 2007-12-20 20:58:38 sshwarts Exp $
// $Id: fpu_compare.cc,v 1.12 2008-02-05 22:33:34 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -101,7 +101,7 @@ void BX_CPU_C::FCOM_STi(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status);
@ -141,7 +141,7 @@ void BX_CPU_C::FCOMI_ST0_STj(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status);
@ -182,7 +182,7 @@ void BX_CPU_C::FUCOMI_ST0_STj(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare_quiet(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status);
@ -221,7 +221,7 @@ void BX_CPU_C::FUCOM_STi(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare_quiet(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status);
@ -263,10 +263,10 @@ void BX_CPU_C::FCOM_SINGLE_REAL(bxInstruction_c *i)
float32 load_reg = read_virtual_dword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare(BX_READ_FPU_REG(0),
int rc = floatx80_compare(BX_READ_FPU_REG(0),
float32_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -306,10 +306,10 @@ void BX_CPU_C::FCOM_DOUBLE_REAL(bxInstruction_c *i)
float64 load_reg = read_virtual_qword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare(BX_READ_FPU_REG(0),
int rc = floatx80_compare(BX_READ_FPU_REG(0),
float64_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -349,10 +349,10 @@ void BX_CPU_C::FICOM_WORD_INTEGER(bxInstruction_c *i)
Bit16s load_reg = (Bit16s) read_virtual_word(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare(BX_READ_FPU_REG(0),
int rc = floatx80_compare(BX_READ_FPU_REG(0),
int32_to_floatx80((Bit32s)(load_reg)), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -392,10 +392,10 @@ void BX_CPU_C::FICOM_DWORD_INTEGER(bxInstruction_c *i)
Bit32s load_reg = (Bit32s) read_virtual_dword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare(BX_READ_FPU_REG(0),
int rc = floatx80_compare(BX_READ_FPU_REG(0),
int32_to_floatx80(load_reg), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
@ -433,7 +433,7 @@ void BX_CPU_C::FCOMPP(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
@ -471,7 +471,7 @@ void BX_CPU_C::FUCOMPP(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare_quiet(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
@ -514,12 +514,12 @@ void BX_CPU_C::FCMOV_ST0_STj(bxInstruction_c *i)
default:
BX_PANIC(("FCMOV_ST0_STj: default case"));
}
if (i->b1() & 1)
if (i->b1() & 1)
condition = !condition;
if (condition)
BX_WRITE_FPU_REGISTER_AND_TAG(sti_reg, sti_tag, 0);
#else
BX_INFO(("FCMOV_ST0_STj: required P6 FPU, configure --enable-fpu, cpu-level=6"));
UndefinedOpcode(i);
@ -548,7 +548,7 @@ void BX_CPU_C::FTST(bxInstruction_c *i)
extern const floatx80 Const_Z;
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare(BX_READ_FPU_REG(0), Const_Z, status);
@ -571,9 +571,9 @@ void BX_CPU_C::FXAM(bxInstruction_c *i)
floatx80 reg = BX_READ_FPU_REG(0);
int sign = floatx80_sign(reg);
/*
* Examine the contents of the ST(0) register and sets the condition
* code flags C0, C2 and C3 in the FPU status word to indicate the
/*
* Examine the contents of the ST(0) register and sets the condition
* code flags C0, C2 and C3 in the FPU status word to indicate the
* class of value or number in the register.
*/
@ -590,33 +590,33 @@ void BX_CPU_C::FXAM(bxInstruction_c *i)
case float_zero:
setcc(FPU_SW_C3|FPU_SW_C1);
break;
case float_NaN:
// unsupported handled as NaNs
if (floatx80_is_unsupported(reg)) {
setcc(FPU_SW_C1);
setcc(FPU_SW_C1);
} else {
setcc(FPU_SW_C1|FPU_SW_C0);
}
break;
case float_negative_inf:
case float_positive_inf:
setcc(FPU_SW_C2|FPU_SW_C1|FPU_SW_C0);
break;
case float_denormal:
setcc(FPU_SW_C3|FPU_SW_C2|FPU_SW_C1);
break;
case float_normalized:
setcc(FPU_SW_C2|FPU_SW_C1);
break;
}
}
/*
* The C1 flag is set to the sign of the value in ST(0), regardless
/*
* The C1 flag is set to the sign of the value in ST(0), regardless
* of whether the register is empty or full.
*/
if (! sign)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_const.cc,v 1.8 2007-03-23 21:27:13 sshwarts Exp $
// $Id: fpu_const.cc,v 1.9 2008-02-05 22:33:34 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -66,11 +66,11 @@ void BX_CPU_C::FLDL2T(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REGISTER_AND_TAG(FPU_round_const(Const_L2T,
BX_WRITE_FPU_REGISTER_AND_TAG(FPU_round_const(Const_L2T,
(FPU_CONTROL_WORD == FPU_RC_UP) ? 1 : 0), FPU_Tag_Valid, 0);
#else
BX_INFO(("FLDL2T: required FPU, configure --enable-fpu"));
@ -87,11 +87,11 @@ void BX_CPU_C::FLDL2E(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REGISTER_AND_TAG(FPU_round_const(Const_L2E,
BX_WRITE_FPU_REGISTER_AND_TAG(FPU_round_const(Const_L2E,
DOWN_OR_CHOP() ? -1 : 0), FPU_Tag_Valid, 0);
#else
BX_INFO(("FLDL2E: required FPU, configure --enable-fpu"));
@ -108,11 +108,11 @@ void BX_CPU_C::FLDPI(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REGISTER_AND_TAG(FPU_round_const(Const_PI,
BX_WRITE_FPU_REGISTER_AND_TAG(FPU_round_const(Const_PI,
DOWN_OR_CHOP() ? -1 : 0), FPU_Tag_Valid, 0);
#else
BX_INFO(("FLDPI: required FPU, configure --enable-fpu"));
@ -129,11 +129,11 @@ void BX_CPU_C::FLDLG2(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REGISTER_AND_TAG(FPU_round_const(Const_LG2,
BX_WRITE_FPU_REGISTER_AND_TAG(FPU_round_const(Const_LG2,
DOWN_OR_CHOP() ? -1 : 0), FPU_Tag_Valid, 0);
#else
BX_INFO(("FLDLG2: required FPU, configure --enable-fpu"));
@ -150,18 +150,18 @@ void BX_CPU_C::FLDLN2(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REGISTER_AND_TAG(FPU_round_const(Const_LN2,
BX_WRITE_FPU_REGISTER_AND_TAG(FPU_round_const(Const_LN2,
DOWN_OR_CHOP() ? -1 : 0), FPU_Tag_Valid, 0);
#else
BX_INFO(("FLDLN2: required FPU, configure --enable-fpu"));
#endif
}
void BX_CPU_C::FLD1(bxInstruction_c *i)
void BX_CPU_C::FLD1(bxInstruction_c *i)
{
#if BX_SUPPORT_FPU
BX_CPU_THIS_PTR prepareFPU(i);
@ -171,7 +171,7 @@ void BX_CPU_C::FLD1(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
BX_CPU_THIS_PTR the_i387.FPU_push();
@ -181,7 +181,7 @@ void BX_CPU_C::FLD1(bxInstruction_c *i)
#endif
}
void BX_CPU_C::FLDZ(bxInstruction_c *i)
void BX_CPU_C::FLDZ(bxInstruction_c *i)
{
#if BX_SUPPORT_FPU
BX_CPU_THIS_PTR prepareFPU(i);
@ -191,7 +191,7 @@ void BX_CPU_C::FLDZ(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
BX_CPU_THIS_PTR the_i387.FPU_push();

View File

@ -29,7 +29,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Written for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
//////////////////////////////
// PI, PI/2, PI/4 constants

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_load_store.cc,v 1.15 2007-12-26 18:39:15 sshwarts Exp $
// $Id: fpu_load_store.cc,v 1.16 2008-02-05 22:33:34 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -40,7 +40,7 @@ void BX_CPU_C::FLD_STi(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
if (IS_TAG_EMPTY(i->rm()))
@ -69,12 +69,12 @@ void BX_CPU_C::FLD_SINGLE_REAL(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
float32 load_reg = read_virtual_dword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
// convert to floatx80 format
@ -100,12 +100,12 @@ void BX_CPU_C::FLD_DOUBLE_REAL(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
float64 load_reg = read_virtual_qword(i->seg(), RMAddr(i));
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
// convert to floatx80 format
@ -131,7 +131,7 @@ void BX_CPU_C::FLD_EXTENDED_REAL(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
floatx80 result;
@ -155,7 +155,7 @@ void BX_CPU_C::FILD_WORD_INTEGER(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
Bit16s load_reg = (Bit16s) read_virtual_word(i->seg(), RMAddr(i));
@ -179,7 +179,7 @@ void BX_CPU_C::FILD_DWORD_INTEGER(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
Bit32s load_reg = (Bit32s) read_virtual_dword(i->seg(), RMAddr(i));
@ -203,7 +203,7 @@ void BX_CPU_C::FILD_QWORD_INTEGER(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
Bit64s load_reg = (Bit64s) read_virtual_qword(i->seg(), RMAddr(i));
@ -227,14 +227,14 @@ void BX_CPU_C::FBLD_PACKED_BCD(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1))
{
BX_CPU_THIS_PTR FPU_stack_overflow();
return;
return;
}
// read packed bcd from memory
Bit64u lo8 = read_virtual_qword(i->seg(), RMAddr(i));
Bit16u hi2 = read_virtual_word (i->seg(), RMAddr(i) + 8);
Bit64s scale = 1;
Bit64s scale = 1;
Bit64s val64 = 0;
for (int n = 0; n < 16; n++)
@ -300,7 +300,7 @@ void BX_CPU_C::FST_SINGLE_REAL(bxInstruction_c *i)
}
else
{
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
save_reg = floatx80_to_float32(BX_READ_FPU_REG(0), status);
@ -336,7 +336,7 @@ void BX_CPU_C::FST_DOUBLE_REAL(bxInstruction_c *i)
}
else
{
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
save_reg = floatx80_to_float64(BX_READ_FPU_REG(0), status);
@ -402,7 +402,7 @@ void BX_CPU_C::FIST_WORD_INTEGER(bxInstruction_c *i)
}
else
{
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
save_reg = floatx80_to_int16(BX_READ_FPU_REG(0), status);
@ -440,7 +440,7 @@ void BX_CPU_C::FIST_DWORD_INTEGER(bxInstruction_c *i)
}
else
{
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
save_reg = floatx80_to_int32(BX_READ_FPU_REG(0), status);
@ -476,7 +476,7 @@ void BX_CPU_C::FISTP_QWORD_INTEGER(bxInstruction_c *i)
}
else
{
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
save_reg = floatx80_to_int64(BX_READ_FPU_REG(0), status);
@ -497,9 +497,9 @@ void BX_CPU_C::FBSTP_PACKED_BCD(bxInstruction_c *i)
#if BX_SUPPORT_FPU
BX_CPU_THIS_PTR prepareFPU(i);
/*
* The packed BCD integer indefinite encoding (FFFFC000000000000000H)
* is stored in response to a masked floating-point invalid-operation
/*
* The packed BCD integer indefinite encoding (FFFFC000000000000000H)
* is stored in response to a masked floating-point invalid-operation
* exception.
*/
Bit16u save_reg_hi = 0xFFFF;
@ -516,20 +516,20 @@ void BX_CPU_C::FBSTP_PACKED_BCD(bxInstruction_c *i)
}
else
{
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
Bit64s save_val = floatx80_to_int64(BX_READ_FPU_REG(0), status);
int sign = (save_val < 0);
if (sign)
if (sign)
save_val = -save_val;
if (save_val > BX_CONST64(999999999999999999))
{
float_raise(status, float_flag_invalid);
}
if (! (status.float_exception_flags & float_flag_invalid))
{
save_reg_hi = (sign) ? 0x8000 : 0;
@ -580,7 +580,7 @@ void BX_CPU_C::FISTTP16(bxInstruction_c *i)
}
else
{
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
save_reg = floatx80_to_int16_round_to_zero(BX_READ_FPU_REG(0), status);
@ -616,7 +616,7 @@ void BX_CPU_C::FISTTP32(bxInstruction_c *i)
}
else
{
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
save_reg = floatx80_to_int32_round_to_zero(BX_READ_FPU_REG(0), status);
@ -652,7 +652,7 @@ void BX_CPU_C::FISTTP64(bxInstruction_c *i)
}
else
{
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
save_reg = floatx80_to_int64_round_to_zero(BX_READ_FPU_REG(0), status);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_misc.cc,v 1.10 2007-03-23 21:27:13 sshwarts Exp $
// $Id: fpu_misc.cc,v 1.11 2008-02-05 22:33:34 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -154,7 +154,7 @@ void BX_CPU_C::FFREE_STi(bxInstruction_c *i)
#endif
}
/*
/*
* Free the st(0) register and pop it from the FPU stack.
* "Undocumented" by Intel & AMD but mentioned in AMDs Athlon Docs.
*/

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_trans.cc,v 1.11 2007-03-23 21:27:13 sshwarts Exp $
// $Id: fpu_trans.cc,v 1.12 2008-02-05 22:33:34 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -46,7 +46,7 @@ void BX_CPU_C::F2XM1(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word() | FPU_PR_80_BITS);
floatx80 result = f2xm1(BX_READ_FPU_REG(0), status);
@ -74,7 +74,7 @@ void BX_CPU_C::FYL2X(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word() | FPU_PR_80_BITS);
floatx80 result = fyl2x(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
@ -110,12 +110,12 @@ void BX_CPU_C::FPTAN(bxInstruction_c *i)
BX_WRITE_FPU_REGISTER_AND_TAG(floatx80_default_nan, FPU_Tag_Special, 0);
}
return;
return;
}
extern const floatx80 Const_1;
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word() | FPU_PR_80_BITS);
floatx80 y = BX_READ_FPU_REG(0);
@ -161,7 +161,7 @@ void BX_CPU_C::FPATAN(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word() | FPU_PR_80_BITS);
floatx80 result = fpatan(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
@ -196,10 +196,10 @@ void BX_CPU_C::FXTRACT(bxInstruction_c *i)
BX_WRITE_FPU_REGISTER_AND_TAG(floatx80_default_nan, FPU_Tag_Special, 0);
}
return;
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 a = BX_READ_FPU_REG(0);
@ -230,7 +230,7 @@ void BX_CPU_C::FPREM1(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
Bit64u quotient;
@ -273,7 +273,7 @@ void BX_CPU_C::FPREM(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
Bit64u quotient;
@ -316,7 +316,7 @@ void BX_CPU_C::FYL2XP1(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word() | FPU_PR_80_BITS);
floatx80 result = fyl2xp1(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
@ -352,15 +352,15 @@ void BX_CPU_C::FSINCOS(bxInstruction_c *i)
BX_WRITE_FPU_REGISTER_AND_TAG(floatx80_default_nan, FPU_Tag_Special, 0);
}
return;
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word() | FPU_PR_80_BITS);
floatx80 y = BX_READ_FPU_REG(0);
floatx80 sin_y, cos_y;
if (fsincos(y, &sin_y, &cos_y, status) == -1)
if (fsincos(y, &sin_y, &cos_y, status) == -1)
{
FPU_PARTIAL_STATUS |= FPU_SW_C2;
return;
@ -391,7 +391,7 @@ void BX_CPU_C::FSCALE(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
floatx80 result = floatx80_scale(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
@ -420,7 +420,7 @@ void BX_CPU_C::FSIN(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word() | FPU_PR_80_BITS);
floatx80 y = BX_READ_FPU_REG(0);
@ -454,7 +454,7 @@ void BX_CPU_C::FCOS(bxInstruction_c *i)
return;
}
float_status_t status =
float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word() | FPU_PR_80_BITS);
floatx80 y = BX_READ_FPU_REG(0);

View File

@ -21,7 +21,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Written for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#define FLOAT128
@ -32,7 +32,7 @@ these four paragraphs for those parts of this code that are retained.
static const floatx80 floatx80_one = packFloatx80(0, 0x3fff, BX_CONST64(0x8000000000000000));
/* reduce trigonometric function argument using 128-bit precision
/* reduce trigonometric function argument using 128-bit precision
M_PI approximation */
static Bit64u argument_reduction_kernel(Bit64u aSig0, int Exp, Bit64u *zSig0, Bit64u *zSig1)
{
@ -74,7 +74,7 @@ static int reduce_trig_arg(int expDiff, int &zSign, Bit64u &aSig0, Bit64u &aSig1
{
int lt = lt128(term0, term1, aSig0, aSig1);
int eq = eq128(aSig0, aSig1, term0, term1);
if ((eq && (q & 1)) || lt) {
zSign = !zSign;
++q;
@ -187,10 +187,10 @@ static floatx80 sincos_approximation(int neg, float128 r, Bit64u quotient, float
}
floatx80 result = float128_to_floatx80(r, status);
if (quotient & 0x2)
if (quotient & 0x2)
neg = ! neg;
if (neg)
if (neg)
floatx80_chs(result);
return result;
@ -224,7 +224,7 @@ int fsincos(floatx80 a, floatx80 *sin_a, floatx80 *cos_a, float_status_t &status
int q = 0;
// handle unsupported extended double-precision floating encodings
if (floatx80_is_unsupported(a))
if (floatx80_is_unsupported(a))
{
goto invalid;
}
@ -232,7 +232,7 @@ int fsincos(floatx80 a, floatx80 *sin_a, floatx80 *cos_a, float_status_t &status
aSig0 = extractFloatx80Frac(a);
aExp = extractFloatx80Exp(a);
aSign = extractFloatx80Sign(a);
/* invalid argument */
if (aExp == 0x7FFF) {
if ((Bit64u) (aSig0<<1)) {
@ -266,13 +266,13 @@ int fsincos(floatx80 a, floatx80 *sin_a, floatx80 *cos_a, float_status_t &status
normalizeFloatx80Subnormal(aSig0, &aExp, &aSig0);
}
zSign = aSign;
zExp = EXP_BIAS;
expDiff = aExp - zExp;
/* argument is out-of-range */
if (expDiff >= 63)
if (expDiff >= 63)
return -1;
float_raise(status, float_flag_inexact);
@ -344,11 +344,11 @@ int ftan(floatx80 &a, float_status_t &status)
{
Bit64u aSig0, aSig1 = 0;
Bit32s aExp, zExp, expDiff;
int aSign, zSign;
int aSign, zSign;
int q = 0;
// handle unsupported extended double-precision floating encodings
if (floatx80_is_unsupported(a))
if (floatx80_is_unsupported(a))
{
goto invalid;
}
@ -356,7 +356,7 @@ int ftan(floatx80 &a, float_status_t &status)
aSig0 = extractFloatx80Frac(a);
aExp = extractFloatx80Exp(a);
aSign = extractFloatx80Sign(a);
/* invalid argument */
if (aExp == 0x7FFF) {
if ((Bit64u) (aSig0<<1))
@ -382,13 +382,13 @@ int ftan(floatx80 &a, float_status_t &status)
}
normalizeFloatx80Subnormal(aSig0, &aExp, &aSig0);
}
zSign = aSign;
zExp = EXP_BIAS;
expDiff = aExp - zExp;
/* argument is out-of-range */
if (expDiff >= 63)
if (expDiff >= 63)
return -1;
float_raise(status, float_flag_inexact);

View File

@ -21,7 +21,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Written for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#define FLOAT128
@ -37,7 +37,7 @@ static const float128 float128_one =
static const float128 float128_two =
packFloat128(BX_CONST64(0x4000000000000000), BX_CONST64(0x0000000000000000));
static const float128 float128_ln2inv2 =
static const float128 float128_ln2inv2 =
packFloat128(BX_CONST64(0x400071547652b82f), BX_CONST64(0xe1777d0ffda0d23a));
#define SQRT2_HALF_SIG BX_CONST64(0xb504f333f9de6484)
@ -151,10 +151,10 @@ invalid:
int bSign = extractFloatx80Sign(b);
int zSign = bSign ^ 1;
if (aExp == 0x7FFF) {
if ((Bit64u) (aSig<<1)
|| ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
|| ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
{
return propagateFloatx80NaN(a, b, status);
}
@ -171,7 +171,7 @@ invalid:
{
if ((Bit64u) (bSig<<1)) return propagateFloatx80NaN(a, b, status);
if (aSign && (Bit64u)(aExp | aSig)) goto invalid;
if (aSig && (aExp == 0))
if (aSig && (aExp == 0))
float_raise(status, float_flag_denormal);
if (aExp < 0x3FFF) {
return packFloatx80(zSign, 0x7FFF, BX_CONST64(0x8000000000000000));
@ -198,7 +198,7 @@ invalid:
float_raise(status, float_flag_denormal);
normalizeFloatx80Subnormal(bSig, &bExp, &bSig);
}
if (aExp == 0x3FFF && ((Bit64u) (aSig<<1) == 0))
if (aExp == 0x3FFF && ((Bit64u) (aSig<<1) == 0))
return packFloatx80(bSign, 0, 0);
float_raise(status, float_flag_inexact);
@ -267,10 +267,10 @@ invalid:
bExp = extractFloatx80Exp(b);
bSign = extractFloatx80Sign(b);
int zSign = aSign ^ bSign;
if (aExp == 0x7FFF) {
if ((Bit64u) (aSig<<1)
|| ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
|| ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
{
return propagateFloatx80NaN(a, b, status);
}
@ -285,7 +285,7 @@ invalid:
}
if (bExp == 0x7FFF)
{
if ((Bit64u) (bSig<<1))
if ((Bit64u) (bSig<<1))
return propagateFloatx80NaN(a, b, status);
if (aExp == 0) {
@ -311,7 +311,7 @@ invalid:
float_raise(status, float_flag_inexact);
if (aSign && aExp >= 0x3FFF)
if (aSign && aExp >= 0x3FFF)
return a;
if (aExp >= 0x3FFC) // big argument

View File

@ -21,7 +21,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Written for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#define FLOAT128
@ -33,9 +33,9 @@ these four paragraphs for those parts of this code that are retained.
// 0 1 2 3 4 n
//
// -- 2k -- 2k+1
// p(x) = > C * x q(x) = > C * x
// p(x) = > C * x q(x) = > C * x
// -- 2k -- 2k+1
//
//
// f(x) ~ [ p(x) + x * q(x) ]
//
@ -72,9 +72,9 @@ float128 EvalPoly(float128 x, float128 *arr, unsigned n, float_status_t &status)
// 0 1 2 3 4 n
//
// -- 4k -- 4k+2
// p(x) = > C * x q(x) = > C * x
// p(x) = > C * x q(x) = > C * x
// -- 2k -- 2k+1
//
//
// 2
// f(x) ~ [ p(x) + x * q(x) ]
//
@ -92,9 +92,9 @@ float128 EvenPoly(float128 x, float128 *arr, unsigned n, float_status_t &status)
// 0 1 2 3 4 n
//
// -- 4k -- 4k+2
// p(x) = > C * x q(x) = > C * x
// p(x) = > C * x q(x) = > C * x
// -- 2k -- 2k+1
//
//
// 2
// f(x) ~ x * [ p(x) + x * q(x) ]
//

View File

@ -30,7 +30,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Adapted for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#ifndef _SOFTFLOAT_MACROS_H_
#define _SOFTFLOAT_MACROS_H_

View File

@ -32,7 +32,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Adapted for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#include "softfloat.h"
#include "softfloat-round-pack.h"
@ -380,7 +380,7 @@ void normalizeFloatx80Subnormal(Bit64u aSig, Bit32s *zExpPtr, Bit64u *zSigPtr)
| Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
floatx80 roundAndPackFloatx80(int roundingPrecision,
floatx80 roundAndPackFloatx80(int roundingPrecision,
int zSign, Bit32s zExp, Bit64u zSig0, Bit64u zSig1, float_status_t &status)
{
Bit64u roundIncrement, roundMask, roundBits;
@ -415,7 +415,7 @@ floatx80 roundAndPackFloatx80(int roundingPrecision,
roundBits = zSig0 & roundMask;
if (0x7FFD <= (Bit32u) (zExp - 1)) {
if ((0x7FFE < zExp)
|| ((zExp == 0x7FFE) && (zSig0 + roundIncrement < zSig0)))
|| ((zExp == 0x7FFE) && (zSig0 + roundIncrement < zSig0)))
{
goto overflow;
}
@ -470,14 +470,14 @@ floatx80 roundAndPackFloatx80(int roundingPrecision,
if ((0x7FFE < zExp)
|| ((zExp == 0x7FFE)
&& (zSig0 == BX_CONST64(0xFFFFFFFFFFFFFFFF))
&& increment))
&& increment))
{
roundMask = 0;
overflow:
float_raise(status, float_flag_overflow | float_flag_inexact);
if ((roundingMode == float_round_to_zero)
|| (zSign && (roundingMode == float_round_up))
|| (! zSign && (roundingMode == float_round_down)))
|| (! zSign && (roundingMode == float_round_down)))
{
return packFloatx80(zSign, 0x7FFE, ~roundMask);
}
@ -536,7 +536,7 @@ floatx80 roundAndPackFloatx80(int roundingPrecision,
| normalized.
*----------------------------------------------------------------------------*/
floatx80 normalizeRoundAndPackFloatx80(int roundingPrecision,
floatx80 normalizeRoundAndPackFloatx80(int roundingPrecision,
int zSign, Bit32s zExp, Bit64u zSig0, Bit64u zSig1, float_status_t &status)
{
if (zSig0 == 0) {
@ -619,7 +619,7 @@ float128 roundAndPackFloat128(
|| ((zExp == 0x7FFD)
&& eq128(BX_CONST64(0x0001FFFFFFFFFFFF),
BX_CONST64(0xFFFFFFFFFFFFFFFF), zSig0, zSig1)
&& increment))
&& increment))
{
float_raise(status, float_flag_overflow | float_flag_inexact);
return packFloat128(zSign, 0x7FFF, 0, 0);

View File

@ -30,7 +30,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Adapted for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#ifndef _SOFTFLOAT_ROUND_PACK_H_
#define _SOFTFLOAT_ROUND_PACK_H_
@ -186,7 +186,7 @@ void normalizeFloatx80Subnormal(Bit64u aSig, Bit32s *zExpPtr, Bit64u *zSigPtr);
| Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
floatx80 roundAndPackFloatx80(int roundingPrecision,
floatx80 roundAndPackFloatx80(int roundingPrecision,
int zSign, Bit32s zExp, Bit64u zSig0, Bit64u zSig1, float_status_t &status);
/*----------------------------------------------------------------------------
@ -198,7 +198,7 @@ floatx80 roundAndPackFloatx80(int roundingPrecision,
| normalized.
*----------------------------------------------------------------------------*/
floatx80 normalizeRoundAndPackFloatx80(int roundingPrecision,
floatx80 normalizeRoundAndPackFloatx80(int roundingPrecision,
int zSign, Bit32s zExp, Bit64u zSig0, Bit64u zSig1, float_status_t &status);
#endif // FLOATX80

View File

@ -32,7 +32,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Adapted for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#include "softfloat.h"
#include "softfloat-specialize.h"
@ -147,7 +147,7 @@ floatx80 propagateFloatx80NaN(floatx80 a, floatx80 b, float_status_t &status)
/*----------------------------------------------------------------------------
| The pattern for a default generated extended double-precision NaN.
*----------------------------------------------------------------------------*/
const floatx80 floatx80_default_nan =
const floatx80 floatx80_default_nan =
packFloatx80(0, floatx80_default_nan_exp, floatx80_default_nan_fraction);
#endif /* FLOATX80 */
@ -189,7 +189,7 @@ float128 propagateFloat128NaN(float128 a, float128 b, float_status_t &status)
/*----------------------------------------------------------------------------
| The pattern for a default generated quadruple-precision NaN.
*----------------------------------------------------------------------------*/
const float128 float128_default_nan =
const float128 float128_default_nan =
packFloat128(float128_default_nan_hi, float128_default_nan_lo);
#endif /* FLOAT128 */

View File

@ -35,7 +35,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Adapted for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#define int16_indefinite ((Bit16s)0x8000)
#define int32_indefinite ((Bit32s)0x80000000)
@ -157,7 +157,7 @@ BX_CPP_INLINE float32 commonNaNToFloat32(commonNaNT a)
float32 propagateFloat32NaN(float32 a, float32 b, float_status_t &status);
/*----------------------------------------------------------------------------
| Takes single-precision floating-point NaN `a' and returns the appropriate
| Takes single-precision floating-point NaN `a' and returns the appropriate
| NaN result. If `a' is a signaling NaN, the invalid exception is raised.
*----------------------------------------------------------------------------*/
@ -276,7 +276,7 @@ BX_CPP_INLINE float64 commonNaNToFloat64(commonNaNT a)
float64 propagateFloat64NaN(float64 a, float64 b, float_status_t &status);
/*----------------------------------------------------------------------------
| Takes double-precision floating-point NaN `a' and returns the appropriate
| Takes double-precision floating-point NaN `a' and returns the appropriate
| NaN result. If `a' is a signaling NaN, the invalid exception is raised.
*----------------------------------------------------------------------------*/
@ -417,8 +417,8 @@ BX_CPP_INLINE floatx80 commonNaNToFloatx80(commonNaNT a)
floatx80 propagateFloatx80NaN(floatx80 a, floatx80 b, float_status_t &status);
/*----------------------------------------------------------------------------
| Takes extended double-precision floating-point NaN `a' and returns the
| appropriate NaN result. If `a' is a signaling NaN, the invalid exception
| Takes extended double-precision floating-point NaN `a' and returns the
| appropriate NaN result. If `a' is a signaling NaN, the invalid exception
| is raised.
*----------------------------------------------------------------------------*/
@ -513,7 +513,7 @@ BX_CPP_INLINE float128 packFloat128(int zSign, Bit32s zExp, Bit64u zSig0, Bit64u
}
/*----------------------------------------------------------------------------
| Packs two 64-bit precision integers into into the quadruple-precision
| Packs two 64-bit precision integers into into the quadruple-precision
| floating-point value, returning the result.
*----------------------------------------------------------------------------*/

View File

@ -32,7 +32,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Adapted for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#include "softfloat.h"
#include "softfloat-round-pack.h"
@ -134,7 +134,7 @@ float64 int64_to_float64(Bit64s a, float_status_t &status)
| `a' to the 32-bit two's complement integer format. The conversion is
| performed according to the IEC/IEEE Standard for Binary Floating-Point
| Arithmetic - which means in particular that the conversion is rounded
| according to the current rounding mode. If `a' is a NaN or the
| according to the current rounding mode. If `a' is a NaN or the
| conversion overflows the integer indefinite value is returned.
*----------------------------------------------------------------------------*/
@ -157,7 +157,7 @@ Bit32s float32_to_int32(float32 a, float_status_t &status)
| `a' to the 32-bit two's complement integer format. The conversion is
| performed according to the IEC/IEEE Standard for Binary Floating-Point
| Arithmetic, except that the conversion is always rounded toward zero.
| If `a' is a NaN or the conversion overflows, the integer indefinite
| If `a' is a NaN or the conversion overflows, the integer indefinite
| value is returned.
*----------------------------------------------------------------------------*/
@ -196,7 +196,7 @@ Bit32s float32_to_int32_round_to_zero(float32 a, float_status_t &status)
| `a' to the 64-bit two's complement integer format. The conversion is
| performed according to the IEC/IEEE Standard for Binary Floating-Point
| Arithmetic - which means in particular that the conversion is rounded
| according to the current rounding mode. If `a' is a NaN or the
| according to the current rounding mode. If `a' is a NaN or the
| conversion overflows, the integer indefinite value is returned.
*----------------------------------------------------------------------------*/
@ -769,7 +769,7 @@ int float32_eq(float32 a, float32 b, float_status_t &status)
float_class_t aClass = float32_class(a);
float_class_t bClass = float32_class(b);
if (aClass == float_NaN || bClass == float_NaN)
if (aClass == float_NaN || bClass == float_NaN)
{
if (float32_is_signaling_nan(a) || float32_is_signaling_nan(b))
{
@ -778,7 +778,7 @@ int float32_eq(float32 a, float32 b, float_status_t &status)
return 0;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -803,7 +803,7 @@ int float32_le(float32 a, float32 b, float_status_t &status)
return 0;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -878,7 +878,7 @@ int float32_le_quiet(float32 a, float32 b, float_status_t &status)
float_class_t aClass = float32_class(a);
float_class_t bClass = float32_class(b);
if (aClass == float_NaN || bClass == float_NaN)
if (aClass == float_NaN || bClass == float_NaN)
{
if (float32_is_signaling_nan(a) || float32_is_signaling_nan(b))
{
@ -887,7 +887,7 @@ int float32_le_quiet(float32 a, float32 b, float_status_t &status)
return 0;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -910,7 +910,7 @@ int float32_lt_quiet(float32 a, float32 b, float_status_t &status)
float_class_t aClass = float32_class(a);
float_class_t bClass = float32_class(b);
if (aClass == float_NaN || bClass == float_NaN)
if (aClass == float_NaN || bClass == float_NaN)
{
if (float32_is_signaling_nan(a) || float32_is_signaling_nan(b))
{
@ -940,7 +940,7 @@ int float32_unordered(float32 a, float32 b, float_status_t &status)
float_class_t aClass = float32_class(a);
float_class_t bClass = float32_class(b);
if (aClass == float_NaN || bClass == float_NaN)
if (aClass == float_NaN || bClass == float_NaN)
{
if (float32_is_signaling_nan(a) || float32_is_signaling_nan(b))
{
@ -949,7 +949,7 @@ int float32_unordered(float32 a, float32 b, float_status_t &status)
return 1;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -962,7 +962,7 @@ int float32_unordered(float32 a, float32 b, float_status_t &status)
| 'float_relation_equal' if the operands are equal, 'float_relation_less' if
| the value 'a' is less than the corresponding value `b',
| 'float_relation_greater' if the value 'a' is greater than the corresponding
| value `b', or 'float_relation_unordered' otherwise.
| value `b', or 'float_relation_unordered' otherwise.
*----------------------------------------------------------------------------*/
int float32_compare(float32 a, float32 b, float_status_t &status)
@ -975,7 +975,7 @@ int float32_compare(float32 a, float32 b, float_status_t &status)
return float_relation_unordered;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -986,7 +986,7 @@ int float32_compare(float32 a, float32 b, float_status_t &status)
int bSign = extractFloat32Sign(b);
if (aSign != bSign)
return (aSign) ? float_relation_less : float_relation_greater;
if (aSign ^ (a < b)) return float_relation_less;
return float_relation_greater;
}
@ -996,7 +996,7 @@ int float32_compare(float32 a, float32 b, float_status_t &status)
| 'float_relation_equal' if the operands are equal, 'float_relation_less' if
| the value 'a' is less than the corresponding value `b',
| 'float_relation_greater' if the value 'a' is greater than the corresponding
| value `b', or 'float_relation_unordered' otherwise. Quiet NaNs do not cause
| value `b', or 'float_relation_unordered' otherwise. Quiet NaNs do not cause
| an exception.
*----------------------------------------------------------------------------*/
@ -1005,7 +1005,7 @@ int float32_compare_quiet(float32 a, float32 b, float_status_t &status)
float_class_t aClass = float32_class(a);
float_class_t bClass = float32_class(b);
if (aClass == float_NaN || bClass == float_NaN)
if (aClass == float_NaN || bClass == float_NaN)
{
if (float32_is_signaling_nan(a) || float32_is_signaling_nan(b))
{
@ -1014,7 +1014,7 @@ int float32_compare_quiet(float32 a, float32 b, float_status_t &status)
return float_relation_unordered;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -1023,7 +1023,7 @@ int float32_compare_quiet(float32 a, float32 b, float_status_t &status)
int aSign = extractFloat32Sign(a);
int bSign = extractFloat32Sign(b);
if (aSign != bSign)
if (aSign != bSign)
return (aSign) ? float_relation_less : float_relation_greater;
if (aSign ^ (a < b)) return float_relation_less;
@ -1035,7 +1035,7 @@ int float32_compare_quiet(float32 a, float32 b, float_status_t &status)
| `a' to the 32-bit two's complement integer format. The conversion is
| performed according to the IEC/IEEE Standard for Binary Floating-Point
| Arithmetic - which means in particular that the conversion is rounded
| according to the current rounding mode. If `a' is a NaN or the
| according to the current rounding mode. If `a' is a NaN or the
| conversion overflows, the integer indefinite value is returned.
*----------------------------------------------------------------------------*/
@ -1674,9 +1674,9 @@ float_class_t float64_class(float64 a)
return float_NaN;
}
if(aExp == 0) {
if (aSig == 0)
if (aSig == 0)
return float_zero;
return float_denormal;
}
@ -1704,7 +1704,7 @@ int float64_eq(float64 a, float64 b, float_status_t &status)
return 0;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -1729,7 +1729,7 @@ int float64_le(float64 a, float64 b, float_status_t &status)
return 0;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -1756,7 +1756,7 @@ int float64_lt(float64 a, float64 b, float_status_t &status)
return 0;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -1784,7 +1784,7 @@ int float64_eq_signaling(float64 a, float64 b, float_status_t &status)
return 0;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -1813,7 +1813,7 @@ int float64_le_quiet(float64 a, float64 b, float_status_t &status)
return 0;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -1845,7 +1845,7 @@ int float64_lt_quiet(float64 a, float64 b, float_status_t &status)
return 0;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -1866,7 +1866,7 @@ int float64_unordered(float64 a, float64 b, float_status_t &status)
float_class_t aClass = float64_class(a);
float_class_t bClass = float64_class(b);
if (aClass == float_NaN || bClass == float_NaN)
if (aClass == float_NaN || bClass == float_NaN)
{
if (float64_is_signaling_nan(a) || float64_is_signaling_nan(b))
{
@ -1875,7 +1875,7 @@ int float64_unordered(float64 a, float64 b, float_status_t &status)
return 1;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -1888,7 +1888,7 @@ int float64_unordered(float64 a, float64 b, float_status_t &status)
| 'float_relation_equal' if the operands are equal, 'float_relation_less' if
| the value 'a' is less than the corresponding value `b',
| 'float_relation_greater' if the value 'a' is greater than the corresponding
| value `b', or 'float_relation_unordered' otherwise.
| value `b', or 'float_relation_unordered' otherwise.
*----------------------------------------------------------------------------*/
int float64_compare(float64 a, float64 b, float_status_t &status)
@ -1901,7 +1901,7 @@ int float64_compare(float64 a, float64 b, float_status_t &status)
return float_relation_unordered;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -1922,7 +1922,7 @@ int float64_compare(float64 a, float64 b, float_status_t &status)
| 'float_relation_equal' if the operands are equal, 'float_relation_less' if
| the value 'a' is less than the corresponding value `b',
| 'float_relation_greater' if the value 'a' is greater than the corresponding
| value `b', or 'float_relation_unordered' otherwise. Quiet NaNs do not cause
| value `b', or 'float_relation_unordered' otherwise. Quiet NaNs do not cause
| an exception.
*----------------------------------------------------------------------------*/
@ -1931,16 +1931,16 @@ int float64_compare_quiet(float64 a, float64 b, float_status_t &status)
float_class_t aClass = float64_class(a);
float_class_t bClass = float64_class(b);
if (aClass == float_NaN || bClass == float_NaN)
if (aClass == float_NaN || bClass == float_NaN)
{
if (float64_is_signaling_nan(a) || float64_is_signaling_nan(b))
if (float64_is_signaling_nan(a) || float64_is_signaling_nan(b))
{
float_raise(status, float_flag_invalid);
}
return float_relation_unordered;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -2048,7 +2048,7 @@ floatx80 float64_to_floatx80(float64 a, float_status_t &status)
| point value `a' to the 32-bit two's complement integer format. The
| conversion is performed according to the IEC/IEEE Standard for Binary
| Floating-Point Arithmetic - which means in particular that the conversion
| is rounded according to the current rounding mode. If `a' is a NaN or the
| is rounded according to the current rounding mode. If `a' is a NaN or the
| conversion overflows, the integer indefinite value is returned.
*----------------------------------------------------------------------------*/
@ -2077,7 +2077,7 @@ Bit32s floatx80_to_int32(floatx80 a, float_status_t &status)
| point value `a' to the 32-bit two's complement integer format. The
| conversion is performed according to the IEC/IEEE Standard for Binary
| Floating-Point Arithmetic, except that the conversion is always rounded
| toward zero. If `a' is a NaN or the conversion overflows, the integer
| toward zero. If `a' is a NaN or the conversion overflows, the integer
| indefinite value is returned.
*----------------------------------------------------------------------------*/
@ -2114,7 +2114,7 @@ Bit32s floatx80_to_int32_round_to_zero(floatx80 a, float_status_t &status)
float_raise(status, float_flag_invalid);
return (Bit32s)(int32_indefinite);
}
if ((aSig<<shiftCount) != savedASig)
if ((aSig<<shiftCount) != savedASig)
{
float_raise(status, float_flag_inexact);
}
@ -2126,7 +2126,7 @@ Bit32s floatx80_to_int32_round_to_zero(floatx80 a, float_status_t &status)
| point value `a' to the 64-bit two's complement integer format. The
| conversion is performed according to the IEC/IEEE Standard for Binary
| Floating-Point Arithmetic - which means in particular that the conversion
| is rounded according to the current rounding mode. If `a' is a NaN or the
| is rounded according to the current rounding mode. If `a' is a NaN or the
| conversion overflows, the integer indefinite value is returned.
*----------------------------------------------------------------------------*/
@ -2149,7 +2149,7 @@ Bit64s floatx80_to_int64(floatx80 a, float_status_t &status)
int shiftCount = 0x403E - aExp;
if (shiftCount <= 0)
{
if (shiftCount)
if (shiftCount)
{
float_raise(status, float_flag_invalid);
return (Bit64s)(int64_indefinite);
@ -2168,7 +2168,7 @@ Bit64s floatx80_to_int64(floatx80 a, float_status_t &status)
| point value `a' to the 64-bit two's complement integer format. The
| conversion is performed according to the IEC/IEEE Standard for Binary
| Floating-Point Arithmetic, except that the conversion is always rounded
| toward zero. If `a' is a NaN or the conversion overflows, the integer
| toward zero. If `a' is a NaN or the conversion overflows, the integer
| indefinite value is returned.
*----------------------------------------------------------------------------*/
@ -2311,7 +2311,7 @@ floatx80 floatx80_round_to_int(floatx80 a, float_status_t &status)
aSign = extractFloatx80Sign(a);
switch (get_float_rounding_mode(status)) {
case float_round_nearest_even:
if ((aExp == 0x3FFE) && (Bit64u) (aSig<<1))
if ((aExp == 0x3FFE) && (Bit64u) (aSig<<1))
return packFloatx80(aSign, 0x3FFF, BX_CONST64(0x8000000000000000));
break;
case float_round_down:
@ -2319,7 +2319,7 @@ floatx80 floatx80_round_to_int(floatx80 a, float_status_t &status)
packFloatx80(1, 0x3FFF, BX_CONST64(0x8000000000000000))
: packFloatx80(0, 0, 0);
case float_round_up:
return aSign ?
return aSign ?
packFloatx80(1, 0, 0)
: packFloatx80(0, 0x3FFF, BX_CONST64(0x8000000000000000));
}
@ -2375,7 +2375,7 @@ static floatx80 addFloatx80Sigs(floatx80 a, floatx80 b, int zSign, float_status_
if (aExp == 0x7FFF) {
if ((Bit64u) (aSig<<1)
|| ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
|| ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
{
return propagateFloatx80NaN(a, b, status);
}
@ -2393,7 +2393,7 @@ static floatx80 addFloatx80Sigs(floatx80 a, floatx80 b, int zSign, float_status_
float_raise(status, float_flag_denormal);
normalizeFloatx80Subnormal(bSig, &bExp, &bSig);
}
return roundAndPackFloatx80(get_float_rounding_precision(status),
return roundAndPackFloatx80(get_float_rounding_precision(status),
zSign, bExp, bSig, 0, status);
}
float_raise(status, float_flag_denormal);
@ -2401,7 +2401,7 @@ static floatx80 addFloatx80Sigs(floatx80 a, floatx80 b, int zSign, float_status_
}
if (bExp == 0) {
if (bSig == 0)
return roundAndPackFloatx80(get_float_rounding_precision(status),
return roundAndPackFloatx80(get_float_rounding_precision(status),
zSign, aExp, aSig, 0, status);
float_raise(status, float_flag_denormal);
@ -2429,7 +2429,7 @@ static floatx80 addFloatx80Sigs(floatx80 a, floatx80 b, int zSign, float_status_
zExp++;
roundAndPack:
return
roundAndPackFloatx80(get_float_rounding_precision(status),
roundAndPackFloatx80(get_float_rounding_precision(status),
zSign, zExp, zSig0, zSig1, status);
}
@ -2514,7 +2514,7 @@ static floatx80 subFloatx80Sigs(floatx80 a, floatx80 b, int zSign, float_status_
zExp = aExp;
normalizeRoundAndPack:
return
normalizeRoundAndPackFloatx80(get_float_rounding_precision(status),
normalizeRoundAndPackFloatx80(get_float_rounding_precision(status),
zSign, zExp, zSig0, zSig1, status);
}
@ -2582,7 +2582,7 @@ floatx80 floatx80_mul(floatx80 a, floatx80 b, float_status_t &status)
if (aExp == 0x7FFF) {
if ((Bit64u) (aSig<<1)
|| ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
|| ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
{
return propagateFloatx80NaN(a, b, status);
}
@ -2620,7 +2620,7 @@ floatx80 floatx80_mul(floatx80 a, floatx80 b, float_status_t &status)
--zExp;
}
return
roundAndPackFloatx80(get_float_rounding_precision(status),
roundAndPackFloatx80(get_float_rounding_precision(status),
zSign, zExp, zSig0, zSig1, status);
}
@ -2708,7 +2708,7 @@ floatx80 floatx80_div(floatx80 a, floatx80 b, float_status_t &status)
zSig1 |= ((rem1 | rem2) != 0);
}
return
roundAndPackFloatx80(get_float_rounding_precision(status),
roundAndPackFloatx80(get_float_rounding_precision(status),
zSign, zExp, zSig0, zSig1, status);
}
@ -2782,7 +2782,7 @@ floatx80 floatx80_sqrt(floatx80 a, float_status_t &status)
shortShift128Left(0, zSig1, 1, &zSig0, &zSig1);
zSig0 |= doubleZSig0;
return
roundAndPackFloatx80(get_float_rounding_precision(status),
roundAndPackFloatx80(get_float_rounding_precision(status),
0, zExp, zSig0, zSig1, status);
}
@ -2830,7 +2830,7 @@ floatx80 float128_to_floatx80(float128 a, float_status_t &status)
int aSign = extractFloat128Sign(a);
if (aExp == 0x7FFF) {
if (aSig0 | aSig1)
if (aSig0 | aSig1)
return commonNaNToFloatx80(float128ToCommonNaN(a, status));
return packFloatx80(aSign, 0x7FFF, BX_CONST64(0x8000000000000000));
@ -2849,8 +2849,8 @@ floatx80 float128_to_floatx80(float128 a, float_status_t &status)
/*----------------------------------------------------------------------------
| Returns the result of multiplying the extended double-precision floating-
| point value `a' and quadruple-precision floating point value `b'. The
| operation is performed according to the IEC/IEEE Standard for Binary
| point value `a' and quadruple-precision floating point value `b'. The
| operation is performed according to the IEC/IEEE Standard for Binary
| Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
@ -2880,7 +2880,7 @@ floatx80 floatx80_mul(floatx80 a, float128 b, float_status_t &status)
if (aExp == 0x7FFF) {
if ((Bit64u) (aSig<<1)
|| ((bExp == 0x7FFF) && (bSig0 | bSig1)))
|| ((bExp == 0x7FFF) && (bSig0 | bSig1)))
{
floatx80 r = commonNaNToFloatx80(float128ToCommonNaN(b, status));
return propagateFloatx80NaN(a, r, status);
@ -2925,7 +2925,7 @@ floatx80 floatx80_mul(floatx80 a, float128 b, float_status_t &status)
--zExp;
}
return
roundAndPackFloatx80(get_float_rounding_precision(status),
roundAndPackFloatx80(get_float_rounding_precision(status),
zSign, zExp, zSig0, zSig1, status);
}
@ -2973,7 +2973,7 @@ static float128 addFloat128Sigs(float128 a, float128 b, int zSign, float_status_
}
else {
if (aExp == 0x7FFF) {
if (aSig0 | aSig1 | bSig0 | bSig1)
if (aSig0 | aSig1 | bSig0 | bSig1)
return propagateFloat128NaN(a, b, status);
return a;

View File

@ -30,7 +30,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Adapted for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#include <config.h> /* generated by configure script from config.h.in */
@ -104,7 +104,7 @@ enum {
/*----------------------------------------------------------------------------
| Software IEC/IEEE floating-point status structure.
*----------------------------------------------------------------------------*/
struct float_status_t
struct float_status_t
{
#ifdef FLOATX80
int float_rounding_precision; /* floatx80 only */
@ -146,7 +146,7 @@ BX_CPP_INLINE int get_float_rounding_precision(float_status_t &status)
#endif
/*----------------------------------------------------------------------------
| Returns current floating point NaN operands handling mode specified
| Returns current floating point NaN operands handling mode specified
| by status word.
*----------------------------------------------------------------------------*/

View File

@ -21,7 +21,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Written for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#include "softfloatx80.h"
#include "softfloat-round-pack.h"
@ -32,7 +32,7 @@ these four paragraphs for those parts of this code that are retained.
| point value `a' to the 16-bit two's complement integer format. The
| conversion is performed according to the IEC/IEEE Standard for Binary
| Floating-Point Arithmetic - which means in particular that the conversion
| is rounded according to the current rounding mode. If `a' is a NaN or the
| is rounded according to the current rounding mode. If `a' is a NaN or the
| conversion overflows, the integer indefinite value is returned.
*----------------------------------------------------------------------------*/
@ -60,7 +60,7 @@ Bit16s floatx80_to_int16(floatx80 a, float_status_t &status)
| point value `a' to the 16-bit two's complement integer format. The
| conversion is performed according to the IEC/IEEE Standard for Binary
| Floating-Point Arithmetic, except that the conversion is always rounded
| toward zero. If `a' is a NaN or the conversion overflows, the integer
| toward zero. If `a' is a NaN or the conversion overflows, the integer
| indefinite value is returned.
*----------------------------------------------------------------------------*/
@ -86,7 +86,7 @@ Bit16s floatx80_to_int16_round_to_zero(floatx80 a, float_status_t &status)
/*----------------------------------------------------------------------------
| Separate the source extended double-precision floating point value `a'
| into its exponent and significand, store the significant back to the
| 'a' and return the exponent. The operation performed is a superset of
| 'a' and return the exponent. The operation performed is a superset of
| the IEC/IEEE recommended logb(x) function.
*----------------------------------------------------------------------------*/
@ -104,7 +104,7 @@ floatx80 floatx80_extract(floatx80 &a, float_status_t &status)
}
if (aExp == 0x7FFF) {
if ((Bit64u) (aSig<<1))
if ((Bit64u) (aSig<<1))
{
a = propagateFloatx80NaN(a, status);
return a;
@ -128,10 +128,10 @@ floatx80 floatx80_extract(floatx80 &a, float_status_t &status)
}
/*----------------------------------------------------------------------------
| Scales extended double-precision floating-point value in operand `a' by
| value `b'. The function truncates the value in the second operand 'b' to
| Scales extended double-precision floating-point value in operand `a' by
| value `b'. The function truncates the value in the second operand 'b' to
| an integral value and adds that value to the exponent of the operand 'a'.
| The operation performed according to the IEC/IEEE Standard for Binary
| The operation performed according to the IEC/IEEE Standard for Binary
| Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
@ -155,7 +155,7 @@ floatx80 floatx80_scale(floatx80 a, floatx80 b, float_status_t &status)
int bSign = extractFloatx80Sign(b);
if (aExp == 0x7FFF) {
if ((Bit64u) (aSig<<1) || ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
if ((Bit64u) (aSig<<1) || ((bExp == 0x7FFF) && (Bit64u) (bSig<<1)))
{
return propagateFloatx80NaN(a, b, status);
}
@ -190,9 +190,9 @@ floatx80 floatx80_scale(floatx80 a, floatx80 b, float_status_t &status)
normalizeFloatx80Subnormal(bSig, &bExp, &bSig);
}
if (bExp > 0x400E) {
if (bExp > 0x400E) {
/* generate appropriate overflow/underflow */
return roundAndPackFloatx80(80, aSign,
return roundAndPackFloatx80(80, aSign,
bSign ? -0x3FFF : 0x7FFF, aSig, 0, status);
}
if (bExp < 0x3FFF) return a;
@ -234,7 +234,7 @@ float_class_t floatx80_class(floatx80 a)
return float_NaN;
}
return float_normalized;
}
@ -243,7 +243,7 @@ float_class_t floatx80_class(floatx80 a)
| 'float_relation_equal' if the operands are equal, 'float_relation_less' if
| the value 'a' is less than the corresponding value `b',
| 'float_relation_greater' if the value 'a' is greater than the corresponding
| value `b', or 'float_relation_unordered' otherwise.
| value `b', or 'float_relation_unordered' otherwise.
*----------------------------------------------------------------------------*/
int floatx80_compare(floatx80 a, floatx80 b, float_status_t &status)
@ -257,7 +257,7 @@ int floatx80_compare(floatx80 a, floatx80 b, float_status_t &status)
return float_relation_unordered;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -277,7 +277,7 @@ int floatx80_compare(floatx80 a, floatx80 b, float_status_t &status)
if (aSign != bSign)
return (aSign) ? float_relation_less : float_relation_greater;
int less_than =
int less_than =
aSign ? lt128(b.exp, b.fraction, a.exp, a.fraction)
: lt128(a.exp, a.fraction, b.exp, b.fraction);
@ -290,7 +290,7 @@ int floatx80_compare(floatx80 a, floatx80 b, float_status_t &status)
| 'float_relation_equal' if the operands are equal, 'float_relation_less' if
| the value 'a' is less than the corresponding value `b',
| 'float_relation_greater' if the value 'a' is greater than the corresponding
| value `b', or 'float_relation_unordered' otherwise. Quiet NaNs do not cause
| value `b', or 'float_relation_unordered' otherwise. Quiet NaNs do not cause
| an exception.
*----------------------------------------------------------------------------*/
@ -310,7 +310,7 @@ int floatx80_compare_quiet(floatx80 a, floatx80 b, float_status_t &status)
return float_relation_unordered;
}
if (aClass == float_denormal || bClass == float_denormal)
if (aClass == float_denormal || bClass == float_denormal)
{
float_raise(status, float_flag_denormal);
}
@ -330,7 +330,7 @@ int floatx80_compare_quiet(floatx80 a, floatx80 b, float_status_t &status)
if (aSign != bSign)
return (aSign) ? float_relation_less : float_relation_greater;
int less_than =
int less_than =
aSign ? lt128(b.exp, b.fraction, a.exp, a.fraction)
: lt128(a.exp, a.fraction, b.exp, b.fraction);

View File

@ -21,7 +21,7 @@ these four paragraphs for those parts of this code that are retained.
/*============================================================================
* Written for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
* ==========================================================================*/
#ifndef _SOFTFLOATX80_EXTENSIONS_H_
#define _SOFTFLOATX80_EXTENSIONS_H_
@ -75,19 +75,19 @@ int floatx80_compare_quiet(floatx80, floatx80, float_status_t &status);
BX_CPP_INLINE floatx80& floatx80_abs(floatx80 &reg)
{
reg.exp &= 0x7FFF;
return reg;
return reg;
}
/*-----------------------------------------------------------------------------
| Changes the sign of the extended double-precision floating-point value 'a'.
| The operation is performed according to the IEC/IEEE Standard for Binary
| The operation is performed according to the IEC/IEEE Standard for Binary
| Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
BX_CPP_INLINE floatx80& floatx80_chs(floatx80 &reg)
{
reg.exp ^= 0x8000;
return reg;
return reg;
}
/*-----------------------------------------------------------------------------

View File

@ -9,5 +9,5 @@ TODO:
3. Elliminate floa128 use, Intel uses only 67-bit precision calculations
when float128 has at least 112-bit. Replacement of float128 with for
example 96-bit precision number could significantly speed up
example 96-bit precision number could significantly speed up
calculations.