fix the wrong zero extend instruction handling
authorLu Guanqun <guanqun.lu@intel.com>
Thu, 24 Jan 2013 04:22:08 +0000 (12:22 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Wed, 10 Apr 2013 06:52:32 +0000 (14:52 +0800)
commit475a5a0983befa7c2ab2249992c9dd84c4dfcc34
treec984d860070bbd74182cbb5452a2f2e83f0dd8f4
parent559580fddfcc39f49529193729ea02e27b726583
fix the wrong zero extend instruction handling

This helps to fix the problem facing Xing Homer. When we encounter 'zext'
instruction, we should take the soruce type as an unsigned type, otherwise
we're just sign extend the number, which is not what we want.

For the implementation, I'm reusing getUnsignedType() and this expects an
integer to be accepted, and this conforms to the spec of LLVM.

This patch doesn't trigger regression. I'll provide the corresponding test case
later.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Reviewed-by: Homer Hsing <homer.xing@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
backend/src/llvm/llvm_gen_backend.cpp