4 ms·
Perhaps I'm jumping ahead of the series here, but one of the unique (I think?) features of ARM is that all the various conditionals listed (NE, EQ, LT etc) can
by joosters 11y ago
Perhaps I'm jumping ahead of the series here, but one of the unique (I think?) features of ARM is that all the various conditionals listed (NE, EQ, LT etc) can be applied to just about any instruction, and not just a branch. So, you could have an instruction sequence like:
SUBS R1,R2,R3
ADDEQ R4,R4,#1
whereas in other instruction sets you'd have to branch over the 'ADD' instruction if the previous comparison was non-zero.
(Not sure if this applies to ARM thumb style instructions or not; my ARM experience is very out of date!)
- ksherlock 11y agoThumb and Arm64 dropped support for conditional execution.
- leicmi 11y agoFor ARM thumb2 style you need a third instruction between the two: IT EQ The 'IT' is for 'if then'. There could also be more 'then's and 'else's for the conditional execution of muliple instructions: ITTE LT (If then then else) The following instructions could for example be: ADDEQ ... STREQ ... BNE ... (Branch - not equal because of the else) Source: http://community.arm.com/groups/processors/blog/2010/09/30/condition-codes-3-conditional-execution-in-thumb-2 http://community.arm.com/groups/processors/blog/2010/09/30/c...
- mtklein 11y agoSort of. Thumb requires that you use an 'it' instruction before a block of up to 4 conditional instructions. Think "if-then". You can make each instruction a 'then' or an 'else' by instruction variants. E.g. something like ittee eq addeq ... addeq ... addne ... addne ... I believe ARM v8 dropped all this.
- Hoff 11y agoYou might be interested in Itanium and the IA-64 architecture, which has what is referred to as branch predication: http://www.cs.umd.edu/class/fall2001/cmsc411/projects/IA64-2/411project.htm http://www.cs.umd.edu/class/fall2001/cmsc411/projects/IA64-2... http://www.drdobbs.com/embedded-systems/predication-speculation-and-modern-cpus/184404099 http://www.drdobbs.com/embedded-systems/predication-speculat... Predication allows all of the code to be executed, and a subset of the results of the code — those from the failing test — discarded.