Thank you Andrew for the hint. I noticed that the option Mask() is used a lot with the flag msoft-float. The documentation states that Mask sets a flag in the target_flags variable. What is the advantage of setting a flag in target_flags, compared to using Var() on a custom variable?
Thank you Best regards Enrico Il sab 4 nov 2023, 19:08 Andrew Pinski <pins...@gmail.com> ha scritto: > On Sat, Nov 4, 2023 at 9:41 AM Enrico via Gcc <gcc@gcc.gnu.org> wrote: > > > > Hello, > > > > > > for a custom architecture I am working on, I would like to entirely > disable > > the usage of hardware floating point instructions in favor of library > > methods on demand. > > > > I need advice on what is the best strategy to do this. My idea is to: > > > > - create a new flag (let's say -m[no-]float-insn or something like that > > A few backends use -msoft-float to handle that. (mips and rs6000 for > examples). > And yes GCC outputs library calls for floating point in those cases. > > Thanks, > Andrew > > > > > - use the value of the flag in the condition of every define_insn in the > > machine description to inhibit their usage if the flag is active > > > > > > My questions: > > > > - Is this a good strategy? Or would you suggest a better solution? > > > > - If I switch all floating point instructions off, will GCC automatically > > use their software counterpart, from the builtins or libraries, by > finding > > them via their instruction patterns? > > > > - I noticed that some opcodes of our architecture can be found in the > > assembler, but they are not available in the GCC backend. How can I > inhibit > > the usage of those instructions? Shall I explicitly add to the machine > > description and then disable them with their condition? > > > > > > Thank you for your suggestions. > > > > I am new in this (difficult) business and I am trying to learn. > > > > > > Kind regards > > > > Enrico Bragante >