什么时候修改CPSR GE[3:0]位

When will CPSR GE[3:0] bits be modified

我在 ARM 文档中读到:

GE[3:0], bits[19:16] The instructions described in Parallel addition and subtraction instructions on page A4-171 update these flags to indicate the results from individual bytes or halfwords of the operation. These flags can control a later SEL instruction.

那么显然 GE[3:0] 代表 "eq/lt/gt"?

我遇到了几个奇怪的问题,我还没有任何线索,但它们都有 CPSR 值 xxxf0030,所以 GE 位是 0b1111?那代表什么?这些GE位正常吗?

提前致谢!

在 ARMv7 ARM(匹配该文本)中,如何设置 GE 标志的详细信息仅在并行指令本身的操作伪代码中。可悲的是,他们似乎已经删除了 ARMv6 ARM 中的这个很好的散文描述:

Instructions that operate on halfwords:

  • set or clear GE[3:2] together, based on the result of the top halfword calculation
  • set or clear GE[1:0] together, based on the result of the bottom halfword calculation.

Instructions that operate on bytes:

  • set or clear GE[3] according to the result of the top byte calculation
  • set or clear GE[2] according to the result of the second byte calculation
  • set or clear GE[1] according to the result of the third byte calculation
  • set or clear GE[0] according to the result of the bottom byte calculation.

Each bit is set (otherwise cleared) if the results of the corresponding calculation are as follows:

  • for unsigned byte addition, if the result is greater than or equal to 2^8
  • for unsigned halfword addition, if the result is greater than or equal to 2^16
  • for unsigned subtraction, if the result is greater than or equal to zero
  • for signed arithmetic, if the result is greater than or equal to zero.

作为算术标志,它们可以有任何旧值(重置时未定义,可以通过 APSR 自由写入),所以除非你专门使用其中一条设置它们的指令,否则它们几乎是无意义,可以忽略。