Chromium Code Reviews| Index: src/a64/instructions-a64.h |
| diff --git a/src/a64/instructions-a64.h b/src/a64/instructions-a64.h |
| index ec1fbf36f11c4f7b477c678fd724f005dc2d441d..e6f297680e5bfb934f8f04fd15f6201ba99c7bcf 100644 |
| --- a/src/a64/instructions-a64.h |
| +++ b/src/a64/instructions-a64.h |
| @@ -40,19 +40,31 @@ namespace internal { |
| // ISA constants. -------------------------------------------------------------- |
| typedef uint32_t Instr; |
| -const float kFP32PositiveInfinity = rawbits_to_float(0x7f800000); |
| -const float kFP32NegativeInfinity = rawbits_to_float(0xff800000); |
| -const double kFP64PositiveInfinity = rawbits_to_double(0x7ff0000000000000UL); |
| -const double kFP64NegativeInfinity = rawbits_to_double(0xfff0000000000000UL); |
| + |
| +#if defined(A64_DEFINE_FP_STATICS) |
| +#define DEFINE_FLOAT(name, value) extern const uint32_t name = value |
|
Rodolph Perfetta (ARM)
2014/02/06 11:51:21
did you mean to declare this extern and provide a
jochen (gone - plz use gerrit)
2014/02/06 11:59:47
no, that's not what will happen. The compiler will
Sven Panne
2014/02/06 12:08:48
http://media.giphy.com/media/3sjQViF0W1Mqs/giphy.g
|
| +#define DEFINE_DOUBLE(name, value) extern const uint64_t name = value |
|
Rodolph Perfetta (ARM)
2014/02/06 11:51:21
same here.
|
| +#else |
| +#define DEFINE_FLOAT(name, value) extern const float name |
| +#define DEFINE_DOUBLE(name, value) extern const double name |
| +#endif // defined(A64_DEFINE_FP_STATICS) |
| + |
| +DEFINE_FLOAT(kFP32PositiveInfinity, 0x7f800000); |
| +DEFINE_FLOAT(kFP32NegativeInfinity, 0xff800000); |
| +DEFINE_DOUBLE(kFP64PositiveInfinity, 0x7ff0000000000000UL); |
| +DEFINE_DOUBLE(kFP64NegativeInfinity, 0xfff0000000000000UL); |
| // This value is a signalling NaN as both a double and as a float (taking the |
| // least-significant word). |
| -static const double kFP64SignallingNaN = rawbits_to_double(0x7ff000007f800001); |
| -static const float kFP32SignallingNaN = rawbits_to_float(0x7f800001); |
| +DEFINE_DOUBLE(kFP64SignallingNaN, 0x7ff000007f800001); |
| +DEFINE_FLOAT(kFP32SignallingNaN, 0x7f800001); |
| // A similar value, but as a quiet NaN. |
| -static const double kFP64QuietNaN = rawbits_to_double(0x7ff800007fc00001); |
| -static const float kFP32QuietNaN = rawbits_to_float(0x7fc00001); |
| +DEFINE_DOUBLE(kFP64QuietNaN, 0x7ff800007fc00001); |
| +DEFINE_FLOAT(kFP32QuietNaN, 0x7fc00001); |
| + |
| +#undef DEFINE_FLOAT |
| +#undef DEFINE_DOUBLE |
| enum LSDataSize { |