Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1210971

Re: [RFC] fbdev/riva:change to use generice function to implement reverse_order()

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From yalin wang <yalin.wang2010@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC] fbdev/riva:change to use generice function to implement reverse_order()
Date Fri, 21 Aug 2015 09:50:01 +0200
Message-ID <pZPfj-5Az-3@gated-at.bofh.it> (permalink)
References <pVSls-3cZ-25@gated-at.bofh.it> <pZvTj-337-3@gated-at.bofh.it> <pZwml-3AQ-11@gated-at.bofh.it> <pZOjf-4fE-1@gated-at.bofh.it>
X-Original-To Tomi Valkeinen <tomi.valkeinen@ti.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WwCFt7o0pFn9E9LCqZFINJZ5NHebFhR959tyebum7tY=; b=gDyV5t70xk1vajnAzXAapgpFyKjSwaBvfWkIktm3WcGIteUp1BhYSs2sMiIixsEyBO 2vhNjgmATl/vootOup/cf7COzM25wsafGAV7S9gJ22jd3bpPdDk0wohVTso7na8cOrQM akV38Q8ldns5UYYiJC+ies1FNZZ2LOlJyWFWBpRO+0VKUYpxrCruzp45b9jJPSQaGZOy gQpY41ACo8pV7CO3lspwR5DnbiZjTRxmIN9mQuwPCxXeNp8axJPFz75fiLCZ6yA0d4xw Ky51j66pOuqWyrAlpejPet6L8WfX++n6pm+L4ZeZSSHctffOUxYcGgUfNn4fAYpBI/rq QM9Q==
X-Received by 10.70.38.101 with SMTP id f5mr14634485pdk.140.1440143219457; Fri, 21 Aug 2015 00:46:59 -0700 (PDT)
Content-Type text/plain; charset=windows-1252
MIME-Version 1.0 (Mac OS X Mail 8.2 \(2104\))
Content-Transfer-Encoding 8BIT
X-Mailer Apple Mail (2.2104)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 99
Organization linux.* mail to news gateway
X-Original-Cc adaplas@gmail.com, plagnioj@jcrosoft.com, linux-fbdev@vger.kernel.org, open list <linux-kernel@vger.kernel.org>
X-Original-Date Fri, 21 Aug 2015 15:46:50 +0800
X-Original-Message-ID <4DCC50F3-9B6D-4A3A-9693-E7A7196564A8@gmail.com>
X-Original-References <C21B8761-0447-45A6-B833-742E3B4C13DE@gmail.com> <55D5B3A9.6040901@ti.com> <867D66CD-9A3B-4536-B537-8C065C85E497@gmail.com> <55D6C812.6080400@ti.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1210971

Show key headers only | View raw


> On Aug 21, 2015, at 14:41, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> 
> 
> 
> On 20/08/15 14:30, yalin wang wrote:
>> 
>>> On Aug 20, 2015, at 19:02, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>> 
>>> 
>>> On 10/08/15 13:12, yalin wang wrote:
>>>> This change to use swab32(bitrev32()) to implement reverse_order()
>>>> function, have better performance on some platforms.
>>> 
>>> Which platforms? Presuming you tested this, roughly how much better
>>> performance? If you didn't, how do you know it's faster?
>> 
>> i investigate on arm64 platforms:
> 
> Ok. So is any arm64 platform actually using these devices? If these
> devices are mostly used by 32bit x86 platforms, optimizing them for
> arm64 doesn't make any sense.
> 
> Possibly the patches are still good for x86 also, but that needs to be
> proven.
> 
not exactly, because x86_64 don’t have hardware instruction to do rbit OP,
i compile by test :

use the patch:
  use swab32(bitrev32()):
  2775:       0f b6 d0                movzbl %al,%edx                                                                                                                                                    
  2778:       0f b6 c4                movzbl %ah,%eax
  277b:       0f b6 92 00 00 00 00    movzbl 0x0(%rdx),%edx
  2782:       0f b6 80 00 00 00 00    movzbl 0x0(%rax),%eax
  2789:       c1 e2 08                shl    $0x8,%edx
  278c:       09 d0                   or     %edx,%eax
  278e:       0f b6 d5                movzbl %ch,%edx
  2791:       0f b6 c9                movzbl %cl,%ecx
  2794:       0f b6 89 00 00 00 00    movzbl 0x0(%rcx),%ecx
  279b:       0f b6 92 00 00 00 00    movzbl 0x0(%rdx),%edx
  27a2:       0f b7 c0                movzwl %ax,%eax
  27a5:       c1 e1 08                shl    $0x8,%ecx
  27a8:       09 ca                   or     %ecx,%edx
  27aa:       c1 e2 10                shl    $0x10,%edx
  27ad:       09 d0                   or     %edx,%eax
  27af:       45 85 ff                test   %r15d,%r15d
  27b2:       0f c8                   bswap  %eax
4 memory access instructions,



without the patch:
use
do {                            \
-       u8 *a = (u8 *)(l);      \
-       a[0] = bitrev8(a[0]);   \
-       a[1] = bitrev8(a[1]);   \
-       a[2] = bitrev8(a[2]);   \
-       a[3] = bitrev8(a[3]);   \
-} while(0)



    277b:       45 0f b6 80 00 00 00    movzbl 0x0(%r8),%r8d
    2782:       00 
    2783:       c1 ee 10                shr    $0x10,%esi
    2786:       89 f2                   mov    %esi,%edx
    2788:       0f b6 f4                movzbl %ah,%esi
    278b:       c1 e8 18                shr    $0x18,%eax
    278e:       0f b6 d2                movzbl %dl,%edx
    2791:       48 98                   cltq   
    2793:       45 85 ed                test   %r13d,%r13d
    2796:       0f b6 92 00 00 00 00    movzbl 0x0(%rdx),%edx
    279d:       0f b6 80 00 00 00 00    movzbl 0x0(%rax),%eax
    27a4:       44 88 85 54 ff ff ff    mov    %r8b,-0xac(%rbp)
    27ab:       44 0f b6 86 00 00 00    movzbl 0x0(%rsi),%r8d
    27b2:       00 
    27b3:       88 95 56 ff ff ff       mov    %dl,-0xaa(%rbp)
    27b9:       88 85 57 ff ff ff       mov    %al,-0xa9(%rbp)
    27bf:       44 88 85 55 ff ff ff    mov    %r8b,-0xab(%rbp)

6 memory access instructions, and generate more code that the patch .

because the original code use byte access 4 times , i don’t
think have better performance. :)

Thanks






--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [RFC] fbdev/riva:change to use generice function to implement   reverse_order() Tomi Valkeinen <tomi.valkeinen@ti.com> - 2015-08-20 13:10 +0200
  Re: [RFC] fbdev/riva:change to use generice function to implement reverse_order() yalin wang <yalin.wang2010@gmail.com> - 2015-08-20 13:40 +0200
    Re: [RFC] fbdev/riva:change to use generice function to implement  reverse_order() Tomi Valkeinen <tomi.valkeinen@ti.com> - 2015-08-21 08:50 +0200
      Re: [RFC] fbdev/riva:change to use generice function to implement reverse_order() yalin wang <yalin.wang2010@gmail.com> - 2015-08-21 09:50 +0200
        Re: [RFC] fbdev/riva:change to use generice function to implement  reverse_order() Tomi Valkeinen <tomi.valkeinen@ti.com> - 2015-08-21 10:10 +0200
          Re: [RFC] fbdev/riva:change to use generice function to implement  reverse_order() Afzal Mohammed <afzal.mohd.ma@gmail.com> - 2015-08-22 10:00 +0200
            Re: [RFC] fbdev/riva:change to use generice function to implement reverse_order() yalin wang <yalin.wang2010@gmail.com> - 2015-08-24 10:40 +0200
              Re: [RFC] fbdev/riva:change to use generice function to implement  reverse_order() Afzal Mohammed <afzal.mohd.ma@gmail.com> - 2015-08-24 15:50 +0200

csiph-web