Commit 141baf80 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k superfluous whitespace

M68k: Remove superfluous whitespace that hurts my eyes with `let
c_space_errors=1' in vim. This includes correcting trailing whitespace and
spaces in front of tabs. `diff -urNbB' shows no difference before/after.
parent 3d29f7cb
......@@ -76,9 +76,9 @@ config SUN3
select MMU_SUN3 if MMU
help
This option enables support for the Sun 3 series of workstations
(3/50, 3/60, 3/1xx, 3/2xx systems). Enabling this option requires
that all other hardware types must be disabled, as Sun 3 kernels
are incompatible with all other m68k targets (including Sun 3x!).
(3/50, 3/60, 3/1xx, 3/2xx systems). Enabling this option requires
that all other hardware types must be disabled, as Sun 3 kernels
are incompatible with all other m68k targets (including Sun 3x!).
If you don't want to compile a kernel exclusively for a Sun 3, say N.
......@@ -687,7 +687,7 @@ config DEBUG_INFO
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
endmenu
source "security/Kconfig"
......
......@@ -56,7 +56,7 @@ ifndef CONFIG_SUN3
head-y := arch/m68k/kernel/head.o
else
head-y := arch/m68k/kernel/sun3-head.o
endif
endif
core-y += arch/m68k/kernel/ arch/m68k/mm/
libs-y += arch/m68k/lib/
......
......@@ -88,7 +88,7 @@ void amiga_mksound( unsigned int hz, unsigned int ticks )
custom.aud[2].audlen = sizeof(sine_data)/2;
custom.aud[2].audper = (unsigned short)period;
custom.aud[2].audvol = 32; /* 50% of maxvol */
if (ticks) {
sound_timer.expires = jiffies + ticks;
add_timer( &sound_timer );
......
......@@ -42,7 +42,7 @@ void __init amiga_chip_init(void)
chipavail = amiga_chip_size;
}
void *amiga_chip_alloc(unsigned long size, const char *name)
{
struct resource *res;
......
......@@ -332,7 +332,7 @@ static void __init amiga_identify(void)
case AMI_DRACO:
panic("No support for Draco yet");
default:
panic("Unknown Amiga Model");
}
......@@ -426,7 +426,7 @@ void __init config_amiga(void)
*/
mach_set_clock_mmss = amiga_set_clock_mmss;
mach_get_ss = amiga_get_ss;
mach_get_ss = amiga_get_ss;
#ifdef CONFIG_AMIGA_FLOPPY
mach_floppy_setup = amiga_floppy_setup;
#endif
......@@ -679,13 +679,13 @@ static int amiga_set_clock_mmss (unsigned long nowtime)
tod_3000.second2 = real_seconds % 10;
tod_3000.minute1 = real_minutes / 10;
tod_3000.minute2 = real_minutes % 10;
tod_3000.cntrl1 = TOD3000_CNTRL1_FREE;
} else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
int cnt = 5;
tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--)
{
tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
......@@ -715,7 +715,7 @@ static unsigned int amiga_get_ss( void )
tod_3000.cntrl1 = TOD3000_CNTRL1_HOLD;
s = tod_3000.second1 * 10 + tod_3000.second2;
tod_3000.cntrl1 = TOD3000_CNTRL1_FREE;
} else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
} else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
s = tod_2000.second1 * 10 + tod_2000.second2;
}
return s;
......@@ -758,7 +758,7 @@ static void amiga_reset (void)
: "a" (jmp_addr));
jmp_addr_label040:
/* disable translation on '040 now */
__asm__ __volatile__
__asm__ __volatile__
("moveq #0,%/d0\n\t"
".chip 68040\n\t"
"movec %%d0,%%tc\n\t" /* disable MMU */
......@@ -783,7 +783,7 @@ static void amiga_reset (void)
"1:\n\t"
"reset\n\t"
"jmp %/a0@" : /* Just that gcc scans it for % escapes */ );
for (;;);
}
......
......@@ -62,19 +62,19 @@ int apollo_parse_bootinfo(const struct bi_record *record) {
const unsigned long *data = record->data;
switch(record->tag) {
case BI_APOLLO_MODEL:
apollo_model=*data;
case BI_APOLLO_MODEL:
apollo_model=*data;
break;
default:
unknown=1;
}
return unknown;
}
void dn_setup_model(void) {
printk("Apollo hardware found: ");
printk("[%s]\n", apollo_models[apollo_model - APOLLO_DN3000]);
......@@ -85,19 +85,19 @@ void dn_setup_model(void) {
break;
case APOLLO_DN3000:
case APOLLO_DN3010:
sio01_physaddr=SAU8_SIO01_PHYSADDR;
rtc_physaddr=SAU8_RTC_PHYSADDR;
pica_physaddr=SAU8_PICA;
picb_physaddr=SAU8_PICB;
sio01_physaddr=SAU8_SIO01_PHYSADDR;
rtc_physaddr=SAU8_RTC_PHYSADDR;
pica_physaddr=SAU8_PICA;
picb_physaddr=SAU8_PICB;
cpuctrl_physaddr=SAU8_CPUCTRL;
timer_physaddr=SAU8_TIMER;
break;
case APOLLO_DN4000:
sio01_physaddr=SAU7_SIO01_PHYSADDR;
sio23_physaddr=SAU7_SIO23_PHYSADDR;
rtc_physaddr=SAU7_RTC_PHYSADDR;
pica_physaddr=SAU7_PICA;
picb_physaddr=SAU7_PICB;
sio01_physaddr=SAU7_SIO01_PHYSADDR;
sio23_physaddr=SAU7_SIO23_PHYSADDR;
rtc_physaddr=SAU7_RTC_PHYSADDR;
pica_physaddr=SAU7_PICA;
picb_physaddr=SAU7_PICB;
cpuctrl_physaddr=SAU7_CPUCTRL;
timer_physaddr=SAU7_TIMER;
break;
......@@ -105,11 +105,11 @@ void dn_setup_model(void) {
panic("Apollo model not yet supported");
break;
case APOLLO_DN3500:
sio01_physaddr=SAU7_SIO01_PHYSADDR;
sio23_physaddr=SAU7_SIO23_PHYSADDR;
rtc_physaddr=SAU7_RTC_PHYSADDR;
pica_physaddr=SAU7_PICA;
picb_physaddr=SAU7_PICB;
sio01_physaddr=SAU7_SIO01_PHYSADDR;
sio23_physaddr=SAU7_SIO23_PHYSADDR;
rtc_physaddr=SAU7_RTC_PHYSADDR;
pica_physaddr=SAU7_PICA;
picb_physaddr=SAU7_PICB;
cpuctrl_physaddr=SAU7_CPUCTRL;
timer_physaddr=SAU7_TIMER;
break;
......@@ -131,17 +131,17 @@ int dn_serial_console_wait_key(struct console *co) {
void dn_serial_console_write (struct console *co, const char *str,unsigned int count)
{
while(count--) {
if (*str == '\n') {
sio01.rhrb_thrb = (unsigned char)'\r';
while (!(sio01.srb_csrb & 0x4))
if (*str == '\n') {
sio01.rhrb_thrb = (unsigned char)'\r';
while (!(sio01.srb_csrb & 0x4))
;
}
}
sio01.rhrb_thrb = (unsigned char)*str++;
while (!(sio01.srb_csrb & 0x4))
;
}
}
}
void dn_serial_print (const char *str)
{
while (*str) {
......@@ -160,7 +160,7 @@ void config_apollo(void) {
int i;
dn_setup_model();
dn_setup_model();
mach_sched_init=dn_sched_init; /* */
mach_init_IRQ=dn_init_IRQ;
......@@ -180,24 +180,24 @@ void config_apollo(void) {
conswitchp = &dummy_con;
#endif
#ifdef CONFIG_HEARTBEAT
mach_heartbeat = dn_heartbeat;
mach_heartbeat = dn_heartbeat;
#endif
mach_get_model = dn_get_model;
cpuctrl=0xaa00;
/* clear DMA translation table */
for(i=0;i<0x400;i++)
for(i=0;i<0x400;i++)
addr_xlat_map[i]=0;
}
}
irqreturn_t dn_timer_int(int irq, void *dev_id, struct pt_regs *fp) {
volatile unsigned char x;
sched_timer_handler(irq,dev_id,fp);
x=*(volatile unsigned char *)(timer+3);
x=*(volatile unsigned char *)(timer+5);
......@@ -206,7 +206,7 @@ irqreturn_t dn_timer_int(int irq, void *dev_id, struct pt_regs *fp) {
void dn_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) {
/* program timer 1 */
/* program timer 1 */
*(volatile unsigned char *)(timer+3)=0x01;
*(volatile unsigned char *)(timer+1)=0x40;
*(volatile unsigned char *)(timer+5)=0x09;
......@@ -272,7 +272,7 @@ void dn_dummy_reset(void) {
for(;;);
}
void dn_dummy_waitbut(void) {
dn_serial_print("waitbut\n");
......@@ -291,7 +291,7 @@ static int dn_cpuctrl=0xff00;
static void dn_heartbeat(int on) {
if(on) {
if(on) {
dn_cpuctrl&=~0x100;
cpuctrl=dn_cpuctrl;
}
......
......@@ -34,7 +34,7 @@ unsigned short dma_map_page(unsigned long phys_addr,int count,int type) {
next_free_xlat_entry+=2;
if(next_free_xlat_entry>125)
next_free_xlat_entry=0;
#if 0
printk("next_free_xlat_entry: %d\n",next_free_xlat_entry);
#endif
......
......@@ -14,9 +14,9 @@ int dn_deb_printf(const char *fmt, ...) {
i=vsprintf(current_dbg_ptr,fmt,args);
va_end(args);
current_dbg_ptr+=i;
return i;
}
else
else
return 0;
}
......@@ -40,7 +40,7 @@ void dn_init_IRQ(void) {
dn_irqs[i].dev_id=NULL;
dn_irqs[i].devname=NULL;
}
}
int dn_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id) {
......@@ -79,7 +79,7 @@ void dn_free_irq(unsigned int irq, void *dev_id) {
if(irq<8)
*(volatile unsigned char *)(pica+1)|=(1<<irq);
else
*(volatile unsigned char *)(picb+1)|=(1<<(irq-8));
*(volatile unsigned char *)(picb+1)|=(1<<(irq-8));
dn_irqs[irq].handler=NULL;
dn_irqs[irq].flags=IRQ_FLG_STD;
......
......@@ -54,14 +54,14 @@
/*
* Atari interrupt handling scheme:
* --------------------------------
*
*
* All interrupt source have an internal number (defined in
* <asm/atariints.h>): Autovector interrupts are 1..7, then follow ST-MFP,
* TT-MFP, SCC, and finally VME interrupts. Vector numbers for the latter can
* be allocated by atari_register_vme_int().
*
* Each interrupt can be of three types:
*
*
* - SLOW: The handler runs with all interrupts enabled, except the one it
* was called by (to avoid reentering). This should be the usual method.
* But it is currently possible only for MFP ints, since only the MFP
......@@ -179,16 +179,16 @@ __asm__ (__ALIGN_STR "\n" \
" movew %%d1,%%sr\n" /* set IPL = previous value */ \
" addql #1,%a0\n" \
" lea %a1,%%a0\n" \
" pea %%sp@\n" /* push addr of frame */ \
" pea %%sp@\n" /* push addr of frame */ \
" movel %%a0@(4),%%sp@-\n" /* push handler data */ \
" pea (%c3+8)\n" /* push int number */ \
" pea (%c3+8)\n" /* push int number */ \
" movel %%a0@,%%a0\n" \
" jbsr %%a0@\n" /* call the handler */ \
" addql #8,%%sp\n" \
" addql #4,%%sp\n" \
" orw #0x0600,%%sr\n" \
" andw #0xfeff,%%sr\n" /* set IPL = 6 again */ \
" orb #(1<<(%c3&7)),%a4:w\n" /* now unmask the int again */ \
" orb #(1<<(%c3&7)),%a4:w\n" /* now unmask the int again */ \
" jbra ret_from_interrupt\n" \
: : "i" (&kstat_cpu(0).irqs[n+8]), "i" (&irq_handler[n+8]), \
"n" (PT_OFF_SR), "n" (n), \
......@@ -274,7 +274,7 @@ asmlinkage void atari_prio_irq_handler( void );
void atari_fast_prio_irq_dummy (void) {
__asm__ (__ALIGN_STR "\n"
"atari_fast_irq_handler:\n\t"
"orw #0x700,%%sr\n" /* disable all interrupts */
"orw #0x700,%%sr\n" /* disable all interrupts */
"atari_prio_irq_handler:\n\t"
"addl %3,%2\n\t" /* preempt_count() += HARDIRQ_OFFSET */
SAVE_ALL_INT "\n\t"
......@@ -282,13 +282,13 @@ __asm__ (__ALIGN_STR "\n"
/* get vector number from stack frame and convert to source */
"bfextu %%sp@(%c1){#4,#10},%%d0\n\t"
"subw #(0x40-8),%%d0\n\t"
"jpl 1f\n\t"
"jpl 1f\n\t"
"addw #(0x40-8-0x18),%%d0\n"
"1:\tlea %a0,%%a0\n\t"
"addql #1,%%a0@(%%d0:l:4)\n\t"
"lea irq_handler,%%a0\n\t"
"lea %%a0@(%%d0:l:8),%%a0\n\t"
"pea %%sp@\n\t" /* push frame address */
"pea %%sp@\n\t" /* push frame address */
"movel %%a0@(4),%%sp@-\n\t" /* push handler data */
"movel %%d0,%%sp@-\n\t" /* push int number */
"movel %%a0@,%%a0\n\t"
......@@ -395,7 +395,7 @@ void __init atari_init_IRQ(void)
be in an atasound_init(), that doesn't exist yet. */
atari_microwire_cmd(MW_LM1992_PSG_HIGH);
}
stdma_init();
/* Initialize the PSG: all sounds off, both ports output */
......@@ -460,7 +460,7 @@ int atari_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, stru
__FUNCTION__, irq, devname);
return -EINVAL;
}
if (vectors[vector] == bad_interrupt) {
/* int has no handler yet */
irq_handler[irq].handler = handler;
......@@ -594,7 +594,7 @@ unsigned long atari_register_vme_int(void)
for(i = 0; i < 32; i++)
if((free_vme_vec_bitmap & (1 << i)) == 0)
break;
if(i == 16)
return 0;
......@@ -641,7 +641,7 @@ int show_atari_interrupts(struct seq_file *p, void *v)
}
if (num_spurious)
seq_printf(p, "spurio.: %10u\n", num_spurious);
return 0;
}
......
......@@ -70,7 +70,7 @@ void atari_mksound (unsigned int hz, unsigned int ticks)
if (hz) {
/* Convert from frequency value to PSG period value (base
frequency 125 kHz). */
period = PSG_FREQ / hz;
if (period > 0xfff) period = 0xfff;
......
......@@ -7,7 +7,7 @@
* Added setting of time_adj to get a better clock.
*
* 5/14/94 Roman Hodek:
* gettod() for TT
* gettod() for TT
*
* 5/15/94 Roman Hodek:
* hard_reset_now() for Atari (and others?)
......@@ -92,7 +92,7 @@ extern void atari_debug_init(void);
* for posterity.
* -- Peter Maydell <pmaydell@chiark.greenend.org.uk>, 05/1998
*/
#if 0
static int __init
hwreg_present_bywrite(volatile void *regp, unsigned char val)
......@@ -100,7 +100,7 @@ hwreg_present_bywrite(volatile void *regp, unsigned char val)
int ret;
long save_sp, save_vbr;
static long tmp_vectors[3] = { [2] = (long)&&after_test };
__asm__ __volatile__
( "movec %/vbr,%2\n\t" /* save vbr value */
"movec %4,%/vbr\n\t" /* set up temporary vectors */
......@@ -141,14 +141,14 @@ static int __init scc_test( volatile char *ctla )
*ctla = 2; MFPDELAY();
*ctla = 0x40; MFPDELAY();
*ctla = 2; MFPDELAY();
if (*ctla != 0x40) return( 0 );
MFPDELAY();
*ctla = 2; MFPDELAY();
*ctla = 0x60; MFPDELAY();
*ctla = 2; MFPDELAY();
if (*ctla != 0x60) return( 0 );
......@@ -199,7 +199,7 @@ void __init atari_switches_setup( const char *str, unsigned len )
p += 3;
ovsc_shift = ATARI_SWITCH_OVSC_SHIFT;
}
if (strcmp( p, "ikbd" ) == 0) {
/* RTS line of IKBD ACIA */
atari_switches |= ATARI_SWITCH_IKBD << ovsc_shift;
......@@ -269,8 +269,8 @@ void __init config_atari(void)
((atari_switches&ATARI_SWITCH_SND6) ? 0x40 : 0) |
((atari_switches&ATARI_SWITCH_SND7) ? 0x80 : 0);
}
/* ++bjoern:
/* ++bjoern:
* Determine hardware present
*/
......@@ -446,7 +446,7 @@ void __init config_atari(void)
: /* no outputs */
: /* no inputs */
: "d0");
/* allocator for memory that must reside in st-ram */
atari_stram_init ();
......@@ -507,7 +507,7 @@ static void atari_heartbeat( int on )
if (atari_dont_touch_floppy_select)
return;
local_irq_save(flags);
sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
tmp = sound_ym.rd_data_reg_sel;
......@@ -544,7 +544,7 @@ static void atari_heartbeat( int on )
* address of a C label. No hope to compile this with another compiler
* than GCC!
*/
/* ++andreas: no need for complicated code, just depend on prefetch */
static void atari_reset (void)
......@@ -563,7 +563,7 @@ static void atari_reset (void)
acia.key_ctrl = ACIA_RESET;
if (atari_switches & ATARI_SWITCH_OVSC_MIDI)
acia.mid_ctrl = ACIA_RESET;
/* processor independent: turn off interrupts and reset the VBR;
* the caches must be left enabled, else prefetching the final jump
* instruction doesn't work. */
......@@ -572,7 +572,7 @@ static void atari_reset (void)
("moveq #0,%/d0\n\t"
"movec %/d0,%/vbr"
: : : "d0" );
if (CPU_IS_040_OR_060) {
unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
if (CPU_IS_060) {
......@@ -584,7 +584,7 @@ static void atari_reset (void)
".chip 68k"
: : : "d0" );
}
__asm__ __volatile__
("movel %0,%/d0\n\t"
"andl #0xff000000,%/d0\n\t"
......
......@@ -4,7 +4,7 @@
* Atari debugging and serial console stuff
*
* Assembled of parts of former atari/config.c 97-12-18 by Roman Hodek
*
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
......@@ -99,7 +99,7 @@ static int ata_par_out (char c)
while( (mfp.par_dt_reg & 1) && --i ) /* wait for BUSY == L */
;
if (!i) return( 0 );
sound_ym.rd_data_reg_sel = 15; /* select port B */
sound_ym.wd_data = c; /* put char onto port */
sound_ym.rd_data_reg_sel = 14; /* select port A */
......@@ -177,7 +177,7 @@ void atari_init_mfp_port( int cflag )
if (baud < B1200 || baud > B38400+2)
baud = B9600; /* use default 9600bps for non-implemented rates */
baud -= B1200; /* baud_table[] starts at 1200bps */
mfp.trn_stat &= ~0x01; /* disable TX */
mfp.usart_ctr = parity | csize | 0x88; /* 1:16 clk mode, 1 stop bit */
mfp.tim_ct_cd &= 0x70; /* stop timer D */
......@@ -204,7 +204,7 @@ void atari_init_mfp_port( int cflag )
for( i = 100; i > 0; --i ) \
MFPDELAY(); \
} while(0)
#ifndef CONFIG_SERIAL_CONSOLE
static void __init atari_init_scc_port( int cflag )
#else
......@@ -214,20 +214,20 @@ void atari_init_scc_port( int cflag )
extern int atari_SCC_reset_done;
static int clksrc_table[9] =
/* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */
{ 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
{ 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
static int brgsrc_table[9] =
/* reg 14: 0 = RTxC, 2 = PCLK */
{ 2, 2, 2, 2, 2, 2, 0, 2, 2 };
{ 2, 2, 2, 2, 2, 2, 0, 2, 2 };
static int clkmode_table[9] =
/* reg 4: 0x40 = x16, 0x80 = x32, 0xc0 = x64 */
{ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 };
{ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 };
static int div_table[9] =
/* reg12 (BRG low) */
{ 208, 138, 103, 50, 24, 11, 1, 0, 0 };
{ 208, 138, 103, 50, 24, 11, 1, 0, 0 };
int baud = cflag & CBAUD;
int clksrc, clkmode, div, reg3, reg5;
if (cflag & CBAUDEX)
baud += B38400;
if (baud < B1200 || baud > B38400+2)
......@@ -248,7 +248,7 @@ void atari_init_scc_port( int cflag )
reg3 = (cflag & CSIZE) == CS8 ? 0xc0 : 0x40;
reg5 = (cflag & CSIZE) == CS8 ? 0x60 : 0x20 | 0x82 /* assert DTR/RTS */;
(void)scc.cha_b_ctrl; /* reset reg pointer */
SCC_WRITE( 9, 0xc0 ); /* reset */
LONG_DELAY(); /* extra delay after WR9 access */
......@@ -267,12 +267,12 @@ void atari_init_scc_port( int cflag )
SCC_WRITE( 14, brgsrc_table[baud] | (div ? 1 : 0) );
SCC_WRITE( 3, reg3 | 1 );
SCC_WRITE( 5, reg5 | 8 );
atari_SCC_reset_done = 1;
atari_SCC_init_done = 1;
}
#ifndef CONFIG_SERIAL_CONSOLE
#ifndef CONFIG_SERIAL_CONSOLE
static void __init atari_init_midi_port( int cflag )
#else
void atari_init_midi_port( int cflag )
......
......@@ -97,7 +97,7 @@ void stdma_lock(irqreturn_t (*handler)(int, void *, struct pt_regs *),
/*
* Function: void stdma_release( void )
*
* Purpose: Releases the lock on the ST-DMA chip.
* Purpose: Releases the lock on the ST-DMA chip.
*
* Inputs: none
*
......
......@@ -52,7 +52,7 @@
/* Pre-swapping comments:
*
* ++roman:
*
*
* New version of ST-Ram buffer allocation. Instead of using the
* 1 MB - 4 KB that remain when the ST-Ram chunk starts at $1000
* (1 MB granularity!), such buffers are reserved like this:
......@@ -60,14 +60,14 @@
* - If the kernel resides in ST-Ram anyway, we can take the buffer
* from behind the current kernel data space the normal way
* (incrementing start_mem).
*
*
* - If the kernel is in TT-Ram, stram_init() initializes start and
* end of the available region. Buffers are allocated from there
* and mem_init() later marks the such used pages as reserved.
* Since each TT-Ram chunk is at least 4 MB in size, I hope there
* won't be an overrun of the ST-Ram region by normal kernel data
* space.
*
*
* For that, ST-Ram may only be allocated while kernel initialization
* is going on, or exactly: before mem_init() is called. There is also
* no provision now for freeing ST-Ram buffers. It seems that isn't
......@@ -105,7 +105,7 @@
* visible on a TT, where the speed difference between ST- and TT-RAM isn't
* that dramatic, but it should on machines where TT-RAM is really much faster
* (e.g. Afterburner).
*
*
* [1]: __get_free_pages() does a fine job if you only want one page, but if
* you want more (contiguous) pages, it can give you such a block only if
* there's already a free one. The algorithm can't try to free buffers or swap
......@@ -318,7 +318,7 @@ void __init atari_stram_reserve_pages(void *start_mem)
swap_end = swap_start + max_swap_size;
DPRINTK( "atari_stram_reserve_pages: swapping enabled; "
"swap=%p-%p\n", swap_start, swap_end);
/* reserve some amount of memory for maintainance of
* swapping itself: one page for each 2048 (PAGE_SIZE/2)
* swap pages. (2 bytes for each page) */
......@@ -328,7 +328,7 @@ void __init atari_stram_reserve_pages(void *start_mem)
/* correct swap_start if necessary */
if (swap_start + PAGE_SIZE == swap_data)
swap_start = start_mem - PAGE_SIZE;
if (!swap_init( start_mem, swap_data )) {
printk( KERN_ERR "ST-RAM swap space initialization failed\n" );
max_swap_size = 0;
......@@ -368,13 +368,13 @@ void atari_stram_mem_init_hook (void)
/*
* This is main public interface: somehow allocate a ST-RAM block
* There are three strategies:
*
*
* - If we're before mem_init(), we have to make a static allocation. The
* region is taken in the kernel data area (if the kernel is in ST-RAM) or
* from the start of ST-RAM (if the kernel is in TT-RAM) and added to the
* rsvd_stram_* region. The ST-RAM is somewhere in the middle of kernel
* address space in the latter case.
*
*
* - If mem_init() already has been called and ST-RAM swapping is enabled,
* try to get the memory from the (pseudo) swap-space, either free already
* or by moving some other pages out of the swap.
......@@ -383,7 +383,7 @@ void atari_stram_mem_init_hook (void)
* enabled, the only possibility is to try with __get_dma_pages(). This has
* the disadvantage that it's very hard to get more than 1 page, and it is
* likely to fail :-(
*
*
*/
void *atari_stram_alloc(long size, const char *owner)
{
......@@ -450,7 +450,7 @@ void atari_stram_free( void *addr )
}
DPRINTK( "atari_stram_free: found block (%p): size=%08lx, owner=%s, "
"flags=%02x\n", block, block->size, block->owner, block->flags );
#ifdef CONFIG_STRAM_SWAP
if (!max_swap_size) {
#endif
......@@ -503,14 +503,14 @@ static int __init swap_init(void *start_mem, void *swap_data)
DPRINTK("swap_init(start_mem=%p, swap_data=%p)\n",
start_mem, swap_data);
/* need at least one page for swapping to (and this also isn't very
* much... :-) */
if (swap_end - swap_start < 2*PAGE_SIZE) {
printk( KERN_WARNING "stram_swap_init: swap space too small\n" );
return( 0 );
}
/* find free slot in swap_info */
for( p = swap_info, type = 0; type < nr_swapfiles; type++, p++ )
if (!(p->flags & SWP_USED))
......@@ -531,7 +531,7 @@ static int __init swap_init(void *start_mem, void *swap_data)
fake_dentry.d_name.name = "stram (internal)";
fake_dentry.d_name.len = 16;
fake_vfsmnt.mnt_parent = &fake_vfsmnt;
p->flags = SWP_USED;
p->swap_file = &fake_dentry;
p->swap_vfsmnt = &fake_vfsmnt;
......@@ -706,7 +706,7 @@ static void unswap_vma(struct vm_area_struct * vma, pgd_t *pgdir,
} while (start < end);
}
static void unswap_process(struct mm_struct * mm, swp_entry_t entry,
static void unswap_process(struct mm_struct * mm, swp_entry_t entry,
struct page *page)
{
struct vm_area_struct* vma;
......@@ -799,7 +799,7 @@ static void *get_stram_region( unsigned long n_pages )
unsigned long start, total_free, region_free;
int err;
void *ret = NULL;
DPRINTK( "get_stram_region(n_pages=%lu)\n", n_pages );
down(&stram_swap_sem);
......@@ -874,7 +874,7 @@ static void free_stram_region( unsigned long offset, unsigned long n_pages )
static int in_some_region(void *addr)
{
BLOCK *p;
for( p = alloc_list; p; p = p->next ) {
if (p->start <= addr && addr < p->start + p->size)
return( 1 );
......@@ -920,7 +920,7 @@ static unsigned long find_free_region(unsigned long n_pages,
/* don't need more free pages... :-) */
goto out;
}
/* now shift the window and look for the area where as much pages as
* possible are free */
while( tail < max ) {
......@@ -1130,7 +1130,7 @@ static BLOCK *add_region( void *addr, unsigned long size )
static BLOCK *find_region( void *addr )
{
BLOCK *p;
for( p = alloc_list; p; p = p->next ) {
if (p->start == addr)
return( p );
......@@ -1145,7 +1145,7 @@ static BLOCK *find_region( void *addr )
static int remove_region( BLOCK *block )
{
BLOCK **p;
for( p = &alloc_list; *p; p = &((*p)->next) )
if (*p == block) break;
if (!*p)
......
......@@ -4,7 +4,7 @@
* Atari time and real time clock stuff
*
* Assembled of parts of former atari/config.c 97-12-18 by Roman Hodek
*
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
......@@ -25,7 +25,7 @@ atari_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *))
/* set Timer C data Register */
mfp.tim_dt_c = INT_TICKS;
/* start timer C, div = 1:100 */
mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60;
mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60;
/* install interrupt service routine for MFP Timer C */
request_irq(IRQ_MFP_TIMC, timer_routine, IRQ_TYPE_SLOW,
"timer", timer_routine);
......@@ -34,7 +34,7 @@ atari_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *))
/* ++andreas: gettimeoffset fixed to check for pending interrupt */
#define TICK_SIZE 10000
/* This is always executed with interrupts disabled. */
unsigned long atari_gettimeoffset (void)
{
......@@ -59,9 +59,9 @@ static void mste_read(struct MSTE_RTC *val)
{
#define COPY(v) val->v=(mste_rtc.v & 0xf)
do {
COPY(sec_ones) ; COPY(sec_tens) ; COPY(min_ones) ;
COPY(min_tens) ; COPY(hr_ones) ; COPY(hr_tens) ;
COPY(weekday) ; COPY(day_ones) ; COPY(day_tens) ;
COPY(sec_ones) ; COPY(sec_tens) ; COPY(min_ones) ;
COPY(min_tens) ; COPY(hr_ones) ; COPY(hr_tens) ;
COPY(weekday) ; COPY(day_ones) ; COPY(day_tens) ;
COPY(mon_ones) ; COPY(mon_tens) ; COPY(year_ones) ;
COPY(year_tens) ;
/* prevent from reading the clock while it changed */
......@@ -73,9 +73,9 @@ static void mste_write(struct MSTE_RTC *val)
{
#define COPY(v) mste_rtc.v=val->v
do {
COPY(sec_ones) ; COPY(sec_tens) ; COPY(min_ones) ;
COPY(min_tens) ; COPY(hr_ones) ; COPY(hr_tens) ;
COPY(weekday) ; COPY(day_ones) ; COPY(day_tens) ;
COPY(sec_ones) ; COPY(sec_tens) ; COPY(min_ones) ;
COPY(min_tens) ; COPY(hr_ones) ; COPY(hr_tens) ;
COPY(weekday) ; COPY(day_ones) ; COPY(day_tens) ;
COPY(mon_ones) ; COPY(mon_tens) ; COPY(year_ones) ;
COPY(year_tens) ;
/* prevent from writing the clock while it changed */
......@@ -104,14 +104,14 @@ int atari_mste_hwclk( int op, struct rtc_time *t )
int hour, year;
int hr24=0;
struct MSTE_RTC val;
mste_rtc.mode=(mste_rtc.mode | 1);
hr24=mste_rtc.mon_tens & 1;
mste_rtc.mode=(mste_rtc.mode & ~1);
if (op) {
/* write: prepare values */
val.sec_ones = t->tm_sec % 10;
val.sec_tens = t->tm_sec / 10;
val.min_ones = t->tm_min % 10;
......@@ -160,8 +160,8 @@ int atari_mste_hwclk( int op, struct rtc_time *t )
int atari_tt_hwclk( int op, struct rtc_time *t )
{
int sec=0, min=0, hour=0, day=0, mon=0, year=0, wday=0;
unsigned long flags;
int sec=0, min=0, hour=0, day=0, mon=0, year=0, wday=0;
unsigned long flags;
unsigned char ctrl;
int pm = 0;
......@@ -170,7 +170,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
if (op) {
/* write: prepare values */
sec = t->tm_sec;
min = t->tm_min;
hour = t->tm_hour;
......@@ -178,7 +178,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
mon = t->tm_mon + 1;
year = t->tm_year - atari_rtc_year_offset;
wday = t->tm_wday + (t->tm_wday >= 0);
if (!(ctrl & RTC_24H)) {
if (hour > 11) {
pm = 0x80;
......@@ -188,7 +188,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
else if (hour == 0)
hour = 12;
}
if (!(ctrl & RTC_DM_BINARY)) {
BIN_TO_BCD(sec);
BIN_TO_BCD(min);
......@@ -199,7 +199,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
if (wday >= 0) BIN_TO_BCD(wday);
}
}
/* Reading/writing the clock registers is a bit critical due to
* the regular update cycle of the RTC. While an update is in
* progress, registers 0..9 shouldn't be touched.
......@@ -242,7 +242,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
if (!op) {
/* read: adjust values */
if (hour & 0x80) {
hour &= ~0x80;
pm = 1;
......@@ -284,7 +284,7 @@ int atari_mste_set_clock_mmss (unsigned long nowtime)
struct MSTE_RTC val;
unsigned char rtc_minutes;
mste_read(&val);
mste_read(&val);
rtc_minutes= val.min_ones + val.min_tens * 10;
if ((rtc_minutes < real_minutes
? real_minutes - rtc_minutes
......
......@@ -44,7 +44,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE;
unsigned char msr;
unsigned long flags;
struct rtc_time wtime;
struct rtc_time wtime;
switch (cmd) {
case RTC_RD_TIME: /* Read the time/date from RTC */
......@@ -105,7 +105,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
if (yrs >= 2070)
return -EINVAL;
local_irq_save(flags);
/* Ensure clock and real-time-mode-register are accessible */
msr = rtc->msr & 0xc0;
......
......@@ -101,7 +101,7 @@ CONFIG_INET=y
# CONFIG_ATM is not set
#
#
#
#
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
......
......@@ -12,7 +12,7 @@ MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE and any warranty against infringement with
regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
and any accompanying written materials.
and any accompanying written materials.
To the maximum extent permitted by applicable law,
IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
......@@ -20,7 +20,7 @@ IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR
OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE
SOFTWARE. Motorola assumes no responsibility for the maintenance
and support of the SOFTWARE.
and support of the SOFTWARE.
You are hereby granted a copyright license to use, modify, and
distribute the SOFTWARE so long as this entire notice is retained
......
This diff is collapsed.
......@@ -60,8 +60,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|BINSTR idnt 2,1 | Motorola 040 Floating Point Software Package
......
......@@ -7,7 +7,7 @@
|
| Fixes for bugs: 1238
|
| Bug: 1238
| Bug: 1238
|
|
| /* The following dirty_bit clear should be left in
......@@ -152,8 +152,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|BUGFIX idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -167,8 +167,8 @@
.global b1238_fix
b1238_fix:
|
| This code is entered only on completion of the handling of an
| nu-generated ovfl, unfl, or inex exception. If the version
| This code is entered only on completion of the handling of an
| nu-generated ovfl, unfl, or inex exception. If the version
| number of the fsave is not $40, this handler is not necessary.
| Simply branch to fix_done and exit normally.
|
......@@ -180,11 +180,11 @@ b1238_fix:
|
moveb CU_SAVEPC(%a6),%d0
andib #0xFE,%d0
beq fix_done |if zero, this is not bug #1238
beq fix_done |if zero, this is not bug #1238
|
| Test the register conflict aspect. If opclass0, check for
| cu src equal to xu dest or equal to nu dest. If so, go to
| cu src equal to xu dest or equal to nu dest. If so, go to
| op0. Else, or if opclass2, check for cu dest equal to
| xu dest or equal to nu dest. If so, go to tst_opcl. Else,
| exit, it is not the bug case.
......@@ -196,17 +196,17 @@ b1238_fix:
bne op2sgl |not opclass 0, check op2
|
| Check for cu and nu register conflict. If one exists, this takes
| priority over a cu and xu conflict.
| priority over a cu and xu conflict.
|
bfextu CMDREG1B(%a6){#3:#3},%d0 |get 1st src
bfextu CMDREG1B(%a6){#3:#3},%d0 |get 1st src
bfextu CMDREG3B(%a6){#6:#3},%d1 |get 3rd dest
cmpb %d0,%d1
beqs op0 |if equal, continue bugfix
|
| Check for cu dest equal to nu dest. If so, go and fix the
| Check for cu dest equal to nu dest. If so, go and fix the
| bug condition. Otherwise, exit.
|
bfextu CMDREG1B(%a6){#6:#3},%d0 |get 1st dest
bfextu CMDREG1B(%a6){#6:#3},%d0 |get 1st dest
cmpb %d0,%d1 |cmp 1st dest with 3rd dest
beqs op0 |if equal, continue bugfix
|
......@@ -215,7 +215,7 @@ b1238_fix:
bfextu CMDREG2B(%a6){#6:#3},%d1 |get 2nd dest
cmpb %d0,%d1 |cmp 1st dest with 2nd dest
beqs op0_xu |if equal, continue bugfix
bfextu CMDREG1B(%a6){#3:#3},%d0 |get 1st src
bfextu CMDREG1B(%a6){#3:#3},%d0 |get 1st src
cmpb %d0,%d1 |cmp 1st src with 2nd dest
beq op0_xu
bne fix_done |if the reg checks fail, exit
......@@ -245,7 +245,7 @@ setete15:
|
| We have the case in which a conflict exists between the cu src or
| dest and the dest of the xu. We must clear the instruction in
| dest and the dest of the xu. We must clear the instruction in
| the cu and restore the state, allowing the instruction in the
| xu to complete. Remember, the instruction in the nu
| was exceptional, and was completed by the appropriate handler.
......@@ -255,7 +255,7 @@ setete15:
| exceptional, we choose to kill the process.
|
| Items saved from the stack:
|
|
| $3c stag - L_SCR1
| $40 cmdreg1b - L_SCR2
| $44 dtag - L_SCR3
......@@ -264,8 +264,8 @@ setete15:
| fpu.
|
op0_xu:
movel STAG(%a6),L_SCR1(%a6)
movel CMDREG1B(%a6),L_SCR2(%a6)
movel STAG(%a6),L_SCR1(%a6)
movel CMDREG1B(%a6),L_SCR2(%a6)
movel DTAG(%a6),L_SCR3(%a6)
andil #0xe0000000,L_SCR3(%a6)
moveb #0,CU_SAVEPC(%a6)
......@@ -274,13 +274,13 @@ op0_xu:
fsave -(%a7)
|
| Check if the instruction which just completed was exceptional.
|
|
cmpw #0x4060,(%a7)
beq op0_xb
|
|
| It is necessary to isolate the result of the instruction in the
| xu if it is to fp0 - fp3 and write that value to the USER_FPn
| locations on the stack. The correct destination register is in
| locations on the stack. The correct destination register is in
| cmdreg2b.
|
bfextu CMDREG2B(%a6){#6:#3},%d0 |get dest register no
......@@ -339,7 +339,7 @@ op0_sete15:
|
| The frame returned is busy. It is not possible to reconstruct
| the code sequence to allow completion. We will jump to
| the code sequence to allow completion. We will jump to
| fpsp_fmt_error and allow the kernel to kill the process.
|
op0_xb:
......@@ -354,20 +354,20 @@ op2sgl:
cmpiw #0x4400,%d0 |test for opclass 2 and size=sgl
bne fix_done |if not, it is not bug 1238
|
| Check for cu dest equal to nu dest or equal to xu dest, with
| Check for cu dest equal to nu dest or equal to xu dest, with
| a cu and nu conflict taking priority an nu conflict. If either,
| go and fix the bug condition. Otherwise, exit.
|
bfextu CMDREG1B(%a6){#6:#3},%d0 |get 1st dest
bfextu CMDREG1B(%a6){#6:#3},%d0 |get 1st dest
bfextu CMDREG3B(%a6){#6:#3},%d1 |get 3rd dest
cmpb %d0,%d1 |cmp 1st dest with 3rd dest
beq op2_com |if equal, continue bugfix
bfextu CMDREG2B(%a6){#6:#3},%d1 |get 2nd dest
bfextu CMDREG2B(%a6){#6:#3},%d1 |get 2nd dest
cmpb %d0,%d1 |cmp 1st dest with 2nd dest
bne fix_done |if the reg checks fail, exit
|
| We have the case in which a conflict exists between the cu src or
| dest and the dest of the xu. We must clear the instruction in
| dest and the dest of the xu. We must clear the instruction in
| the cu and restore the state, allowing the instruction in the
| xu to complete. Remember, the instruction in the nu
| was exceptional, and was completed by the appropriate handler.
......@@ -377,7 +377,7 @@ op2sgl:
| exceptional, we choose to kill the process.
|
| Items saved from the stack:
|
|
| $3c stag - L_SCR1
| $40 cmdreg1b - L_SCR2
| $44 dtag - L_SCR3
......@@ -387,9 +387,9 @@ op2sgl:
| fpu.
|
op2_xu:
movel STAG(%a6),L_SCR1(%a6)
movel CMDREG1B(%a6),L_SCR2(%a6)
movel DTAG(%a6),L_SCR3(%a6)
movel STAG(%a6),L_SCR1(%a6)
movel CMDREG1B(%a6),L_SCR2(%a6)
movel DTAG(%a6),L_SCR3(%a6)
andil #0xe0000000,L_SCR3(%a6)
moveb #0,CU_SAVEPC(%a6)
movel ETEMP(%a6),FP_SCR2(%a6)
......@@ -400,13 +400,13 @@ op2_xu:
fsave -(%a7)
|
| Check if the instruction which just completed was exceptional.
|
|
cmpw #0x4060,(%a7)
beq op2_xb
|
|
| It is necessary to isolate the result of the instruction in the
| xu if it is to fp0 - fp3 and write that value to the USER_FPn
| locations on the stack. The correct destination register is in
| locations on the stack. The correct destination register is in
| cmdreg2b.
|
bfextu CMDREG2B(%a6){#6:#3},%d0 |get dest register no
......@@ -459,12 +459,12 @@ op2_com:
bnes case2
movew #0x43FF,ETEMP_EX(%a6) |to double +max
bra finish
case2:
case2:
cmpw #0xC07F,ETEMP_EX(%a6) |single -max
bnes case3
movew #0xC3FF,ETEMP_EX(%a6) |to double -max
bra finish
case3:
case3:
cmpw #0x3F80,ETEMP_EX(%a6) |single +min
bnes case4
movew #0x3C00,ETEMP_EX(%a6) |to double +min
......@@ -480,7 +480,7 @@ case4:
| an fline illegal instruction to be executed.
|
| You should replace the jump to fpsp_fmt_error with a jump
| to the entry point used to kill a process.
| to the entry point used to kill a process.
|
op2_xb:
jmp fpsp_fmt_error
......
......@@ -60,17 +60,17 @@
| it is negative.
|
| Clean up and return. Check if the final mul or div resulted
| in an inex2 exception. If so, set inex1 in the fpsr and
| in an inex2 exception. If so, set inex1 in the fpsr and
| check if the inex1 exception is enabled. If so, set d7 upper
| word to $0100. This will signal unimp.sa that an enabled inex1
| exception occurred. Unimp will fix the stack.
|
|
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|DECBIN idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -107,12 +107,12 @@ RTABLE: .byte 0,0,0,0
.set FSTRT,0
|
.set ESTRT,4
.set EDIGITS,2 |
.set EDIGITS,2 |
|
| Constants in single precision
FZERO: .long 0x00000000
FONE: .long 0x3F800000
FTEN: .long 0x41200000
FZERO: .long 0x00000000
FONE: .long 0x3F800000
FTEN: .long 0x41200000
.set TEN,10
......@@ -224,7 +224,7 @@ nextlw:
addql #1,%d1 |inc lw pointer in mantissa
cmpl #2,%d1 |test for last lw
ble loadlw |if not, get last one
|
| Check the sign of the mant and make the value in fp0 the same sign.
|
......@@ -232,7 +232,7 @@ m_sign:
btst #31,(%a0) |test sign of the mantissa
beq ap_st_z |if clear, go to append/strip zeros
fnegx %fp0 |if set, negate fp0
|
| Append/strip zeros:
|
......@@ -407,7 +407,7 @@ ap_n_en:
|
| Pwrten calculates the exponent factor in the selected rounding mode
| according to the following table:
|
|
| Sign of Mant Sign of Exp Rounding Mode PWRTEN Rounding Mode
|
| ANY ANY RN RN
......@@ -495,7 +495,7 @@ mul:
| it will be inex2, but will be reported as inex1 by get_op.
|
end_dec:
fmovel %FPSR,%d0 |get status register
fmovel %FPSR,%d0 |get status register
bclrl #inex2_bit+8,%d0 |test for inex2 and clear it
fmovel %d0,%FPSR |return status reg w/o inex2
beqs no_exc |skip this if no exc
......
......@@ -4,11 +4,11 @@
| Do_func performs the unimplemented operation. The operation
| to be performed is determined from the lower 7 bits of the
| extension word (except in the case of fmovecr and fsincos).
| The opcode and tag bits form an index into a jump table in
| tbldo.sa. Cases of zero, infinity and NaN are handled in
| The opcode and tag bits form an index into a jump table in
| tbldo.sa. Cases of zero, infinity and NaN are handled in
| do_func by forcing the default result. Normalized and
| denormalized (there are no unnormalized numbers at this
| point) are passed onto the emulation code.
| point) are passed onto the emulation code.
|
| CMDREG1B and STAG are extracted from the fsave frame
| and combined to form the table index. The function called
......@@ -22,8 +22,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
DO_FUNC: |idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -35,7 +35,7 @@ DO_FUNC: |idnt 2,1 | Motorola 040 Floating Point Software Package
|xref t_dz2
|xref t_operr
|xref t_inx2
|xref t_resdnrm
|xref t_resdnrm
|xref dst_nan
|xref src_nan
|xref nrm_set
......@@ -68,7 +68,7 @@ do_func:
| directly.
|
bfextu CMDREG1B(%a6){#0:#6},%d0 |get opclass and src fields
cmpil #0x17,%d0 |if op class and size fields are $17,
cmpil #0x17,%d0 |if op class and size fields are $17,
| ;it is FMOVECR; if not, continue
bnes not_fmovecr
jmp smovcr |fmovecr; jmp directly to emulation
......@@ -76,7 +76,7 @@ do_func:
not_fmovecr:
movew CMDREG1B(%a6),%d0
andl #0x7F,%d0
cmpil #0x38,%d0 |if the extension is >= $38,
cmpil #0x38,%d0 |if the extension is >= $38,
bge serror |it is illegal
bfextu STAG(%a6){#0:#3},%d1
lsll #3,%d0 |make room for STAG
......@@ -111,7 +111,7 @@ ld_mzinx:
bsr ld_mzero |if neg, load neg zero, return here
bra t_inx2 |now, set the inx for the next inst
|
| Load a signed zero to fp0; do not set inex2/ainex
| Load a signed zero to fp0; do not set inex2/ainex
|
.global szero
szero:
......@@ -119,7 +119,7 @@ szero:
bne ld_mzero |if neg, load neg zero
bra ld_pzero |load positive zero
|
| Load a signed infinity to fp0; do not set inex2/ainex
| Load a signed infinity to fp0; do not set inex2/ainex
|
.global sinf
sinf:
......@@ -127,7 +127,7 @@ sinf:
bne ld_minf |if negative branch
bra ld_pinf
|
| Load a signed one to fp0; do not set inex2/ainex
| Load a signed one to fp0; do not set inex2/ainex
|
.global sone
sone:
......@@ -135,7 +135,7 @@ sone:
bne ld_mone
bra ld_pone
|
| Load a signed pi/2 to fp0; do not set inex2/ainex
| Load a signed pi/2 to fp0; do not set inex2/ainex
|
.global spi_2
spi_2:
......@@ -160,13 +160,13 @@ sopr_inf:
bne t_operr
bra ld_pinf
|
| FLOGNP1
| FLOGNP1
|
.global sslognp1
sslognp1:
fmovemx (%a0),%fp0-%fp0
fcmpb #-1,%fp0
fbgt slognp1
fbgt slognp1
fbeq t_dz2 |if = -1, divide by zero exception
fmovel #0,%FPSR |clr N flag
bra t_operr |take care of operands < -1
......@@ -186,7 +186,7 @@ setoxm1i:
|
.global sslogn
sslogn:
btstb #sign_bit,LOCAL_EX(%a0)
btstb #sign_bit,LOCAL_EX(%a0)
bne t_operr |take care of operands < 0
cmpiw #0x3fff,LOCAL_EX(%a0) |test for 1.0 input
bne slogn
......@@ -199,7 +199,7 @@ sslogn:
.global sslognd
sslognd:
btstb #sign_bit,LOCAL_EX(%a0)
btstb #sign_bit,LOCAL_EX(%a0)
beq slognd
bra t_operr |take care of operands < 0
......@@ -221,7 +221,7 @@ sslog10:
.global sslog10d
sslog10d:
btstb #sign_bit,LOCAL_EX(%a0)
btstb #sign_bit,LOCAL_EX(%a0)
beq slog10d
bra t_operr |take care of operands < 0
......@@ -243,7 +243,7 @@ sslog2:
.global sslog2d
sslog2d:
btstb #sign_bit,LOCAL_EX(%a0)
btstb #sign_bit,LOCAL_EX(%a0)
beq slog2d
bra t_operr |take care of operands < 0
......@@ -310,7 +310,7 @@ smod_zsn:
btstl #7,%d0 |test if + or -
beq ld_pzero |if pos then load +0
bra ld_mzero |else neg load -0
smod_fpn:
moveb ETEMP(%a6),%d1 |get sign of src op
moveb FPTEMP(%a6),%d0 |get sign of dst op
......@@ -327,7 +327,7 @@ smod_nrm:
fmovel USER_FPCR(%a6),%fpcr |use user's rmode and precision
fmovex FPTEMP(%a6),%fp0 |return dest to fp0
rts
|
| FREM
|
......@@ -372,7 +372,7 @@ prem:
lea premt,%a1
movel (%a1,%d1.w*4),%a1
jmp (%a1)
srem_snan:
bra src_nan
srem_dnan:
......@@ -390,7 +390,7 @@ srem_zsn:
btstl #7,%d0 |test if + or -
beq ld_pzero |if pos then load +0
bra ld_mzero |else neg load -0
srem_fpn:
moveb ETEMP(%a6),%d1 |get sign of src op
moveb FPTEMP(%a6),%d0 |get sign of dst op
......@@ -424,10 +424,10 @@ pscalet:
.long scl_inf | 10,00 inf,norm = +-inf
.long scl_inf | 10,01 inf,zero = +-inf
.long scl_opr | 10,10 inf,inf = nan with operr
.long scl_snan | 10,11 inf,nan = nan
.long scl_dnan | 11,00 nan,norm = nan
.long scl_dnan | 11,01 nan,zero = nan
.long scl_dnan | 11,10 nan,inf = nan
.long scl_snan | 10,11 inf,nan = nan
.long scl_dnan | 11,00 nan,norm = nan
.long scl_dnan | 11,01 nan,zero = nan
.long scl_dnan | 11,10 nan,inf = nan
.long scl_dnan | 11,11 nan,nan = nan
.global pscale
......@@ -478,7 +478,7 @@ ssincosz:
sincosp:
fmovex PZERO,%fp0
sincoscom:
fmovemx PONE,%fp1-%fp1 |do not allow FPSR to be affected
fmovemx PONE,%fp1-%fp1 |do not allow FPSR to be affected
bra sto_cos |store cosine result
.global ssincosi
......@@ -498,7 +498,7 @@ ssincosnan:
bsr sto_cos
bra src_nan
|
| This code forces default values for the zero, inf, and nan cases
| This code forces default values for the zero, inf, and nan cases
| in the transcendentals code. The CC bits must be set in the
| stacked FPSR to be correctly reported.
|
......
......@@ -5,15 +5,15 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
| fpsp.h --- stack frame offsets during FPSP exception handling
|
| These equates are used to access the exception frame, the fsave
| frame and any local variables needed by the FPSP package.
|
|
| All FPSP handlers begin by executing:
|
| link a6,#-LOCAL_SIZE
......@@ -90,13 +90,13 @@
.set USER_FP2,LV+40 | saved user FP2
.set USER_FP3,LV+52 | saved user FP3
.set USER_FPCR,LV+64 | saved user FPCR
.set FPCR_ENABLE,USER_FPCR+2 | FPCR exception enable
.set FPCR_MODE,USER_FPCR+3 | FPCR rounding mode control
.set FPCR_ENABLE,USER_FPCR+2 | FPCR exception enable
.set FPCR_MODE,USER_FPCR+3 | FPCR rounding mode control
.set USER_FPSR,LV+68 | saved user FPSR
.set FPSR_CC,USER_FPSR+0 | FPSR condition code
.set FPSR_QBYTE,USER_FPSR+1 | FPSR quotient
.set FPSR_EXCEPT,USER_FPSR+2 | FPSR exception
.set FPSR_AEXCEPT,USER_FPSR+3 | FPSR accrued exception
.set FPSR_CC,USER_FPSR+0 | FPSR condition code
.set FPSR_QBYTE,USER_FPSR+1 | FPSR quotient
.set FPSR_EXCEPT,USER_FPSR+2 | FPSR exception
.set FPSR_AEXCEPT,USER_FPSR+3 | FPSR accrued exception
.set USER_FPIAR,LV+72 | saved user FPIAR
.set FP_SCR1,LV+76 | room for a temporary float value
.set FP_SCR2,LV+92 | room for a temporary float value
......@@ -143,8 +143,8 @@
.set CMDREG3B,LV-48 | cmd reg for E3 exceptions (2 bytes)
|
.set NMNEXC,LV-44 | NMNEXC (unsup,snan bits only)
.set nmn_unsup_bit,1 |
.set nmn_snan_bit,0 |
.set nmn_unsup_bit,1 |
.set nmn_snan_bit,0 |
|
.set NMCEXC,LV-43 | NMNEXC & NMCEXC
.set nmn_operr_bit,7
......@@ -249,7 +249,7 @@
.set inf_mask,0x02000000
.set nan_mask,0x01000000
|
.set bsun_mask,0x00008000 |
.set bsun_mask,0x00008000 |
.set snan_mask,0x00004000
.set operr_mask,0x00002000
.set ovfl_mask,0x00001000
......@@ -268,7 +268,7 @@
|
.set dzinf_mask,inf_mask+dz_mask+adz_mask
.set opnan_mask,nan_mask+operr_mask+aiop_mask
.set nzi_mask,0x01ffffff | clears N, Z, and I
.set nzi_mask,0x01ffffff | clears N, Z, and I
.set unfinx_mask,unfl_mask+inex2_mask+aunfl_mask+ainex_mask
.set unf2inx_mask,unfl_mask+inex2_mask+ainex_mask
.set ovfinx_mask,ovfl_mask+inex2_mask+aovfl_mask+ainex_mask
......
......@@ -2,10 +2,10 @@
| gen_except.sa 3.7 1/16/92
|
| gen_except --- FPSP routine to detect reportable exceptions
|
|
| This routine compares the exception enable byte of the
| user_fpcr on the stack with the exception status byte
| of the user_fpsr.
| of the user_fpsr.
|
| Any routine which may report an exceptions must load
| the stack frame in memory with the exceptional operand(s).
......@@ -23,14 +23,14 @@
|
| Note: The IEEE standard specifies that inex2 is to be
| reported if ovfl occurs and the ovfl enable bit is not
| set but the inex2 enable bit is.
| set but the inex2 enable bit is.
|
|
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
GEN_EXCEPT: |idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -70,12 +70,12 @@ gen_except:
|
movel ETEMP_EX(%a6),ETEMP_EX(%a1) |copy etemp from unimp
movel ETEMP_HI(%a6),ETEMP_HI(%a1) |frame to busy frame
movel ETEMP_LO(%a6),ETEMP_LO(%a1)
movel ETEMP_LO(%a6),ETEMP_LO(%a1)
movel CMDREG1B(%a6),CMDREG1B(%a1) |set inst in frame to unimp
movel CMDREG1B(%a6),%d0 |fix cmd1b to make it
andl #0x03c30000,%d0 |work for cmd3b
bfextu CMDREG1B(%a6){#13:#1},%d1 |extract bit 2
lsll #5,%d1
lsll #5,%d1
swap %d1
orl %d1,%d0 |put it in the right place
bfextu CMDREG1B(%a6){#10:#3},%d1 |extract bit 3,4,5
......@@ -86,7 +86,7 @@ gen_except:
|
| Or in the FPSR from the emulation with the USER_FPSR on the stack.
|
fmovel %FPSR,%d0
fmovel %FPSR,%d0
orl %d0,USER_FPSR(%a6)
movel USER_FPSR(%a6),FPSR_SHADOW(%a1) |set exc bits
orl #sx_mask,E_BYTE(%a1)
......@@ -108,7 +108,7 @@ test_rev:
cmpib #UNIMP_41_SIZE-4,1(%a7) |test for rev unimp frame
bnel fpsp_fmt_error |if not $28 or $30
leal UNIMP_41_SIZE+LOCAL_SIZE(%a7),%a1
unimp_con:
|
| Fix up the new unimp frame with entries from the old unimp frame
......@@ -117,23 +117,23 @@ unimp_con:
|
| Or in the FPSR from the emulation with the USER_FPSR on the stack.
|
fmovel %FPSR,%d0
fmovel %FPSR,%d0
orl %d0,USER_FPSR(%a6)
bra do_clean
|
| Frame is idle, so check for exceptions reported through
| USER_FPSR and set the unimp frame accordingly.
| USER_FPSR and set the unimp frame accordingly.
| A7 must be incremented to the point before the
| idle fsave vector to the unimp vector.
|
do_check:
addl #4,%a7 |point A7 back to unimp frame
|
| Or in the FPSR from the emulation with the USER_FPSR on the stack.
|
fmovel %FPSR,%d0
fmovel %FPSR,%d0
orl %d0,USER_FPSR(%a6)
|
| On a busy frame, we must clear the nmnexc bits.
......@@ -165,10 +165,10 @@ frame_com:
bsun_exc:
bra do_clean
|
| The typical work to be done to the unimp frame to report an
| The typical work to be done to the unimp frame to report an
| exception is to set the E1/E3 byte and clr the U flag.
| commonE1 does this for E1 exceptions, which are snan,
| operr, and dz. commonE3 does this for E3 exceptions, which
| commonE1 does this for E1 exceptions, which are snan,
| operr, and dz. commonE3 does this for E3 exceptions, which
| are inex2 and inex1, and also clears the E1 exception bit
| left over from the unimp exception.
|
......@@ -186,7 +186,7 @@ uniE3:
unsE3:
tstb RES_FLG(%a6)
bnes unsE3_0
bnes unsE3_0
unsE3_1:
bsetb #E3,E_BYTE(%a6) |set E3 flag
unsE3_0:
......@@ -194,7 +194,7 @@ unsE3_0:
movel CMDREG1B(%a6),%d0
andl #0x03c30000,%d0 |work for cmd3b
bfextu CMDREG1B(%a6){#13:#1},%d1 |extract bit 2
lsll #5,%d1
lsll #5,%d1
swap %d1
orl %d1,%d0 |put it in the right place
bfextu CMDREG1B(%a6){#10:#3},%d1 |extract bit 3,4,5
......@@ -218,8 +218,8 @@ no_match:
beqs no_exc |if clear, exit
bras ovfl_unfl |go to unfl_ovfl to determine if
| ;it is an unsupp or unimp exc
| No exceptions are to be reported. If the instruction was
| No exceptions are to be reported. If the instruction was
| unimplemented, no FPU restore is necessary. If it was
| unsupported, we must perform the restore.
no_exc:
......@@ -227,7 +227,7 @@ no_exc:
beqs uni_no_exc
uns_no_exc:
tstb RES_FLG(%a6) |check if frestore is needed
bne do_clean |if clear, no frestore needed
bne do_clean |if clear, no frestore needed
uni_no_exc:
moveml USER_DA(%a6),%d0-%d1/%a0-%a1
fmovemx USER_FP0(%a6),%fp0-%fp3
......@@ -243,13 +243,13 @@ uni_no_exc:
|
| Unimplemented Instruction Handler:
| Ovfl:
| Only scosh, setox, ssinh, stwotox, and scale can set overflow in
| Only scosh, setox, ssinh, stwotox, and scale can set overflow in
| this manner.
| Unfl:
| Stwotox, setox, and scale can set underflow in this manner.
| Any of the other Library Routines such that f(x)=x in which
| x is an extended denorm can report an underflow exception.
| It is the responsibility of the exception-causing exception
| x is an extended denorm can report an underflow exception.
| It is the responsibility of the exception-causing exception
| to make sure that WBTEMP is correct.
|
| The exceptional operand is in FP_SCR1.
......@@ -306,7 +306,7 @@ busy_fr:
movel CMDREG1B(%a6),%d0 |fix cmd1b to make it
andl #0x03c30000,%d0 |work for cmd3b
bfextu CMDREG1B(%a6){#13:#1},%d1 |extract bit 2
lsll #5,%d1
lsll #5,%d1
swap %d1
orl %d1,%d0 |put it in the right place
bfextu CMDREG1B(%a6){#10:#3},%d1 |extract bit 3,4,5
......@@ -318,10 +318,10 @@ busy_fr:
|
| Check if the frame to be restored is busy or unimp.
|** NOTE *** Bug fix for errata (0d43b #3)
| If the frame is unimp, we must create a busy frame to
| If the frame is unimp, we must create a busy frame to
| fix the bug with the nmnexc bits in cases in which they
| are set by a previous instruction and not cleared by
| the save. The frame will be unimp only if the final
| the save. The frame will be unimp only if the final
| instruction in an emulation routine caused the exception
| by doing an fmove <ea>,fp0. The exception operand, in
| internal format, is in fptemp.
......@@ -353,7 +353,7 @@ loop2:
leal BUSY_SIZE+LOCAL_SIZE(%a7),%a1 |init a1 for new frame
moveb VER_TMP(%a6),(%a7) |write busy fmt word
moveb #BUSY_SIZE-4,1(%a7)
movel FP_SCR1(%a6),WBTEMP_EX(%a1) |write
movel FP_SCR1(%a6),WBTEMP_EX(%a1) |write
movel FP_SCR1+4(%a6),WBTEMP_HI(%a1) |exceptional op to
movel FP_SCR1+8(%a6),WBTEMP_LO(%a1) |wbtemp
| btst.b #E1,E_BYTE(%a1)
......@@ -362,7 +362,7 @@ loop2:
bfins %d0,NMCEXC(%a1){#4:#4} |and insert them in nmcexc
movel USER_FPSR(%a6),FPSR_SHADOW(%a1) |set exc bits
orl #sx_mask,E_BYTE(%a1)
do_restore:
moveml USER_DA(%a6),%d0-%d1/%a0-%a1
fmovemx USER_FP0(%a6),%fp0-%fp3
......@@ -374,10 +374,10 @@ do_restore:
cont:
unlk %a6
|
| If trace mode enabled, then go to trace handler. This handler
| cannot have any fp instructions. If there are fp inst's and an
| exception has been restored into the machine then the exception
| will occur upon execution of the fp inst. This is not desirable
| If trace mode enabled, then go to trace handler. This handler
| cannot have any fp instructions. If there are fp inst's and an
| exception has been restored into the machine then the exception
| will occur upon execution of the fp inst. This is not desirable
| in the kernel (supervisor mode). See MC68040 manual Section 9.3.8.
|
finish_up:
......@@ -436,12 +436,12 @@ loop40: clrl -(%sp)
movel USER_D1(%a6),%d1 | restore d1
movel #0x40280000,-(%sp)
frestore (%sp)+
unlk %a5
unlk %a5
rts
frame_41:
tstb 1(%sp) | check to see if idle
bne notidle
bne notidle
idle41:
clrl (%sp) | get rid of old fsave frame
movel %d1,USER_D1(%a6) | save d1
......@@ -451,18 +451,18 @@ loop41: clrl -(%sp)
movel USER_D1(%a6),%d1 | restore d1
movel #0x41300000,-(%sp)
frestore (%sp)+
unlk %a5
unlk %a5
rts
notidle:
bclrb #etemp15_bit,-40(%a5)
bclrb #etemp15_bit,-40(%a5)
frestore (%sp)+
unlk %a5
unlk %a5
rts
nofix:
frestore (%sp)+
unlk %a5
unlk %a5
rts
|end
......@@ -16,7 +16,7 @@
|
| - For unnormalized numbers (opclass 0, 2, or 3) the
| number(s) is normalized and the operand type tag is updated.
|
|
| - For a packed number (opclass 2) the number is unpacked and the
| operand type tag is updated.
|
......@@ -41,7 +41,7 @@
| the '040. The '040 then re-executes the fadd.x fpm,fpn with
| a normalized number in the source and the instruction is
| successful.
|
|
| Next consider if in the process of normalizing the un-
| normalized number it becomes a denormalized number. The
| routine which converts the unnorm to a norm (called mk_norm)
......@@ -54,8 +54,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
GET_OP: |idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -194,7 +194,7 @@ uns_notpacked:
uni_getop:
bfextu CMDREG1B(%a6){#0:#6},%d0 |get opclass and src fields
cmpil #0x17,%d0 |if op class and size fields are $17,
cmpil #0x17,%d0 |if op class and size fields are $17,
| ;it is FMOVECR; if not, continue
|
| If the instruction is fmovecr, exit get_op. It is handled
......@@ -226,21 +226,21 @@ dst_ex_dnrm:
movew FPTEMP_EX(%a6),%d0 |get destination exponent
andiw #0x7fff,%d0 |mask sign, check if exp = 0000
beqs src_op_ck |if denorm then check source op.
| ;denorms are taken care of in res_func
| ;denorms are taken care of in res_func
| ;(unsupp) or do_func (unimp)
| ;else unnorm fall through
leal FPTEMP(%a6),%a0 |point a0 to dop - used in mk_norm
bsr mk_norm |go normalize - mk_norm returns:
| ;L_SCR1{7:5} = operand tag
| ;L_SCR1{7:5} = operand tag
| ; (000 = norm, 100 = denorm)
| ;L_SCR1{4} = fpte15 or ete15
| ;L_SCR1{4} = fpte15 or ete15
| ; 0 = exp > $3fff
| ; 1 = exp <= $3fff
| ;and puts the normalized num back
| ;and puts the normalized num back
| ;on the fsave stack
|
moveb L_SCR1(%a6),DTAG(%a6) |write the new tag & fpte15
| ;to the fsave stack and fall
moveb L_SCR1(%a6),DTAG(%a6) |write the new tag & fpte15
| ;to the fsave stack and fall
| ;through to check source operand
|
src_op_ck:
......@@ -255,19 +255,19 @@ src_op_ck:
src_ex_dnrm:
movew ETEMP_EX(%a6),%d0 |get source exponent
andiw #0x7fff,%d0 |mask sign, check if exp = 0000
beq end_getop |if denorm then exit, denorms are
beq end_getop |if denorm then exit, denorms are
| ;handled in do_func
leal ETEMP(%a6),%a0 |point a0 to sop - used in mk_norm
bsr mk_norm |go normalize - mk_norm returns:
| ;L_SCR1{7:5} = operand tag
| ;L_SCR1{7:5} = operand tag
| ; (000 = norm, 100 = denorm)
| ;L_SCR1{4} = fpte15 or ete15
| ;L_SCR1{4} = fpte15 or ete15
| ; 0 = exp > $3fff
| ; 1 = exp <= $3fff
| ;and puts the normalized num back
| ;and puts the normalized num back
| ;on the fsave stack
|
moveb L_SCR1(%a6),STAG(%a6) |write the new tag & ete15
moveb L_SCR1(%a6),STAG(%a6) |write the new tag & ete15
rts |end_getop
|
......@@ -285,7 +285,7 @@ is_double:
movew #0x3c01,%d1 |write the bias for a dbl denorm
common:
btstb #sign_bit,ETEMP_EX(%a6) |grab sign bit of mantissa
beqs pos
beqs pos
bset #15,%d1 |set sign bit because it is negative
pos:
movew %d1,ETEMP_EX(%a6)
......@@ -297,7 +297,7 @@ pos:
movew %d1,CMDREG1B(%a6) |write back to the command word in stack
| ;this is needed to fix unsupp data stack
leal ETEMP(%a6),%a0 |point a0 to sop
bsr mk_norm |convert sgl/dbl denorm to norm
moveb L_SCR1(%a6),STAG(%a6) |put tag into source tag reg - d0
rts |end_getop
......@@ -306,7 +306,7 @@ pos:
| instruction is dyadic or monadic is still unknown
|
pack_source:
movel FPTEMP_LO(%a6),ETEMP(%a6) |write ms part of packed
movel FPTEMP_LO(%a6),ETEMP(%a6) |write ms part of packed
| ;number to etemp slot
bsr chk_dy_mo |set dyadic/monadic flag
bsr unpack
......@@ -325,7 +325,7 @@ pack_dya:
btstb #7,DTAG(%a6) |check dest tag for unnorm or denorm
bne dst_ex_dnrm |else, handle the unnorm or ext denorm
|
| Dest is not denormalized. Check for norm, and set fpte15
| Dest is not denormalized. Check for norm, and set fpte15
| accordingly.
|
moveb DTAG(%a6),%d0
......@@ -357,13 +357,13 @@ end_getop:
| unsupported data type exception. Set if dyadic.
|
chk_dy_mo:
movew CMDREG1B(%a6),%d0
movew CMDREG1B(%a6),%d0
btstl #5,%d0 |testing extension command word
beqs set_mon |if bit 5 = 0 then monadic
btstl #4,%d0 |know that bit 5 = 1
beqs set_dya |if bit 4 = 0 then dyadic
andiw #0x007f,%d0 |get rid of all but extension bits {6:0}
cmpiw #0x0038,%d0 |if extension = $38 then fcmp (dyadic)
cmpiw #0x0038,%d0 |if extension = $38 then fcmp (dyadic)
bnes set_mon
set_dya:
st DY_MO_FLG(%a6) |set the inst flag type to dyadic
......@@ -406,7 +406,7 @@ set_mon:
| L_SCR1{7:5} = operand tag (000 = norm, 100 = denorm)
| L_SCR1{4} = fpte15 or ete15 (0 = exp > $3fff, 1 = exp <=$3fff)
| the normalized operand is placed back on the fsave stack
mk_norm:
mk_norm:
clrl L_SCR1(%a6)
bclrb #sign_bit,LOCAL_EX(%a0)
sne LOCAL_SGN(%a0) |transform into internal extended format
......@@ -426,11 +426,11 @@ reload:
cmpw #0x3fff,LOCAL_EX(%a0) |if exp > $3fff
bgts end_mk | fpte15/ete15 already set to 0
bsetb #4,L_SCR1(%a6) |else set fpte15/ete15 to 1
| ;calling routine actually sets the
| ;value on the stack (along with the
| ;tag), since this routine doesn't
| ;calling routine actually sets the
| ;value on the stack (along with the
| ;tag), since this routine doesn't
| ;know if it should set ete15 or fpte15
| ;ie, it doesn't know if this is the
| ;ie, it doesn't know if this is the
| ;src op or dest op.
end_mk:
bfclr LOCAL_SGN(%a0){#0:#8}
......@@ -455,7 +455,7 @@ no_unfl:
|
uns_opx:
bsr nrm_zero |normalize the number
btstb #7,LOCAL_HI(%a0) |check if integer bit (j-bit) is set
btstb #7,LOCAL_HI(%a0) |check if integer bit (j-bit) is set
beqs uns_den |if clear then now have a denorm
uns_nrm:
orb #norm_tag,L_SCR1(%a6) |set tag to norm
......@@ -468,7 +468,7 @@ uns_den:
|
uni_inst:
bsr nrm_zero
btstb #7,LOCAL_HI(%a0) |check if integer bit (j-bit) is set
btstb #7,LOCAL_HI(%a0) |check if integer bit (j-bit) is set
beqs uni_den |if clear then now have a denorm
uni_nrm:
orb #norm_tag,L_SCR1(%a6) |set tag to norm
......@@ -480,9 +480,9 @@ uni_den:
|
| Decimal to binary conversion
|
| Special cases of inf and NaNs are completed outside of decbin.
| Special cases of inf and NaNs are completed outside of decbin.
| If the input is an snan, the snan bit is not set.
|
|
| input:
| ETEMP(a6) - points to packed decimal string in memory
| output:
......@@ -610,16 +610,16 @@ mnot_spec:
finish:
movew CMDREG1B(%a6),%d0 |get the command word
andw #0xfbff,%d0 |change the source specifier field to
andw #0xfbff,%d0 |change the source specifier field to
| ;extended (was packed).
movew %d0,CMDREG1B(%a6) |write command word back to fsave stack
| ;we need to do this so the 040 will
| ;re-execute the inst. without taking
| ;we need to do this so the 040 will
| ;re-execute the inst. without taking
| ;another packed trap.
fix_stag:
|Converted result is now in etemp on fsave stack, now set the source
|tag (stag)
|Converted result is now in etemp on fsave stack, now set the source
|tag (stag)
| if (ete =$7fff) then INF or NAN
| if (etemp = $x.0----0) then
| stag = INF
......@@ -632,12 +632,12 @@ fix_stag:
| stag = NORM
|
| Note also that the etemp_15 bit (just right of the stag) must
| be set accordingly.
| be set accordingly.
|
movew ETEMP_EX(%a6),%d1
andiw #0x7fff,%d1 |strip sign
cmpw #0x7fff,%d1
bnes z_or_nrm
cmpw #0x7fff,%d1
bnes z_or_nrm
movel ETEMP_HI(%a6),%d1
bnes is_nan
movel ETEMP_LO(%a6),%d1
......@@ -651,7 +651,7 @@ is_nan:
movel #0x60,%d0
rts
z_or_nrm:
tstw %d1
tstw %d1
bnes is_nrm
is_zro:
| For a zero, set etemp_15
......@@ -670,7 +670,7 @@ end_is_nrm:
movel #0,%d0
end_fix:
rts
end_get:
rts
|end
|
| kernel_ex.sa 3.3 12/19/90
| kernel_ex.sa 3.3 12/19/90
|
| This file contains routines to force exception status in the
| This file contains routines to force exception status in the
| fpu for exceptional cases detected or reported within the
| transcendental functions. Typically, the t_xx routine will
| set the appropriate bits in the USER_FPSR word on the stack.
| The bits are tested in gen_except.sa to determine if an exceptional
| situation needs to be created on return from the FPSP.
| situation needs to be created on return from the FPSP.
|
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
KERNEL_EX: |idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -31,7 +31,7 @@ huge: .long 0x7ffe0000,0xffffffff,0xffffffff
|xref unf_sub
|xref nrm_set
.global t_dz
.global t_dz
.global t_dz2
.global t_operr
.global t_unfl
......@@ -49,7 +49,7 @@ huge: .long 0x7ffe0000,0xffffffff,0xffffffff
|
| if dz trap disabled
| store properly signed inf (use sign of etemp) into fp0
| set FPSR exception status dz bit, condition code
| set FPSR exception status dz bit, condition code
| inf bit, and accrued dz bit
| return
| frestore the frame into the machine (done by unimp_hd)
......@@ -61,7 +61,7 @@ huge: .long 0x7ffe0000,0xffffffff,0xffffffff
| frestore the frame into the machine (done by unimp_hd)
|
| t_dz2 is used by monadic functions such as flogn (from do_func).
| t_dz is used by monadic functions such as satanh (from the
| t_dz is used by monadic functions such as satanh (from the
| transcendental function).
|
t_dz2:
......@@ -104,10 +104,10 @@ dz_ena_end:
| OPERR exception
|
| if (operr trap disabled)
| set FPSR exception status operr bit, condition code
| set FPSR exception status operr bit, condition code
| nan bit; Store default NAN into fp0
| frestore the frame into the machine (done by unimp_hd)
|
|
| else (operr trap enabled)
| set FPSR exception status operr bit, accrued operr bit
| set flag to disable sto_res from corrupting fp register
......@@ -159,13 +159,13 @@ unfl_ena:
unfl_dis:
bfextu FPCR_MODE(%a6){#0:#2},%d0 |get round precision
bclrb #sign_bit,LOCAL_EX(%a0)
sne LOCAL_SGN(%a0) |convert to internal ext format
bsr unf_sub |returns IEEE result at a0
| ;and sets FPSR_CC accordingly
bfclr LOCAL_SGN(%a0){#0:#8} |convert back to IEEE ext format
beqs unfl_fin
......@@ -175,7 +175,7 @@ unfl_dis:
unfl_fin:
fmovemx (%a0),%fp0-%fp0 |store result in fp0
rts
|
| t_ovfl2 --- OVFL exception (without inex2 returned)
......@@ -280,7 +280,7 @@ no_uacc1:
| DST_NAN
|
| Determine if the destination nan is signalling or non-signalling,
| and set the FPSR bits accordingly. See the MC68040 User's Manual
| and set the FPSR bits accordingly. See the MC68040 User's Manual
| section 3.2.2.5 NOT-A-NUMBERS.
|
dst_nan:
......@@ -288,7 +288,7 @@ dst_nan:
beqs dst_pos |if clr, it was positive
bsetb #neg_bit,FPSR_CC(%a6) |set N bit
dst_pos:
btstb #signan_bit,FPTEMP_HI(%a6) |check if signalling
btstb #signan_bit,FPTEMP_HI(%a6) |check if signalling
beqs dst_snan |branch if signalling
fmovel %d1,%fpcr |restore user's rmode/prec
......@@ -300,14 +300,14 @@ dst_pos:
andib #0xe0,%d0
cmpib #0x60,%d0
bnes no_snan
btstb #signan_bit,ETEMP_HI(%a6) |check if signalling
btstb #signan_bit,ETEMP_HI(%a6) |check if signalling
bnes no_snan
orl #snaniop_mask,USER_FPSR(%a6) |set NAN, SNAN, AIOP
no_snan:
rts
rts
dst_snan:
btstb #snan_bit,FPCR_ENABLE(%a6) |check if trap enabled
btstb #snan_bit,FPCR_ENABLE(%a6) |check if trap enabled
beqs dst_dis |branch if disabled
orb #nan_tag,DTAG(%a6) |set up dtag for nan
......@@ -316,9 +316,9 @@ dst_snan:
rts
dst_dis:
bsetb #signan_bit,FPTEMP_HI(%a6) |set SNAN bit in sop
bsetb #signan_bit,FPTEMP_HI(%a6) |set SNAN bit in sop
fmovel %d1,%fpcr |restore user's rmode/prec
fmovex FPTEMP(%a6),%fp0 |load non-sign. nan
fmovex FPTEMP(%a6),%fp0 |load non-sign. nan
orl #snaniop_mask,USER_FPSR(%a6) |set NAN, SNAN, AIOP
rts
......@@ -326,7 +326,7 @@ dst_dis:
| SRC_NAN
|
| Determine if the source nan is signalling or non-signalling,
| and set the FPSR bits accordingly. See the MC68040 User's Manual
| and set the FPSR bits accordingly. See the MC68040 User's Manual
| section 3.2.2.5 NOT-A-NUMBERS.
|
src_nan:
......@@ -334,16 +334,16 @@ src_nan:
beqs src_pos |if clr, it was positive
bsetb #neg_bit,FPSR_CC(%a6) |set N bit
src_pos:
btstb #signan_bit,ETEMP_HI(%a6) |check if signalling
btstb #signan_bit,ETEMP_HI(%a6) |check if signalling
beqs src_snan |branch if signalling
fmovel %d1,%fpcr |restore user's rmode/prec
fmovex ETEMP(%a6),%fp0 |return the non-signalling nan
rts
rts
src_snan:
btstb #snan_bit,FPCR_ENABLE(%a6) |check if trap enabled
btstb #snan_bit,FPCR_ENABLE(%a6) |check if trap enabled
beqs src_dis |branch if disabled
bsetb #signan_bit,ETEMP_HI(%a6) |set SNAN bit in sop
bsetb #signan_bit,ETEMP_HI(%a6) |set SNAN bit in sop
orb #norm_tag,DTAG(%a6) |set up dtag for norm
orb #nan_tag,STAG(%a6) |set up stag for nan
st STORE_FLG(%a6) |do not store a result
......@@ -351,9 +351,9 @@ src_snan:
rts
src_dis:
bsetb #signan_bit,ETEMP_HI(%a6) |set SNAN bit in sop
bsetb #signan_bit,ETEMP_HI(%a6) |set SNAN bit in sop
fmovel %d1,%fpcr |restore user's rmode/prec
fmovex ETEMP(%a6),%fp0 |load non-sign. nan
fmovex ETEMP(%a6),%fp0 |load non-sign. nan
orl #snaniop_mask,USER_FPSR(%a6) |set NAN, SNAN, AIOP
rts
......@@ -367,7 +367,7 @@ t_extdnrm:
bras xdnrm_con
|
| Entry point for scale with extended denorm. The function does
| not set inex2, aunfl, or ainex.
| not set inex2, aunfl, or ainex.
|
t_resdnrm:
orl #unfl_mask,USER_FPSR(%a6)
......@@ -402,7 +402,7 @@ xdnrm_dn:
bfclr LOCAL_SGN(%a0){#0:#8} |change back to IEEE ext format
beqs xdep
bsetb #sign_bit,LOCAL_EX(%a0)
xdep:
xdep:
bfclr STAG(%a6){#5:#3} |clear wbtm66,wbtm1,wbtm0
bsetb #wbtemp15_bit,WB_BYTE(%a6) |set wbtemp15
bclrb #sticky_bit,STICKY(%a6) |clear sticky bit
......@@ -439,7 +439,7 @@ xdnrm_store:
|
.global t_avoid_unsupp
t_avoid_unsupp:
link %a2,#-LOCAL_SIZE |so that a2 fpsp.h negative
link %a2,#-LOCAL_SIZE |so that a2 fpsp.h negative
| ;offsets may be used
fsave -(%a7)
tstb 1(%a7) |check if idle, exit if so
......
This diff is collapsed.
This diff is collapsed.
......@@ -12,7 +12,7 @@
|
| Accuracy and Monotonicity: The returned result is within 3 ulps in
| 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
| result is subsequently rounded to double precision. The
| result is subsequently rounded to double precision. The
| result is provably monotonic in double precision.
|
| Speed: The program sCOS takes approximately 310 cycles.
......@@ -38,8 +38,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|SACOS idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -74,17 +74,17 @@ sacos:
|--ACOS(X) = 2 * ATAN( SQRT( (1-X)/(1+X) ) )
fmoves #0x3F800000,%fp1
faddx %fp0,%fp1 | ...1+X
fnegx %fp0 | ... -X
faddx %fp0,%fp1 | ...1+X
fnegx %fp0 | ... -X
fadds #0x3F800000,%fp0 | ...1-X
fdivx %fp1,%fp0 | ...(1-X)/(1+X)
fdivx %fp1,%fp0 | ...(1-X)/(1+X)
fsqrtx %fp0 | ...SQRT((1-X)/(1+X))
fmovemx %fp0-%fp0,(%a0) | ...overwrite input
movel %d1,-(%sp) |save original users fpcr
clrl %d1
bsr satan | ...ATAN(SQRT([1-X]/[1+X]))
fmovel (%sp)+,%fpcr |restore users exceptions
faddx %fp0,%fp0 | ...2 * ATAN( STUFF )
faddx %fp0,%fp0 | ...2 * ATAN( STUFF )
bra t_frcinx
ACOSBIG:
......@@ -110,6 +110,6 @@ ACOSBIG:
ACOSP1:
fmovel %d1,%FPCR
fmoves #0x00000000,%fp0
rts |Facos ; of +1 is exact
rts |Facos ; of +1 is exact
|end
......@@ -12,7 +12,7 @@
|
| Accuracy and Monotonicity: The returned result is within 3 ulps in
| 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
| result is subsequently rounded to double precision. The
| result is subsequently rounded to double precision. The
| result is provably monotonic in double precision.
|
| Speed: The program sASIN takes approximately 310 cycles.
......@@ -38,8 +38,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|SASIN idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -80,7 +80,7 @@ sasin:
fmulx %fp2,%fp1 | ...(1+X)(1-X)
fmovemx (%a7)+,%fp2-%fp2
fsqrtx %fp1 | ...SQRT([1-X][1+X])
fdivx %fp1,%fp0 | ...X/SQRT([1-X][1+X])
fdivx %fp1,%fp0 | ...X/SQRT([1-X][1+X])
fmovemx %fp0-%fp0,(%a0)
bsr satan
bra t_frcinx
......@@ -97,7 +97,7 @@ asinbig:
andil #0x80000000,%d0 | ...SIGN BIT OF X
oril #0x3F800000,%d0 | ...+-1 IN SGL FORMAT
movel %d0,-(%sp) | ...push SIGN(X) IN SGL-FMT
fmovel %d1,%FPCR
fmovel %d1,%FPCR
fmuls (%sp)+,%fp0
bra t_frcinx
......
......@@ -43,8 +43,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|satan idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -52,7 +52,7 @@
|section 8
#include "fpsp.h"
BOUNDS1: .long 0x3FFB8000,0x4002FFFF
ONE: .long 0x3F800000
......@@ -322,7 +322,7 @@ ATANMAIN:
|--THE REASON FOR THIS REARRANGEMENT IS TO MAKE THE INDEPENDENT
|--PARTS A1*U*V AND (A2 + ... STUFF) MORE LOAD-BALANCED
fmovex %fp0,%fp1
fmulx %fp1,%fp1
fmoved ATANA3,%fp2
......@@ -332,7 +332,7 @@ ATANMAIN:
faddd ATANA2,%fp2 | ...A2+V*(A3+V)
fmuld ATANA1,%fp1 | ...A1*U*V
fmulx %fp2,%fp1 | ...A1*U*V*(A2+V*(A3+V))
faddx %fp1,%fp0 | ...ATAN(U), FP1 RELEASED
fmovel %d1,%FPCR |restore users exceptions
faddx ATANF(%a6),%fp0 | ...ATAN(X)
......@@ -356,7 +356,7 @@ ATANSM:
|--COMPUTE POLYNOMIAL
fmulx %fp0,%fp0 | ...FP0 IS Y = X*X
movew #0x0000,XDCARE(%a6)
fmovex %fp0,%fp1
......@@ -381,7 +381,7 @@ ATANSM:
fmulx X(%a6),%fp0 | ...X*Y
faddx %fp2,%fp1 | ...[B1+Z*(B3+Z*B5)]+[Y*(B2+Z*(B4+Z*B6))]
fmulx %fp1,%fp0 | ...X*Y*([B1+Z*(B3+Z*B5)]+[Y*(B2+Z*(B4+Z*B6))])
......@@ -413,7 +413,7 @@ ATANBIG:
fmoves #0xBF800000,%fp1 | ...LOAD -1
fdivx %fp0,%fp1 | ...FP1 IS -1/X
|--DIVIDE IS STILL CRANKING
fmovex %fp1,%fp0 | ...FP0 IS X'
......@@ -439,14 +439,14 @@ ATANBIG:
fmulx X(%a6),%fp0 | ...X'*Y
faddx %fp2,%fp1 | ...[Y*(C2+Z*C4)]+[C1+Z*(C3+Z*C5)]
fmulx %fp1,%fp0 | ...X'*Y*([B1+Z*(B3+Z*B5)]
| ... +[Y*(B2+Z*(B4+Z*B6))])
faddx X(%a6),%fp0
fmovel %d1,%FPCR |restore users exceptions
btstb #7,(%a0)
beqs pos_big
......@@ -474,5 +474,5 @@ pos_huge:
fmovel %d1,%fpcr
fsubx PTINY,%fp0
bra t_frcinx
|end
......@@ -13,7 +13,7 @@
|
| Accuracy and Monotonicity: The returned result is within 3 ulps in
| 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
| result is subsequently rounded to double precision. The
| result is subsequently rounded to double precision. The
| result is provably monotonic in double precision.
|
| Speed: The program satanh takes approximately 270 cycles.
......@@ -33,7 +33,7 @@
| 3. If |X| > 1, go to 5.
|
| 4. (|X| = 1) Generate infinity with an appropriate sign and
| divide-by-zero by
| divide-by-zero by
| sgn := sign(X)
| atan(X) := sgn / (+0).
| Exit.
......@@ -45,8 +45,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|satanh idnt 2,1 | Motorola 040 Floating Point Software Package
......
......@@ -9,7 +9,7 @@
| The entry point sscale is called from do_func to emulate
| the fscale unimplemented instruction.
|
| Input: Double-extended destination operand in FPTEMP,
| Input: Double-extended destination operand in FPTEMP,
| double-extended source operand in ETEMP.
|
| Output: The function returns scale(X,Y) to fp0.
......@@ -17,12 +17,12 @@
| Modifies: fp0.
|
| Algorithm:
|
|
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|SCALE idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -147,7 +147,7 @@ nden_exit:
src_neg:
addl %d0,%d1 |add src to dest
beqs denorm |if zero, result is denorm
blts fix_dnrm |if negative, result is
blts fix_dnrm |if negative, result is
| ;needing denormalization
tstb L_SCR1(%a6)
beqs sneg_pos
......@@ -161,7 +161,7 @@ sneg_pos:
|
| The result exponent is below denorm value. Test for catastrophic
| underflow and force zero if true. If not, try to shift the
| underflow and force zero if true. If not, try to shift the
| mantissa right until a zero exponent exists.
|
fix_dnrm:
......@@ -229,7 +229,7 @@ no_dir:
rts
|
| The rounding mode changed the zero to a smallest denorm. Call
| The rounding mode changed the zero to a smallest denorm. Call
| t_resdnrm with exceptional operand in ETEMP.
|
sm_dnrm:
......@@ -250,7 +250,7 @@ not_zero:
fix_exit:
bras sm_dnrm
|
| The result has underflowed to zero. Return zero and set
| unfl, aunfl, and ainex.
......@@ -284,7 +284,7 @@ neg_zero:
clrl FP_SCR1(%a6) |clear the exceptional operand
clrl FP_SCR1+4(%a6) |for gen_except.
clrl FP_SCR1+8(%a6)
fmoves #0x80000000,%fp0
fmoves #0x80000000,%fp0
rts
pos_zero:
clrl FP_SCR1(%a6) |clear the exceptional operand
......@@ -299,7 +299,7 @@ pos_zero:
| then adding the remainder of the source to the exponent.
|
dst_dnrm:
moveml %d2/%d3,-(%a7)
moveml %d2/%d3,-(%a7)
movew FPTEMP_EX(%a6),%d1
movel FPTEMP_HI(%a6),%d2
movel FPTEMP_LO(%a6),%d3
......@@ -313,7 +313,7 @@ dst_loop:
roxll #1,%d2
bras dst_loop
|
| Destination became normalized. Simply add the remaining
| Destination became normalized. Simply add the remaining
| portion of the src to the exponent.
|
dst_norm:
......
......@@ -49,8 +49,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|SCOSH idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -99,7 +99,7 @@ scosh:
movel (%sp)+,%d1
fmoves #0x3E800000,%fp1 | ...(1/4)
fdivx %fp0,%fp1 | ...1/(2 EXP(|X|))
fdivx %fp0,%fp1 | ...1/(2 EXP(|X|))
fmovel %d1,%FPCR
faddx %fp1,%fp0
......
......@@ -331,8 +331,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|setox idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -505,7 +505,7 @@ EXPCONT1:
fmovex %fp0,%fp2
fmuls #0xBC317218,%fp0 | ...N * L1, L1 = lead(-log2/64)
fmulx L2,%fp2 | ...N * L2, L1+L2 = -log2/64
faddx %fp1,%fp0 | ...X + N*L1
faddx %fp1,%fp0 | ...X + N*L1
faddx %fp2,%fp0 | ...fp0 is R, reduced arg.
| MOVE.W #$3FA5,EXPA3 ...load EXPA3 in cache
......@@ -516,46 +516,46 @@ EXPCONT1:
|--[R+R*S*(A2+S*A4)] + [S*(A1+S*(A3+S*A5))]
fmovex %fp0,%fp1
fmulx %fp1,%fp1 | ...fp1 IS S = R*R
fmulx %fp1,%fp1 | ...fp1 IS S = R*R
fmoves #0x3AB60B70,%fp2 | ...fp2 IS A5
| MOVE.W #0,2(%a1) ...load 2^(J/64) in cache
fmulx %fp1,%fp2 | ...fp2 IS S*A5
fmulx %fp1,%fp2 | ...fp2 IS S*A5
fmovex %fp1,%fp3
fmuls #0x3C088895,%fp3 | ...fp3 IS S*A4
faddd EXPA3,%fp2 | ...fp2 IS A3+S*A5
faddd EXPA2,%fp3 | ...fp3 IS A2+S*A4
fmulx %fp1,%fp2 | ...fp2 IS S*(A3+S*A5)
fmulx %fp1,%fp2 | ...fp2 IS S*(A3+S*A5)
movew %d0,SCALE(%a6) | ...SCALE is 2^(M) in extended
clrw SCALE+2(%a6)
movel #0x80000000,SCALE+4(%a6)
clrl SCALE+8(%a6)
fmulx %fp1,%fp3 | ...fp3 IS S*(A2+S*A4)
fmulx %fp1,%fp3 | ...fp3 IS S*(A2+S*A4)
fadds #0x3F000000,%fp2 | ...fp2 IS A1+S*(A3+S*A5)
fmulx %fp0,%fp3 | ...fp3 IS R*S*(A2+S*A4)
fmulx %fp0,%fp3 | ...fp3 IS R*S*(A2+S*A4)
fmulx %fp1,%fp2 | ...fp2 IS S*(A1+S*(A3+S*A5))
faddx %fp3,%fp0 | ...fp0 IS R+R*S*(A2+S*A4),
fmulx %fp1,%fp2 | ...fp2 IS S*(A1+S*(A3+S*A5))
faddx %fp3,%fp0 | ...fp0 IS R+R*S*(A2+S*A4),
| ...fp3 released
fmovex (%a1)+,%fp1 | ...fp1 is lead. pt. of 2^(J/64)
faddx %fp2,%fp0 | ...fp0 is EXP(R) - 1
faddx %fp2,%fp0 | ...fp0 is EXP(R) - 1
| ...fp2 released
|--Step 5
|--final reconstruction process
|--EXP(X) = 2^M * ( 2^(J/64) + 2^(J/64)*(EXP(R)-1) )
fmulx %fp1,%fp0 | ...2^(J/64)*(Exp(R)-1)
fmulx %fp1,%fp0 | ...2^(J/64)*(Exp(R)-1)
fmovemx (%a7)+,%fp2-%fp2/%fp3 | ...fp2 restored
fadds (%a1),%fp0 | ...accurate 2^(J/64)
faddx %fp1,%fp0 | ...2^(J/64) + 2^(J/64)*...
faddx %fp1,%fp0 | ...2^(J/64) + 2^(J/64)*...
movel ADJFLAG(%a6),%d0
|--Step 6
......@@ -564,7 +564,7 @@ EXPCONT1:
ADJUST:
fmulx ADJSCALE(%a6),%fp0
NORMAL:
fmovel %d1,%FPCR | ...restore user FPCR
fmovel %d1,%FPCR | ...restore user FPCR
fmulx SCALE(%a6),%fp0 | ...multiply 2^(M)
bra t_frcinx
......
|
| sgetem.sa 3.1 12/10/90
|
| The entry point sGETEXP returns the exponent portion
| The entry point sGETEXP returns the exponent portion
| of the input argument. The exponent bias is removed
| and the exponent value is returned as an extended
| and the exponent value is returned as an extended
| precision number in fp0. sGETEXPD handles denormalized
| numbers.
|
| The entry point sGETMAN extracts the mantissa of the
| input argument. The mantissa is converted to an
| The entry point sGETMAN extracts the mantissa of the
| input argument. The mantissa is converted to an
| extended precision number and returned in fp0. The
| range of the result is [1.0 - 2.0).
|
......@@ -24,8 +24,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|SGETEM idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -81,7 +81,7 @@ sgetman:
fmovel %d0,%fpcr |this fpcr setting is used by the 882
movew LOCAL_EX(%a0),%d0 |get the exp (really just want sign bit)
orw #0x7fff,%d0 |clear old exp
bclrl #14,%d0 |make it the new exp +-3fff
bclrl #14,%d0 |make it the new exp +-3fff
movew %d0,LOCAL_EX(%a0) |move the sign & exp back to fsave stack
fmovex (%a0),%fp0 |put new value back in fp0
rts
......
|
| sint.sa 3.1 12/10/90
|
| The entry point sINT computes the rounded integer
| equivalent of the input argument, sINTRZ computes
| The entry point sINT computes the rounded integer
| equivalent of the input argument, sINTRZ computes
| the integer rounded to zero of the input argument.
|
| Entry points sint and sintrz are called from do_func
......@@ -24,10 +24,10 @@
|
| Algorithm: (sint and sintrz)
|
| 1. If exp(X) >= 63, return X.
| 1. If exp(X) >= 63, return X.
| If exp(X) < 0, return +/- 0 or +/- 1, according to
| the rounding mode.
|
|
| 2. (X is in range) set rsc = 63 - exp(X). Unnormalize the
| result to the exponent $403e.
|
......@@ -51,8 +51,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|SINT idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -78,9 +78,9 @@
sint:
bfextu FPCR_MODE(%a6){#2:#2},%d1 |use user's mode for rounding
| ;implicitly has extend precision
| ;in upper word.
| ;in upper word.
movel %d1,L_SCR1(%a6) |save mode bits
bras sintexc
bras sintexc
|
| FINT with extended denorm inputs.
......@@ -115,13 +115,13 @@ sintmz:
sintrz:
movel #1,L_SCR1(%a6) |use rz mode for rounding
| ;implicitly has extend precision
| ;in upper word.
bras sintexc
| ;in upper word.
bras sintexc
|
| SINTDO
|
| Input: a0 points to an IEEE extended format operand
| Output: fp0 has the result
| Output: fp0 has the result
|
| Exceptions:
|
......@@ -133,7 +133,7 @@ sintrz:
sintdo:
bfextu FPCR_MODE(%a6){#2:#2},%d1 |use user's mode for rounding
| ;implicitly has ext precision
| ;in upper word.
| ;in upper word.
movel %d1,L_SCR1(%a6) |save mode bits
|
| Real work of sint is in sintexc
......@@ -141,7 +141,7 @@ sintdo:
sintexc:
bclrb #sign_bit,LOCAL_EX(%a0) |convert to internal extended
| ;format
sne LOCAL_SGN(%a0)
sne LOCAL_SGN(%a0)
cmpw #0x403e,LOCAL_EX(%a0) |check if (unbiased) exp > 63
bgts out_rnge |branch if exp < 63
cmpw #0x3ffd,LOCAL_EX(%a0) |check if (unbiased) exp < 0
......@@ -187,7 +187,7 @@ un_rnrz:
un_rnrz_neg:
bsr ld_mzero
bra t_inx2
|
| Input is greater than 2^63. All bits are significant. Return
| the input.
......@@ -206,7 +206,7 @@ intps:
rts
in_rnge:
| ;shift off fraction bits
| ;shift off fraction bits
clrl %d0 |clear d0 - initial g,r,s for
| ;dnrm_lp
movel #0x403e,%d1 |set threshold for dnrm_lp
......
......@@ -18,20 +18,20 @@
| to handle the exception.
|
| If the exception was completely handled by the package, then
| the return will be via a 'jmp fpsp_done'. Unless there is
| the return will be via a 'jmp fpsp_done'. Unless there is
| OS specific work to be done (such as handling a context switch or
| interrupt) the user program can be resumed via 'rte'.
|
| In the following skeleton code, some typical 'real_xxxx' handling
| code is shown. This code may need to be moved to an appropriate
| place in the target system, or rewritten.
|
|
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|
......@@ -50,7 +50,7 @@
|
|section 8
#include "fpsp.h"
|xref b1238_fix
......@@ -72,7 +72,7 @@ real_dz:
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument
movel %sp,%sp@- | stack frame pointer argument
bsrl trap_c
addql #4,%sp
bral ret_from_exception
......@@ -82,7 +82,7 @@ real_dz:
|
| All inexact exceptions are real, but the 'real' handler
| will probably want to clear the pending exception.
| The provided code will clear the E3 exception (if pending),
| The provided code will clear the E3 exception (if pending),
| otherwise clear the E1 exception. The frestore is not really
| necessary for E1 exceptions.
|
......@@ -96,7 +96,7 @@ real_dz:
| to the appropriate handler for the exception in the fpsr. Note
| that this fix is only for d43b parts, and is skipped if the
| version number is not $40.
|
|
|
.global real_inex
.global inex
......@@ -116,7 +116,7 @@ inex:
bra snan
inex_ckofl:
btstb #ovfl_bit,2(%sp) |test for ovfl
beq inex_ckufl
beq inex_ckufl
addl #4,%sp
frestore (%sp)+
unlk %a6
......@@ -163,11 +163,11 @@ inex_done:
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument
movel %sp,%sp@- | stack frame pointer argument
bsrl trap_c
addql #4,%sp
bral ret_from_exception
|
| Overflow exception
|
......@@ -189,11 +189,11 @@ ovfl_done:
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument
movel %sp,%sp@- | stack frame pointer argument
bsrl trap_c
addql #4,%sp
bral ret_from_exception
|
| Underflow exception
|
......@@ -215,11 +215,11 @@ unfl_done:
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument
movel %sp,%sp@- | stack frame pointer argument
bsrl trap_c
addql #4,%sp
bral ret_from_exception
|
| Signalling NAN exception
|
......@@ -237,11 +237,11 @@ real_snan:
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument
movel %sp,%sp@- | stack frame pointer argument
bsrl trap_c
addql #4,%sp
bral ret_from_exception
|
| Operand Error exception
|
......@@ -259,12 +259,12 @@ real_operr:
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument
movel %sp,%sp@- | stack frame pointer argument
bsrl trap_c
addql #4,%sp
bral ret_from_exception
|
| BSUN exception
|
......@@ -287,7 +287,7 @@ real_bsun:
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument
movel %sp,%sp@- | stack frame pointer argument
bsrl trap_c
addql #4,%sp
bral ret_from_exception
......@@ -295,7 +295,7 @@ real_bsun:
|
| F-line exception
|
| A 'real' F-line exception is one that the FPSP isn't supposed to
| A 'real' F-line exception is one that the FPSP isn't supposed to
| handle. E.g. an instruction with a co-processor ID that is not 1.
|
|
......@@ -308,7 +308,7 @@ real_fline:
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument
movel %sp,%sp@- | stack frame pointer argument
bsrl trap_c
addql #4,%sp
bral ret_from_exception
......@@ -330,7 +330,7 @@ real_unsupp:
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- | stack frame pointer argument
movel %sp,%sp@- | stack frame pointer argument
bsrl trap_c
addql #4,%sp
bral ret_from_exception
......@@ -355,14 +355,14 @@ real_trace:
| {4028, 4130} - unimp frame
| {4000, 4100} - idle frame
|
| This entry point simply holds an f-line illegal value.
| This entry point simply holds an f-line illegal value.
| Replace this with a call to your kernel panic code or
| code to handle future revisions of the fpu.
|
.global fpsp_fmt_error
fpsp_fmt_error:
.long 0xf27f0000 |f-line illegal
.long 0xf27f0000 |f-line illegal
|
| fpsp_done --- FPSP exit point
......@@ -442,7 +442,7 @@ user_write:
| a1 - supervisor destination address
| d0 - number of bytes to read (maximum count is 12)
|
| Like mem_write, mem_read always reads with a supervisor
| Like mem_write, mem_read always reads with a supervisor
| destination address on the supervisor stack. Also like mem_write,
| the EXC_SR is checked and a simple memory copy is done if reading
| from supervisor space is indicated.
......
|
| slog2.sa 3.1 12/10/90
|
| The entry point slog10 computes the base-10
| The entry point slog10 computes the base-10
| logarithm of an input argument X.
| slog10d does the same except the input value is a
| denormalized number.
| slog10d does the same except the input value is a
| denormalized number.
| sLog2 and sLog2d are the base-2 analogues.
|
| INPUT: Double-extended value in memory location pointed to
| INPUT: Double-extended value in memory location pointed to
| by address register a0.
|
| OUTPUT: log_10(X) or log_2(X) returned in floating-point
| OUTPUT: log_10(X) or log_2(X) returned in floating-point
| register fp0.
|
| ACCURACY and MONOTONICITY: The returned result is within 1.7
| ulps in 64 significant bit, i.e. within 0.5003 ulp
| to 53 bits if the result is subsequently rounded
| to double precision. The result is provably monotonic
| ACCURACY and MONOTONICITY: The returned result is within 1.7
| ulps in 64 significant bit, i.e. within 0.5003 ulp
| to 53 bits if the result is subsequently rounded
| to double precision. The result is provably monotonic
| in double precision.
|
| SPEED: Two timings are measured, both in the copy-back mode.
| The first one is measured when the function is invoked
| the first time (so the instructions and data are not
| in cache), and the second one is measured when the
| SPEED: Two timings are measured, both in the copy-back mode.
| The first one is measured when the function is invoked
| the first time (so the instructions and data are not
| in cache), and the second one is measured when the
| function is reinvoked at the same input argument.
|
| ALGORITHM and IMPLEMENTATION NOTES:
......@@ -42,7 +42,7 @@
| 2.2 Return ans := Y * INV_L10.
|
|
| slog10:
| slog10:
|
| Step 0. If X < 0, create a NaN and raise the invalid operation
| flag. Otherwise, save FPCR in D1; set FpCR to default.
......@@ -96,15 +96,15 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|SLOG2 idnt 2,1 | Motorola 040 Floating Point Software Package
|section 8
|xref t_frcinx
|xref t_frcinx
|xref t_operr
|xref slogn
|xref slognd
......
......@@ -13,11 +13,11 @@
|
| Accuracy and Monotonicity: The returned result is within 2 ulps in
| 64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
| result is subsequently rounded to double precision. The
| result is subsequently rounded to double precision. The
| result is provably monotonic in double precision.
|
| Speed: The program slogn takes approximately 190 cycles for input
| argument X such that |X-1| >= 1/16, which is the usual
| Speed: The program slogn takes approximately 190 cycles for input
| argument X such that |X-1| >= 1/16, which is the usual
| situation. For those arguments, slognp1 takes approximately
| 210 cycles. For the less common arguments, the program will
| run no worse than 10% slower.
......@@ -45,26 +45,26 @@
| Step 2: Let 1+X = 2**k * Y, where 1 <= Y < 2. Define F as done in Step 2
| of the algorithm for LOGN and compute log(1+X) as
| k*log(2) + log(F) + poly where poly approximates log(1+u),
| u = (Y-F)/F.
| u = (Y-F)/F.
|
| Implementation Notes:
| Note 1. There are 64 different possible values for F, thus 64 log(F)'s
| need to be tabulated. Moreover, the values of 1/F are also
| need to be tabulated. Moreover, the values of 1/F are also
| tabulated so that the division in (Y-F)/F can be performed by a
| multiplication.
|
| Note 2. In Step 2 of lognp1, in order to preserved accuracy, the value
| Y-F has to be calculated carefully when 1/2 <= X < 3/2.
| Y-F has to be calculated carefully when 1/2 <= X < 3/2.
|
| Note 3. To fully exploit the pipeline, polynomials are usually separated
| into two parts evaluated independently before being added up.
|
|
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|slogn idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -262,7 +262,7 @@ slognd:
|----the value TWOTO100 is no longer needed.
|----Note that this code assumes the denormalized input is NON-ZERO.
moveml %d2-%d7,-(%a7) | ...save some registers
moveml %d2-%d7,-(%a7) | ...save some registers
movel #0x00000000,%d3 | ...D3 is exponent of smallest norm. #
movel 4(%a0),%d4
movel 8(%a0),%d5 | ...(D4,D5) is (Hi_X,Lo_X)
......@@ -347,14 +347,14 @@ LOGMAIN:
|--NOTE THAT U = (Y-F)/F IS VERY SMALL AND THUS APPROXIMATING
|--LOG(1+U) CAN BE VERY EFFICIENT.
|--ALSO NOTE THAT THE VALUE 1/F IS STORED IN A TABLE SO THAT NO
|--DIVISION IS NEEDED TO CALCULATE (Y-F)/F.
|--DIVISION IS NEEDED TO CALCULATE (Y-F)/F.
|--GET K, Y, F, AND ADDRESS OF 1/F.
asrl #8,%d0
asrl #8,%d0 | ...SHIFTED 16 BITS, BIASED EXPO. OF X
subil #0x3FFF,%d0 | ...THIS IS K
subil #0x3FFF,%d0 | ...THIS IS K
addl ADJK(%a6),%d0 | ...ADJUST K, ORIGINAL INPUT MAY BE DENORM.
lea LOGTBL,%a0 | ...BASE ADDRESS OF 1/F AND LOG(F)
lea LOGTBL,%a0 | ...BASE ADDRESS OF 1/F AND LOG(F)
fmovel %d0,%fp1 | ...CONVERT K TO FLOATING-POINT FORMAT
|--WHILE THE CONVERSION IS GOING ON, WE GET F AND ADDRESS OF 1/F
......@@ -363,7 +363,7 @@ LOGMAIN:
andil #0xFE000000,FFRAC(%a6) | ...FIRST 7 BITS OF Y
oril #0x01000000,FFRAC(%a6) | ...GET F: ATTACH A 1 AT THE EIGHTH BIT
movel FFRAC(%a6),%d0 | ...READY TO GET ADDRESS OF 1/F
andil #0x7E000000,%d0
andil #0x7E000000,%d0
asrl #8,%d0
asrl #8,%d0
asrl #4,%d0 | ...SHIFTED 20, D0 IS THE DISPLACEMENT
......@@ -390,7 +390,7 @@ LP1CONT1:
|--[U + V*(A1+V*(A3+V*A5))] + [U*V*(A2+V*(A4+V*A6))]
fmovex %fp2,%fp3
fmovex %fp2,%fp1
fmovex %fp2,%fp1
fmuld LOGA6,%fp1 | ...V*A6
fmuld LOGA5,%fp2 | ...V*A5
......@@ -440,7 +440,7 @@ LP1CONT2:
fmovex %fp1,%fp0
fmulx %fp0,%fp0 | ...FP0 IS V
fmovex %fp1,SAVEU(%a6) | ...STORE U IN MEMORY, FREE FP1
fmovex %fp0,%fp1
fmovex %fp0,%fp1
fmulx %fp1,%fp1 | ...FP1 IS W
fmoved LOGB5,%fp3
......@@ -465,7 +465,7 @@ LP1CONT2:
fmulx %fp1,%fp0 | ...U*V*( [B1+W*(B3+W*B5)] + [V*(B2+W*B4)] )
fmovel %d1,%fpcr
faddx SAVEU(%a6),%fp0
faddx SAVEU(%a6),%fp0
bra t_frcinx
rts
......@@ -549,7 +549,7 @@ KISNEG1:
asrl #8,%d0
asrl #4,%d0 | ...D0 CONTAINS DISPLACEMENT FOR 1/F
faddx %fp1,%fp1 | ...GET 2Z
fmovemx %fp2-%fp2/%fp3,-(%sp) | ...SAVE FP2
fmovemx %fp2-%fp2/%fp3,-(%sp) | ...SAVE FP2
faddx %fp1,%fp0 | ...FP0 IS Y-F = (2-F)+2Z
lea LOGTBL,%a0 | ...A0 IS ADDRESS OF 1/F
addal %d0,%a0
......@@ -569,7 +569,7 @@ KISZERO:
faddx %fp1,%fp0 | ...FP0 IS Y-F
fmovemx %fp2-%fp2/%fp3,-(%sp) | ...FP2 SAVED
lea LOGTBL,%a0
addal %d0,%a0 | ...A0 IS ADDRESS OF 1/F
addal %d0,%a0 | ...A0 IS ADDRESS OF 1/F
fmoves zero,%fp1 | ...FP1 IS K = 0
bra LP1CONT1
......
......@@ -15,8 +15,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|SMOVECR idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -39,7 +39,7 @@
FZERO: .long 00000000
|
| FMOVECR
| FMOVECR
|
.global smovcr
smovcr:
......@@ -55,9 +55,9 @@ smovcr:
cmpib #0x0e,%d0 |check range $0b - $0e
bles SM_TBL |valid constants in this range
cmpib #0x2f,%d0 |check range $10 - $2f
bles Z_VAL |if in this range, return zero
bles Z_VAL |if in this range, return zero
cmpib #0x3f,%d0 |check range $30 - $3f
ble BG_TBL |valid constants in this range
ble BG_TBL |valid constants in this range
Z_VAL:
fmoves FZERO,%fp0
rts
......@@ -149,7 +149,7 @@ not_ext:
lea FP_SCR1(%a6),%a0
btstb #sign_bit,LOCAL_EX(%a0)
sne LOCAL_SGN(%a0) |convert to internal ext. format
bsr round |go round the mantissa
bfclr LOCAL_SGN(%a0){#0:#8} |convert back to IEEE ext format
......
......@@ -21,7 +21,7 @@
| ---------
|
| Step 1. Save and strip signs of X and Y: signX := sign(X),
| signY := sign(Y), X := |X|, Y := |Y|,
| signY := sign(Y), X := |X|, Y := |Y|,
| signQ := signX EOR signY. Record whether MOD or REM
| is requested.
|
......@@ -41,7 +41,7 @@
|
| Step 4. At this point, R = X - QY = MOD(X,Y). Set
| Last_Subtract := false (used in Step 7 below). If
| MOD is requested, go to Step 6.
| MOD is requested, go to Step 6.
|
| Step 5. R = MOD(X,Y), but REM(X,Y) is requested.
| 5.1 If R < Y/2, then R = MOD(X,Y) = REM(X,Y). Go to
......@@ -61,13 +61,13 @@
| X = 2^(j)*(Q+1)Y. set Q := 2^(j)*(Q+1),
| R := 0. Return signQ, last 7 bits of Q, and R.
|
|
|
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
SREM_MOD: |idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -362,10 +362,10 @@ Fix_Sign:
|..Get Q
|
Get_Q:
clrl %d6
clrl %d6
movew SignQ(%a6),%d6 | ...D6 is sign(Q)
movel #8,%d7
lsrl %d7,%d6
lsrl %d7,%d6
andil #0x0000007F,%d3 | ...7 bits of Q
orl %d6,%d3 | ...sign and bits of Q
swap %d3
......@@ -391,7 +391,7 @@ Finish:
Rem_is_0:
|..R = 2^(-j)X - Q Y = Y, thus R = 0 and quotient = 2^j (Q+1)
addql #1,%d3
cmpil #8,%d0 | ...D0 is j
cmpil #8,%d0 | ...D0 is j
bges Q_Big
lsll %d0,%d3
......
......@@ -83,8 +83,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|SSIN idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -204,7 +204,7 @@ SINMAIN:
|--HIDE THE NEXT THREE INSTRUCTIONS
lea PITBL+0x200,%a1 | ...TABLE OF N*PI/2, N = -32,...,32
|--FP1 IS NOW READY
fmovel %fp1,N(%a6) | ...CONVERT TO INTEGER
......@@ -273,7 +273,7 @@ SINPOLY:
faddx %fp2,%fp1 | ...[A1+T(A3+T(A5+TA7))]+[S(A2+T(A4+TA6))]
|--FP3 RELEASED, RESTORE NOW AND TAKE SOME ADVANTAGE OF HIDING
|--FP2 RELEASED, RESTORE NOW AND TAKE FULL ADVANTAGE OF HIDING
fmulx %fp1,%fp0 | ...SIN(R')-R'
|--FP1 RELEASED.
......@@ -335,7 +335,7 @@ COSPOLY:
fmulx %fp2,%fp0 | ...S(B2+T(B4+T(B6+TB8)))
|--FP3 RELEASED, RESTORE NOW AND TAKE SOME ADVANTAGE OF HIDING
|--FP2 RELEASED.
faddx %fp1,%fp0
|--FP1 RELEASED
......@@ -352,7 +352,7 @@ SINBORS:
|--IF |X| < 2**(-40), RETURN X OR 1.
cmpil #0x3FFF8000,%d0
bgts REDUCEX
SINSM:
movel ADJN(%a6),%d0
......@@ -466,7 +466,7 @@ WORK:
movew %d2,FP_SCR2(%a6)
clrw FP_SCR2+2(%a6)
movel #0xC90FDAA2,FP_SCR2+4(%a6)
clrl FP_SCR2+8(%a6) | ...FP_SCR2 is 2**(L) * Piby2_1
clrl FP_SCR2+8(%a6) | ...FP_SCR2 is 2**(L) * Piby2_1
|--FP2 IS READY
fsubs TWOTO63(%a6),%fp2 | ...FP2 is N
......@@ -514,7 +514,7 @@ RESTORE:
movel (%a7)+,%d2
fmovemx (%a7)+,%fp2-%fp5
movel ADJN(%a6),%d0
cmpil #4,%d0
......@@ -559,7 +559,7 @@ SCMAIN:
|--HIDE THE NEXT THREE INSTRUCTIONS
lea PITBL+0x200,%a1 | ...TABLE OF N*PI/2, N = -32,...,32
|--FP1 IS NOW READY
fmovel %fp1,N(%a6) | ...CONVERT TO INTEGER
......@@ -577,7 +577,7 @@ SCCONT:
|--HIDE THE NEXT TWO
movel N(%a6),%d0
rorl #1,%d0
cmpil #0,%d0 | ...D0 < 0 IFF N IS ODD
bge NEVEN
......@@ -641,7 +641,7 @@ NODD:
fmulx %fp0,%fp1 | ...S(A1+...)
fmulx %fp2,%fp0 | ...S(B2+...)
fmulx RPRIME(%a6),%fp1 | ...R'S(A1+...)
fadds COSB1,%fp0 | ...B1+S(B2...)
......@@ -709,7 +709,7 @@ NEVEN:
fmulx %fp0,%fp1 | ...S(B2+...)
fmulx %fp2,%fp0 | ...s(a1+...)
fadds COSB1,%fp1 | ...B1+S(B2...)
fmulx RPRIME(%a6),%fp0 | ...R'S(A1+...)
......@@ -728,7 +728,7 @@ NEVEN:
SCBORS:
cmpil #0x3FFF8000,%d0
bgt REDUCEX
SCSM:
movew #0x0000,XDCARE(%a6)
......
......@@ -5,7 +5,7 @@
| an input argument; sSinhd does the same except for denormalized
| input.
|
| Input: Double-extended number X in location pointed to
| Input: Double-extended number X in location pointed to
| by address register a0.
|
| Output: The value sinh(X) returned in floating-point register Fp0.
......@@ -49,8 +49,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|SSINH idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -91,7 +91,7 @@ ssinh:
moveml %a1/%d1,-(%sp)
fmovemx %fp0-%fp0,(%a0)
clrl %d1
bsr setoxm1 | ...FP0 IS Z = EXPM1(Y)
bsr setoxm1 | ...FP0 IS Z = EXPM1(Y)
fmovel #0,%fpcr
moveml (%sp)+,%a1/%d1
......
......@@ -50,8 +50,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|STAN idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -213,34 +213,34 @@ TANCONT:
blt NODD
fmovex %fp0,%fp1
fmulx %fp1,%fp1 | ...S = R*R
fmulx %fp1,%fp1 | ...S = R*R
fmoved TANQ4,%fp3
fmoved TANP3,%fp2
fmulx %fp1,%fp3 | ...SQ4
fmulx %fp1,%fp2 | ...SP3
fmulx %fp1,%fp3 | ...SQ4
fmulx %fp1,%fp2 | ...SP3
faddd TANQ3,%fp3 | ...Q3+SQ4
faddx TANP2,%fp2 | ...P2+SP3
fmulx %fp1,%fp3 | ...S(Q3+SQ4)
fmulx %fp1,%fp2 | ...S(P2+SP3)
fmulx %fp1,%fp3 | ...S(Q3+SQ4)
fmulx %fp1,%fp2 | ...S(P2+SP3)
faddx TANQ2,%fp3 | ...Q2+S(Q3+SQ4)
faddx TANP1,%fp2 | ...P1+S(P2+SP3)
fmulx %fp1,%fp3 | ...S(Q2+S(Q3+SQ4))
fmulx %fp1,%fp2 | ...S(P1+S(P2+SP3))
fmulx %fp1,%fp3 | ...S(Q2+S(Q3+SQ4))
fmulx %fp1,%fp2 | ...S(P1+S(P2+SP3))
faddx TANQ1,%fp3 | ...Q1+S(Q2+S(Q3+SQ4))
fmulx %fp0,%fp2 | ...RS(P1+S(P2+SP3))
fmulx %fp0,%fp2 | ...RS(P1+S(P2+SP3))
fmulx %fp3,%fp1 | ...S(Q1+S(Q2+S(Q3+SQ4)))
fmulx %fp3,%fp1 | ...S(Q1+S(Q2+S(Q3+SQ4)))
faddx %fp2,%fp0 | ...R+RS(P1+S(P2+SP3))
faddx %fp2,%fp0 | ...R+RS(P1+S(P2+SP3))
fadds #0x3F800000,%fp1 | ...1+S(Q1+...)
......@@ -251,40 +251,40 @@ TANCONT:
NODD:
fmovex %fp0,%fp1
fmulx %fp0,%fp0 | ...S = R*R
fmulx %fp0,%fp0 | ...S = R*R
fmoved TANQ4,%fp3
fmoved TANP3,%fp2
fmulx %fp0,%fp3 | ...SQ4
fmulx %fp0,%fp2 | ...SP3
fmulx %fp0,%fp3 | ...SQ4
fmulx %fp0,%fp2 | ...SP3
faddd TANQ3,%fp3 | ...Q3+SQ4
faddx TANP2,%fp2 | ...P2+SP3
fmulx %fp0,%fp3 | ...S(Q3+SQ4)
fmulx %fp0,%fp2 | ...S(P2+SP3)
fmulx %fp0,%fp3 | ...S(Q3+SQ4)
fmulx %fp0,%fp2 | ...S(P2+SP3)
faddx TANQ2,%fp3 | ...Q2+S(Q3+SQ4)
faddx TANP1,%fp2 | ...P1+S(P2+SP3)
fmulx %fp0,%fp3 | ...S(Q2+S(Q3+SQ4))
fmulx %fp0,%fp2 | ...S(P1+S(P2+SP3))
fmulx %fp0,%fp3 | ...S(Q2+S(Q3+SQ4))
fmulx %fp0,%fp2 | ...S(P1+S(P2+SP3))
faddx TANQ1,%fp3 | ...Q1+S(Q2+S(Q3+SQ4))
fmulx %fp1,%fp2 | ...RS(P1+S(P2+SP3))
fmulx %fp1,%fp2 | ...RS(P1+S(P2+SP3))
fmulx %fp3,%fp0 | ...S(Q1+S(Q2+S(Q3+SQ4)))
fmulx %fp3,%fp0 | ...S(Q1+S(Q2+S(Q3+SQ4)))
faddx %fp2,%fp1 | ...R+RS(P1+S(P2+SP3))
faddx %fp2,%fp1 | ...R+RS(P1+S(P2+SP3))
fadds #0x3F800000,%fp0 | ...1+S(Q1+...)
fmovex %fp1,-(%sp)
eoril #0x80000000,(%sp)
fmovel %d1,%fpcr |restore users exceptions
fmovel %d1,%fpcr |restore users exceptions
fdivx (%sp)+,%fp0 |last inst - possible exception set
bra t_frcinx
......@@ -397,7 +397,7 @@ WORK:
movew %d2,FP_SCR2(%a6)
clrw FP_SCR2+2(%a6)
movel #0xC90FDAA2,FP_SCR2+4(%a6)
clrl FP_SCR2+8(%a6) | ...FP_SCR2 is 2**(L) * Piby2_1
clrl FP_SCR2+8(%a6) | ...FP_SCR2 is 2**(L) * Piby2_1
|--FP2 IS READY
fsubs TWOTO63(%a6),%fp2 | ...FP2 is N
......@@ -445,7 +445,7 @@ RESTORE:
movel (%a7)+,%d2
fmovemx (%a7)+,%fp2-%fp5
movel N(%a6),%d0
rorl #1,%d0
......
......@@ -49,14 +49,14 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|STANH idnt 2,1 | Motorola 040 Floating Point Software Package
|section 8
#include "fpsp.h"
.set X,FP_SCR5
......@@ -106,7 +106,7 @@ stanh:
movel %d1,-(%a7)
clrl %d1
fmovemx %fp0-%fp0,(%a0)
bsr setoxm1 | ...FP0 IS Z = EXPM1(Y)
bsr setoxm1 | ...FP0 IS Z = EXPM1(Y)
movel (%a7)+,%d1
fmovex %fp0,%fp1
......@@ -149,7 +149,7 @@ TANHBORS:
eorl #0xC0000000,%d0 | ...-SIGN(X)*2
fmoves %d0,%fp1 | ...-SIGN(X)*2 IN SGL FMT
fdivx %fp0,%fp1 | ...-SIGN(X)2 / [EXP(Y)+1 ]
fdivx %fp0,%fp1 | ...-SIGN(X)2 / [EXP(Y)+1 ]
movel SGN(%a6),%d0
orl #0x3F800000,%d0 | ...SGN
......
......@@ -5,9 +5,9 @@
| Library functions return result in fp0. If fp0 is not the
| users destination register then fp0 is moved to the
| correct floating-point destination register. fp0 and fp1
| are then restored to the original contents.
| are then restored to the original contents.
|
| Input: result in fp0,fp1
| Input: result in fp0,fp1
|
| d2 & a0 should be kept unmodified
|
......@@ -19,8 +19,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
STO_RES: |idnt 2,1 | Motorola 040 Floating Point Software Package
......
......@@ -76,8 +76,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|STWOTOX idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -222,17 +222,17 @@ TWOOK1:
cmpil #0x400D80C0,%d0 | ...|X| > 16480?
bles TWOMAIN
bra EXPBORS
TWOMAIN:
|--USUAL CASE, 2^(-70) <= |X| <= 16480
fmovex %fp0,%fp1
fmuls #0x42800000,%fp1 | ...64 * X
fmovel %fp1,N(%a6) | ...N = ROUND-TO-INT(64 X)
movel %d2,-(%sp)
lea EXPTBL,%a1 | ...LOAD ADDRESS OF TABLE OF 2^(J/64)
lea EXPTBL,%a1 | ...LOAD ADDRESS OF TABLE OF 2^(J/64)
fmovel N(%a6),%fp1 | ...N --> FLOATING FMT
movel N(%a6),%d0
movel %d0,%d2
......@@ -244,7 +244,7 @@ TWOMAIN:
asrl #1,%d0 | ...D0 IS M
subl %d0,%d2 | ...d2 IS M', N = 64(M+M') + J
addil #0x3FFF,%d2
movew %d2,ADJFACT(%a6) | ...ADJFACT IS 2^(M')
movew %d2,ADJFACT(%a6) | ...ADJFACT IS 2^(M')
movel (%sp)+,%d2
|--SUMMARY: a1 IS ADDRESS FOR THE LEADING PORTION OF 2^(J/64),
|--D0 IS M WHERE N = 64(M+M') + J. NOTE THAT |M| <= 16140 BY DESIGN.
......@@ -258,13 +258,13 @@ TWOMAIN:
movew (%a1)+,FACT2(%a6)
clrw FACT2+2(%a6)
fsubx %fp1,%fp0 | ...X - (1/64)*INT(64 X)
fsubx %fp1,%fp0 | ...X - (1/64)*INT(64 X)
movew (%a1)+,FACT2HI(%a6)
clrw FACT2HI+2(%a6)
clrl FACT2LOW(%a6)
addw %d0,FACT1(%a6)
fmulx LOG2,%fp0 | ...FP0 IS R
addw %d0,FACT2(%a6)
......@@ -332,10 +332,10 @@ TENMAIN:
fmovex %fp0,%fp1
fmuld L2TEN64,%fp1 | ...X*64*LOG10/LOG2
fmovel %fp1,N(%a6) | ...N=INT(X*64*LOG10/LOG2)
movel %d2,-(%sp)
lea EXPTBL,%a1 | ...LOAD ADDRESS OF TABLE OF 2^(J/64)
lea EXPTBL,%a1 | ...LOAD ADDRESS OF TABLE OF 2^(J/64)
fmovel N(%a6),%fp1 | ...N --> FLOATING FMT
movel N(%a6),%d0
movel %d0,%d2
......@@ -347,7 +347,7 @@ TENMAIN:
asrl #1,%d0 | ...D0 IS M
subl %d0,%d2 | ...d2 IS M', N = 64(M+M') + J
addil #0x3FFF,%d2
movew %d2,ADJFACT(%a6) | ...ADJFACT IS 2^(M')
movew %d2,ADJFACT(%a6) | ...ADJFACT IS 2^(M')
movel (%sp)+,%d2
|--SUMMARY: a1 IS ADDRESS FOR THE LEADING PORTION OF 2^(J/64),
......@@ -375,7 +375,7 @@ TENMAIN:
clrl FACT2LOW(%a6)
fmulx LOG10,%fp0 | ...FP0 IS R
addw %d0,FACT1(%a6)
addw %d0,FACT2(%a6)
......@@ -405,9 +405,9 @@ expr:
fmulx %fp1,%fp2 | ...FP2 IS S*(A1+S*(A3+S*A5))
faddx %fp3,%fp0 | ...FP0 IS R+R*S*(A2+S*A4)
faddx %fp2,%fp0 | ...FP0 IS EXP(R) - 1
|--FINAL RECONSTRUCTION PROCESS
|--EXP(X) = 2^M*2^(J/64) + 2^M*2^(J/64)*(EXP(R)-1) - (1 OR 0)
......
......@@ -6,19 +6,19 @@
| of indirection in do_func for monadic
| functions. Dyadic functions require two
| levels, and the tables are still contained
| in do_func. The table is arranged for
| in do_func. The table is arranged for
| index with a 10-bit index, with the first
| 7 bits the opcode, and the remaining 3
| the stag. For dyadic functions, all
| valid addresses are to the generic entry
| point.
| point.
|
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|TBLDO idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -57,7 +57,7 @@ tblpre:
.long smovcr |$00-7 fmovecr all
.long sint |$01-0 fint norm
.long szero |$01-1 fint zero
.long szero |$01-1 fint zero
.long sinf |$01-2 fint inf
.long src_nan |$01-3 fint nan
.long sintd |$01-4 fint denorm inx
......
......@@ -4,20 +4,20 @@
| This file contains routines used by other programs.
|
| ovf_res: used by overflow to force the correct
| result. ovf_r_k, ovf_r_x2, ovf_r_x3 are
| result. ovf_r_k, ovf_r_x2, ovf_r_x3 are
| derivatives of this routine.
| get_fline: get user's opcode word
| g_dfmtou: returns the destination format.
| g_opcls: returns the opclass of the float instruction.
| g_rndpr: returns the rounding precision.
| g_rndpr: returns the rounding precision.
| reg_dest: write byte, word, or long data to Dn
|
|
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
|UTIL idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -39,13 +39,13 @@
| are unnecessary as ovf_res always returns the sign separately from
| the exponent.
| ;+inf
EXT_PINF: .long 0x7fff0000,0x00000000,0x00000000,0x00000000
EXT_PINF: .long 0x7fff0000,0x00000000,0x00000000,0x00000000
| ;largest +ext
EXT_PLRG: .long 0x7ffe0000,0xffffffff,0xffffffff,0x00000000
EXT_PLRG: .long 0x7ffe0000,0xffffffff,0xffffffff,0x00000000
| ;largest magnitude +sgl in ext
SGL_PLRG: .long 0x407e0000,0xffffff00,0x00000000,0x00000000
SGL_PLRG: .long 0x407e0000,0xffffff00,0x00000000,0x00000000
| ;largest magnitude +dbl in ext
DBL_PLRG: .long 0x43fe0000,0xffffffff,0xfffff800,0x00000000
DBL_PLRG: .long 0x43fe0000,0xffffffff,0xfffff800,0x00000000
| ;largest -ext
tblovfl:
......@@ -70,7 +70,7 @@ tblovfl:
|
| ovf_r_k --- overflow result calculation
|
| This entry point is used by kernel_ex.
| This entry point is used by kernel_ex.
|
| This forces the destination precision to be extended
|
......@@ -79,7 +79,7 @@ tblovfl:
|
.global ovf_r_k
ovf_r_k:
lea ETEMP(%a6),%a0 |a0 points to source operand
lea ETEMP(%a6),%a0 |a0 points to source operand
bclrb #sign_bit,ETEMP_EX(%a6)
sne ETEMP_SGN(%a6) |convert to internal IEEE format
......@@ -112,10 +112,10 @@ ovf_e3_exc:
beql ovff_dbl |force precision is double
movew CMDREG3B(%a6),%d0 |get the command word again
andil #0x7f,%d0 |clear all except operation
cmpil #0x33,%d0
cmpil #0x33,%d0
beql ovf_fsgl |fsglmul or fsgldiv
cmpil #0x30,%d0
beql ovf_fsgl
beql ovf_fsgl
bra ovf_fpcr |instruction is none of the above
| ;use FPCR
ovf_e1_exc:
......@@ -129,10 +129,10 @@ ovf_e1_exc:
andil #0x0000007f,%d0 |clear all except the op code
cmpil #0x00000027,%d0
beql ovf_fsgl |fsglmul
cmpil #0x00000024,%d0
cmpil #0x00000024,%d0
beql ovf_fsgl |fsgldiv
bra ovf_fpcr |none of the above, use FPCR
|
|
|
| Inst is either fsgldiv or fsglmul. Force extended precision.
|
......@@ -152,7 +152,7 @@ ovff_dbl:
ovf_fpcr:
bfextu FPCR_MODE(%a6){#0:#2},%d0 |set round precision
bra ovf_res
|
|
| ovf_r_x3 --- overflow result calculation
......@@ -174,9 +174,9 @@ ovf_r_x3:
| ovf_res --- overflow result calculation
|
| Input:
| a0 points to operand in internal extended format
| a0 points to operand in internal extended format
| Output:
| a0 points to result in internal extended format
| a0 points to result in internal extended format
|
.global ovf_res
ovf_res:
......@@ -192,7 +192,7 @@ ovf_res:
EXT_RN:
leal EXT_PINF,%a1 |answer is +/- infinity
bsetb #inf_bit,FPSR_CC(%a6)
bra set_sign |now go set the sign
bra set_sign |now go set the sign
EXT_RZ:
leal EXT_PLRG,%a1 |answer is +/- large number
bra set_sign |now go set the sign
......@@ -312,10 +312,10 @@ get_fline:
movel (%a7)+,%d0
rts
|
| g_rndpr --- put rounding precision in d0{1:0}
|
| g_rndpr --- put rounding precision in d0{1:0}
|
| valid return codes are:
| 00 - extended
| 00 - extended
| 01 - single
| 10 - double
|
......@@ -350,7 +350,7 @@ g_rndpr:
| For move out instructions (opclass 011) the destination format
| is the same as the rounding precision. Pass results from g_dfmtou.
|
bsr g_dfmtou
bsr g_dfmtou
rts
op_0x0:
btstb #E3,E_BYTE(%a6)
......@@ -364,7 +364,7 @@ unf_e3_exc:
beql unff_dbl
movew CMDREG3B(%a6),%d0 |get the command word again
andil #0x7f,%d0 |clear all except operation
cmpil #0x33,%d0
cmpil #0x33,%d0
beql unf_fsgl |fsglmul or fsgldiv
cmpil #0x30,%d0
beql unf_fsgl |fsgldiv or fsglmul
......@@ -408,7 +408,7 @@ unff_dbl:
| Force extended
|
unf_fsgl:
movel #0,%d0
movel #0,%d0
rts
|
| Get rounding precision set in FPCR{7:6}.
......@@ -436,7 +436,7 @@ opc_1b:
| If E1, the format is from cmdreg1b{12:10}
| If E3, the format is extended.
|
| Dest. Fmt.
| Dest. Fmt.
| extended 010 -> 00
| single 001 -> 01
| double 101 -> 10
......@@ -468,26 +468,26 @@ not_dbl:
| are unnecessary as unf_sub always returns the sign separately from
| the exponent.
| ;+zero
EXT_PZRO: .long 0x00000000,0x00000000,0x00000000,0x00000000
EXT_PZRO: .long 0x00000000,0x00000000,0x00000000,0x00000000
| ;+zero
SGL_PZRO: .long 0x3f810000,0x00000000,0x00000000,0x00000000
SGL_PZRO: .long 0x3f810000,0x00000000,0x00000000,0x00000000
| ;+zero
DBL_PZRO: .long 0x3c010000,0x00000000,0x00000000,0x00000000
DBL_PZRO: .long 0x3c010000,0x00000000,0x00000000,0x00000000
| ;smallest +ext denorm
EXT_PSML: .long 0x00000000,0x00000000,0x00000001,0x00000000
EXT_PSML: .long 0x00000000,0x00000000,0x00000001,0x00000000
| ;smallest +sgl denorm
SGL_PSML: .long 0x3f810000,0x00000100,0x00000000,0x00000000
SGL_PSML: .long 0x3f810000,0x00000100,0x00000000,0x00000000
| ;smallest +dbl denorm
DBL_PSML: .long 0x3c010000,0x00000000,0x00000800,0x00000000
DBL_PSML: .long 0x3c010000,0x00000000,0x00000800,0x00000000
|
| UNF_SUB --- underflow result calculation
|
| Input:
| d0 contains round precision
| d0 contains round precision
| a0 points to input operand in the internal extended format
|
| Output:
| a0 points to correct internal extended precision result.
| a0 points to correct internal extended precision result.
|
tblunf:
......@@ -522,7 +522,7 @@ unf_sub:
uEXT_RN:
leal EXT_PZRO,%a1 |answer is +/- zero
bsetb #z_bit,FPSR_CC(%a6)
bra uset_sign |now go set the sign
bra uset_sign |now go set the sign
uEXT_RZ:
leal EXT_PZRO,%a1 |answer is +/- zero
bsetb #z_bit,FPSR_CC(%a6)
......@@ -629,7 +629,7 @@ end_unfr:
|
|
| Input:
| L_SCR1: Data
| L_SCR1: Data
| d1: data size and dest register number formatted as:
|
| 32 5 4 3 2 1 0
......
......@@ -13,8 +13,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
X_BSUN: |idnt 2,1 | Motorola 040 Floating Point Software Package
......
......@@ -13,8 +13,8 @@
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
X_FLINE: |idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -52,7 +52,7 @@ fpsp_fline:
leal L_SCR1(%a6),%a1 |use L_SCR1 as scratch
movel #4,%d0
addl #4,%a6 |to offset the sub.l #4,a7 above so that
| ;a6 can point correctly to the stack frame
| ;a6 can point correctly to the stack frame
| ;before branching to mem_read
bsrl mem_read
subl #4,%a6
......@@ -62,7 +62,7 @@ fpsp_fline:
bne not_mvcr |exit if not
bfextu %d0{#16:#6},%d1
cmpib #0x17,%d1 |check if it is an FMOVECR encoding
bne not_mvcr
bne not_mvcr
| ;if an FMOVECR instruction, fix stack
| ;and go to FPSP_UNIMP
fix_stack:
......
......@@ -13,8 +13,8 @@
| the dest format is integer (b, w, l) and the operr is caused by
| integer overflow, or the source op is inf, then the result stored is
| garbage.
| There are three cases in which operr is incorrectly signaled on the
| 040. This occurs for move_out of format b, w, or l for the largest
| There are three cases in which operr is incorrectly signaled on the
| 040. This occurs for move_out of format b, w, or l for the largest
| negative integer (-2^7 for b, -2^15 for w, -2^31 for l).
|
| On opclass = 011 fmove.(b,w,l) that causes a conversion
......@@ -36,15 +36,15 @@
| Note 2: For trap enabled 040 does the following:
| If the inst is move_out, then same as Note 1.
| If the inst is not move_out, the dest is not modified.
| The exceptional operand is not defined for integer overflow
| The exceptional operand is not defined for integer overflow
| during a move_out.
|
| Copyright (C) Motorola, Inc. 1990
| All Rights Reserved
|
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
| The copyright notice above does not evidence any
| actual or intended publication of such source code.
X_OPERR: |idnt 2,1 | Motorola 040 Floating Point Software Package
......@@ -77,7 +77,7 @@ fpsp_operr:
beqs operr_end
|
| If the destination size is B,W,or L, the operr must be
| If the destination size is B,W,or L, the operr must be
| handled here.
|
movel CMDREG1B(%a6),%d0
......@@ -90,9 +90,9 @@ fpsp_operr:
beq operr_byte
|
| The size is not B,W,or L, so the operr is handled by the
| The size is not B,W,or L, so the operr is handled by the
| kernel handler. Set the operr bits and clean up, leaving
| only the integer exception frame on the stack, and the
| only the integer exception frame on the stack, and the
| fpu in the original exceptional state.
|
operr_end:
......@@ -111,7 +111,7 @@ operr_long:
moveb STAG(%a6),%d0 |test stag for nan
andib #0xe0,%d0 |clr all but tag
cmpib #0x60,%d0 |check for nan
beq operr_nan
beq operr_nan
cmpil #0x80000000,FPTEMP_LO(%a6) |test if ls lword is special
bnes chklerr |if not equal, check for incorrect operr
bsr check_upper |check if exp and ms mant are special
......@@ -158,7 +158,7 @@ operr_word:
moveb STAG(%a6),%d0 |test stag for nan
andib #0xe0,%d0 |clr all but tag
cmpib #0x60,%d0 |check for nan
beq operr_nan
beq operr_nan
cmpil #0xffff8000,FPTEMP_LO(%a6) |test if ls lword is special
bnes chkwerr |if not equal, check for incorrect operr
bsr check_upper |check if exp and ms mant are special
......@@ -185,7 +185,7 @@ operr_byte:
moveb STAG(%a6),%d0 |test stag for nan
andib #0xe0,%d0 |clr all but tag
cmpib #0x60,%d0 |check for nan
beqs operr_nan
beqs operr_nan
cmpil #0xffffff80,FPTEMP_LO(%a6) |test if ls lword is special
bnes chkberr |if not equal, check for incorrect operr
bsr check_upper |check if exp and ms mant are special
......@@ -229,7 +229,7 @@ store_max:
bclrb #inex2_bit,FPSR_EXCEPT(%a6)
bclrb #ainex_bit,FPSR_AEXCEPT(%a6)
fmovel #0,%FPSR
tstw FPTEMP_EX(%a6) |check sign
blts load_neg
movel #0x7fffffff,%d0
......@@ -280,7 +280,7 @@ dest_mem:
bsrl mem_write
rts
|
| Check the exponent for $c000 and the upper 32 bits of the
| Check the exponent for $c000 and the upper 32 bits of the
| mantissa for $ffffffff. If both are true, return d0 clr
| and store the lower n bits of the least lword of FPTEMP
| to d0 for write out. If not, it is a real operr, and set d0.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5,10 +5,10 @@ M68060 Software Package
Production Release P1.00 -- October 10, 1994
M68060 Software Package Copyright © 1993, 1994 Motorola Inc. All rights reserved.
THE SOFTWARE is provided on an "AS IS" basis and without warranty.
To the maximum extent permitted by applicable law,
MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
and any warranty against infringement with regard to the SOFTWARE
(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment