18c2ecf20Sopenharmony_ci~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28c2ecf20Sopenharmony_ciMOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP 38c2ecf20Sopenharmony_ciM68000 Hi-Performance Microprocessor Division 48c2ecf20Sopenharmony_ciM68060 Software Package 58c2ecf20Sopenharmony_ciProduction Release P1.00 -- October 10, 1994 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciM68060 Software Package Copyright © 1993, 1994 Motorola Inc. All rights reserved. 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciTHE SOFTWARE is provided on an "AS IS" basis and without warranty. 108c2ecf20Sopenharmony_ciTo the maximum extent permitted by applicable law, 118c2ecf20Sopenharmony_ciMOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 128c2ecf20Sopenharmony_ciINCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE 138c2ecf20Sopenharmony_ciand any warranty against infringement with regard to the SOFTWARE 148c2ecf20Sopenharmony_ci(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials. 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ciTo the maximum extent permitted by applicable law, 178c2ecf20Sopenharmony_ciIN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER 188c2ecf20Sopenharmony_ci(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, 198c2ecf20Sopenharmony_ciBUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) 208c2ecf20Sopenharmony_ciARISING OF THE USE OR INABILITY TO USE THE SOFTWARE. 218c2ecf20Sopenharmony_ciMotorola assumes no responsibility for the maintenance and support of the SOFTWARE. 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ciYou are hereby granted a copyright license to use, modify, and distribute the SOFTWARE 248c2ecf20Sopenharmony_ciso long as this entire notice is retained without alteration in any modified and/or 258c2ecf20Sopenharmony_ciredistributed versions, and that such modified versions are clearly identified as such. 268c2ecf20Sopenharmony_ciNo licenses are granted by implication, estoppel or otherwise under any patents 278c2ecf20Sopenharmony_cior trademarks of Motorola, Inc. 288c2ecf20Sopenharmony_ci~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci68060 FLOATING-POINT SOFTWARE PACKAGE (Library version) 318c2ecf20Sopenharmony_ci-------------------------------------------------------- 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ciThe file fplsp.sa contains the "Library version" of the 348c2ecf20Sopenharmony_ci68060SP Floating-Point Software Package. The routines 358c2ecf20Sopenharmony_ciincluded in this module can be used to emulate the 368c2ecf20Sopenharmony_ciFP instructions not implemented in 68060 hardware. These 378c2ecf20Sopenharmony_ciinstructions normally take exception vector #11 388c2ecf20Sopenharmony_ci"FP Unimplemented Instruction". 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ciBy re-compiling a program that uses these instructions, and 418c2ecf20Sopenharmony_cimaking subroutine calls in place of the unimplemented 428c2ecf20Sopenharmony_ciinstructions, a program can avoid the overhead associated 438c2ecf20Sopenharmony_ciwith taking the exception. 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ciRelease file format: 468c2ecf20Sopenharmony_ci-------------------- 478c2ecf20Sopenharmony_ciThe file fplsp.sa is essentially a hexadecimal image of the 488c2ecf20Sopenharmony_cirelease package. This is the ONLY format which will be supported. 498c2ecf20Sopenharmony_ciThe hex image was created by assembling the source code and 508c2ecf20Sopenharmony_cithen converting the resulting binary output image into an 518c2ecf20Sopenharmony_ciASCII text file. The hexadecimal numbers are listed 528c2ecf20Sopenharmony_ciusing the Motorola Assembly Syntax assembler directive "dc.l" 538c2ecf20Sopenharmony_ci(define constant longword). The file can be converted to other 548c2ecf20Sopenharmony_ciassembly syntaxes by using any word processor with a global 558c2ecf20Sopenharmony_cisearch and replace function. 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ciTo assist in assembling and linking this module with other modules, 588c2ecf20Sopenharmony_cithe installer should add a symbolic label to the top of the file. 598c2ecf20Sopenharmony_ciThis will allow calling routines to access the entry points 608c2ecf20Sopenharmony_ciof this package. 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ciThe source code fplsp.s has also been included but only for 638c2ecf20Sopenharmony_cidocumentation purposes. 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ciRelease file structure: 668c2ecf20Sopenharmony_ci----------------------- 678c2ecf20Sopenharmony_ciThe file fplsp.sa contains an "Entry-Point" section and a 688c2ecf20Sopenharmony_cicode section. The FPLSP has no "Call-Out" section. The first section 698c2ecf20Sopenharmony_ciis the "Entry-Point" section. In order to access a function in the 708c2ecf20Sopenharmony_cipackage, a program must "bsr" or "jsr" to the location listed 718c2ecf20Sopenharmony_cibelow in "68060FPLSP entry points" that corresponds to the desired 728c2ecf20Sopenharmony_cifunction. A branch instruction located at the selected entry point 738c2ecf20Sopenharmony_ciwithin the package will then enter the correct emulation code routine. 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ciThe entry point addresses at the beginning of the package will remain 768c2ecf20Sopenharmony_cifixed so that a program calling the routines will not have to be 778c2ecf20Sopenharmony_cire-compiled with every new 68060FPLSP release. 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ciThere are 3 entry-points for each instruction type: single precision, 808c2ecf20Sopenharmony_cidouble precision, and extended precision. 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ciAs an example, the "fsin" library instruction can be passed an 838c2ecf20Sopenharmony_ciextended precision operand if program executes: 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci# fsin.x fp0 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci fmovm.x &0x01,-(%sp) # pass operand on stack 888c2ecf20Sopenharmony_ci bsr.l _060FPLSP_TOP+0x1a8 # branch to fsin routine 898c2ecf20Sopenharmony_ci add.l &0xc,%sp # clear operand from stack 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ciUpon return, fp0 holds the correct result. The FPSR is 928c2ecf20Sopenharmony_ciset correctly. The FPCR is unchanged. The FPIAR is undefined. 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ciAnother example. This time, a dyadic operation: 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_ci# frem.s %fp1,%fp0 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_ci fmov.s %fp1,-(%sp) # pass src operand 998c2ecf20Sopenharmony_ci fmov.s %fp0,-(%sp) # pass dst operand 1008c2ecf20Sopenharmony_ci bsr.l _060FPLSP_TOP+0x168 # branch to frem routine 1018c2ecf20Sopenharmony_ci addq.l &0x8,%sp # clear operands from stack 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ciAgain, the result is returned in fp0. Note that BOTH operands 1048c2ecf20Sopenharmony_ciare passed in single precision format. 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ciException reporting: 1078c2ecf20Sopenharmony_ci-------------------- 1088c2ecf20Sopenharmony_ciThe package takes exceptions according to the FPCR value upon subroutine 1098c2ecf20Sopenharmony_cientry. If an exception should be reported, then the package forces 1108c2ecf20Sopenharmony_cithis exception using implemented floating-point instructions. 1118c2ecf20Sopenharmony_ciFor example, if the instruction being emulated should cause a 1128c2ecf20Sopenharmony_cifloating-point Operand Error exception, then the library routine 1138c2ecf20Sopenharmony_ciexecutes an FMUL of a zero and an infinity to force the OPERR 1148c2ecf20Sopenharmony_ciexception. Although the FPIAR will be undefined for the enabled 1158c2ecf20Sopenharmony_ciOperand Error exception handler, the user will at least be able 1168c2ecf20Sopenharmony_cito record that the event occurred. 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ciMiscellaneous: 1198c2ecf20Sopenharmony_ci-------------- 1208c2ecf20Sopenharmony_ciThe package does not attempt to correctly emulate instructions 1218c2ecf20Sopenharmony_ciwith Signalling NAN inputs. Use of SNANs should be avoided with 1228c2ecf20Sopenharmony_cithis package. 1238c2ecf20Sopenharmony_ci 1248c2ecf20Sopenharmony_ciThe fabs/fadd/fdiv/fint/fintrz/fmul/fneg/fsqrt/fsub entry points 1258c2ecf20Sopenharmony_ciare provided for the convenience of older compilers that make 1268c2ecf20Sopenharmony_cisubroutine calls for all fp instructions. The code does NOT emulate 1278c2ecf20Sopenharmony_cithe instruction but rather simply executes it. 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_ci68060FPLSP entry points: 1308c2ecf20Sopenharmony_ci------------------------ 1318c2ecf20Sopenharmony_ci_060FPLSP_TOP: 1328c2ecf20Sopenharmony_ci0x000: _060LSP__facoss_ 1338c2ecf20Sopenharmony_ci0x008: _060LSP__facosd_ 1348c2ecf20Sopenharmony_ci0x010: _060LSP__facosx_ 1358c2ecf20Sopenharmony_ci0x018: _060LSP__fasins_ 1368c2ecf20Sopenharmony_ci0x020: _060LSP__fasind_ 1378c2ecf20Sopenharmony_ci0x028: _060LSP__fasinx_ 1388c2ecf20Sopenharmony_ci0x030: _060LSP__fatans_ 1398c2ecf20Sopenharmony_ci0x038: _060LSP__fatand_ 1408c2ecf20Sopenharmony_ci0x040: _060LSP__fatanx_ 1418c2ecf20Sopenharmony_ci0x048: _060LSP__fatanhs_ 1428c2ecf20Sopenharmony_ci0x050: _060LSP__fatanhd_ 1438c2ecf20Sopenharmony_ci0x058: _060LSP__fatanhx_ 1448c2ecf20Sopenharmony_ci0x060: _060LSP__fcoss_ 1458c2ecf20Sopenharmony_ci0x068: _060LSP__fcosd_ 1468c2ecf20Sopenharmony_ci0x070: _060LSP__fcosx_ 1478c2ecf20Sopenharmony_ci0x078: _060LSP__fcoshs_ 1488c2ecf20Sopenharmony_ci0x080: _060LSP__fcoshd_ 1498c2ecf20Sopenharmony_ci0x088: _060LSP__fcoshx_ 1508c2ecf20Sopenharmony_ci0x090: _060LSP__fetoxs_ 1518c2ecf20Sopenharmony_ci0x098: _060LSP__fetoxd_ 1528c2ecf20Sopenharmony_ci0x0a0: _060LSP__fetoxx_ 1538c2ecf20Sopenharmony_ci0x0a8: _060LSP__fetoxm1s_ 1548c2ecf20Sopenharmony_ci0x0b0: _060LSP__fetoxm1d_ 1558c2ecf20Sopenharmony_ci0x0b8: _060LSP__fetoxm1x_ 1568c2ecf20Sopenharmony_ci0x0c0: _060LSP__fgetexps_ 1578c2ecf20Sopenharmony_ci0x0c8: _060LSP__fgetexpd_ 1588c2ecf20Sopenharmony_ci0x0d0: _060LSP__fgetexpx_ 1598c2ecf20Sopenharmony_ci0x0d8: _060LSP__fgetmans_ 1608c2ecf20Sopenharmony_ci0x0e0: _060LSP__fgetmand_ 1618c2ecf20Sopenharmony_ci0x0e8: _060LSP__fgetmanx_ 1628c2ecf20Sopenharmony_ci0x0f0: _060LSP__flog10s_ 1638c2ecf20Sopenharmony_ci0x0f8: _060LSP__flog10d_ 1648c2ecf20Sopenharmony_ci0x100: _060LSP__flog10x_ 1658c2ecf20Sopenharmony_ci0x108: _060LSP__flog2s_ 1668c2ecf20Sopenharmony_ci0x110: _060LSP__flog2d_ 1678c2ecf20Sopenharmony_ci0x118: _060LSP__flog2x_ 1688c2ecf20Sopenharmony_ci0x120: _060LSP__flogns_ 1698c2ecf20Sopenharmony_ci0x128: _060LSP__flognd_ 1708c2ecf20Sopenharmony_ci0x130: _060LSP__flognx_ 1718c2ecf20Sopenharmony_ci0x138: _060LSP__flognp1s_ 1728c2ecf20Sopenharmony_ci0x140: _060LSP__flognp1d_ 1738c2ecf20Sopenharmony_ci0x148: _060LSP__flognp1x_ 1748c2ecf20Sopenharmony_ci0x150: _060LSP__fmods_ 1758c2ecf20Sopenharmony_ci0x158: _060LSP__fmodd_ 1768c2ecf20Sopenharmony_ci0x160: _060LSP__fmodx_ 1778c2ecf20Sopenharmony_ci0x168: _060LSP__frems_ 1788c2ecf20Sopenharmony_ci0x170: _060LSP__fremd_ 1798c2ecf20Sopenharmony_ci0x178: _060LSP__fremx_ 1808c2ecf20Sopenharmony_ci0x180: _060LSP__fscales_ 1818c2ecf20Sopenharmony_ci0x188: _060LSP__fscaled_ 1828c2ecf20Sopenharmony_ci0x190: _060LSP__fscalex_ 1838c2ecf20Sopenharmony_ci0x198: _060LSP__fsins_ 1848c2ecf20Sopenharmony_ci0x1a0: _060LSP__fsind_ 1858c2ecf20Sopenharmony_ci0x1a8: _060LSP__fsinx_ 1868c2ecf20Sopenharmony_ci0x1b0: _060LSP__fsincoss_ 1878c2ecf20Sopenharmony_ci0x1b8: _060LSP__fsincosd_ 1888c2ecf20Sopenharmony_ci0x1c0: _060LSP__fsincosx_ 1898c2ecf20Sopenharmony_ci0x1c8: _060LSP__fsinhs_ 1908c2ecf20Sopenharmony_ci0x1d0: _060LSP__fsinhd_ 1918c2ecf20Sopenharmony_ci0x1d8: _060LSP__fsinhx_ 1928c2ecf20Sopenharmony_ci0x1e0: _060LSP__ftans_ 1938c2ecf20Sopenharmony_ci0x1e8: _060LSP__ftand_ 1948c2ecf20Sopenharmony_ci0x1f0: _060LSP__ftanx_ 1958c2ecf20Sopenharmony_ci0x1f8: _060LSP__ftanhs_ 1968c2ecf20Sopenharmony_ci0x200: _060LSP__ftanhd_ 1978c2ecf20Sopenharmony_ci0x208: _060LSP__ftanhx_ 1988c2ecf20Sopenharmony_ci0x210: _060LSP__ftentoxs_ 1998c2ecf20Sopenharmony_ci0x218: _060LSP__ftentoxd_ 2008c2ecf20Sopenharmony_ci0x220: _060LSP__ftentoxx_ 2018c2ecf20Sopenharmony_ci0x228: _060LSP__ftwotoxs_ 2028c2ecf20Sopenharmony_ci0x230: _060LSP__ftwotoxd_ 2038c2ecf20Sopenharmony_ci0x238: _060LSP__ftwotoxx_ 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci0x240: _060LSP__fabss_ 2068c2ecf20Sopenharmony_ci0x248: _060LSP__fabsd_ 2078c2ecf20Sopenharmony_ci0x250: _060LSP__fabsx_ 2088c2ecf20Sopenharmony_ci0x258: _060LSP__fadds_ 2098c2ecf20Sopenharmony_ci0x260: _060LSP__faddd_ 2108c2ecf20Sopenharmony_ci0x268: _060LSP__faddx_ 2118c2ecf20Sopenharmony_ci0x270: _060LSP__fdivs_ 2128c2ecf20Sopenharmony_ci0x278: _060LSP__fdivd_ 2138c2ecf20Sopenharmony_ci0x280: _060LSP__fdivx_ 2148c2ecf20Sopenharmony_ci0x288: _060LSP__fints_ 2158c2ecf20Sopenharmony_ci0x290: _060LSP__fintd_ 2168c2ecf20Sopenharmony_ci0x298: _060LSP__fintx_ 2178c2ecf20Sopenharmony_ci0x2a0: _060LSP__fintrzs_ 2188c2ecf20Sopenharmony_ci0x2a8: _060LSP__fintrzd_ 2198c2ecf20Sopenharmony_ci0x2b0: _060LSP__fintrzx_ 2208c2ecf20Sopenharmony_ci0x2b8: _060LSP__fmuls_ 2218c2ecf20Sopenharmony_ci0x2c0: _060LSP__fmuld_ 2228c2ecf20Sopenharmony_ci0x2c8: _060LSP__fmulx_ 2238c2ecf20Sopenharmony_ci0x2d0: _060LSP__fnegs_ 2248c2ecf20Sopenharmony_ci0x2d8: _060LSP__fnegd_ 2258c2ecf20Sopenharmony_ci0x2e0: _060LSP__fnegx_ 2268c2ecf20Sopenharmony_ci0x2e8: _060LSP__fsqrts_ 2278c2ecf20Sopenharmony_ci0x2f0: _060LSP__fsqrtd_ 2288c2ecf20Sopenharmony_ci0x2f8: _060LSP__fsqrtx_ 2298c2ecf20Sopenharmony_ci0x300: _060LSP__fsubs_ 2308c2ecf20Sopenharmony_ci0x308: _060LSP__fsubd_ 2318c2ecf20Sopenharmony_ci0x310: _060LSP__fsubx_ 232