qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-mips: Stop using uint_fast*_t types in r4k_tlb_t struct
@ 2016-01-25 17:40 Peter Maydell
  2016-01-29  8:46 ` Aurelien Jarno
  2016-02-02 10:49 ` Leon Alrae
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Maydell @ 2016-01-25 17:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Leon Alrae, Aurelien Jarno, patches

The r4k_tlb_t structure uses the uint_fast*_t types. Most of these
uses are in bitfields and are thus pointless, because the bitfield
itself specifies the width of the type; just use 'unsigned int'
instead. (On glibc uint_fast16_t is defined as either 32 or 64 bits,
so we know the code is not reliant on it being exactly 16 bits.)
There is also one use of uint_fast8_t, which we replace with uint8_t,
because both are exactly 8 bits on glibc and this is the only
place outside the softfloat code which uses an int_fast*_t type.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
I'm going to have a go at getting rid of the int_fast16_t usage
in the softfloat code too, but in the meantime this is an
independent cleanup.

 target-mips/cpu.h | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index 17817c3..86b6333 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -19,19 +19,19 @@ typedef struct r4k_tlb_t r4k_tlb_t;
 struct r4k_tlb_t {
     target_ulong VPN;
     uint32_t PageMask;
-    uint_fast8_t ASID;
-    uint_fast16_t G:1;
-    uint_fast16_t C0:3;
-    uint_fast16_t C1:3;
-    uint_fast16_t V0:1;
-    uint_fast16_t V1:1;
-    uint_fast16_t D0:1;
-    uint_fast16_t D1:1;
-    uint_fast16_t XI0:1;
-    uint_fast16_t XI1:1;
-    uint_fast16_t RI0:1;
-    uint_fast16_t RI1:1;
-    uint_fast16_t EHINV:1;
+    uint8_t ASID;
+    unsigned int G:1;
+    unsigned int C0:3;
+    unsigned int C1:3;
+    unsigned int V0:1;
+    unsigned int V1:1;
+    unsigned int D0:1;
+    unsigned int D1:1;
+    unsigned int XI0:1;
+    unsigned int XI1:1;
+    unsigned int RI0:1;
+    unsigned int RI1:1;
+    unsigned int EHINV:1;
     uint64_t PFN[2];
 };
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] target-mips: Stop using uint_fast*_t types in r4k_tlb_t struct
  2016-01-25 17:40 [Qemu-devel] [PATCH] target-mips: Stop using uint_fast*_t types in r4k_tlb_t struct Peter Maydell
@ 2016-01-29  8:46 ` Aurelien Jarno
  2016-02-02 10:49 ` Leon Alrae
  1 sibling, 0 replies; 5+ messages in thread
From: Aurelien Jarno @ 2016-01-29  8:46 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Leon Alrae, qemu-devel, patches

On 2016-01-25 17:40, Peter Maydell wrote:
> The r4k_tlb_t structure uses the uint_fast*_t types. Most of these
> uses are in bitfields and are thus pointless, because the bitfield
> itself specifies the width of the type; just use 'unsigned int'
> instead. (On glibc uint_fast16_t is defined as either 32 or 64 bits,
> so we know the code is not reliant on it being exactly 16 bits.)
> There is also one use of uint_fast8_t, which we replace with uint8_t,
> because both are exactly 8 bits on glibc and this is the only
> place outside the softfloat code which uses an int_fast*_t type.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> I'm going to have a go at getting rid of the int_fast16_t usage
> in the softfloat code too, but in the meantime this is an
> independent cleanup.
> 
>  target-mips/cpu.h | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)

Thanks for the cleanup.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] target-mips: Stop using uint_fast*_t types in r4k_tlb_t struct
  2016-01-25 17:40 [Qemu-devel] [PATCH] target-mips: Stop using uint_fast*_t types in r4k_tlb_t struct Peter Maydell
  2016-01-29  8:46 ` Aurelien Jarno
@ 2016-02-02 10:49 ` Leon Alrae
  2016-02-18 11:51   ` Peter Maydell
  1 sibling, 1 reply; 5+ messages in thread
From: Leon Alrae @ 2016-02-02 10:49 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Aurelien Jarno, patches

On 25/01/16 17:40, Peter Maydell wrote:
> The r4k_tlb_t structure uses the uint_fast*_t types. Most of these
> uses are in bitfields and are thus pointless, because the bitfield
> itself specifies the width of the type; just use 'unsigned int'
> instead. (On glibc uint_fast16_t is defined as either 32 or 64 bits,
> so we know the code is not reliant on it being exactly 16 bits.)
> There is also one use of uint_fast8_t, which we replace with uint8_t,
> because both are exactly 8 bits on glibc and this is the only
> place outside the softfloat code which uses an int_fast*_t type.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> I'm going to have a go at getting rid of the int_fast16_t usage
> in the softfloat code too, but in the meantime this is an
> independent cleanup.
> 
>  target-mips/cpu.h | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)

Applied to target-mips tree, thanks.

Leon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] target-mips: Stop using uint_fast*_t types in r4k_tlb_t struct
  2016-02-02 10:49 ` Leon Alrae
@ 2016-02-18 11:51   ` Peter Maydell
  2016-02-18 19:42     ` Leon Alrae
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2016-02-18 11:51 UTC (permalink / raw)
  To: Leon Alrae; +Cc: qemu-devel, Aurelien Jarno, patches

On 2 February 2016 at 10:49, Leon Alrae <leon.alrae@imgtec.com> wrote:
> On 25/01/16 17:40, Peter Maydell wrote:
>> The r4k_tlb_t structure uses the uint_fast*_t types. Most of these
>> uses are in bitfields and are thus pointless, because the bitfield
>> itself specifies the width of the type; just use 'unsigned int'
>> instead. (On glibc uint_fast16_t is defined as either 32 or 64 bits,
>> so we know the code is not reliant on it being exactly 16 bits.)
>> There is also one use of uint_fast8_t, which we replace with uint8_t,
>> because both are exactly 8 bits on glibc and this is the only
>> place outside the softfloat code which uses an int_fast*_t type.
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>> I'm going to have a go at getting rid of the int_fast16_t usage
>> in the softfloat code too, but in the meantime this is an
>> independent cleanup.
>>
>>  target-mips/cpu.h | 26 +++++++++++++-------------
>>  1 file changed, 13 insertions(+), 13 deletions(-)
>
> Applied to target-mips tree, thanks.

Hi -- is this going to appear in master soon? I have another patch
pending that depends on it...

thanks
-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] target-mips: Stop using uint_fast*_t types in r4k_tlb_t struct
  2016-02-18 11:51   ` Peter Maydell
@ 2016-02-18 19:42     ` Leon Alrae
  0 siblings, 0 replies; 5+ messages in thread
From: Leon Alrae @ 2016-02-18 19:42 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, Aurelien Jarno, patches

On 18/02/16 11:51, Peter Maydell wrote:
> On 2 February 2016 at 10:49, Leon Alrae <leon.alrae@imgtec.com> wrote:
>> On 25/01/16 17:40, Peter Maydell wrote:
>>> The r4k_tlb_t structure uses the uint_fast*_t types. Most of these
>>> uses are in bitfields and are thus pointless, because the bitfield
>>> itself specifies the width of the type; just use 'unsigned int'
>>> instead. (On glibc uint_fast16_t is defined as either 32 or 64 bits,
>>> so we know the code is not reliant on it being exactly 16 bits.)
>>> There is also one use of uint_fast8_t, which we replace with uint8_t,
>>> because both are exactly 8 bits on glibc and this is the only
>>> place outside the softfloat code which uses an int_fast*_t type.
>>>
>>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>>> ---
>>> I'm going to have a go at getting rid of the int_fast16_t usage
>>> in the softfloat code too, but in the meantime this is an
>>> independent cleanup.
>>>
>>>  target-mips/cpu.h | 26 +++++++++++++-------------
>>>  1 file changed, 13 insertions(+), 13 deletions(-)
>>
>> Applied to target-mips tree, thanks.
> 
> Hi -- is this going to appear in master soon? I have another patch
> pending that depends on it...

I'm out of office this week and will be able to send a pull request
early next week. If you are planning to apply that another patch
earlier, then please feel free to include this one in your pull request.

Thanks,
Leon

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-18 19:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-25 17:40 [Qemu-devel] [PATCH] target-mips: Stop using uint_fast*_t types in r4k_tlb_t struct Peter Maydell
2016-01-29  8:46 ` Aurelien Jarno
2016-02-02 10:49 ` Leon Alrae
2016-02-18 11:51   ` Peter Maydell
2016-02-18 19:42     ` Leon Alrae

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).