GBE: optimize a special case of convert INT64 to float.
authorZhigang Gong <zhigang.gong@intel.com>
Thu, 5 Jun 2014 08:16:10 +0000 (16:16 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Mon, 9 Jun 2014 03:50:11 +0000 (11:50 +0800)
commit3564ef7589c569f5cf840386c6e29f926a5f407c
treef30f7d46827c3bc37be6cb73982905f4cc621849
parentf2479594d4a5f71bd1eb389a4efb70fa132a19d7
GBE: optimize a special case of convert INT64 to float.

We found the following instruction sequence is common
in luxmark:
CVT.int64.uin32 %75 %74
LOADI.int64 %537 16777215
AND.int64 %76 %75 %537
CVT.float.uin64 %77 %76

Actually, the immediate value is a pure 32 bit value,
and the %74 is also a uint32 bit value. The AND instruction
will not touch the high 32 bit as well. So we can simply optimize
the above instruction series to the follow:
AND.uint32 %tmp %74 16777215
MOV.float  %77 %tmp

This way, it will finally save about 55 instructions for each
of the above case. This patch could bring about 8% performance
gain with sala scene in luxmark.

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
backend/src/backend/gen_insn_selection.cpp