简体   繁体   English

Power ISA 中有标志寄存器吗?

[英]Is there a flag register in the Power ISA?

Is there a flag register in the Power ISA, similar to EFLAGS in the x86 machines? Power ISA中是否有标志寄存器,类似于x86机器中的EFLAGS? It could have some other name, for example it could be called "Status Register" or something of that kind, but its purpose would be saving some general attributes of the last instruction execution, for example overflow and carriage flags in arithmetic operations or the result of comparision two integer numbers before making a conditional jump.它可以有其他名称,例如它可以称为“状态寄存器”或类似的名称,但其目的是保存最后一条指令执行的一些一般属性,例如算术运算或结果中的溢出和回车标志在进行条件跳转之前比较两个 integer 数字。 I know, SPARC and ARM processors have such a register while MIPS and RISC-V ISAs are deprived of it.我知道,SPARC 和 ARM 处理器有这样的寄存器,而 MIPS 和 RISC-V ISA 则没有。 What's about another popular architecture - Power (from PowerPC to Power10)?另一种流行的架构——Power(从 PowerPC 到 Power10)呢? What approach is adopted in this architecture, concerning flags and this register?在这个架构中采用什么方法,关于标志和这个寄存器? How can one check for an overflow when say adding two unsigned 64-bit integer numbers?当说添加两个无符号的 64 位 integer 数字时,如何检查溢出? How is comparing two integer numbers and conditional branching on the results of this comparision organized in this processor on the ISA level?如何在 ISA 级别上比较两个 integer 数字和此比较结果的条件分支?

Could anybody enumerate all popular well-known general purpose RISC architectures and notify which ones have a flag (or status) registers and which ones don't?任何人都可以列举所有流行的众所周知的通用 RISC 架构并通知哪些有标志(或状态)寄存器,哪些没有?

They are called the Condition Register(s) on PowerPC.它们在 PowerPC 上称为条件寄存器。

2.3.1 Condition Register 2.3.1 条件寄存器

The Condition Register (CR) is a 32-bit register which reflects the result of certain operations, and provides a mechanism for testing (and branching).条件寄存器 (CR) 是一个 32 位寄存器,它反映特定操作的结果,并提供测试(和分支)机制。

The bits in the Condition Register are grouped into eight 4-bit fields, named CR Field 0 (CR0),..., CR Field 7 (CR7), which are set in one of the following ways.条件寄存器中的位分为 8 个 4 位字段,分别命名为 CR 字段 0 (CR0)、...、CR 字段 7 (CR7),它们以下列方式之一设置。

The Power architectures have multiple sets of flags: 8 of 4-bit condition codes, CR0-CR7, held collectively in one 32-bit condition register — when you use compare instructions and branch instruction, you choose which 4-bit flags field to target. Power 架构具有多组标志:8 个 4 位条件代码 CR0-CR7,共同保存在一个 32 位条件寄存器中 — 当您使用比较指令和分支指令时,您可以选择要定位的 4 位标志字段. Some instructions implicitly target CR0 or CR1.一些指令隐含地以 CR0 或 CR1 为目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM