Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/97597/?format=api
{ "id": 97597, "url": "http://patchwork.ozlabs.org/api/patches/97597/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20110526175634.4bcab9b5@rex.config/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20110526175634.4bcab9b5@rex.config>", "list_archive_url": null, "date": "2011-05-26T16:56:34", "name": "ARM fixed-point support [5.5/6]: argument & return padding for libcalls", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d049474564ef2ea8b7a93b4f382e409a17ddda27", "submitter": { "id": 4374, "url": "http://patchwork.ozlabs.org/api/people/4374/?format=api", "name": "Julian Brown", "email": "julian@codesourcery.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20110526175634.4bcab9b5@rex.config/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/97597/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/97597/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-return-292903-incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "mailing list gcc-patches@gcc.gnu.org" ], "Received": [ "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\tby ozlabs.org (Postfix) with SMTP id AA72FB6F90\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 27 May 2011 02:56:59 +1000 (EST)", "(qmail 1488 invoked by alias); 26 May 2011 16:56:58 -0000", "(qmail 1479 invoked by uid 22791); 26 May 2011 16:56:56 -0000", "from mail.codesourcery.com (HELO mail.codesourcery.com)\n\t(38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with\n\tESMTP; Thu, 26 May 2011 16:56:40 +0000", "(qmail 2886 invoked from network); 26 May 2011 16:56:39 -0000", "from unknown (HELO rex.config) (julian@127.0.0.2) by\n\tmail.codesourcery.com with ESMTPA; 26 May 2011 16:56:39 -0000" ], "X-SWARE-Spam-Status": "No, hits=-1.6 required=5.0\ttests=AWL, BAYES_00,\n\tT_RP_MATCHES_RCVD", "X-Spam-Check-By": "sourceware.org", "Date": "Thu, 26 May 2011 17:56:34 +0100", "From": "Julian Brown <julian@codesourcery.com>", "To": "gcc-patches@gcc.gnu.org", "Subject": "[PATCH] ARM fixed-point support [5.5/6]: argument & return padding\n\tfor libcalls", "Message-ID": "<20110526175634.4bcab9b5@rex.config>", "Mime-Version": "1.0", "Content-Type": "multipart/mixed; boundary=\"MP_/i/9ZY9ZmMC+.hZ2xJg86XKU\"", "X-IsSubscribed": "yes", "Mailing-List": "contact gcc-patches-help@gcc.gnu.org; run by ezmlm", "Precedence": "bulk", "List-Id": "<gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>", "List-Archive": "<http://gcc.gnu.org/ml/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-help@gcc.gnu.org>", "Sender": "gcc-patches-owner@gcc.gnu.org" }, "content": "This patch allows padding to be specified per-target for libcalls. This\nhasn't been traditionally important, because libcalls haven't accepted\nquantities which might need padding, but that's no longer true with the\nnew(-ish) fixed-point support helper functions.\n\nTested (alongside other fixed-point support patches) with cross to ARM\nEABI in both big & little-endian mode (the target-specific part is to\navoid a behaviour change for half-float types on ARM). OK to apply?\n\nThanks,\n\nJulian\n\nChangeLog\n\n gcc/\n * calls.c (emit_library_call_value_1): Support padding for libcall\n arguments and return values.\n * config/arm/arm.c (arm_pad_arg_upward): Pad half-float values\n downwards in big-endian mode.", "diff": "commit e3b8b63431fc1d701ac5d3cafd19c24e6d3b5c6e\nAuthor: Julian Brown <julian@henry8.codesourcery.com>\nDate: Thu May 26 09:06:44 2011 -0700\n\n Support target-specific padding for libcalls.\n\ndiff --git a/gcc/calls.c b/gcc/calls.c\nindex 44a16ff..9d5d294 100644\n--- a/gcc/calls.c\n+++ b/gcc/calls.c\n@@ -3794,13 +3794,41 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,\n rtx val = argvec[argnum].value;\n rtx reg = argvec[argnum].reg;\n int partial = argvec[argnum].partial;\n-\n+ int size = 0;\n+ \n /* Handle calls that pass values in multiple non-contiguous\n \t locations. The PA64 has examples of this for library calls. */\n if (reg != 0 && GET_CODE (reg) == PARALLEL)\n \temit_group_load (reg, val, NULL_TREE, GET_MODE_SIZE (mode));\n else if (reg != 0 && partial == 0)\n-\temit_move_insn (reg, val);\n+ {\n+\t emit_move_insn (reg, val);\n+#ifdef BLOCK_REG_PADDING\n+\t size = GET_MODE_SIZE (argvec[argnum].mode);\n+\n+\t /* Copied from load_register_parameters. */\n+\n+\t /* Handle case where we have a value that needs shifting\n+\t up to the msb. eg. a QImode value and we're padding\n+\t upward on a BYTES_BIG_ENDIAN machine. */\n+\t if (size < UNITS_PER_WORD\n+\t && (argvec[argnum].locate.where_pad\n+\t\t == (BYTES_BIG_ENDIAN ? upward : downward)))\n+\t {\n+\t rtx x;\n+\t int shift = (UNITS_PER_WORD - size) * BITS_PER_UNIT;\n+\n+\t /* Assigning REG here rather than a temp makes CALL_FUSAGE\n+\t\t report the whole reg as used. Strictly speaking, the\n+\t\t call only uses SIZE bytes at the msb end, but it doesn't\n+\t\t seem worth generating rtl to say that. */\n+\t reg = gen_rtx_REG (word_mode, REGNO (reg));\n+\t x = expand_shift (LSHIFT_EXPR, word_mode, reg, shift, reg, 1);\n+\t if (x != reg)\n+\t\temit_move_insn (reg, x);\n+\t }\n+#endif\n+\t}\n \n NO_DEFER_POP;\n }\n@@ -3866,6 +3894,15 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,\n \t valreg,\n \t old_inhibit_defer_pop + 1, call_fusage, flags, & args_so_far);\n \n+ /* Right-shift returned value if necessary. */\n+ if (!pcc_struct_value\n+ && TYPE_MODE (tfom) != BLKmode\n+ && targetm.calls.return_in_msb (tfom))\n+ {\n+ shift_return_value (TYPE_MODE (tfom), false, valreg);\n+ valreg = gen_rtx_REG (TYPE_MODE (tfom), REGNO (valreg));\n+ }\n+\n /* For calls to `setjmp', etc., inform function.c:setjmp_warnings\n that it should complain if nonvolatile values are live. For\n functions that cannot return, inform flow that control does not\ndiff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c\nindex 7d52b0e..cd32fe3 100644\n--- a/gcc/config/arm/arm.c\n+++ b/gcc/config/arm/arm.c\n@@ -11375,6 +11375,15 @@ arm_pad_arg_upward (enum machine_mode mode, const_tree type)\n if (type && BYTES_BIG_ENDIAN && INTEGRAL_TYPE_P (type))\n return false;\n \n+ /* Half-float values are only passed to libcalls, not regular functions.\n+ They should be passed and returned as \"short\"s (see RTABI). To achieve\n+ that effect in big-endian mode, pad downwards so the value is passed in\n+ the least-significant end of the register. ??? This needs to be here\n+ rather than in arm_pad_reg_upward due to peculiarity in the handling of\n+ libcall arguments. */\n+ if (BYTES_BIG_ENDIAN && mode == HFmode)\n+ return false;\n+\n return true;\n }\n \n", "prefixes": [] }