On Friday 20 May 2016 14:22:48 Kyrill Tkachov wrote: > Hi Thomas, > > > Hmm, I'm not a fan of this change. arm_print_operand_punct_valid_p is an > implementation of a target hook that is used to validate user-provided > inline asm as well and is therefore the right place to reject such invalid > constructs. > > This is just working around the fact that the output template for the > [u]divsi3 patterns has a '%?' in it that is illegal in Thumb1 and will not > be used for ARMv8-M Baseline anyway. I'd prefer it if you add a second > alternative to those patterns and emit the sdiv/udiv mnemonic without the > '%?' and enable that for the v8mb arch attribute (and mark the existing > alternative as requiring the "32" arch attribute). Fixed. > > s/TARGET_HAVE_MOVT/TARGET_HAVE_CBZ/ Likewise. > > + [(set (attr "far_jump") > > + (if_then_else > > + (eq_attr "length" "8") > > + (const_string "yes") > > + (const_string "no"))) > > + (set (attr "length") > > + (if_then_else > > + (and (ge (minus (match_dup 2) (pc)) (const_int 2)) > > + (le (minus (match_dup 2) (pc)) (const_int 128)) > > + (not (match_test "which_alternative"))) > > This pattern only has one alternative so "which_alternative" > will always be 0, so the (not (match_test "which_alternative")) > test inside the 'and' is redundant and can be removed. Ditto. Please find updated ChangeLog entries: *** gcc/ChangeLog *** 2016-05-23 Thomas Preud'homme * config/arm/arm.h (TARGET_HAVE_CBZ): Define. (TARGET_IDIV): Set for all Thumb targets provided they have hardware divide feature. * config/arm/arm.md (divsi3): New unpredicable alternative for ARMv8-M Baseline. Make initial alternative TARGET_32BIT only. (udivsi3): Likewise. * config/arm/thumb1.md (thumb1_cbz): New insn. * doc/sourcebuild.texi (arm_thumb1_cbz_ok): Document new effective target. *** gcc/testsuite/ChangeLog *** 2016-05-23 Thomas Preud'homme * lib/target-supports.exp (check_effective_target_arm_thumb1_cbz_ok): Add new arm_thumb1_cbz_ok effective target. * gcc.target/arm/cbz.c: New test. Updated patch in attachment. Best regards, Thomas