From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21074 invoked by alias); 20 Jul 2010 07:59:03 -0000 Received: (qmail 21032 invoked by uid 48); 20 Jul 2010 07:58:46 -0000 Date: Tue, 20 Jul 2010 07:59:00 -0000 Subject: [Bug target/44999] New: "and r0, r0, #255" can be replace with uxtb in thumb2 X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "carrot at google dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg02004.txt.bz2 Compile the following code with options -march=armv7-a -mthumb -Os int tp(int x, int y) { return (x & 0xff) - (y & 0xffff); } GCC generates: uxth r1, r1 and r0, r0, #255 //A subs r0, r0, r1 bx lr Instruction A is 32 bit, it can be replace by uxtb, a 16 bit equivalent instruction. A possible implementation is to call gen_thumb2_zero_extendqisi2_v6 in pattern (define_expand "andsi3"). -- Summary: "and r0, r0, #255" can be replace with uxtb in thumb2 Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: carrot at google dot com GCC build triplet: i686-linux GCC host triplet: i686-linux GCC target triplet: arm-eabi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44999