diff mbox

[API-NEXT,PATCHv2,1/2] drv: adding compiler.h

Message ID 1455701546-48997-1-git-send-email-christophe.milard@linaro.org
State New
Headers show

Commit Message

Christophe Milard Feb. 17, 2016, 9:32 a.m. UTC
The file is, of course, largely inspired from its equivalent on the
application interface.

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 include/odp/drv/spec/compiler.h | 51 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 include/odp/drv/spec/compiler.h

Comments

Bill Fischofer Feb. 18, 2016, 1:25 a.m. UTC | #1
For this series:

Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>

On Wed, Feb 17, 2016 at 3:32 AM, Christophe Milard <
christophe.milard@linaro.org> wrote:

> The file is, of course, largely inspired from its equivalent on the

> application interface.

>

> Signed-off-by: Christophe Milard <christophe.milard@linaro.org>

> ---

>  include/odp/drv/spec/compiler.h | 51

> +++++++++++++++++++++++++++++++++++++++++

>  1 file changed, 51 insertions(+)

>  create mode 100644 include/odp/drv/spec/compiler.h

>

> diff --git a/include/odp/drv/spec/compiler.h

> b/include/odp/drv/spec/compiler.h

> new file mode 100644

> index 0000000..3198d21

> --- /dev/null

> +++ b/include/odp/drv/spec/compiler.h

> @@ -0,0 +1,51 @@

> +/* Copyright (c) 2016, Linaro Limited

> + * All rights reserved.

> + *

> + * SPDX-License-Identifier:     BSD-3-Clause

> + */

> +

> +/**

> + * @file

> + *

> + * Compiler related for ODP driver interface

> + */

> +

> +#ifndef ODPDRV_COMPILER_H_

> +#define ODPDRV_COMPILER_H_

> +

> +#ifdef __cplusplus

> +extern "C" {

> +#endif

> +

> +/** @addtogroup odpdrv_compiler_optim ODPDRV COMPILER / OPTIMIZATION

> + *  Macro for old compilers

> + *  @{

> + */

> +

> +/** @internal GNU compiler version */

> +#define GCC_VERSION (__GNUC__ * 10000 \

> +                       + __GNUC_MINOR__ * 100 \

> +                       + __GNUC_PATCHLEVEL__)

> +

> +/**

> + * @internal

> + * Compiler __builtin_bswap16() is not available on all platforms

> + * until GCC 4.8.0 - work around this by offering

> __odpdrv_builtin_bswap16()

> + * Don't use this function directly, instead see odpdrv byteorder.h

> + */

> +#if GCC_VERSION < 40800

> +#define __odpdrv_builtin_bswap16(u16) \

> +                               ((((u16)&0x00ff) << 8) | (((u16)&0xff00)

> >> 8))

> +#else

> +#define __odpdrv_builtin_bswap16(u16) __builtin_bswap16(u16)

> +#endif

> +

> +/**

> + * @}

> + */

> +

> +#ifdef __cplusplus

> +}

> +#endif

> +

> +#endif

> --

> 2.1.4

>

>
Christophe Milard March 30, 2016, 8:37 a.m. UTC | #2
ping for merge...

On 18 February 2016 at 02:25, Bill Fischofer <bill.fischofer@linaro.org>
wrote:

> For this series:

>

> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>

>

> On Wed, Feb 17, 2016 at 3:32 AM, Christophe Milard <

> christophe.milard@linaro.org> wrote:

>

>> The file is, of course, largely inspired from its equivalent on the

>> application interface.

>>

>> Signed-off-by: Christophe Milard <christophe.milard@linaro.org>

>> ---

>>  include/odp/drv/spec/compiler.h | 51

>> +++++++++++++++++++++++++++++++++++++++++

>>  1 file changed, 51 insertions(+)

>>  create mode 100644 include/odp/drv/spec/compiler.h

>>

>> diff --git a/include/odp/drv/spec/compiler.h

>> b/include/odp/drv/spec/compiler.h

>> new file mode 100644

>> index 0000000..3198d21

>> --- /dev/null

>> +++ b/include/odp/drv/spec/compiler.h

>> @@ -0,0 +1,51 @@

>> +/* Copyright (c) 2016, Linaro Limited

>> + * All rights reserved.

>> + *

>> + * SPDX-License-Identifier:     BSD-3-Clause

>> + */

>> +

>> +/**

>> + * @file

>> + *

>> + * Compiler related for ODP driver interface

>> + */

>> +

>> +#ifndef ODPDRV_COMPILER_H_

>> +#define ODPDRV_COMPILER_H_

>> +

>> +#ifdef __cplusplus

>> +extern "C" {

>> +#endif

>> +

>> +/** @addtogroup odpdrv_compiler_optim ODPDRV COMPILER / OPTIMIZATION

>> + *  Macro for old compilers

>> + *  @{

>> + */

>> +

>> +/** @internal GNU compiler version */

>> +#define GCC_VERSION (__GNUC__ * 10000 \

>> +                       + __GNUC_MINOR__ * 100 \

>> +                       + __GNUC_PATCHLEVEL__)

>> +

>> +/**

>> + * @internal

>> + * Compiler __builtin_bswap16() is not available on all platforms

>> + * until GCC 4.8.0 - work around this by offering

>> __odpdrv_builtin_bswap16()

>> + * Don't use this function directly, instead see odpdrv byteorder.h

>> + */

>> +#if GCC_VERSION < 40800

>> +#define __odpdrv_builtin_bswap16(u16) \

>> +                               ((((u16)&0x00ff) << 8) | (((u16)&0xff00)

>> >> 8))

>> +#else

>> +#define __odpdrv_builtin_bswap16(u16) __builtin_bswap16(u16)

>> +#endif

>> +

>> +/**

>> + * @}

>> + */

>> +

>> +#ifdef __cplusplus

>> +}

>> +#endif

>> +

>> +#endif

>> --

>> 2.1.4

>>

>>

>
Maxim Uvarov March 30, 2016, 2:53 p.m. UTC | #3
Merged,
Maxim.

On 03/30/16 11:37, Christophe Milard wrote:
> ping for merge...
>
> On 18 February 2016 at 02:25, Bill Fischofer 
> <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>> wrote:
>
>     For this series:
>
>     Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>>
>
>     On Wed, Feb 17, 2016 at 3:32 AM, Christophe Milard
>     <christophe.milard@linaro.org
>     <mailto:christophe.milard@linaro.org>> wrote:
>
>         The file is, of course, largely inspired from its equivalent
>         on the
>         application interface.
>
>         Signed-off-by: Christophe Milard <christophe.milard@linaro.org
>         <mailto:christophe.milard@linaro.org>>
>         ---
>          include/odp/drv/spec/compiler.h | 51
>         +++++++++++++++++++++++++++++++++++++++++
>          1 file changed, 51 insertions(+)
>          create mode 100644 include/odp/drv/spec/compiler.h
>
>         diff --git a/include/odp/drv/spec/compiler.h
>         b/include/odp/drv/spec/compiler.h
>         new file mode 100644
>         index 0000000..3198d21
>         --- /dev/null
>         +++ b/include/odp/drv/spec/compiler.h
>         @@ -0,0 +1,51 @@
>         +/* Copyright (c) 2016, Linaro Limited
>         + * All rights reserved.
>         + *
>         + * SPDX-License-Identifier:     BSD-3-Clause
>         + */
>         +
>         +/**
>         + * @file
>         + *
>         + * Compiler related for ODP driver interface
>         + */
>         +
>         +#ifndef ODPDRV_COMPILER_H_
>         +#define ODPDRV_COMPILER_H_
>         +
>         +#ifdef __cplusplus
>         +extern "C" {
>         +#endif
>         +
>         +/** @addtogroup odpdrv_compiler_optim ODPDRV COMPILER /
>         OPTIMIZATION
>         + *  Macro for old compilers
>         + *  @{
>         + */
>         +
>         +/** @internal GNU compiler version */
>         +#define GCC_VERSION (__GNUC__ * 10000 \
>         +                       + __GNUC_MINOR__ * 100 \
>         +                       + __GNUC_PATCHLEVEL__)
>         +
>         +/**
>         + * @internal
>         + * Compiler __builtin_bswap16() is not available on all platforms
>         + * until GCC 4.8.0 - work around this by offering
>         __odpdrv_builtin_bswap16()
>         + * Don't use this function directly, instead see odpdrv
>         byteorder.h
>         + */
>         +#if GCC_VERSION < 40800
>         +#define __odpdrv_builtin_bswap16(u16) \
>         +  ((((u16)&0x00ff) << 8) | (((u16)&0xff00) >> 8))
>         +#else
>         +#define __odpdrv_builtin_bswap16(u16) __builtin_bswap16(u16)
>         +#endif
>         +
>         +/**
>         + * @}
>         + */
>         +
>         +#ifdef __cplusplus
>         +}
>         +#endif
>         +
>         +#endif
>         --
>         2.1.4
>
>
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/include/odp/drv/spec/compiler.h b/include/odp/drv/spec/compiler.h
new file mode 100644
index 0000000..3198d21
--- /dev/null
+++ b/include/odp/drv/spec/compiler.h
@@ -0,0 +1,51 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * Compiler related for ODP driver interface
+ */
+
+#ifndef ODPDRV_COMPILER_H_
+#define ODPDRV_COMPILER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @addtogroup odpdrv_compiler_optim ODPDRV COMPILER / OPTIMIZATION
+ *  Macro for old compilers
+ *  @{
+ */
+
+/** @internal GNU compiler version */
+#define GCC_VERSION (__GNUC__ * 10000 \
+			+ __GNUC_MINOR__ * 100 \
+			+ __GNUC_PATCHLEVEL__)
+
+/**
+ * @internal
+ * Compiler __builtin_bswap16() is not available on all platforms
+ * until GCC 4.8.0 - work around this by offering __odpdrv_builtin_bswap16()
+ * Don't use this function directly, instead see odpdrv byteorder.h
+ */
+#if GCC_VERSION < 40800
+#define __odpdrv_builtin_bswap16(u16) \
+				((((u16)&0x00ff) << 8) | (((u16)&0xff00) >> 8))
+#else
+#define __odpdrv_builtin_bswap16(u16) __builtin_bswap16(u16)
+#endif
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif