diff mbox series

[v1,1/7] fpu: move LIT64 helper to softfloat-types

Message ID 20190808164117.23348-2-alex.bennee@linaro.org
State Superseded
Headers show
Series softfloat header cleanups | expand

Commit Message

Alex Bennée Aug. 8, 2019, 4:41 p.m. UTC
This simple pasting helper can be used by those who don't need the
entire softfloat api. Move it to the smaller types header.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 include/fpu/softfloat-types.h | 2 ++
 include/fpu/softfloat.h       | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.20.1

Comments

Richard Henderson Aug. 8, 2019, 5:28 p.m. UTC | #1
On 8/8/19 9:41 AM, Alex Bennée wrote:
> This simple pasting helper can be used by those who don't need the

> entire softfloat api. Move it to the smaller types header.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> ---

>  include/fpu/softfloat-types.h | 2 ++

>  include/fpu/softfloat.h       | 2 --

>  2 files changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h

> index 2aae6a89b19..7e88152dfc4 100644

> --- a/include/fpu/softfloat-types.h

> +++ b/include/fpu/softfloat-types.h

> @@ -80,6 +80,8 @@ this code that are retained.

>  #ifndef SOFTFLOAT_TYPES_H

>  #define SOFTFLOAT_TYPES_H

>  

> +#define LIT64( a ) a##LL


Better would be to replace all uses with {,U}INT64_C from <stdint.h>.

But if you prefer this smaller patch for now,
Acked-by: Richard Henderson <richard.henderson@linaro.org>



r~
Peter Maydell Aug. 9, 2019, 10:08 a.m. UTC | #2
On Thu, 8 Aug 2019 at 17:41, Alex Bennée <alex.bennee@linaro.org> wrote:
>

> This simple pasting helper can be used by those who don't need the

> entire softfloat api. Move it to the smaller types header.

>

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> ---

>  include/fpu/softfloat-types.h | 2 ++

>  include/fpu/softfloat.h       | 2 --

>  2 files changed, 2 insertions(+), 2 deletions(-)


I think we should be trying to get rid of uses of this
macro, not making it easier to use in more places...

thanks
-- PMM
Alex Bennée Aug. 10, 2019, 10:03 a.m. UTC | #3
Peter Maydell <peter.maydell@linaro.org> writes:

> On Thu, 8 Aug 2019 at 17:41, Alex Bennée <alex.bennee@linaro.org> wrote:

>>

>> This simple pasting helper can be used by those who don't need the

>> entire softfloat api. Move it to the smaller types header.

>>

>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>> ---

>>  include/fpu/softfloat-types.h | 2 ++

>>  include/fpu/softfloat.h       | 2 --

>>  2 files changed, 2 insertions(+), 2 deletions(-)

>

> I think we should be trying to get rid of uses of this

> macro, not making it easier to use in more places...


True - that is a more invasive (but mechanical) patch.

--
Alex Bennée
diff mbox series

Patch

diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h
index 2aae6a89b19..7e88152dfc4 100644
--- a/include/fpu/softfloat-types.h
+++ b/include/fpu/softfloat-types.h
@@ -80,6 +80,8 @@  this code that are retained.
 #ifndef SOFTFLOAT_TYPES_H
 #define SOFTFLOAT_TYPES_H
 
+#define LIT64( a ) a##LL
+
 /* This 'flag' type must be able to hold at least 0 and 1. It should
  * probably be replaced with 'bool' but the uses would need to be audited
  * to check that they weren't accidentally relying on it being a larger type.
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index 3ff3fa52245..d9333eb65b8 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -82,8 +82,6 @@  this code that are retained.
 #ifndef SOFTFLOAT_H
 #define SOFTFLOAT_H
 
-#define LIT64( a ) a##LL
-
 /*----------------------------------------------------------------------------
 | Software IEC/IEEE floating-point ordering relations
 *----------------------------------------------------------------------------*/