[vlc-commits] arm: make the assembler functions compatible with non ELF/gas platforms

2018-02-20 Thread Janne Grunau
vlc/vlc-3.0 | branch: master | Janne Grunau  | Mon Feb 19 
00:47:53 2018 +0100| [38fd7515e108dddaa36c3fdc5ec0577209fca9cb] | committer: 
Thomas Guillem

arm: make the assembler functions compatible with non ELF/gas platforms

Allow assembling arm neon functions for IOS and arm windows.

Signed-off-by: Martin Storsjö 
(cherry picked from commit ec4d9649d1c03fe8f578db38b41dccdf5e11b005)
Signed-off-by: Thomas Guillem 

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=38fd7515e108dddaa36c3fdc5ec0577209fca9cb
---

 modules/arm_neon/amplify.S |  8 --
 modules/arm_neon/asm.S | 39 ++
 modules/arm_neon/deinterleave_chroma.S | 10 ---
 modules/arm_neon/i420_rgb.S| 10 ---
 modules/arm_neon/i420_rv16.S   | 10 ---
 modules/arm_neon/i420_yuyv.S   | 14 -
 modules/arm_neon/i422_yuyv.S   | 14 -
 modules/arm_neon/nv12_rgb.S| 10 ---
 modules/arm_neon/nv21_rgb.S| 10 ---
 modules/arm_neon/simple_channel_mixer.S| 38 +
 modules/arm_neon/yuyv_i422.S   | 14 -
 modules/video_filter/deinterlace/merge_arm.S   | 22 +++
 modules/video_filter/deinterlace/merge_arm64.S | 10 +++
 13 files changed, 122 insertions(+), 87 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commitdiff;h=38fd7515e108dddaa36c3fdc5ec0577209fca9cb
___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] arm: make the assembler functions compatible with non ELF/gas platforms

2018-02-19 Thread Janne Grunau
vlc | branch: master | Janne Grunau  | Mon Feb 19 
00:47:53 2018 +0100| [ec4d9649d1c03fe8f578db38b41dccdf5e11b005] | committer: 
Martin Storsjö

arm: make the assembler functions compatible with non ELF/gas platforms

Allow assembling arm neon functions for IOS and arm windows.

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ec4d9649d1c03fe8f578db38b41dccdf5e11b005
---

 modules/arm_neon/amplify.S |  8 --
 modules/arm_neon/asm.S | 39 ++
 modules/arm_neon/deinterleave_chroma.S | 10 ---
 modules/arm_neon/i420_rgb.S| 10 ---
 modules/arm_neon/i420_rv16.S   | 10 ---
 modules/arm_neon/i420_yuyv.S   | 14 -
 modules/arm_neon/i422_yuyv.S   | 14 -
 modules/arm_neon/nv12_rgb.S| 10 ---
 modules/arm_neon/nv21_rgb.S| 10 ---
 modules/arm_neon/simple_channel_mixer.S| 38 +
 modules/arm_neon/yuyv_i422.S   | 14 -
 modules/video_filter/deinterlace/merge_arm.S   | 22 +++
 modules/video_filter/deinterlace/merge_arm64.S | 10 +++
 13 files changed, 122 insertions(+), 87 deletions(-)

diff --git a/modules/arm_neon/amplify.S b/modules/arm_neon/amplify.S
index 5938118378..9e655afe16 100644
--- a/modules/arm_neon/amplify.S
+++ b/modules/arm_neon/amplify.S
@@ -18,18 +18,20 @@
  @ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  @/
 
+#include "asm.S"
+
.syntax unified
.arm
+#if HAVE_AS_FPU_DIRECTIVE
.fpuneon
+#endif
.text
 
 #defineDST r0
 #defineSRC r1
 #defineSIZEr2
.align 2
-   .global amplify_float_arm_neon
-   .type   amplify_float_arm_neon, %function
-amplify_float_arm_neon:
+function amplify_float_arm_neon
cmp SIZE,   #0
bxeqlr
 #ifdef __ARM_PCS
diff --git a/modules/arm_neon/asm.S b/modules/arm_neon/asm.S
new file mode 100644
index 00..728391ea37
--- /dev/null
+++ b/modules/arm_neon/asm.S
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018 Janne Grunau 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef __APPLE__
+#   define EXTERN_ASM _
+#else
+#   define EXTERN_ASM
+#endif
+
+#if defined(__APPLE__) || defined(_WIN32)
+#   define HAVE_AS_ARCH_DIRECTIVE 0
+#   define HAVE_AS_FPU_DIRECTIVE  0
+#else
+#   define HAVE_AS_ARCH_DIRECTIVE 1
+#   define HAVE_AS_FPU_DIRECTIVE  1
+#endif
+
+.macro  function name
+   .globl  EXTERN_ASM\name
+#ifdef __ELF__
+   .type   EXTERN_ASM\name, %function
+#endif
+EXTERN_ASM\name:
+.endm
diff --git a/modules/arm_neon/deinterleave_chroma.S 
b/modules/arm_neon/deinterleave_chroma.S
index 019d647ed6..9cd01c7aed 100644
--- a/modules/arm_neon/deinterleave_chroma.S
+++ b/modules/arm_neon/deinterleave_chroma.S
@@ -19,8 +19,12 @@
  @ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  @/
 
+#include "asm.S"
+
.syntax unified
-   .fpu neon
+#if HAVE_AS_FPU_DIRECTIVE
+   .fpuneon
+#endif
.text
 
 #define UV r0
@@ -35,9 +39,7 @@
 #define OPAD   lr
 
.align 2
-   .global deinterleave_chroma_neon
-   .type   deinterleave_chroma_neon, %function
-deinterleave_chroma_neon:
+function deinterleave_chroma_neon
push{r4-r6,lr}
ldmia   r0, {U, V, OPITCH}
ldmia   r1, {UV, IPITCH}
diff --git a/modules/arm_neon/i420_rgb.S b/modules/arm_neon/i420_rgb.S
index a512b5f0b2..54fb38746e 100644
--- a/modules/arm_neon/i420_rgb.S
+++ b/modules/arm_neon/i420_rgb.S
@@ -19,8 +19,12 @@
  @ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  @/
 
+#include "asm.S"
+
.syntax unified
-   .fpu neon
+#if HAVE_AS_FPU_DIRECTIVE
+   .fpuneon
+#endif
.text
 
 /* ARM */
@@ -80,9 +84,7 @@ coefficients:

[vlc-commits] arm: make the assembler functions compatible with non ELF/gas platforms

2018-02-19 Thread Janne Grunau
vlc | branch: master | Janne Grunau  | Mon Feb 19 
00:47:53 2018 +0100| [85b89f35bdd5799436ea51086c7a38f1f4b3f451] | committer: 
Martin Storsjö

arm: make the assembler functions compatible with non ELF/gas platforms

Allow assembling arm neon functions for IOS and arm windows.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=85b89f35bdd5799436ea51086c7a38f1f4b3f451
---

 modules/arm_neon/amplify.S |  8 --
 modules/arm_neon/asm.S | 39 ++
 modules/arm_neon/deinterleave_chroma.S | 10 ---
 modules/arm_neon/i420_rgb.S| 10 ---
 modules/arm_neon/i420_rv16.S   | 10 ---
 modules/arm_neon/i420_yuyv.S   | 14 -
 modules/arm_neon/i422_yuyv.S   | 14 -
 modules/arm_neon/nv12_rgb.S| 10 ---
 modules/arm_neon/nv21_rgb.S| 10 ---
 modules/arm_neon/simple_channel_mixer.S| 38 +
 modules/arm_neon/yuyv_i422.S   | 14 -
 modules/video_filter/deinterlace/merge_arm.S   | 22 +++
 modules/video_filter/deinterlace/merge_arm64.S | 10 +++
 13 files changed, 122 insertions(+), 87 deletions(-)

diff --git a/modules/arm_neon/amplify.S b/modules/arm_neon/amplify.S
index 5938118378..9e655afe16 100644
--- a/modules/arm_neon/amplify.S
+++ b/modules/arm_neon/amplify.S
@@ -18,18 +18,20 @@
  @ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  @/
 
+#include "asm.S"
+
.syntax unified
.arm
+#if HAVE_AS_FPU_DIRECTIVE
.fpuneon
+#endif
.text
 
 #defineDST r0
 #defineSRC r1
 #defineSIZEr2
.align 2
-   .global amplify_float_arm_neon
-   .type   amplify_float_arm_neon, %function
-amplify_float_arm_neon:
+function amplify_float_arm_neon
cmp SIZE,   #0
bxeqlr
 #ifdef __ARM_PCS
diff --git a/modules/arm_neon/asm.S b/modules/arm_neon/asm.S
new file mode 100644
index 00..728391ea37
--- /dev/null
+++ b/modules/arm_neon/asm.S
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018 Janne Grunau 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef __APPLE__
+#   define EXTERN_ASM _
+#else
+#   define EXTERN_ASM
+#endif
+
+#if defined(__APPLE__) || defined(_WIN32)
+#   define HAVE_AS_ARCH_DIRECTIVE 0
+#   define HAVE_AS_FPU_DIRECTIVE  0
+#else
+#   define HAVE_AS_ARCH_DIRECTIVE 1
+#   define HAVE_AS_FPU_DIRECTIVE  1
+#endif
+
+.macro  function name
+   .globl  EXTERN_ASM\name
+#ifdef __ELF__
+   .type   EXTERN_ASM\name, %function
+#endif
+EXTERN_ASM\name:
+.endm
diff --git a/modules/arm_neon/deinterleave_chroma.S 
b/modules/arm_neon/deinterleave_chroma.S
index 019d647ed6..9cd01c7aed 100644
--- a/modules/arm_neon/deinterleave_chroma.S
+++ b/modules/arm_neon/deinterleave_chroma.S
@@ -19,8 +19,12 @@
  @ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  @/
 
+#include "asm.S"
+
.syntax unified
-   .fpu neon
+#if HAVE_AS_FPU_DIRECTIVE
+   .fpuneon
+#endif
.text
 
 #define UV r0
@@ -35,9 +39,7 @@
 #define OPAD   lr
 
.align 2
-   .global deinterleave_chroma_neon
-   .type   deinterleave_chroma_neon, %function
-deinterleave_chroma_neon:
+function deinterleave_chroma_neon
push{r4-r6,lr}
ldmia   r0, {U, V, OPITCH}
ldmia   r1, {UV, IPITCH}
diff --git a/modules/arm_neon/i420_rgb.S b/modules/arm_neon/i420_rgb.S
index a512b5f0b2..54fb38746e 100644
--- a/modules/arm_neon/i420_rgb.S
+++ b/modules/arm_neon/i420_rgb.S
@@ -19,8 +19,12 @@
  @ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  @/
 
+#include "asm.S"
+
.syntax unified
-   .fpu neon
+#if HAVE_AS_FPU_DIRECTIVE
+   .fpuneon
+#endif
.text
 
 /* ARM */
@@ -80,9 +84,7 @@ coefficients:
 .short  -18432
 
.align 2
-