Le 04/09/2017 à 18:38, Kamil Rytarowski a écrit : > On 04.09.2017 18:17, Peter Maydell wrote: >> On 4 September 2017 at 16:53, Laurent Vivier <laur...@vivier.eu> wrote: >>> Le 04/09/2017 à 17:02, Peter Maydell a écrit : >>>> On 4 September 2017 at 15:09, Laurent Vivier <laur...@vivier.eu> wrote: >>>>> You can: >>>>> >>>>> either replace the "#define floatx80_pi make_floatx80(...)" by a "const >>>>> floatx80 floatx80_pi = make_floatx80_init(...)" >>>>> >>>>> or replace all the macros in the m68k/fpu_helper.c array by >>>>> make_floatx80_init(...) >>>> >>>> Taking a step back, what's different about floatx80 and float12 >>>> that means they need separate _init and non-init versions of >>>> the macros, when for float16/float32/float64 we instead have >>>> #define make_float32(x) __extension__ ({ float32 f32_val = {x}; f32_val; }) >>>> #define const_float32(x) { x } >>> >>> floatx80/float128 are structureq while float16/float32/float64 are >>> native data types. >> >> If USE_SOFTFLOAT_STRUCT_TYPES is defined then float16/32/64 are >> also struct types and use the make_ and const_ macros as above. >> >> (We should check whether USE_SOFTFLOAT_STRUCT_TYPES still builds, >> it tends to bitrot. If it does then maybe we should use it by default >> since gcc 3 is now just a memory...) >> > > USE_SOFTFLOAT_STRUCT_TYPES breaks for me on SmartOS: > > migration/vmstate-types.c: In function 'put_float64': > migration/vmstate-types.c:430:5: error: conversion to non-scalar type > requested > >>>> ? Could we move to consistency for the macro naming we're using? >>> >>> Do you mean "s/make_floatx80_init/const_floatx80/"? >> >> Yes (and the same implementation would be nice too). >> > > I will push my patch as is and later it can be refactored by a > maintainer. Is this fine? > > https://github.com/NetBSD/pkgsrc-wip/blob/master/qemu-git/patches/patch-target_m68k_fpu__helper.c >
If Peter agrees, the patch is good for me as is: I never liked the mix of macros and values in this array. Send it to the list, I will put it in my next pull request. Thanks, Laurent
signature.asc
Description: OpenPGP digital signature