Re: [LAD] Bit shift

2019-03-16 Thread karl
Will Godfrey:
> On Wed, 13 Mar 2019 00:09:17 +0100 (CET)
> k...@aspodata.se wrote:
> 
> >Will Godfrey:
> >> Does anyone know if GCC will replace power of 2 multiplications/divisions 
> >> of
> >> unsigned integers with bit shifts?  
...
> >$ cat a.c
> >#include 
> >
> >int main(int argc, char *argv[]) {
> >  uint16_t b = argc * 2;
> >
> >  return b;
> >}
> >$ gcc -S a.c 
,,,
> >It seems it just adds the value with itself here.
...
> Thanks, that seems to hold true for a mixture of AMD and Intel machines.

BTW, testing with 4, 8 and 16 instead of 2, it does actually do bit 
shifts:

$ diff a.02.s a.04.s 
16c16
<   addl%eax, %eax
---
>   sall$2, %eax
$ diff a.02.s a.08.s 
16c16
<   addl%eax, %eax
---
>   sall$3, %eax
$ diff a.02.s a.16.s 
16c16
<   addl%eax, %eax
---
>   sall$4, %eax

Regards,
/Karl Hammar
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
https://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Bit shift

2019-03-16 Thread Will J Godfrey
On Wed, 13 Mar 2019 00:09:17 +0100 (CET)
k...@aspodata.se wrote:

>Will Godfrey:
>> Does anyone know if GCC will replace power of 2 multiplications/divisions of
>> unsigned integers with bit shifts?  
>
>Test on your system:
>
>$ cat a.c
>#include 
>
>int main(int argc, char *argv[]) {
>  uint16_t b = argc * 2;
>
>  return b;
>}
>$ gcc -S a.c 
>$ cat a.s 
>...
>main:
>.LFB0:
>.cfi_startproc
>pushq   %rbp
>.cfi_def_cfa_offset 16
>.cfi_offset 6, -16
>movq%rsp, %rbp
>.cfi_def_cfa_register 6
>movl%edi, -20(%rbp)
>movq%rsi, -32(%rbp)
>movl-20(%rbp), %eax
>addl%eax, %eax
>movw%ax, -2(%rbp)
>movzwl  -2(%rbp), %eax
>popq%rbp
>.cfi_def_cfa 7, 8
>ret
>.cfi_endproc
>...
>$
>
>It seems it just adds the value with itself here.
>
>Regards,
>/Karl Hammar

Thanks, that seems to hold true for a mixture of AMD and Intel machines.

-- 
It wasn't me! (Well actually, it probably was)

... the hard part is not dodging what life throws at you,
but trying to catch the good bits.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
https://lists.linuxaudio.org/listinfo/linux-audio-dev


[LAD] Sonoj Convention 2019 - Announcement #1 - Looking for Speakers (no papers required)

2019-03-16 Thread Sonoj Convention
Ladies and Gentlemen,

The Sonoj Convention is an annual event in Cologne, Germany about music
production with free and open source software (and hardware).

This year it will be on October the 26th and 27th 2019.

It features demonstrations, talks and hands-on workshops. Meet
like-minded people, learn insider knowledge and tricks, participate in
our one-hour production challenge! Everybody is welcome, no matter your
musical or technological background or capabilities.

Our Website:

https://sonoj.org


This is our first announcement, reaching out to our core audience. The
event is more than half a year away, but we are starting talks to find
speakers and lecturers now.

Sonoj is not a software-developers conference; instead the stereotypical
speaker is an experienced musician or producer.

If you would like to make a contribution, please send an informal and
short e-mail with your ideas to i...@sonoj.org

Here are some examples from the past years, to get an idea:

* Creating a Radio Drama with Ardour (for Beginners)
* Synthesizing electronic dance music with ZynAddSubFx
* Carla Plugin Host Feature Demonstration and Workflows
*/Making Music with Text/ - Audible Programming with Sonic Pi
/* The Realm of Too Many Options/ - Write, record, mix and actually
finish your music.
* Fantasy Game Soundtrack Production in an open source ecosystem

If you would like to participate creatively in the Sonoj Convention
please reach out to us!

(And if you just want to visit, the visitor registration is already
online as well)

I am looking forward to your answer!

Nils Hilbricht
Sonoj Convention
https://www.sonoj.org.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
https://lists.linuxaudio.org/listinfo/linux-audio-dev