Help with clz(0) and optimization

2023-10-31 Thread Enrico via Gcc
I am working on GCC for a target architecture where clz(0) is defined and is 32 (TriCore). The code under test is the following: #include int f(unsigned int a) { unsigned int res = 32 - __builtin_clz(a); if(res > 0) printf("test"); return res; } >From GCC version greater and equal to

Advice on how to disable floating point instructions

2023-11-04 Thread Enrico via Gcc
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

Re: Advice on how to disable floating point instructions

2023-11-05 Thread Enrico via Gcc
Best regards Enrico Il sab 4 nov 2023, 19:08 Andrew Pinski ha scritto: > On Sat, Nov 4, 2023 at 9:41 AM Enrico via Gcc wrote: > > > > Hello, > > > > > > for a custom architecture I am working on, I would like to entirely > disable > > the usage of hardwa

Understanding where a certain RTX comes from

2023-11-13 Thread Enrico via Gcc
Good evening, I need help understanding where some RTX comes from. In my target.md I have the following expansion: (define_expand "smaxsf3" [(parallel [(set (match_dup 3) (unspec:SI [(match_operand:SF 1 "register_operand" "") (match_operand:SF

Meaning of flag_pic

2024-09-26 Thread Enrico via Gcc
I am trying to understand how 'flag_pic' works. It is used extensively in TARGET_OPTION_OVERRIDE functions in the form 'if (flag_pic) ... '. The flags fPic and fpic have a default value of -1, so as far as I understand, if the two flags are not set in the command line, all 'if (flag_pic)' will be t

Re: Meaning of flag_pic

2024-09-26 Thread Enrico via Gcc
scritto: > On Thu, Sep 26, 2024 at 11:20:15PM +0200, Enrico via Gcc wrote: > > I am trying to understand how 'flag_pic' works. > > It is used extensively in TARGET_OPTION_OVERRIDE functions in the form > 'if > > (flag_pic) ... '. > > The flags fPic