There are 2 types of control instructions conditional

This preview shows page 1 - 3 out of 4 pages.

other means to alter its value, and thus change the location where the program will continue its execution. There are 2 types of control instructions:Conditional branch instructions are typically used to form loops. Since most loops tend to be small in size, the target address tends to be close to thebranch instruction. When the target instruction is close enough to the current instruction, then the target can be specified relative to the current instructionwith a small offset. A branch instruction could be described as the equivalent of “If X0 is not 0, then skip the next 5 instructions.” In addition to the offsetbeing positive (forward branch), the branch instruction also allows a negative offset (backwards branch). Such a branch would be useful in an instructionthat does the equivalent of “If the loop is not done, go back 100 instructions and execute it again.” This is called PC-relative addressing. Note that all PC-relative addressing is in terms of instructions rather than bytes, so the offset encoded is always right shifted by two versus the true byteoffset of the target from the current PC.There are two types of conditional branches, equalityconditional branches and condition-codeconditional branches. Equality conditional branches arethe simplest and only test for a register being equal to or not equal to zero. For example:CBZX0, label // if X0 == 0 then go to labelCBNZX0, label // if X0 != 0 then go to labelWhile equality branches are sufficient for many cases, they do not easily allow more complicated tests often used in higher-level languages. To deal withthese cases, ARMv8 also includes condition-code based branches. These branches use the processor state flags which are set by certain arithmeticoperations. In particular, ARMv8 has the following processor state condition flags as shown in Table 2.1:Table 2.1. Condition flagsThese flags can be set by any arithmetic operation with the trailing "S" as described in the book (e.g.ADDSfor add operation with flagset).So for instance the following code:eCampusePortfoliosCommunityContent CollectionJacob Geller
6/1/2018Review Test Submission: Prelab 03: ARMv8 Control Instructions ...ResultsDisplayedAll Answers, Submitted Answers, FeedbackCodeEncodingMeaning (when set by CMP)Meaning (when set by FCMP)Condition flagsEQ0b0000Equal to.Equal to.Z =1NE0b0001Not equal to.Unordered, or not equal to.Z = 0CS0b0010Carry set (identical to HS).Greater than, equal to, or unordered (identicalto HS).C = 1HS0b0010Greater than, equal to (unsigned) (identicalto CS).Greater than, equal to, or unordered (identicalto CS).C = 1CC0b0011Carry clear (identical to LO).Less than (identical to LO).C = 0LO0b0011Unsigned less than (identical to CC).Less than (identical to CC).C = 0MI0b0100Minus, Negative.Less than.N = 1PL0b0101Positive or zero.Greater than, equal to, or unordered.N = 0VS0b0110Signed overflow.Unordered. (At least one argument was NaN).V = 1VC

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture