From b10922fb33b620b5fe384ca4a708681de1f92c25 Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Sun, 4 Mar 2018 23:03:52 -0500 Subject: [PATCH] target/m68k: Switch fpu_rom from make_floatx80() to make_floatx80_init() GCC 4.7.2 on SunOS reports that the values assigned to array members are not real constants: target/m68k/fpu_helper.c:32:5: error: initializer element is not constant target/m68k/fpu_helper.c:32:5: error: (near initialization for 'fpu_rom[0]') rules.mak:66: recipe for target 'target/m68k/fpu_helper.o' failed Convert the array to make_floatx80_init() to fix it. Replace floatx80_pi-like constants with make_floatx80_init() as they are defined as make_floatx80(). This fixes build on SmartOS (Joyent). Backports commit 6fa9ba09dbf4eb8b52bcb47d6820957f1b77ee0b from qemu --- qemu/target/m68k/fpu_helper.c | 44 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/qemu/target/m68k/fpu_helper.c b/qemu/target/m68k/fpu_helper.c index bbb83d94..a7c537c3 100644 --- a/qemu/target/m68k/fpu_helper.c +++ b/qemu/target/m68k/fpu_helper.c @@ -29,15 +29,15 @@ */ static const floatx80 fpu_rom[128] = { - floatx80_pi, /* Pi */ + make_floatx80_init(0x4000, 0xc90fdaa22168c235ULL), /* Pi */ {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, - make_floatx80(0x3ffd, 0x9a209a84fbcff798ULL), /* Log10(2) */ - make_floatx80(0x4000, 0xadf85458a2bb4a9aULL), /* e */ - make_floatx80(0x3fff, 0xb8aa3b295c17f0bcULL), /* Log2(e) */ - make_floatx80(0x3ffd, 0xde5bd8a937287195ULL), /* Log10(e) */ - floatx80_zero, /* Zero */ + make_floatx80_init(0x3ffd, 0x9a209a84fbcff798ULL), /* Log10(2) */ + make_floatx80_init(0x4000, 0xadf85458a2bb4a9aULL), /* e */ + make_floatx80_init(0x3fff, 0xb8aa3b295c17f0bcULL), /* Log2(e) */ + make_floatx80_init(0x3ffd, 0xde5bd8a937287195ULL), /* Log10(e) */ + make_floatx80_init(0x0000, 0x0000000000000000ULL), /* Zero */ {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, @@ -46,22 +46,22 @@ static const floatx80 fpu_rom[128] = { {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, - floatx80_ln2, /* ln(2) */ - make_floatx80(0x4000, 0x935d8dddaaa8ac17ULL), /* ln(10) */ - floatx80_one, /* 10^0 */ - make_floatx80(0x4002, 0xa000000000000000ULL), /* 10^1 */ - make_floatx80(0x4005, 0xc800000000000000ULL), /* 10^2 */ - make_floatx80(0x400c, 0x9c40000000000000ULL), /* 10^4 */ - make_floatx80(0x4019, 0xbebc200000000000ULL), /* 10^8 */ - make_floatx80(0x4034, 0x8e1bc9bf04000000ULL), /* 10^16 */ - make_floatx80(0x4069, 0x9dc5ada82b70b59eULL), /* 10^32 */ - make_floatx80(0x40d3, 0xc2781f49ffcfa6d5ULL), /* 10^64 */ - make_floatx80(0x41a8, 0x93ba47c980e98ce0ULL), /* 10^128 */ - make_floatx80(0x4351, 0xaa7eebfb9df9de8eULL), /* 10^256 */ - make_floatx80(0x46a3, 0xe319a0aea60e91c7ULL), /* 10^512 */ - make_floatx80(0x4d48, 0xc976758681750c17ULL), /* 10^1024 */ - make_floatx80(0x5a92, 0x9e8b3b5dc53d5de5ULL), /* 10^2048 */ - make_floatx80(0x7525, 0xc46052028a20979bULL), /* 10^4096 */ + make_floatx80_init(0x3ffe, 0xb17217f7d1cf79acULL), /* ln(2) */ + make_floatx80_init(0x4000, 0x935d8dddaaa8ac17ULL), /* ln(10) */ + make_floatx80_init(0x3fff, 0x8000000000000000ULL), /* 10^0 */ + make_floatx80_init(0x4002, 0xa000000000000000ULL), /* 10^1 */ + make_floatx80_init(0x4005, 0xc800000000000000ULL), /* 10^2 */ + make_floatx80_init(0x400c, 0x9c40000000000000ULL), /* 10^4 */ + make_floatx80_init(0x4019, 0xbebc200000000000ULL), /* 10^8 */ + make_floatx80_init(0x4034, 0x8e1bc9bf04000000ULL), /* 10^16 */ + make_floatx80_init(0x4069, 0x9dc5ada82b70b59eULL), /* 10^32 */ + make_floatx80_init(0x40d3, 0xc2781f49ffcfa6d5ULL), /* 10^64 */ + make_floatx80_init(0x41a8, 0x93ba47c980e98ce0ULL), /* 10^128 */ + make_floatx80_init(0x4351, 0xaa7eebfb9df9de8eULL), /* 10^256 */ + make_floatx80_init(0x46a3, 0xe319a0aea60e91c7ULL), /* 10^512 */ + make_floatx80_init(0x4d48, 0xc976758681750c17ULL), /* 10^1024 */ + make_floatx80_init(0x5a92, 0x9e8b3b5dc53d5de5ULL), /* 10^2048 */ + make_floatx80_init(0x7525, 0xc46052028a20979bULL), /* 10^4096 */ }; int32_t HELPER(reds32)(CPUM68KState *env, FPReg *val)