2c2
< * Copyright (c) 2010, 2012-2013 ARM Limited
---
> * Copyright (c) 2010, 2012-2013, 2017-2018 ARM Limited
160a161,163
> /** Floating point data types. */
> enum class FpDataType { Fp16, Fp32, Fp64 };
>
162c165
< vfp_modified_imm(uint8_t data, bool wide)
---
> vfp_modified_imm(uint8_t data, FpDataType dtype)
166,171c169,176
< if (wide) {
< repData = bits(data, 6) ? 0xFF : 0;
< bigData = (bits(bigData, 5, 0) << 48) |
< (repData << 54) | (bits(~bigData, 6) << 62) |
< (bits(bigData, 7) << 63);
< } else {
---
> switch (dtype) {
> case FpDataType::Fp16:
> repData = bits(data, 6) ? 0x3 : 0;
> bigData = (bits(bigData, 5, 0) << 6) |
> (repData << 12) | (bits(~bigData, 6) << 14) |
> (bits(bigData, 7) << 15);
> break;
> case FpDataType::Fp32:
175a181,189
> break;
> case FpDataType::Fp64:
> repData = bits(data, 6) ? 0xFF : 0;
> bigData = (bits(bigData, 5, 0) << 48) |
> (repData << 54) | (bits(~bigData, 6) << 62) |
> (bits(bigData, 7) << 63);
> break;
> default:
> assert(0);
179a194,205
> static inline FpDataType
> decode_fp_data_type(uint8_t encoding)
> {
> switch (encoding) {
> case 1: return FpDataType::Fp16;
> case 2: return FpDataType::Fp32;
> case 3: return FpDataType::Fp64;
> default:
> panic(
> "Invalid floating point data type in VFP/SIMD or SVE instruction");
> }
> }