This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, nds32] Missing target_cpu_default in TARGET_DEFAULT_TARGET_FLAGS.


2013/12/13 Chung-Ju Wu <jasonwucj@gmail.com>:
> 2013/12/11 Monk Chiang <sh.chiang04@gmail.com>:
>> Hi,
>>
>> Recently I used --target=nds32be-elf to configure nds32 gcc,
>> it seems that the big endian is not set as default.
>>
> [...]
>>
>> The following is the patch to fix this issue.  Tested on nds32be-elf.
>>
>> OK to apply?
>>
>> Index: common/config/nds32/nds32-common.c
>> ===================================================================
>> --- common/config/nds32/nds32-common.c  (revision 205880)
>> +++ common/config/nds32/nds32-common.c  (working copy)
>> @@ -93,7 +93,8 @@
>>       TARGET_CMOV     : Generate conditional move instruction.  */
>
> Could you also extend the comment about adding TARGET_CPU_DEFAULT?
> That would be great to let other developers realize why we need it. :)
>
>>  #undef TARGET_DEFAULT_TARGET_FLAGS
>>  #define TARGET_DEFAULT_TARGET_FLAGS            \
>> -  (MASK_GP_DIRECT                              \
>> +  (TARGET_CPU_DEFAULT                          \
>> +   | MASK_GP_DIRECT                            \
>>     | MASK_16_BIT                               \
>>     | MASK_PERF_EXT                             \
>>     | MASK_CMOV)
>
>> Index: ChangeLog
>> ===================================================================
>> --- ChangeLog   (revision 205880)
>> +++ ChangeLog   (working copy)
>> @@ -1,3 +1,8 @@
>> +2013-12-11  Monk Chiang <sh.chiang04@gmail.com>
>
> In ChangeLog formatting, there should be two spaces between 'Chiang' and '<'.
>
>> +
>> +       * common/config/nds32/nds32-common.c (TARGET_DEFAULT_TARGET_FLAGS):
>> +       Redefine.
>> +
>
> Suggest using 'Consider TARGET_CPU_DEFAULT settings.'
>
>>  2013-12-11  Bin Cheng  <bin.cheng@arm.com>
>>
>
> OK with those changes.
>
> Thank you for the patch fixing that issue. :)
>
>
> Best regards,
> jasonwucj


I add comment to describe why I adding TARGET_CPU_DEFAULT,
and fix typo in ChangeLog fle.

Thank you for your suggestion.

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 206039)
+++ ChangeLog   (working copy)
@@ -1,3 +1,8 @@
+2013-12-17  Monk Chiang  <sh.chiang04@gmail.com>
+
+       * common/config/nds32/nds32-common.c (TARGET_DEFAULT_TARGET_FLAGS):
+       Consider TARGET_CPU_DEFAULT settings.
+
 2013-12-16  Jakub Jelinek  <jakub@redhat.com>

        * predict.h (PROB_LIKELY): Fix the value.
Index: common/config/nds32/nds32-common.c
===================================================================
--- common/config/nds32/nds32-common.c  (revision 206039)
+++ common/config/nds32/nds32-common.c  (working copy)
@@ -86,14 +86,23 @@

 /* Run-time Target Specification.  */

-/* Default enable
+/* The default target flags consist of
+   TARGET_CPU_DEFAULT and other MASK_XXX flags.
+
+   The value of TARGET_CPU_DEFAULT is set by
+   the process of 'configure' and 'make' stage.
+   Please check gcc/config.gcc for more implementation detail.
+
+   Other MASK_XXX flags are set individually.
+   By default we enable
      TARGET_GP_DIRECT: Generate gp-imply instruction.
      TARGET_16_BIT   : Generate 16/32 bit mixed length instruction.
      TARGET_PERF_EXT : Generate performance extention instrcution.
      TARGET_CMOV     : Generate conditional move instruction.  */
 #undef TARGET_DEFAULT_TARGET_FLAGS
 #define TARGET_DEFAULT_TARGET_FLAGS            \
-  (MASK_GP_DIRECT                              \
+  (TARGET_CPU_DEFAULT                          \
+   | MASK_GP_DIRECT                            \
    | MASK_16_BIT                               \
    | MASK_PERF_EXT                             \
    | MASK_CMOV)


Monk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]