1/* |
2 * Copyright (c) 2015-2016, 2018 ARM Limited |
3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 619 unchanged lines hidden (view full) --- 630/** 631 * Calls required for serialization/deserialization 632 */ 633/** @{ */ 634template <size_t Sz> 635inline bool 636to_number(const std::string& value, VecRegContainer<Sz>& v) 637{ |
638 fatal_if(value.size() > 2 * VecRegContainer<Sz>::SIZE, 639 "Vector register value overflow at unserialize"); 640 641 for (int i = 0; i < VecRegContainer<Sz>::SIZE; i++) { 642 uint8_t b = 0; 643 if (2 * i < value.size()) 644 b = stoul(value.substr(i * 2, 2), nullptr, 16); 645 v.template raw_ptr<uint8_t>()[i] = b; |
646 } 647 return true; 648} 649/** @} */ 650 651#endif /* __ARCH_GENERIC_VEC_REG_HH__ */ |