Patchwork [committed] AIX largetoc fixes

login
register
mail settings
Submitter David Edelsohn
Date Nov. 20, 2012, 4:26 p.m.
Message ID <CAGWvnyn4a-g-XDTngcrQUZ3uzM5PqT0r1cnmayi2C+AXFo7EHg@mail.gmail.com>
Download mbox | patch
Permalink /patch/200387/
State New
Headers show

Comments

David Edelsohn - Nov. 20, 2012, 4:26 p.m.
The AIX assembler prefers "la" mnemonic and syntax over "addi" for cmodel=large.

Bootstrapped on powerpc-ibm-aix7.1.0.0 and powerpc64-linux.

David

        * config/rs6000/rs6000.md (largetoc_low): Revert.
        (largetoc_low_aix<mode>): New.

Patch

Index: rs6000.md
===================================================================
--- rs6000.md	(revision 193665)
+++ rs6000.md	(working copy)
@@ -10354,15 +10354,22 @@ 
    "TARGET_XCOFF && TARGET_CMODEL != CMODEL_SMALL"
    "addis %0,%1+%3@u(%2)")

-(define_insn "*largetoc_low<mode>"
-  [(set (match_operand:P 0 "gpc_reg_operand" "=r,r")
-        (lo_sum:P (match_operand:P 1 "gpc_reg_operand" "b,!*r")
-	           (match_operand:P 2 "" "")))]
-   "TARGET_TOC && TARGET_CMODEL != CMODEL_SMALL"
+(define_insn "*largetoc_low"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+        (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b,!*r")
+	           (match_operand:DI 2 "" "")))]
+   "TARGET_ELF && TARGET_CMODEL != CMODEL_SMALL"
    "@
     addi %0,%1,%2@l
     addic %0,%1,%2@l")

+(define_insn "*largetoc_low_aix<mode>"
+  [(set (match_operand:P 0 "gpc_reg_operand" "=r")
+        (lo_sum:P (match_operand:P 1 "gpc_reg_operand" "b")
+	           (match_operand:P 2 "" "")))]
+   "TARGET_XCOFF && TARGET_CMODEL != CMODEL_SMALL"
+   "la %0,%2@l(%1)")
+
 (define_insn_and_split "*tocref<mode>"
   [(set (match_operand:P 0 "gpc_reg_operand" "=b*r")
 	(match_operand:P 1 "small_toc_ref" "R"))]