From patchwork Thu Mar 5 09:21:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tang, HaifengX" X-Patchwork-Id: 3864 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 323715A7A; Thu, 5 Mar 2015 10:21:17 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 222D55A74 for ; Thu, 5 Mar 2015 10:21:14 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 05 Mar 2015 01:18:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,345,1422950400"; d="scan'208";a="536433997" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by orsmga003.jf.intel.com with ESMTP; 05 Mar 2015 01:21:03 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 5 Mar 2015 17:21:11 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.197]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.161]) with mapi id 14.03.0195.001; Thu, 5 Mar 2015 17:21:10 +0800 From: "Tang, HaifengX" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v3] librte_eal/common: Fix cast from pointer to integer of different size Thread-Index: AdBXJTlAznaSWkQnSnmwQvkcD7T3Fw== Date: Thu, 5 Mar 2015 09:21:08 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v3] librte_eal/common: Fix cast from pointer to integer of different size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Thomas and all : I686 gcc and icc targets both have the below build issue: For GCC(after apply the patch :[dpdk-dev] [PATCH v3] librte_eal/common: Fix cast from pointer to integer of different size ) == Build lib/librte_hash CC rte_hash.o /jenkins/workspace/DPDK_AUTO_IDT_VM_FC18_32_BUILD2/DPDK/lib/librte_hash/rte_hash_crc.h: Assembler messages: /jenkins/workspace/DPDK_AUTO_IDT_VM_FC18_32_BUILD2/DPDK/lib/librte_hash/rte_hash_crc.h:380: Error: unsupported instruction `crc32' /jenkins/workspace/DPDK_AUTO_IDT_VM_FC18_32_BUILD2/DPDK/lib/librte_hash/rte_hash_crc.h:380: Error: unsupported instruction `crc32' gmake[5]: *** [rte_hash.o] Error 1 gmake[4]: *** [librte_hash] Error 2 gmake[3]: *** [lib] Error 2 gmake[2]: *** [all] Error 2 gmake[1]: *** [i686-native-linuxapp-gcc_install] Error 2 gmake: *** [install] Error 2 For ICC : == Build lib/librte_hash CC rte_hash.o /tmp/iccOsnsZzas_.s: Assembler messages: /tmp/iccOsnsZzas_.s:49: Error: unsupported instruction `crc32' /tmp/iccOsnsZzas_.s:133: Error: unsupported instruction `crc32' make[5]: *** [rte_hash.o] Error 1 make[4]: *** [librte_hash] Error 2 make[3]: *** [lib] Error 2 make[2]: *** [all] Error 2 make[1]: *** [i686-native-linuxapp-icc_install] Error 2 make: *** [install] Error 2 Can anyone can help to check the assemble code . thanks -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu Sent: Thursday, March 05, 2015 3:47 PM To: dev@dpdk.org Subject: [dpdk-dev] [PATCH v3] librte_eal/common: Fix cast from pointer to integer of different size ./i686-native-linuxapp-gcc/include/rte_memcpy.h:592:23: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] dstofss = 16 - (int)((long long)(void *)dst & 0x0F) + 16; Type 'long long' is 64-bit in i686 platform while 'void *' is 32-bit. Signed-off-by: Michael Qiu --- v3 --> v2: make dstofss and srcofs to be type size_t casting type use uintptr_t v2 --> v1: Remove unnecessary casting (void *) lib/librte_eal/common/include/arch/x86/rte_memcpy.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) * unaligned copy functions require up to 15 bytes * backwards access. */ - dstofss = 16 - (int)((long long)(void *)dst & 0x0F) + 16; + dstofss = 16 - ((uintptr_t)dst & 0x0F) + 16; n -= dstofss; rte_mov32((uint8_t *)dst, (const uint8_t *)src); src = (const uint8_t *)src + dstofss; dst = (uint8_t *)dst + dstofss; - srcofs = (int)((long long)(const void *)src & 0x0F); + srcofs = (uintptr_t)src & 0x0F; /** * For aligned copy -- 1.9.3 diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h index 7b2d382..aa433e4 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h +++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h @@ -493,8 +493,8 @@ rte_memcpy(void *dst, const void *src, size_t n) { __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8; void *ret = dst; - int dstofss; - int srcofs; + size_t dstofss; + size_t srcofs; /** * Copy less than 16 bytes @@ -589,12 +589,12 @@ COPY_BLOCK_64_BACK15: