From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13482 invoked by alias); 8 Jan 2007 20:34:50 -0000 Received: (qmail 13431 invoked by uid 22791); 8 Jan 2007 20:34:49 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 08 Jan 2007 20:34:43 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id l08KYe98226480 for ; Mon, 8 Jan 2007 20:34:40 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id l08KYemC3018862 for ; Mon, 8 Jan 2007 21:34:40 +0100 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l08KYdCC020726 for ; Mon, 8 Jan 2007 21:34:39 +0100 Received: from d12mc102.megacenter.de.ibm.com (d12mc102.megacenter.de.ibm.com [9.149.167.114]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l08KYdt9020721 for ; Mon, 8 Jan 2007 21:34:39 +0100 Subject: [PATCH] misaligned stores support To: gcc-patches@gcc.gnu.org X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: From: Dorit Nuzman Date: Mon, 08 Jan 2007 20:34:00 -0000 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=4DBBF8CEDFA9B6A88f9e8a93df938690918c4DBBF8CEDFA9B6A8" Content-Disposition: inline X-IsSubscribed: yes 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: 2007-01/txt/msg00604.txt.bz2 --0__=4DBBF8CEDFA9B6A88f9e8a93df938690918c4DBBF8CEDFA9B6A8 Content-type: text/plain; charset=US-ASCII Content-length: 1740 This is an old patch - I think relative to autovect-branch - from over a year ago, written by Leehod Baruch (IIRC, with some hints from rth at the time). I don't remember if it was working all the way, and it would anyhow need to be updated to current mainline and tested. I'm bringing it up as promised here - http://gcc.gnu.org/ml/gcc/2007-01/msg00289.html, in case someone wants to take it forward. This patch includes code to expand a MISALIGNED_INDIRECT_REF in a store stmt, and a couple changes to the vectorizer: one is when considering to peel a loop to align an otherwise-unsupported misaligned memory access - currently we do that only for stores, but with this patch there's no longer a need to treat stores differently than loads. The second change is to check whether a movmisalign is supported rather than always returning that there's no support for misaligned stores. With this patch we'd probably need to change a lot of vectorizer testcases that currently assume that misaligned stores are not supported. Also, a couple things that, with this patch, would be even more important/desired: 1. Add support for the "software-pipelined" (or "explicit") vectorization scheme of handling misalignment (i.e. - add a "realign-store" idiom and use it to handle misaligned store by doing an extra aligned load+store before and after of the loop, and realignment operations in the loop to extract the desired data for each iteration). 2. Add a cost model - with this patch the vectorizer will generate misaligned vector stores, whereas peeling (which is what we do now) might be preferable. We need a way to evaluate which vectorization scheme is expected to be more profitable. Dorit (See attached file: misaaligned_store.txt) --0__=4DBBF8CEDFA9B6A88f9e8a93df938690918c4DBBF8CEDFA9B6A8 Content-type: text/plain; name="misaaligned_store.txt" Content-Disposition: attachment; filename="misaaligned_store.txt" Content-transfer-encoding: base64 Content-length: 11826 PyBvdXQKPyBvdXRkaWZmCkluZGV4OiBleHByLmMKPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PQpSQ1MgZmlsZTogL2N2cy9nY2MvZ2NjL2djYy9leHByLmMsdgpy ZXRyaWV2aW5nIHJldmlzaW9uIDEuNzM4LjIuNQpkaWZmIC1jIC0zIC1wIC1y MS43MzguMi41IGV4cHIuYwoqKiogZXhwci5jCTggTWFyIDIwMDUgMDg6Mjk6 NTAgLTAwMDAJMS43MzguMi41Ci0tLSBleHByLmMJMTcgTm92IDIwMDUgMDk6 MDA6MzIgLTAwMDAKKioqKioqKioqKioqKioqIGV4cGFuZF9hc3NpZ25tZW50 ICh0cmVlIHRvLCB0cmVlIGZyb20pCioqKiAzOTI0LDM5MzAgKioqKgotLS0g MzkyNCwzOTY0IC0tLS0KICAgICAgICBwb3BfdGVtcF9zbG90cyAoKTsKICAg ICAgICByZXR1cm47CiAgICAgIH0KKyAgCisgICBlbHNlIGlmIChUUkVFX0NP REUgKHRvKSA9PSBNSVNBTElHTkVEX0lORElSRUNUX1JFRikKKyAgICAgewor ICAgICAgIGVudW0gbWFjaGluZV9tb2RlIG1vZGUsIG9wX21vZGUxOworICAg ICAgIGVudW0gaW5zbl9jb2RlIGljb2RlOworICAgICAgIHJ0eCByZWcsIGFk ZHIsIG1lbSwgaW5zbjsKKyAgICAgICB0cmVlIG9yaWc7CisgICAgICAgCisg ICAgICAgcmVnID0gZXhwYW5kX2V4cHIgKGZyb20sIE5VTExfUlRYLCBWT0lE bW9kZSwgRVhQQU5EX05PUk1BTCk7CisgICAgICAgcmVnID0gZm9yY2Vfbm90 X21lbSAocmVnKTsKICAKKyAgICAgICBtb2RlID0gVFlQRV9NT0RFIChUUkVF X1RZUEUgKHRvKSk7CisgICAgICAgYWRkciA9IGV4cGFuZF9leHByIChUUkVF X09QRVJBTkQgKHRvLCAwKSwgTlVMTF9SVFgsIFZPSURtb2RlLAorIAkJCSAg RVhQQU5EX1NVTSk7CisgICAgICAgYWRkciA9IG1lbW9yeV9hZGRyZXNzICht b2RlLCBhZGRyKTsKKyAgICAgICBtZW0gPSBnZW5fcnR4X01FTSAobW9kZSwg YWRkcik7CisgICAgICAgCisgICAgICAgb3JpZyA9IFJFRl9PUklHSU5BTCAo dG8pOworICAgICAgIGlmICghb3JpZykKKyAJb3JpZyA9IHRvOworICAgICAg IHNldF9tZW1fYXR0cmlidXRlcyAobWVtLCBvcmlnLCAwKTsKKyAgICAgICAK KyAgICAgICBpY29kZSA9IG1vdm1pc2FsaWduX29wdGFiLT5oYW5kbGVyc1tt b2RlXS5pbnNuX2NvZGU7CisgICAgICAgZ2NjX2Fzc2VydCAoaWNvZGUgIT0g Q09ERV9GT1Jfbm90aGluZyk7CisgCisgICAgICAgb3BfbW9kZTEgPSBpbnNu X2RhdGFbaWNvZGVdLm9wZXJhbmRbMV0ubW9kZTsKKyAgICAgICBpZiAoISAo Kmluc25fZGF0YVtpY29kZV0ub3BlcmFuZFsxXS5wcmVkaWNhdGUpIChyZWcs IG9wX21vZGUxKQorICAgICAgICAgICAmJiBvcF9tb2RlMSAhPSBWT0lEbW9k ZSkKKyAgICAgICAgIHJlZyA9IGNvcHlfdG9fbW9kZV9yZWcgKG9wX21vZGUx LCByZWcpOworICAgICAgIAorICAgICAgIGluc24gPSBHRU5fRkNOIChpY29k ZSkgKG1lbSwgcmVnKTsKKyAgICAgICBlbWl0X2luc24gKGluc24pOworICAg ICAgIHJldHVybjsgIAorICAgICB9CisgICAKICAgIC8qIE9yZGluYXJ5IHRy ZWF0bWVudC4gIEV4cGFuZCBUTyB0byBnZXQgYSBSRUcgb3IgTUVNIHJ0eC4K ICAgICAgIERvbid0IHJlLWV4cGFuZCBpZiBpdCB3YXMgZXhwYW5kZWQgYWxy ZWFkeSAoaW4gQ09NUE9ORU5UX1JFRiBjYXNlKS4gICovCiAgCkluZGV4OiB0 cmVlLXZlY3QtYW5hbHl6ZS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNT IGZpbGU6IC9jdnMvZ2NjL2djYy9nY2MvdHJlZS12ZWN0LWFuYWx5emUuYyx2 CnJldHJpZXZpbmcgcmV2aXNpb24gMi40LjQuOQpkaWZmIC1jIC0zIC1wIC1y Mi40LjQuOSB0cmVlLXZlY3QtYW5hbHl6ZS5jCio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