0

I read in ARM docs that:

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.

So apparently GE[3:0] stands for "eq/lt/gt"?

I came into a couple of strange issues which I yet don't have a clue, but they all have CPSR value xxxf0030, so the GE bits are 0b1111? What does that stands for? Is it normal for these GE bits?

Thanks in advance!

Bill Randerson
  • 1,028
  • 1
  • 11
  • 29

1 Answers1

1

In the ARMv7 ARM (which matches that text), the details of how the GE flags get set are only in the operation pseudocode of the parallel instructions themselves. Sadly, they seem to have removed this nice prose description which was in the 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.

As arithmetic flags, they could have any old value (undefined at reset, and can be freely written to via APSR), so until you've specifically used one of the instructions which sets them, they're pretty much meaningless and can be ignored.

Notlikethat
  • 20,095
  • 3
  • 40
  • 77