4 ms·
Instructions that update some flags and not others have to be serialised in this design.
by inigyou 4mo ago
Instructions that update some flags and not others have to be serialised in this design.
- phire 4mo agoTrue, and I wouldn't be surprised if modern x86 implementations need to do something a bit smarter. But if you are designing a new ISA for the modern era (the purported selling point of RISC-V), you just don't implement any such instructions. Only implement clean instructions that update all the flags or none. ARM and PowerPC already did this 35-40 years ago.
- adrian_b 4mo agoIn ISAs where this problem exists, i.e. in x86-64 where the carry flag is updated or not updated regardless of what happens with the other flags, the flags register is split into 2 separate registers, which are renamed independently. The 2 parts of the flags register are reunited only for the purpose of saving or restoring from the main memory. (Actually the x86-64 flags register has 3 independent parts, the carry flag, the other status flags, and a set of configuration flags, which are not modified by most instructions.)