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: [MIPS][LS2][3/5] Miscellaneous instructions


Maxim Kuvyrkov wrote:
Richard Sandiford wrote:

...

;; This mode macro allows :ANYF_MIPS5_LS2 to be used wherever
;; a scalar or Loongson2 vector floating-point mode is allowed.
(define_mode_macro ANYF_MIPS5_LS2
  [(SF "TARGET_HARD_FLOAT")
   (DF "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT")
   (V2SF "TARGET_PAIRED_SINGLE_FLOAT_MIPS5_LS2")])

Hence the instructions from MIPS5 ISA, which happen to be supported by Loongson2, are declared with ANYF_MIPS5_LS2 mode_iterator. I don't like this, but can't figure out alternative way to name / describe these instructions.

I'd prefer to keep TARGET_PAIRED_SINGLE_FLOAT for the cases that are common between Loongson and non-Loongson mode (i.e. the cases in which .ps is available in some form). Then add new ISA_HAS_FOO macros for each class of instruction that Loongson doesn't have. E.g.

ISA_HAS_PXX_PS

for PUU.PS & co.

Feel free to run a list of ISA_HAS_* macros by me before testing.

How does the following patch look? Now the patch disables certain .ps instruction when compiling for Loongson and uses everything else (in contrast, previous version enabled instruction that Loongson does support and disabled everything else).


I also noticed that the previous version of the patch didn't enable [n]madd3/msub3 instructions and fixed that in this one.

During testing I discovered that the last version of the patch doesn't properly handles paired-single float builtins.


The last field in mips_builtin_description is target_flags. For all builtins for paired-single float instructions target_flags is MASK_PAIRED_SINGLE_FLOAT. As this mask specifies backend to support all paired-single float instruction Loongson gets too much intrinsics it can't back up.

I think, I misunderstood your original suggestion to make MASK_PAIRED_SINGLE_FLOAT to specify instructions that both Loongson and generic MIPS5 have. If so, then we need a new mask to use with builtins that MIPS5 supports and Loongson doesn't.

--
Maxim


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