49#include "fputils/fp80.h"
69 return ((ncc_flags | cc_flags | cfof_bits | df_bit) & 0x3F7FD5)
93 for (
int i = 0;
i < 8; ++
i) {
95 const unsigned tag((ftw >> (2 *
i)) & 0x3);
118 for (
int i = 0;
i < 8; ++
i) {
119 const unsigned xtag(((ftwx >>
i) & 0x1));
124 ftw |= 0x3 << (2 *
i);
138 const uint8_t new_top((
top + spm + 8) % 8);
142 for (
int i =
top;
i != new_top;
i = (
i + 1 + 8) % 8)
143 ftw |= 0x3 << (2 *
i);
144 }
else if (spm < 0) {
148 for (
int i = new_top;
i !=
top;
i = (
i + 1 + 8) % 8)
149 ftw &= ~(0x3 << (2 *
i));
159 memcpy(fp80.bits, _mem, 10);
161 return fp80_cvtd(fp80);
167 fp80_t fp80 = fp80_cvfd(value);
168 memcpy(_mem, fp80.bits, 10);
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
virtual RegVal getReg(const RegId ®) const
virtual void setReg(const RegId ®, RegVal val)
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
double loadFloat80(const void *_mem)
Load an 80-bit float from memory and convert it to double.
void storeFloat80(void *_mem, double value)
Convert and store a double as an 80-bit float.
constexpr uint32_t CcFlagMask
uint8_t convX87TagsToXTags(uint16_t ftw)
Convert an x87 tag word to abridged tag format.
void setRFlags(ThreadContext *tc, uint64_t val)
Set update the rflags register and internal gem5 state.
uint16_t convX87XTagsToTags(uint8_t ftwx)
Convert an x87 xtag word to normal tags format.
uint64_t getRFlags(ThreadContext *tc)
Reconstruct the rflags register from the internal gem5 register state.
constexpr uint32_t CfofMask
uint16_t genX87Tags(uint16_t ftw, uint8_t top, int8_t spm)
Generate and updated x87 tag register after a push/pop operation.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.