From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 75C7F389042B; Thu, 4 Jun 2020 20:18:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75C7F389042B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591301900; bh=W5IPKnTSRuOGHEakOkxLPvFQJIebMiICyBUj2OXYZv4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HDP8wzVqY5+F3fCrt1unEyJ0siq8QO1YoMDPWSwnrAn/ld9XphDuRf9pQi5DCavho VOIDBJQl0iAx5FuZ9O3iiI3MjwY6y4HnnW78bIcllBskXWbg8jieOFJW4oP82Kj+RZ 9kt/Vf7+UfWEcJlQzoqGt/MUZ5gR4wlFOIHxeMzI= From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/68837] PowerPC switch statement performance Date: Thu, 04 Jun 2020 20:18:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: segher at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2020 20:18:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D68837 --- Comment #4 from Segher Boessenkool --- On Power9 the lwa insn is cracked into an lwz and an extsw, just like on older CPUs. Cracked instructions have fewer constraints on p9 than they did on most older CPUs though (it doesn't have to be first in a fetch group any more). It still saves one insn to execute if lwz would be enough. Another option may be to just do an ld even: this saves the number of insns needed, but it takes more space for the table (so it won't be cached / prefetched as well), and absolute addresses require relocations.=