break;
case INSN:
- /* Instructions using or affecting the condition codes make it
- fail. */
+ /* Check the instruction is explicitly marked as predicable.
+ Instructions using or affecting the condition codes are not. */
scanbody = PATTERN (this_insn);
if (!(GET_CODE (scanbody) == SET
|| GET_CODE (scanbody) == PARALLEL)
+ || get_attr_predicable (this_insn) != PREDICABLE_YES
|| get_attr_conds (this_insn) != CONDS_NOCOND)
fail = TRUE;
break;
;
; NOCOND means that the instruction does not use or alter the condition
; codes but can be converted into a conditionally exectuted instruction.
+; Given that NOCOND is the default for most instructions if omitted,
+; the attribute predicable must be set to yes as well.
(define_attr "conds" "use,set,clob,unconditional,nocond"
(if_then_else
revsh%?\t%0, %1"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
+ (set_attr "predicable" "no,yes,yes")
(set_attr "type" "rev")]
)
rev16%?\t%0, %1"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
+ (set_attr "predicable" "no,yes,yes")
(set_attr "type" "rev")]
)
rev16%?\t%0, %1"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
+ (set_attr "predicable" "no,yes,yes")
(set_attr "type" "rev")]
)
rev16%?\t%0, %1"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
+ (set_attr "predicable" "no,yes,yes")
(set_attr "type" "rev")]
)
of the instructions. Add an -mtune option known to facilitate that. */
/* { dg-additional-options "-O2 -mtune=cortex-a53" } */
/* { dg-final { scan-assembler-not "orr\[ \t\]" } } */
-/* { dg-final { scan-assembler-times "revsh\\t" 1 { target { arm_nothumb } } } } */
-/* { dg-final { scan-assembler-times "revshne\\t" 1 { target { arm_nothumb } } } } */
-/* { dg-final { scan-assembler-times "revsh\\t" 2 { target { ! arm_nothumb } } } } */
-/* { dg-final { scan-assembler-times "rev16\\t" 1 { target { arm_nothumb } } } } */
-/* { dg-final { scan-assembler-times "rev16ne\\t" 1 { target { arm_nothumb } } } } */
-/* { dg-final { scan-assembler-times "rev16\\t" 2 { target { ! arm_nothumb } } } } */
-/* { dg-final { scan-assembler-times "rev\\t" 2 { target { arm_nothumb } } } } */
-/* { dg-final { scan-assembler-times "revne\\t" 2 { target { arm_nothumb } } } } */
-/* { dg-final { scan-assembler-times "rev\\t" 4 { target { ! arm_nothumb } } } } */
+/* { dg-final { scan-assembler-times "revsh\\t" 1 } } */
+/* { dg-final { scan-assembler-times "revshne\\t" 1 } } */
+/* { dg-final { scan-assembler-times "rev16\\t" 1 } } */
+/* { dg-final { scan-assembler-times "rev16ne\\t" 1 } } */
+/* { dg-final { scan-assembler-times "rev\\t" 2 } } */
+/* { dg-final { scan-assembler-times "revne\\t" 2 } } */
#include "builtin-bswap.x"