TOCPREVNEXTINDEX

Lund Performance Solutions


The FASTLIB Tool
FASTLIB 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.

NOTE See the MPE/iX Intrinsics Reference Manual for an explanation of base 10, -10, and 8.

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:

    FASTLIB.XL
    Native Mode executable libraries, sets condition codes
    FASTRLIB.XL
    Native Mode executable libraries, no condition codes set
    FASTLIB.O
    Native Mode object file, sets condition codes
    FASTRLIB.O
    Native Mode object file, no condition codes set
    FASTLIB.USL
    USL (classic) object file, sets condition codes

    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.LPSTOOLS
    If 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.PUB
    Linking 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.

    NOTE CTRANSLATE always sets the condition code to CCE, no
    other value is possible!

    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:
    SEGMENTER
  • USL MYUSL
  • AUX FASTLIB.USL.LPSTOOLS
  • COPY SEGMENT,FASTLIB
  • FASTRLIB 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 ASCII

    BINARY

    Purpose: Convert an ASCII string into a 16-bit number.


    Figure 8.2 Convert from ASCII

    DASCII

    Purpose: Convert a 32-bit number into the equivalent ASCII string.


    Figure 8.3 Convert to Equivalent ASCII String

    DBINARY

    Purpose: Convert an ASCII string into a 32-bit number.


    Figure 8.4 Converted ASCII String

    CTRANSLATE

    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 Conversion

    TOOLBOX 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.LPSTOOLS
    RUN TIMEFAST.TIMING.LPSTOOLS

    FASTLIB Examples

    Following are some examples of the FASTLIB tool:


    Figure 8.6 Running the TIMEMPE Program


    Figure 8.7 Running the TIMEFAST Program

    FASTLIB 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
    TOCPREVNEXTINDEX