diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2020-11-03 19:13:57 +0100 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2020-11-03 19:15:03 +0100 |
commit | f4a0e873be8a6c2787c13bd29c0b2a5df332adeb (patch) | |
tree | 12fd1f704055f2eaf6c04b6a9592e53c98f94c93 /gcc | |
parent | 5b01425ec2019f822f9eb628ef0932f6deff44f9 (diff) | |
download | gcc-f4a0e873be8a6c2787c13bd29c0b2a5df332adeb.zip gcc-f4a0e873be8a6c2787c13bd29c0b2a5df332adeb.tar.gz gcc-f4a0e873be8a6c2787c13bd29c0b2a5df332adeb.tar.bz2 |
i386: Fix ix86_function_arg_regno_p to return correct SSE regno for 32bit TARGET_MACHO
Use up to SSE_REGPARM_MAX registers to pass function parameters
for 32bit Mach-O targets. Also, define X86_32_MMX_REGPARM_MAX
to return 0 for 32bit Mach-O targets.
2020-11-03 Uroš Bizjak <ubizjak@gmail.com>
gcc/
* config/i386/i386.c (ix86_function_arg_regno_p): Use up to
SSE_REGPARM_MAX registers to pass function parameters
for 32bit Mach-O targets.
* config/i386/i386.h (X86_32_MMX_REGPARM_MAX): New macro.
(MMX_REGPARM_MAX): Use it.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/i386/i386.c | 20 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 4 |
2 files changed, 9 insertions, 15 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index df47a53..ddd1c71 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1423,23 +1423,15 @@ ix86_function_arg_regno_p (int regno) enum calling_abi call_abi; const int *parm_regs; - if (!TARGET_64BIT) - { - if (TARGET_MACHO) - return (regno < REGPARM_MAX - || (TARGET_SSE && SSE_REGNO_P (regno) && !fixed_regs[regno])); - else - return (regno < REGPARM_MAX - || (TARGET_MMX && MMX_REGNO_P (regno) - && (regno < FIRST_MMX_REG + MMX_REGPARM_MAX)) - || (TARGET_SSE && SSE_REGNO_P (regno) - && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX))); - } - if (TARGET_SSE && SSE_REGNO_P (regno) - && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)) + && regno < FIRST_SSE_REG + SSE_REGPARM_MAX) return true; + if (!TARGET_64BIT) + return (regno < REGPARM_MAX + || (TARGET_MMX && MMX_REGNO_P (regno) + && regno < FIRST_MMX_REG + MMX_REGPARM_MAX)); + /* TODO: The function should depend on current function ABI but builtins.c would need updating then. Therefore we use the default ABI. */ diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 760c60fb..d0c157a 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1950,7 +1950,9 @@ typedef struct ix86_args { : X86_64_SSE_REGPARM_MAX) \ : X86_32_SSE_REGPARM_MAX) -#define MMX_REGPARM_MAX (TARGET_64BIT ? 0 : (TARGET_MMX ? 3 : 0)) +#define X86_32_MMX_REGPARM_MAX (TARGET_MMX ? (TARGET_MACHO ? 0 : 3) : 0) + +#define MMX_REGPARM_MAX (TARGET_64BIT ? 0 : X86_32_MMX_REGPARM_MAX) /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ |