Nullstone Logo

COMPANY
Home
Contacts
Customers
Testimonials

PRODUCTS
Overview
NULLSTONE for C
NULLSTONE for Java
Technical Overview

SUPPORT
Release Notes
Download
PGP Information
Service Report
Write Us

INFORMATION
Performance Results
Glossary of Terms

RELATED LINKS
Compiler Connection
Compiler Jobs

Previous Up Next
Integer Multiply Optimization

On many architectures, integer multiply instructions are slower than other instructions such as integer add and shift, and multiply expressions with power-of-two constant multiplicands and other bit patterns can be replaced with faster instructions.

Example:

The integer multiply expression in the code fragment below can be replaced with an shift expression.

    int f (int i)
    {
      return i * 4;
    }
    

Below is the code fragment after the multiply expression has been translated to a shift expression.

    int f (int i)
    {
      return i << 2;
    }
    

© 1990-2012 Nullstone Corporation. All Rights Reserved.