From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2195 invoked by alias); 12 Apr 2011 14:01:29 -0000 Received: (qmail 2183 invoked by uid 22791); 12 Apr 2011 14:01:27 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ey0-f175.google.com (HELO mail-ey0-f175.google.com) (209.85.215.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Apr 2011 14:01:19 +0000 Received: by eye27 with SMTP id 27so2159469eye.20 for ; Tue, 12 Apr 2011 07:01:18 -0700 (PDT) Received: by 10.216.72.20 with SMTP id s20mr6042496wed.80.1302616878427; Tue, 12 Apr 2011 07:01:18 -0700 (PDT) Received: from richards-thinkpad (gbibp9ph1--blueice2n1.emea.ibm.com [195.212.29.75]) by mx.google.com with ESMTPS id d54sm3200775wej.10.2011.04.12.07.01.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Apr 2011 07:01:17 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org,patches@linaro.org, richard.sandiford@linaro.org Cc: patches@linaro.org Subject: [6/9] NEON vec_load_lanes and vec_store_lanes patterns References: Date: Tue, 12 Apr 2011 14:01:00 -0000 In-Reply-To: (Richard Sandiford's message of "Tue, 12 Apr 2011 14:20:54 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg00882.txt.bz2 This patch adds vec_load_lanes and vec_store_lanes patterns for NEON. They feed directly into the corresponding intrinsic patterns. Tested on x86_64-linux-gnu and arm-linux-gnueabi. OK to install? Richard gcc/ * config/arm/neon.md (vec_load_lanes): New expanders, (vec_store_lanes): Likewise. Index: gcc/config/arm/neon.md =================================================================== --- gcc/config/arm/neon.md 2011-04-12 11:54:04.000000000 +0100 +++ gcc/config/arm/neon.md 2011-04-12 11:55:11.000000000 +0100 @@ -4258,6 +4258,12 @@ (define_expand "neon_vreinterpretv2di" + [(set (match_operand:VDQX 0 "s_register_operand") + (unspec:VDQX [(match_operand:VDQX 1 "neon_struct_operand")] + UNSPEC_VLD1))] + "TARGET_NEON") + (define_insn "neon_vld1" [(set (match_operand:VDQX 0 "s_register_operand" "=w") (unspec:VDQX [(match_operand:VDQX 1 "neon_struct_operand" "Um")] @@ -4355,6 +4361,12 @@ (define_insn "neon_vld1_dup" (const_string "neon_vld1_1_2_regs")))] ) +(define_expand "vec_store_lanes" + [(set (match_operand:VDQX 0 "neon_struct_operand") + (unspec:VDQX [(match_operand:VDQX 1 "s_register_operand")] + UNSPEC_VST1))] + "TARGET_NEON") + (define_insn "neon_vst1" [(set (match_operand:VDQX 0 "neon_struct_operand" "=Um") (unspec:VDQX [(match_operand:VDQX 1 "s_register_operand" "w")] @@ -4411,6 +4423,13 @@ (define_insn "neon_vst1_lane" [(set_attr "neon_type" "neon_vst1_vst2_lane")] ) +(define_expand "vec_load_lanesti" + [(set (match_operand:TI 0 "s_register_operand") + (unspec:TI [(match_operand:TI 1 "neon_struct_operand") + (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + UNSPEC_VLD2))] + "TARGET_NEON") + (define_insn "neon_vld2" [(set (match_operand:TI 0 "s_register_operand" "=w") (unspec:TI [(match_operand:TI 1 "neon_struct_operand" "Um") @@ -4429,6 +4448,13 @@ (define_insn "neon_vld2" (const_string "neon_vld2_2_regs_vld1_vld2_all_lanes")))] ) +(define_expand "vec_load_lanesoi" + [(set (match_operand:OI 0 "s_register_operand") + (unspec:OI [(match_operand:OI 1 "neon_struct_operand") + (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + UNSPEC_VLD2))] + "TARGET_NEON") + (define_insn "neon_vld2" [(set (match_operand:OI 0 "s_register_operand" "=w") (unspec:OI [(match_operand:OI 1 "neon_struct_operand" "Um") @@ -4511,6 +4537,13 @@ (define_insn "neon_vld2_dup" (const_string "neon_vld1_1_2_regs")))] ) +(define_expand "vec_store_lanesti" + [(set (match_operand:TI 0 "neon_struct_operand") + (unspec:TI [(match_operand:TI 1 "s_register_operand") + (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + UNSPEC_VST2))] + "TARGET_NEON") + (define_insn "neon_vst2" [(set (match_operand:TI 0 "neon_struct_operand" "=Um") (unspec:TI [(match_operand:TI 1 "s_register_operand" "w") @@ -4529,6 +4562,13 @@ (define_insn "neon_vst2" (const_string "neon_vst1_1_2_regs_vst2_2_regs")))] ) +(define_expand "vec_store_lanesoi" + [(set (match_operand:OI 0 "neon_struct_operand") + (unspec:OI [(match_operand:OI 1 "s_register_operand") + (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + UNSPEC_VST2))] + "TARGET_NEON") + (define_insn "neon_vst2" [(set (match_operand:OI 0 "neon_struct_operand" "=Um") (unspec:OI [(match_operand:OI 1 "s_register_operand" "w") @@ -4594,6 +4634,13 @@ (define_insn "neon_vst2_lane" [(set_attr "neon_type" "neon_vst1_vst2_lane")] ) +(define_expand "vec_load_lanesei" + [(set (match_operand:EI 0 "s_register_operand") + (unspec:EI [(match_operand:EI 1 "neon_struct_operand") + (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + UNSPEC_VLD3))] + "TARGET_NEON") + (define_insn "neon_vld3" [(set (match_operand:EI 0 "s_register_operand" "=w") (unspec:EI [(match_operand:EI 1 "neon_struct_operand" "Um") @@ -4612,6 +4659,16 @@ (define_insn "neon_vld3" (const_string "neon_vld3_vld4")))] ) +(define_expand "vec_load_lanesci" + [(match_operand:CI 0 "s_register_operand") + (match_operand:CI 1 "neon_struct_operand") + (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + "TARGET_NEON" +{ + emit_insn (gen_neon_vld3 (operands[0], operands[1])); + DONE; +}) + (define_expand "neon_vld3" [(match_operand:CI 0 "s_register_operand") (match_operand:CI 1 "neon_struct_operand") @@ -4751,6 +4808,13 @@ (define_insn "neon_vld3_dup" (const_string "neon_vld3_vld4_all_lanes") (const_string "neon_vld1_1_2_regs")))]) +(define_expand "vec_store_lanesei" + [(set (match_operand:EI 0 "neon_struct_operand") + (unspec:EI [(match_operand:EI 1 "s_register_operand") + (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + UNSPEC_VST3))] + "TARGET_NEON") + (define_insn "neon_vst3" [(set (match_operand:EI 0 "neon_struct_operand" "=Um") (unspec:EI [(match_operand:EI 1 "s_register_operand" "w") @@ -4768,6 +4832,16 @@ (define_insn "neon_vst3" (const_string "neon_vst1_1_2_regs_vst2_2_regs") (const_string "neon_vst2_4_regs_vst3_vst4")))]) +(define_expand "vec_store_lanesci" + [(match_operand:CI 0 "neon_struct_operand") + (match_operand:CI 1 "s_register_operand") + (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + "TARGET_NEON" +{ + emit_insn (gen_neon_vst3 (operands[0], operands[1])); + DONE; +}) + (define_expand "neon_vst3" [(match_operand:CI 0 "neon_struct_operand") (match_operand:CI 1 "s_register_operand") @@ -4879,6 +4953,13 @@ (define_insn "neon_vst3_lane" } [(set_attr "neon_type" "neon_vst3_vst4_lane")]) +(define_expand "vec_load_lanesoi" + [(set (match_operand:OI 0 "s_register_operand") + (unspec:OI [(match_operand:OI 1 "neon_struct_operand") + (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + UNSPEC_VLD4))] + "TARGET_NEON") + (define_insn "neon_vld4" [(set (match_operand:OI 0 "s_register_operand" "=w") (unspec:OI [(match_operand:OI 1 "neon_struct_operand" "Um") @@ -4897,6 +4978,16 @@ (define_insn "neon_vld4" (const_string "neon_vld3_vld4")))] ) +(define_expand "vec_load_lanesxi" + [(match_operand:XI 0 "s_register_operand") + (match_operand:XI 1 "neon_struct_operand") + (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + "TARGET_NEON" +{ + emit_insn (gen_neon_vld4 (operands[0], operands[1])); + DONE; +}) + (define_expand "neon_vld4" [(match_operand:XI 0 "s_register_operand") (match_operand:XI 1 "neon_struct_operand") @@ -5043,6 +5134,13 @@ (define_insn "neon_vld4_dup" (const_string "neon_vld1_1_2_regs")))] ) +(define_expand "vec_store_lanesoi" + [(set (match_operand:OI 0 "neon_struct_operand") + (unspec:OI [(match_operand:OI 1 "s_register_operand") + (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + UNSPEC_VST4))] + "TARGET_NEON") + (define_insn "neon_vst4" [(set (match_operand:OI 0 "neon_struct_operand" "=Um") (unspec:OI [(match_operand:OI 1 "s_register_operand" "w") @@ -5061,6 +5159,16 @@ (define_insn "neon_vst4" (const_string "neon_vst2_4_regs_vst3_vst4")))] ) +(define_expand "vec_store_lanesxi" + [(match_operand:XI 0 "neon_struct_operand") + (match_operand:XI 1 "s_register_operand") + (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)] + "TARGET_NEON" +{ + emit_insn (gen_neon_vst4 (operands[0], operands[1])); + DONE; +}) + (define_expand "neon_vst4" [(match_operand:XI 0 "neon_struct_operand") (match_operand:XI 1 "s_register_operand")