public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: David Edelsohn <dje@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-6996] aix: Permit use of AIX Vector extended ABI mode Date: Sat, 30 Jan 2021 17:06:59 +0000 (GMT) [thread overview] Message-ID: <20210130170659.E60883857000@sourceware.org> (raw) https://gcc.gnu.org/g:2e7750cb518f5abedbd6fb2725882079a6934dce commit r11-6996-g2e7750cb518f5abedbd6fb2725882079a6934dce Author: David Edelsohn <dje.gcc@gmail.com> Date: Wed Jan 27 16:47:22 2021 -0500 aix: Permit use of AIX Vector extended ABI mode AIX only permits use of Altivec VSRs 20-31 in a Vector Extended ABI mode. This patch explicitly enables use of the VSRs using the new -mabi=vec-extabi command line option also implemented in LLVM for AIX. Bootstrapped on powerpc-ibm-aix7.2.3.0 and powerpc64le-linux-gnu. gcc/ChangeLog: * config/rs6000/rs6000.opt (mabi=vec-extabi): New. (mabi=vec-default): New. * config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define __EXTABI__ for AIX Vector extended ABI. * config/rs6000/rs6000.c (rs6000_debug_reg_global): Print AIX Vector extabi info. (conditional_register_usage): If AIX vec_extabi enabled, vs20-vs31 are non-volatile. * doc/invoke.texi (PowerPC mabi): Add AIX vec-extabi and vec-default. Diff: --- gcc/config/rs6000/rs6000-c.c | 2 ++ gcc/config/rs6000/rs6000.c | 5 ++++- gcc/config/rs6000/rs6000.opt | 11 +++++++++++ gcc/doc/invoke.texi | 5 +++-- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index 656cdb39f3f..06b3bc0df33 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -483,6 +483,8 @@ rs6000_target_modify_macros (bool define_p, HOST_WIDE_INT flags, /* Define this when supporting context-sensitive keywords. */ if (!flag_iso) rs6000_define_or_undefine_macro (define_p, "__APPLE_ALTIVEC__"); + if (rs6000_aix_extabi) + rs6000_define_or_undefine_macro (define_p, "__EXTABI__"); } /* Note that the OPTION_MASK_VSX flag is automatically turned on in the following conditions: diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index fbaff289a40..0d5ef38bd82 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2512,6 +2512,9 @@ rs6000_debug_reg_global (void) if (rs6000_altivec_abi) fprintf (stderr, DEBUG_FMT_S, "altivec_abi", "true"); + if (rs6000_aix_extabi) + fprintf (stderr, DEBUG_FMT_S, "AIX vec-extabi", "true"); + if (rs6000_darwin64_abi) fprintf (stderr, DEBUG_FMT_S, "darwin64_abi", "true"); @@ -9815,7 +9818,7 @@ rs6000_conditional_register_usage (void) call_used_regs[i] = 1; /* AIX reserves VR20:31 in non-extended ABI mode. */ - if (TARGET_XCOFF) + if (TARGET_XCOFF && !rs6000_aix_extabi) for (i = FIRST_ALTIVEC_REGNO + 20; i < FIRST_ALTIVEC_REGNO + 32; ++i) fixed_regs[i] = call_used_regs[i] = 1; } diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt index 6240f779694..7aaabf39b25 100644 --- a/gcc/config/rs6000/rs6000.opt +++ b/gcc/config/rs6000/rs6000.opt @@ -352,6 +352,7 @@ mdebug= Target RejectNegative Joined -mdebug= Enable debug output. +; Altivec ABI mabi=altivec Target RejectNegative Var(rs6000_altivec_abi) Save Use the AltiVec ABI extensions. @@ -360,6 +361,16 @@ mabi=no-altivec Target RejectNegative Var(rs6000_altivec_abi, 0) Do not use the AltiVec ABI extensions. +; AIX Extended vector ABI +mabi=vec-extabi +Target RejectNegative Var(rs6000_aix_extabi, 1) Save +Use the AIX Vector Extended ABI + +mabi=vec-default +Target RejectNegative Var(rs6000_aix_extabi, 0) +Do not use the AIX Vector Extended ABI + +; PPC64 Linux ELF ABI mabi=elfv1 Target RejectNegative Var(rs6000_elf_abi, 1) Save Use the ELFv1 ABI. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index a89d3859d6d..3751bc3ac7c 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -27509,9 +27509,10 @@ SVR4 ABI)@. @item -mabi=@var{abi-type} @opindex mabi Extend the current ABI with a particular extension, or remove such extension. -Valid values are @samp{altivec}, @samp{no-altivec}, +Valid values are: @samp{altivec}, @samp{no-altivec}, @samp{ibmlongdouble}, @samp{ieeelongdouble}, -@samp{elfv1}, @samp{elfv2}@. +@samp{elfv1}, @samp{elfv2}, +and for AIX: @samp{vec-extabi}, @samp{vec-default}@. @item -mabi=ibmlongdouble @opindex mabi=ibmlongdouble
reply other threads:[~2021-01-30 17:06 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210130170659.E60883857000@sourceware.org \ --to=dje@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).