* Re: [PATCH v3] librte_eal/common: Fix cast from pointer to integer of different size
@ 2015-03-05 9:21 Tang, HaifengX
[not found] ` <DF029FFF923C334FAA58CEEB2979DCA6014F8D62-0J0gbvR4kTggGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Tang, HaifengX @ 2015-03-05 9:21 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev-VfR2kkLFssw@public.gmane.org
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-VfR2kkLFssw@public.gmane.org] On Behalf Of Michael Qiu
Sent: Thursday, March 05, 2015 3:47 PM
To: dev-VfR2kkLFssw@public.gmane.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 <michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
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(-)
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:
* 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
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <DF029FFF923C334FAA58CEEB2979DCA6014F8D62-0J0gbvR4kTggGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH v3] librte_eal/common: Fix cast from pointer to integer of different size [not found] ` <DF029FFF923C334FAA58CEEB2979DCA6014F8D62-0J0gbvR4kTggGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2015-03-05 9:58 ` Thomas Monjalon 0 siblings, 0 replies; 4+ messages in thread From: Thomas Monjalon @ 2015-03-05 9:58 UTC (permalink / raw) To: Tang, HaifengX; +Cc: dev-VfR2kkLFssw 2015-03-05 09:21, Tang, HaifengX: > Hi Thomas and all : [...] > 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' [...] > 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' [...] > Can anyone can help to check the assemble code . These errors are related to "[PATCH v6 2/7] hash: add assembly implementation of CRC32 intrinsics" Please ask in the right thread. Yerden should know how to properly fix this problem. Thanks ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] librte_eal/common: Fix cast from pointer to integer of different size
@ 2015-03-02 7:27 Michael Qiu
[not found] ` <1425281223-14043-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Michael Qiu @ 2015-03-02 7:27 UTC (permalink / raw)
To: dev-VfR2kkLFssw
/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 <michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
lib/librte_eal/common/include/arch/x86/rte_memcpy.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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..6565c00 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
@@ -589,12 +589,12 @@ COPY_BLOCK_64_BACK15:
* unaligned copy functions require up to 15 bytes
* backwards access.
*/
- dstofss = 16 - (int)((long long)(void *)dst & 0x0F) + 16;
+ dstofss = 16 - (int)((long)(void *)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 = (int)((long)(const void *)src & 0x0F);
/**
* For aligned copy
--
1.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <1425281223-14043-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>]
* [PATCH v3] librte_eal/common: Fix cast from pointer to integer of different size [not found] ` <1425281223-14043-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> @ 2015-03-05 7:46 ` Michael Qiu [not found] ` <1425541598-8669-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Michael Qiu @ 2015-03-05 7:46 UTC (permalink / raw) To: dev-VfR2kkLFssw ./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 <michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> --- 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(-) 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: * 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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
[parent not found: <1425541598-8669-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH v3] librte_eal/common: Fix cast from pointer to integer of different size [not found] ` <1425541598-8669-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> @ 2015-03-05 8:25 ` Tang, HaifengX 0 siblings, 0 replies; 4+ messages in thread From: Tang, HaifengX @ 2015-03-05 8:25 UTC (permalink / raw) To: Qiu, Michael, dev-VfR2kkLFssw@public.gmane.org Tested-by: haifeng.tang <haifengx.tang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Patch name: [dpdk-dev] [PATCH v3] librte_eal/common: Fix cast from pointer to integer of different size Test Env : Fedora 18 , 3.6.10-4 ,4.7.2 ,14.0.0 Fedora20 ,3.11.0,4.8.2,14.0.0 Fedora21,3.17.4-302,4.9.2,15.0.0 Ubuntu 14.04, 3.13.0-30, 4.8.2, 14.0.0 Test Result: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] problem fixed now -----Original Message----- From: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] On Behalf Of Michael Qiu Sent: Thursday, March 05, 2015 3:47 PM To: dev-VfR2kkLFssw@public.gmane.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 <michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> --- 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(-) 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: * 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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-05 9:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-05 9:21 [PATCH v3] librte_eal/common: Fix cast from pointer to integer of different size Tang, HaifengX
[not found] ` <DF029FFF923C334FAA58CEEB2979DCA6014F8D62-0J0gbvR4kTggGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-05 9:58 ` Thomas Monjalon
-- strict thread matches above, loose matches on Subject: below --
2015-03-02 7:27 [PATCH] " Michael Qiu
[not found] ` <1425281223-14043-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-05 7:46 ` [PATCH v3] " Michael Qiu
[not found] ` <1425541598-8669-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-05 8:25 ` Tang, HaifengX
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).