Sign in



Don't have an account?

Signing up is free and easy
Home -> Our Services -> Programming Tools BU -> C Compilers -> Development of emulation libraries

Development of emulation libraries

Requirements

We had developed two emulation libraries for our Japanese customers. We had also earlier developed compilers for these Japanese customers.

The requirement from one of the customers was to develop emulation libraries for an 8-bit micro-controller. Emulation library should support routines for long and float operations. The requirement from another customer was to develop a fast float library for one of their MIPS based processor. In both the cases the requirement was that the emulation library should have compact code size and faster execution performance.

Challenges

  • Identifying optimal algorithms for floating point operations
  • Debugging emulation routines

Solution

  • Environment
    OS
    Windows
    Language/Platform Assembly language for the respective architectures
    Tools Cross compiler tool for the respective architectures
  • Description

    The team started with study of IEEE floating pointing formats. The team then studied how operations like addition, subtraction, multiplication, division, overflow detection etc. are done on floating point numbers. Information from internet and the book "The Art of Computer Programming" by Donald E. Knuth were referred to identify optimal algorithms for floating point operations.

    The development was done by a 3 member team. For each floating point operation, the team first developed a file header, which contained details like the algorithm for the floating point operation, input registers, output registers, assumption etc. The team reviewed this header first to fix on an optimal algorithm. During implementation of the algorithm, the team focused on optimal use of instructions of the target architecture. acmet had earlier carried out a performance improvement of an emulation library. This was used the benchmark for this development.

    The real challenges in the project were identification of optimal algorithm and debugging the emulation library. Debugging assembly was difficult as the cross compiler tool set did not have sophisticated debugging features. Especially for cases where the result is off by 1 bit in terms of precision, tracking down the cause was a tedious thing to do.

    The test cases provided by the customer covered the different possible cases in floating point operations. This greatly helped the development and enabled us to identify the defects at early stages of development. The team also developed implementation specific test cases to make the testing complete.

    The emulation libraries were developed in planned schedule and with good quality.