On Wed, Mar 28, 2012 at 3:17 AM, Uros Bizjak <ubiz...@gmail.com> wrote:
> On Tue, Mar 27, 2012 at 7:48 PM, H.J. Lu <hongjiu...@intel.com> wrote:
>
>>> OPTION_MASK_ISA_64BIT                 32bit x86-64 code or 64bit x86-64 code
>>> OPTION_MASK_ISA_X86_64                64bit x86-64 code
>>> OPTION_MASK_ISA_X32           32bit x86-64 code
>
> How annoying, the first one doesn't mean what it says.
> OPTION_MASK_ISA_64BIT should be renamed to OPTION_MASK_ARCH_X86_64,
> then it makes sense. For consistency, I'd say:
>
> OPTION_MASK_ISA_64BIT -> OPTION_MASK_ARCH_X86_64
> OPTION_MASK_ISA_X86_64 -> OPTION_MASK_ISA_64
> OPTION_MASK_ISA_X32 -> stays the same.
>
>>> and i386.opt becomes
>>>
>>> -m64: Turn on OPTION_MASK_ISA_X86_64
>>> -mx32: Turn on OPTION_MASK_ISA_X32
>>> -m32: Turn off OPTION_MASK_ISA_64BIT
>>>
>>> Both OPTION_MASK_ISA_X32 and OPTION_MASK_ISA_X86_64 imply
>>> OPTION_MASK_ISA_64BIT. OPTION_MASK_ISA_X32 clears OPTION_MASK_ISA_X86_64
>>> and vice versa.
>
> With a renamed macros, the above make sense.
>
>> -#define TARGET_LP64    (TARGET_64BIT && !TARGET_X32)
>> +#define TARGET_LP64    TARGET_X86_64
>
> You don't need new define, just use OPTION_MASK_ISA_64.
>

What do we do with TARGET_64BIT and TARGET_64BIT_DEFAULT?  They
are used to indicate 64bit ISA like:

collect2.c:/* TARGET_64BIT may be defined to use driver specific
functionality. */
collect2.c:#undef TARGET_64BIT
collect2.c:#define TARGET_64BIT TARGET_64BIT_DEFAULT
reg-stack.c:  if ((flag_pic && !TARGET_64BIT)
tlink.c:/* TARGET_64BIT may be defined to use driver specific functionality. */
tlink.c:#undef TARGET_64BIT
tlink.c:#define TARGET_64BIT TARGET_64BIT_DEFAULT
xcoffout.c:       if (lno > 0 && (TARGET_64BIT || lno <= (int)USHRT_MAX))       
   \
config/darwin.c:               && TARGET_64BIT
config/darwin.c:           && TARGET_64BIT
config/darwin.c:                : (TARGET_64BIT ? 2
config/darwin.c:      if (TARGET_64BIT && global_options.x_flag_objc_abi < 2)
config/darwin.c:      if (!TARGET_64BIT && global_options.x_flag_objc_abi >= 2)
config/darwin.c:      && !TARGET_64BIT)
config/darwin.c:  if (!TARGET_64BIT)                            \
config/darwin.c:  if (!TARGET_64BIT                                             
  \
config/darwin.h:                                flag_next_runtime && 
!TARGET_64BIT;     \
config/sol2-bi.h:#define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
config/sol2-bi.h:#define WINT_TYPE (TARGET_64BIT ? "int" : "long int")

Should we keep them? Right now I have

#define TARGET_64BIT    OPTION_ARCH_X86_64

and

#define TARGET_64BIT_DEFAULT (OPTION_MASK_ARCH_X86_64 | OPTION_MASK_ISA_64)

Should we go with

OPTION_MASK_ISA_64BIT -> stays the same
OPTION_MASK_ISA_X86_64 -> OPTION_MASK_ABI_64
OPTION_MASK_ISA_X32 ->  OPTION_MASK_ABI_X32

instead?

-- 
H.J.

Reply via email to