1. An apparatus for compiling software written to be executed on a microprocessor that supports at least one hardware transactional memory function, comprising: a compiler having support for at least one software transactional memory function; and a system mapping between the at least one software transactional memory function and the at least one hardware transactional memory instruction.