|
|
The FASTLIB ToolFASTLIB is a library of fast replacements for the standard intrinsics: ASCII, BINARY, CTRANSLATE, DASCII, and DBINARY. Both CM and NM versions of these routines are available. Given that many applications call these intrinsics hundreds of thousands of times, using FASTLIB provides significant savings in CPU time. FASTLIB intrinsics are provided in libraries for both the Classic machine and the Spectrum machine.Operation
The five FASTLIB intrinsics are "plug-compatible" with the standard intrinsics. ASCII and DASCII provide an extra output base, 16, which works in the same manner as base 8, except that the output is in hexadecimal.
FASTLIB comes as an NMOBJ file (for linking into your NM programs), an NMXL (for load-time linking with your NM programs), and as a USL (for prepping with your CM programs).In addition to offering plug compatible replacements for these intrinsics, we also provide another choice. If your application does not use the return condition codes, you may choose to use FASTRLIB library of intrinsics. Functionally equivalent to the standard FASTLIB intrinsics, these intrinsics differ only in that they omit the step of setting the return condition code which yields even greater performance.The FASTLIB intrinsics differ from the standard intrinsics in only two ways:They are much faster; If a standard intrinsic wants to abort your process, it will do so with a nice "intrinsic abort" message. The FASTLIB intrinsics will abort you in the same circumstances as the standard intrinsics, but without the same abort message (either a "FASTLIB abort" message will be displayed or an "invalid virtual address" message will appear). The FASTLIB libraries that you have received are:
Capabilities
No special capabilities are required to run FASTLIB.Usage
Usage information is provided in two sections: one section for Native Mode usage, and a second section for Compatibility Mode.Native Mode Usage
There are two ways to use FASTLIB from your Native Mode application.Easiest
Simply run existing programs with an extra option at the end of the RUN command. For example:RUN MYPROG; XL = "FASTLIB.XL.LPSTOOLS"If you specify a "XL=" command when you link a program, then you can omit the "XL=" at RUN time. For example::PASXL MYPROG, MYPROG.O, $NULL:LINK FROM=MYPROG.O; TO=MYPROG.PUB; XL = FASTLIB.XL.LPSTOOLSIf you have the ability to re-link your programs, see the next note for a faster way of using FASTLIB.Fastest
LINK the FASTLIB routines along with your program. In the LINK command, add the phrase ",FASTLIB.O.LPSTOOLS" to the FROM= option.Example::PASXL FOO, FOO.O, $NULL:LINK FROM=FOO.O, FASTLIB.O.LPSTOOLS; TO = FOO.PUBLinking FASTLIB into your program will save about 20 instructions per call to each FASTLIB procedure.Without Condition Codes
Many users do not need the condition codes set by BINARY, DBINARY, and CTRANSLATE. These users might begrudge the time spent by these FASTLIB procedures in setting the condition code.
FASTRLIB is a version of FASTLIB that does not set condition codes for any of the procedures. It is used exactly like FASTLIB (i.e.: it can either be linked into a program or accessed via an "XL=" option on the RUN command).Compatibility Mode Usage
For compatibility mode users the only option that Lund Performance Solutions provides for the use of the FASTLIB intrinsics is to PREP them into your program. For example:SEGMENTERFASTRLIB comes as an NMOBJ file (for linking into your NM programs), and as an NMXL (for load-time linking with your NM programs). A USL version is not provided because setting the condition code in CM code requires only 4 instructions.What’s Next
The following section illustrates the calling sequence for each intrinsic in FASTLIB and FASTRLIB (see The CSEQ Tool to find how this was generated) from the viewpoint of Pascal/XL and the hardware, plus a brief description of each intrinsic. For a more detailed discussion, please refer to the MPE/iX Intrinsic Reference Manual.ASCII
Purpose: Convert a 16-bit number into the equivalent ASCII string.
Figure 8.1 Convert to ASCIIBINARY
Purpose: Convert an ASCII string into a 16-bit number.
Figure 8.2 Convert from ASCIIDASCII
Purpose: Convert a 32-bit number into the equivalent ASCII string.
Figure 8.3 Convert to Equivalent ASCII StringDBINARY
Purpose: Convert an ASCII string into a 32-bit number.
Figure 8.4 Converted ASCII StringCTRANSLATE
Purpose: Converts a string of EBCDIC or ASCII characters from one to the other, or between EBCDIK and KANA8. Or, translate via a user-supplied translation table.
Figure 8.5 ConversionTOOLBOX STANDARDS
The ToolBox collections from Lund Performance Solutions have a uniform user interface. As a result, in addition to the commands specific to each Toolbox tool, most tools allow the commands described in "TOOLBOX STANDARDS".Timing
How much faster are the FASTLIB intrinsics? When they are originally written, the FASTLIB intrinsics were up to 20 times faster than the system intrinsics. Although the system intrinsics have been optimized since FASTLIB first became available, FASTLIB intrinsics should still be considered as a high-performance alternative.Two test programs are provided so that you can measure the performance gains provided by the FASTLIB intrinsics.
TIMEMPE.TIMING test program uses HP intrinsics TIMEFAST.TIMING same program, uses FASTLIB intrinsics
To run these programs just use one of the RUN statements below:RUN TIMEMPE.TIMING.LPSTOOLSRUN TIMEFAST.TIMING.LPSTOOLSFASTLIB Examples
Following are some examples of the FASTLIB tool:
Figure 8.6 Running the TIMEMPE Program
Figure 8.7 Running the TIMEFAST ProgramFASTLIB Error Messages
Errors generated by FASTLIB are the same as those generated by their HP equivalents. See the HP Intrinsic Reference Manual for possible error conditions.
|
Lund Performance Solutions www.lund.com Voice: (541) 812-7600 Fax: (541) 81207611 info@lund.com |
|
|