From patchwork Tue Apr 12 14:01:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 983 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:47:59 -0000 Delivered-To: patches@linaro.org Received: by 10.68.59.138 with SMTP id z10cs184165pbq; Tue, 12 Apr 2011 07:01:20 -0700 (PDT) Received: by 10.227.201.8 with SMTP id ey8mr1494573wbb.200.1302616879109; Tue, 12 Apr 2011 07:01:19 -0700 (PDT) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id d17si13080327wbh.139.2011.04.12.07.01.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Apr 2011 07:01:19 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of richard.sandiford@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of richard.sandiford@linaro.org) smtp.mail=richard.sandiford@linaro.org Received: by wyb33 with SMTP id 33so6844888wyb.37 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 15:01:16 +0100 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 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")