Fix chacha-armv4.pl with clang -fno-integrated-as.
[oweals/openssl.git] / crypto / chacha / asm / chacha-armv4.pl
index c9083998349ce4e81c10d79f7a2492f70b9a9a9c..d3fadcc63d3338e25f0eadb41d2c6ce435410413 100755 (executable)
@@ -1,4 +1,11 @@
-#!/usr/bin/env perl
+#! /usr/bin/env perl
+# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the OpenSSL license (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
 #
 # ====================================================================
 # Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
@@ -8,7 +15,7 @@
 # ====================================================================
 #
 # December 2014
-# 
+#
 # ChaCha20 for ARMv4.
 #
 # Performance in cycles per byte out of large buffer.
@@ -165,8 +172,10 @@ $code.=<<___;
 #include "arm_arch.h"
 
 .text
-#if defined(__thumb2__)
+#if defined(__thumb2__) || defined(__clang__)
 .syntax        unified
+#endif
+#if defined(__thumb2__)
 .thumb
 #else
 .code  32
@@ -713,7 +722,7 @@ ChaCha20_neon:
        vadd.i32        $d2,$d1,$t0             @ counter+2
        str             @t[3], [sp,#4*(16+15)]
        mov             @t[3],#10
-       add             @x[12],@x[12],#3        @ counter+3 
+       add             @x[12],@x[12],#3        @ counter+3
        b               .Loop_neon
 
 .align 4
@@ -1127,7 +1136,7 @@ $code.=<<___;
        ldrb            @t[1],[r12],#1          @ read input
        subs            @t[3],@t[3],#1
        eor             @t[0],@t[0],@t[1]
-       strb            @t[0],[r14],#1          @ store ouput
+       strb            @t[0],[r14],#1          @ store output
        bne             .Loop_tail_neon
 
 .Ldone_neon: