From: Egor Bogatov Date: Thu, 5 Dec 2019 01:38:34 +0000 (+0300) Subject: Convert to 0/1 in OP_XEQUAL (mono/mono#18038) X-Git-Tag: submit/tizen/20210909.063632~10331^2~5^2~126 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a59a616c462fbfd1dabb6f241746bdc66984289c;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Convert to 0/1 in OP_XEQUAL (mono/mono#18038) Commit migrated from https://github.com/mono/mono/commit/a3fbb644938bdfe008796f281e958f7707069dfe --- diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index da8e6d7..91b24d8 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -7472,8 +7472,10 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) half = half / 2; } // Extract [0] - values [ins->dreg] = LLVMBuildExtractElement (builder, cmp, LLVMConstInt (LLVMInt32Type (), 0, FALSE), ""); - // Maybe convert to 0/1 ? + LLVMValueRef first_elem = LLVMBuildExtractElement (builder, cmp, LLVMConstInt (LLVMInt32Type (), 0, FALSE), ""); + // convert to 0/1 + LLVMValueRef cmp_zero = LLVMBuildICmp (builder, LLVMIntNE, first_elem, LLVMConstInt (LLVMInt8Type (), 0, FALSE), ""); + values [ins->dreg] = LLVMBuildZExt (builder, cmp_zero, LLVMInt8Type (), ""); break; } case OP_XBINOP: {