tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Jump optimization questions - commit: 8227db3a


From: Ekaitz Zarraga
Subject: Re: [Tinycc-devel] Jump optimization questions - commit: 8227db3a
Date: Fri, 26 Aug 2022 19:47:51 +0000

Hi,


> > I have not other chance at the moment but make this backport, as well as I 
> > already did with GCC.
> > 
> > Maybe this makes some more sense to you now you know.
> 
> Actually no, it doesn't.

I'm not the best person to clarify it further. I didn't take this decision.
 
> > Could you please help me understand how this internals work?
> 
> Internals about cmp_r I assume. Let's see ...
> 
> $ grep -nrw cmp_r .
> 
> gives this (with hits in other target generators omitted):
> 
> ./riscv64-gen.c:325: int a = vtop->cmp_r & 0xff;
> 
> ./riscv64-gen.c:326: int b = (vtop->cmp_r >> 8) & 0xff;
> 
> ./riscv64-gen.c:979: int a = vtop->cmp_r & 0xff;
> 
> ./riscv64-gen.c:980: int b = (vtop->cmp_r >> 8) & 0xff;
> 
> ./riscv64-gen.c:1041: vtop->cmp_r = ireg(d) | 0 << 8;
> 
> ./riscv64-gen.c:1076: vtop->cmp_r = a | 0 << 8;
> 
> ./riscv64-gen.c:1093: vtop->cmp_r = a | b << 8;
> 
> ./tcc.h:525: struct { unsigned short cmp_op, cmp_r; }; /* VT_CMP operation */
> 
> Which is four lines to get its value and three lines to set it, in the
> generator, and one line in tcc.h to declare it.
> 
> Now you want to connect this generator with an older tcc version without
> riscv64 and no cmp_r declared in tcc.h. And ... what was the question?
> Whether it would make sense? No.


I'm just going to assume I didn't explain my doubt properly:

That is not the question. What I was wondering from the beginning was which use 
are you giving to cmp_r and if there was any equivalent before the commit I 
mentioned. The question is how was that done before, because i wasn't unable to 
grasp it myself. What should be used to store the registers? Was it possible 
before the commit?

It can make sense if the older header had a field to work with that kind of 
values but in a different fashion. The compiler was working before so it had a 
way to generate test expressions, didn't it? How did it pass that register 
information (maybe it didn't if the supported architectures use cpu flags)?
The thing is I'm unable to understand how the vtop is handled properly, the 
fields it has are obscure to me and the documentation is scarce.

What I was asking was if there's a field I can use for that. Or if there was an 
equivalent way to handle those values before the commit was done using any of 
the other fields vtop has.

Best regards,
Ekaitz






reply via email to

[Prev in Thread] Current Thread [Next in Thread]