From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ravi Kerur Subject: Re: [PATCH] Implement memcmp using AVX/SSE instructio Date: Thu, 23 Apr 2015 06:43:36 -0700 Message-ID: References: <1429716828-19012-1-git-send-email-rkerur@gmail.com> <1429716828-19012-2-git-send-email-rkerur@gmail.com> <55389E44.8030603@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: "dev-VfR2kkLFssw@public.gmane.org" To: Pawel Wodkowski Return-path: In-Reply-To: <55389E44.8030603-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On Thu, Apr 23, 2015 at 12:24 AM, Pawel Wodkowski < pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote: > On 2015-04-22 17:33, Ravi Kerur wrote: > >> +/** >> + * Compare bytes between two locations. The locations must not overlap. >> + * >> + * @note This is implemented as a macro, so it's address should not be >> taken >> + * and care is needed as parameter expressions may be evaluated multiple >> times. >> + * >> + * @param src_1 >> + * Pointer to the first source of the data. >> + * @param src_2 >> + * Pointer to the second source of the data. >> + * @param n >> + * Number of bytes to compare. >> + * @return >> + * true if equal otherwise false. >> + */ >> +static inline bool >> +rte_memcmp(const void *src_1, const void *src, >> + size_t n) __attribute__((always_inline)); >> > You are exposing this as public API, so I think you should follow > description bellow or not call this _memcmp_ > > int memcmp(const void *s1, const void *s2, size_t n); > > The memcmp() function returns an integer less than, equal to, or > greater than > zero if the first n bytes of s1 is found, respectively, to be > less than, to > match, or be greater than the first n bytes of s2. > > This can/will be fixed in future version. Thanks. > -- > Pawel >