[Pixman] [PATCH] SIMD: Try without any CFLAGS before forcing -mcpu=

Siarhei Siamashka siarhei.siamashka at gmail.com
Fri Mar 19 06:07:24 PDT 2010

On Friday 19 March 2010, Martin Jansa wrote:
> After this patch is SIMD enabled on my armv4t (samsung s3c2442) with
> -mthumb in CC by default, it never was before and I'm not sure it's
> intentional now as it fails in runtime on SIGILL.
> Environment:
> OpenEmbedded builg
> gcc-4.4.3
> binutils-2.20
> run env from http://pastebin.ca/1845506


> Program received signal SIGILL, Illegal instruction.
> 0x401af86a in pixman_transform_init_identity () from
> /usr/lib/libpixman-1.so.0 (gdb) disass 0x401af85a 0x401af87a
> Dump of assembler code from 0x401af85a to 0x401af87a:
> 0x401af85a <pixman_transform_scale+130>:        lsls    r0, r0, #0
> 0x401af85c <pixman_transform_scale+132>:        lsls    r1, r0, #0
> 0x401af85e <pixman_transform_scale+134>:        lsls    r0, r0, #0
> 0x401af860 <pixman_transform_init_identity+0>:  push    {r4, lr}
> 0x401af862 <pixman_transform_init_identity+2>:  movs    r1, #0
> 0x401af864 <pixman_transform_init_identity+4>:  movs    r2, #36 ; 0x24
> 0x401af866 <pixman_transform_init_identity+6>:  adds    r4, r0, #0
> 0x401af868 <pixman_transform_init_identity+8>:  blx     0x401868d0

OK, this "blx" in the above line is the instruction causing problems, and the
corresponding line from objdump output is the following:
    2c868:       f7d7 e832       blx     38d0 <_init+0xd8>

The value of PC register (0x401af86a) points in the middle of this
instruction. According to ARM Architecture Reference Manual, this form
of instruction is not supported on armv4t and it was introduced in

> 0x401af86c <pixman_transform_init_identity+12>: movs    r0, #128        ;
> 0x80 0x401af86e <pixman_transform_init_identity+14>: lsls    r3, r0, #9
> 0x401af870 <pixman_transform_init_identity+16>: str     r3, [r4, #0]
> 0x401af872 <pixman_transform_init_identity+18>: str     r3, [r4, #16]
> 0x401af874 <pixman_transform_init_identity+20>: str     r3, [r4, #32]
> 0x401af876 <pixman_transform_init_identity+22>: pop     {r4}
> 0x401af878 <pixman_transform_init_identity+24>: pop     {r0}


> When linked with binutils-2.19 (as suggested on #ubuntu-arm) it fails the
> same.
> For now I'll use --disable-arm-simd, but let me know how can I help
> debugging/testing simd code, or if it's only usefull with -mno-thumb, then
> how to modify configure.ac to respect -mthumb from CC (not only from
> CFLAGS) if possible.

The whole issue is very strange. This 'pixman_transform_init_identity'
function is defined in 'pixman-matrix.c' file. The compiler seems to generate
a call to 'memset' using the variant of 'blx' instruction which is invalid for
armv4t compatible processors.

I have no idea how this all could be related to the presence of absence
of arm-simd support. For me gcc-4.4.3 generates the following thumb code
for 'pixman_transform_init_identity' function when targeting armv4t
(support for arm-simd is also enabled):

00000f90 <pixman_transform_init_identity>:
 f90:   b510            push    {r4, lr}
 f92:   2100            movs    r1, #0
 f94:   2224            movs    r2, #36
 f96:   1c04            adds    r4, r0, #0
 f98:   f7ff fffe       bl      0 <memset>
 f9c:   2080            movs    r0, #128
 f9e:   0243            lsls    r3, r0, #9
 fa0:   6023            str     r3, [r4, #0]
 fa2:   6123            str     r3, [r4, #16]
 fa4:   6223            str     r3, [r4, #32]
 fa6:   bc10            pop     {r4}
 fa8:   bc01            pop     {r0}
 faa:   4700            bx      r0

Please check the precise options which are passed to the compiler when
compiling 'pixman-matrix.c' source file.

Best regards,
Siarhei Siamashka

More information about the Pixman mailing list