This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
more on 17107
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: gcc <gcc at gcc dot gnu dot org>, David Edelsohn <dje at watson dot ibm dot com>
- Date: Wed, 17 Nov 2004 15:44:16 +0000
- Subject: more on 17107
- Organization: Codesourcery LLC
Here is an example of the sCOND expanders being inconsistent.
Signed greater-than generates a branch sequence (because the sgt expander
is disabled on non-power arches). Unsigned greater-than generates an
extraction from the CCR (because the sgtu expander is not disabled).
One of these sequences, with the appropriate comparision instruction, must
be better for *both* signed and unsigned greater than -- which one is it?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
int sge (int i)
{
return i >= 55;
}
unsigned sgeu (unsigned i)
{
return i >= 55;
}
.file "17107-a.i"
.section ".text"
.align 2
.align 4
.globl sge
.section ".opd","aw"
.align 3
sge:
.quad .sge,.TOC.@tocbase,0
.previous
.size sge,24
.type .sge,@function
.globl .sge
.sge:
cmpwi 7,3,54
li 3,1
bgt 7,.L2
li 3,0
.L2:
extsw 3,3
blr
.long 0
.byte 0,0,0,0,0,0,0,0
.size .sge,.-.sge
.align 2
.align 4
.globl sgeu
.section ".opd","aw"
.align 3
sgeu:
.quad .sgeu,.TOC.@tocbase,0
.previous
.size sgeu,24
.type .sgeu,@function
.globl .sgeu
.sgeu:
cmplwi 7,3,54
mfcr 3
rlwinm 3,3,30,1
blr
.long 0
.byte 0,0,0,0,0,0,0,0
.size .sgeu,.-.sgeu
.ident "GCC: (GNU) 4.0.0 20041111 (experimental)"
.section .note.GNU-stack,"",@progbits