Merge lp:~uweigand/gcc-linaro/neon-extendsidi-4.7 into lp:gcc-linaro/4.7

Proposed by Andrew Stubbs
Status: Superseded
Proposed branch: lp:~uweigand/gcc-linaro/neon-extendsidi-4.7
Merge into: lp:gcc-linaro/4.7
To merge this branch: bzr merge lp:~uweigand/gcc-linaro/neon-extendsidi-4.7
Reviewer Review Type Date Requested Status
Michael Hope Needs Fixing
Andrew Stubbs Pending
Review via email: mp+100812@code.launchpad.net

This proposal supersedes a proposal from 2012-03-27.

This proposal has been superseded by a proposal from 2012-04-11.

Description of the change

Better optimize SI->DI extends that move from core to NEON registers.

Patch posted upstream here:
http://gcc.gnu.org/ml/gcc-patches/2012-02/msg01213.html

UPDATE 20120327: the shifts patch should be fixed now. This patch needs that patch as prerequisite.

UPDATE 20120404: fixed misapplied patch.

To post a comment you must log in.
Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal

cbuild has taken a snapshot of this branch at r114970 and queued it for build.

The diff against the ancestor r114969 is available at:
 http://builds.linaro.org/toolchain/snapshots/gcc-linaro-4.7+bzr114970~ams-codesourcery~neon-extendsidi-4.7.diff

and will be built on the following builders:
 a9-builder armv5-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.7+bzr114970~ams-codesourcery~neon-extendsidi-4.7
cbuild-ancestor: lp:gcc-linaro/4.7+bzr114969
cbuild-state: check

Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal

cbuild had trouble building this on armv7l-natty-cbuild259-tcpanda02-cortexa9r1.

See the *failed.txt logs under the build results at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114970~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild259-tcpanda02-cortexa9r1

The test suite results were not checked.

cbuild-checked: armv7l-natty-cbuild259-tcpanda02-cortexa9r1

review: Needs Fixing
Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal
Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote : Posted in a previous version of this proposal

I forgot that this patch depends on the neon-shifts patch! I'll resubmit when that one works.

review: Needs Fixing
Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal

cbuild successfully built this on armv7l-natty-cbuild259-tcpanda03-armv5r2.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114970~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild259-tcpanda03-armv5r2

-PASS: gcc.dg/vect/vect-cond-7.c (test for excess errors)
-PASS: gcc.dg/vect/vect-cond-7.c -flto (test for excess errors)
-PASS: gcc.dg/vect/vect-cond-7.c -flto execution test
-PASS: gcc.dg/vect/vect-cond-7.c execution test
+FAIL: gcc.dg/vect/vect-cond-7.c (internal compiler error)
+FAIL: gcc.dg/vect/vect-cond-7.c (test for excess errors)
+FAIL: gcc.dg/vect/vect-cond-7.c -flto (internal compiler error)
+FAIL: gcc.dg/vect/vect-cond-7.c -flto (test for excess errors)
+UNRESOLVED: gcc.dg/vect/vect-cond-7.c -flto compilation failed to produce executable
+UNRESOLVED: gcc.dg/vect/vect-cond-7.c compilation failed to produce executable
+FAIL: gcc.target/arm/neon-extend-1.c (internal compiler error)
+FAIL: gcc.target/arm/neon-extend-1.c (test for excess errors)
+UNRESOLVED: gcc.target/arm/neon-extend-1.c scan-assembler vdup.32
+UNRESOLVED: gcc.target/arm/neon-extend-1.c scan-assembler vshr.u64
+FAIL: gcc.target/arm/neon-extend-2.c (internal compiler error)
+FAIL: gcc.target/arm/neon-extend-2.c (test for excess errors)
+UNRESOLVED: gcc.target/arm/neon-extend-2.c scan-assembler vdup.32
+UNRESOLVED: gcc.target/arm/neon-extend-2.c scan-assembler vshr.s64

The full diff is at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114970~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild259-tcpanda03-armv5r2/testsuite-diff.txt

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114970~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild259-tcpanda03-armv5r2/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild259-tcpanda03-armv5r2

Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal
Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal

cbuild has taken a snapshot of this branch at r114971 and queued it for build.

The diff against the ancestor r114969 is available at:
 http://builds.linaro.org/toolchain/snapshots/gcc-linaro-4.7+bzr114971~ams-codesourcery~neon-extendsidi-4.7.diff

and will be built on the following builders:
 a9-builder armv5-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.7+bzr114971~ams-codesourcery~neon-extendsidi-4.7
cbuild-ancestor: lp:gcc-linaro/4.7+bzr114969
cbuild-state: check

Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal
Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal

cbuild had trouble building this on armv7l-natty-cbuild280-tcpanda05-cortexa9r1.

See the *failed.txt logs under the build results at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114971~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild280-tcpanda05-cortexa9r1

The test suite results were not checked.

cbuild-checked: armv7l-natty-cbuild280-tcpanda05-cortexa9r1

review: Needs Fixing
Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal

cbuild successfully built this on armv7l-natty-cbuild280-tcpanda05-armv5r2.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114971~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild280-tcpanda05-armv5r2

+PASS: gcc.target/arm/neon-extend-1.c (test for excess errors)
+PASS: gcc.target/arm/neon-extend-1.c scan-assembler vdup.32
+PASS: gcc.target/arm/neon-extend-1.c scan-assembler vshr.u64
+PASS: gcc.target/arm/neon-extend-2.c (test for excess errors)
+PASS: gcc.target/arm/neon-extend-2.c scan-assembler vdup.32
+PASS: gcc.target/arm/neon-extend-2.c scan-assembler vshr.s64
+UNSUPPORTED: gcc.target/arm/thumb-16bit-ops.c
+UNSUPPORTED: gcc.target/arm/thumb-ifcvt.c

The full diff is at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114971~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild280-tcpanda05-armv5r2/testsuite-diff.txt

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114971~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild280-tcpanda05-armv5r2/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild280-tcpanda05-armv5r2

Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal
Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal

This seems to also include the 16 bit instructions patch:

+UNSUPPORTED: gcc.target/arm/thumb-16bit-ops.c
+UNSUPPORTED: gcc.target/arm/thumb-ifcvt.c

2012-03-08 Andrew Stubbs <email address hidden>

Revision history for this message
Michael Hope (michaelh1) wrote : Posted in a previous version of this proposal

The Cortex-A9 build fails with a split ICE:

../../../../gcc-linaro-4.7/libgcc/fixed-bit.c: In function '__gnu_satfractqqdq2':
../../../../gcc-linaro-4.7/libgcc/fixed-bit.c:873:1: error: could not split insn
(insn:TI 25 192 193 4 (set (reg/v:DI 95 d16 [orig:137 utemp ] [137])
        (sign_extend:DI (reg:QI 0 r0 [orig:135 D.8823 ] [135]))) ../../../../gcc-linaro-4.7/libgcc/fixed-bit.c:803 156 {extendqidi2}
     (nil))
../../../../gcc-linaro-4.7/libgcc/fixed-bit.c:873:1: internal compiler error: in final_scan_insn, at final.c:2716

review: Disapprove
Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote : Posted in a previous version of this proposal

This patch depends on the 16-bit instructions patch (or more accurately, it depends on the neon-shifts patch, which in turn depends on the 16-bit instruction patch), hence the presence of the test cases.

The build failure is surprising. I saw that failure myself, and fixed it already, so I don't know why it's recurred. Maybe I misapplied the patch?

Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote : Posted in a previous version of this proposal

Yeah, I misapplied the patch update. Somehow the QI->DI and HI->DI extends are missing.

I've updated the branch now, but I'll wait until the neon-shifts patch is working before resubmitting this for more testing.

review: Needs Fixing
Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote : Posted in a previous version of this proposal

Neon shifts appears good, after all. I'll resubmit this now.

Revision history for this message
Michael Hope (michaelh1) wrote :

cbuild has taken a snapshot of this branch at r114972 and queued it for build.

The diff against the ancestor r114969 is available at:
 http://builds.linaro.org/toolchain/snapshots/gcc-linaro-4.7+bzr114972~ams-codesourcery~neon-extendsidi-4.7.diff

and will be built on the following builders:
 a9-builder armv5-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.7+bzr114972~ams-codesourcery~neon-extendsidi-4.7
cbuild-ancestor: lp:gcc-linaro+bzr114969
cbuild-state: check

Revision history for this message
Michael Hope (michaelh1) wrote :
Revision history for this message
Michael Hope (michaelh1) wrote :
Revision history for this message
Michael Hope (michaelh1) wrote :
Revision history for this message
Michael Hope (michaelh1) wrote :

cbuild had trouble building this on armv7l-natty-cbuild286-ursa3-cortexa9r1.

See the *failed.txt logs under the build results at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114972~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild286-ursa3-cortexa9r1

The test suite results were not checked.

cbuild-checked: armv7l-natty-cbuild286-ursa3-cortexa9r1

review: Needs Fixing
Revision history for this message
Michael Hope (michaelh1) wrote :

cbuild successfully built this on armv7l-natty-cbuild286-ursa4-armv5r2.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114972~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild286-ursa4-armv5r2

+PASS: gcc.target/arm/neon-extend-1.c (test for excess errors)
+PASS: gcc.target/arm/neon-extend-1.c scan-assembler vdup.32
+PASS: gcc.target/arm/neon-extend-1.c scan-assembler vshr.u64
+PASS: gcc.target/arm/neon-extend-2.c (test for excess errors)
+PASS: gcc.target/arm/neon-extend-2.c scan-assembler vdup.32
+PASS: gcc.target/arm/neon-extend-2.c scan-assembler vshr.s64
+UNSUPPORTED: gcc.target/arm/thumb-16bit-ops.c
+UNSUPPORTED: gcc.target/arm/thumb-ifcvt.c

The full diff is at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114972~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild286-ursa4-armv5r2/testsuite-diff.txt

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.7+bzr114972~ams-codesourcery~neon-extendsidi-4.7/logs/armv7l-natty-cbuild286-ursa4-armv5r2/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild286-ursa4-armv5r2

Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote :

The build failure is this:

../../../../gcc-linaro-4.7/libgfortran/io/write.c: In function 'extract_int':
../../../../gcc-linaro-4.7/libgfortran/io/write.c:466:1: error: insn does not satisfy its constraints:
(insn 20 19 21 4 (set (reg/v:DI 2 r2 [orig:134 i ] [134])
        (sign_extend:DI (mem:QI (reg:SI 3 r3) [0 MEM[(char * {ref-all})p_4(D)]+0 S1 A8]))) ../../../../gcc-linaro-4.7/libgfortran/io/write.c:428 156 {extendqidi2}
     (nil))
../../../../gcc-linaro-4.7/libgfortran/io/write.c:466:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:403
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

This appears to be caused by a latent bug: the extendqidi2 pattern (actually "extend<mode>di2") has a predicate that allows memory loads in both ARM and Thumb modes, but the constraints only permit mems in ARM mode. Presumably this hasn't been a problem before because a) when optimizing the pattern has always been split before register allocation (i.e. before the constraints really mean anything), and b) when not optimizing it's too stupid to do load and extend in one insn.

It didn't show up in my own test builds. This might be because I have a slightly different baseline, or it might be because I wasn't building fortran.

I can fix this by adding a proper alternative for thumb mode, I expect.

Subscribers

People subscribed via source and target branches