From: David Holsgrove Date: Tue, 23 Jul 2013 21:09:50 +0000 (+0000) Subject: microblaze.c: Add microblaze_asm_output_mi_thunk and define TARGET_ASM_OUTPUT_MI_THUN... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=450b0ebbc011c68aeeeaee858cd38006aec62432;p=gcc.git microblaze.c: Add microblaze_asm_output_mi_thunk and define TARGET_ASM_OUTPUT_MI_THUNK and... * config/microblaze/microblaze.c: Add microblaze_asm_output_mi_thunk and define TARGET_ASM_OUTPUT_MI_THUNK and TARGET_ASM_CAN_OUTPUT_MI_THUNK. From-SVN: r201185 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 620ac6dd384..ad01f9d3913 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-07-23 David Holsgrove + + * config/microblaze/microblaze.c: Add microblaze_asm_output_mi_thunk + and define TARGET_ASM_OUTPUT_MI_THUNK and + TARGET_ASM_CAN_OUTPUT_MI_THUNK. + 2013-07-23 Eric Botcazou * doc/invoke.texi (SPARC Options): Document new leon3 processor value. diff --git a/gcc/config/microblaze/constraints.md b/gcc/config/microblaze/constraints.md index c6fbc987819..c9c164962cd 100644 --- a/gcc/config/microblaze/constraints.md +++ b/gcc/config/microblaze/constraints.md @@ -70,3 +70,8 @@ "Double word operand." (and (match_code "mem") (match_test "double_memory_operand (op, GET_MODE (op))"))) + +(define_memory_constraint "Q" + "Memory operand which is a single register." + (and (match_code "mem") + (match_test "GET_CODE ( XEXP (op, 0)) == REG"))) diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c index 46d07c7e318..649a6b74bbe 100644 --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -2118,6 +2118,7 @@ microblaze_initial_elimination_offset (int from, int to) 't' print 't' for EQ, 'f' for NE 'm' Print 1<. + +(define_insn "atomic_compare_and_swapsi" + [(match_operand:SI 0 "register_operand" "=&d") ;; bool output + (match_operand:SI 1 "register_operand" "=&d") ;; val output + (match_operand:SI 2 "nonimmediate_operand" "+Q") ;; memory + (match_operand:SI 3 "register_operand" "d") ;; expected value + (match_operand:SI 4 "register_operand" "d") ;; desired value + (match_operand:SI 5 "const_int_operand" "") ;; is_weak + (match_operand:SI 6 "const_int_operand" "") ;; mod_s + (match_operand:SI 7 "const_int_operand" "") ;; mod_f + (clobber (match_scratch:SI 8 "=&d"))] + "" + { + output_asm_insn ("addc \tr0,r0,r0", operands); + output_asm_insn ("lwx \t%1,%y2,r0", operands); + output_asm_insn ("addic\t%8,r0,0", operands); + output_asm_insn ("bnei \t%8,.-8", operands); + output_asm_insn ("cmp \t%0,%1,%3", operands); + output_asm_insn ("bnei \t%0,.+16", operands); + output_asm_insn ("swx \t%4,%y2,r0", operands); + output_asm_insn ("addic\t%8,r0,0", operands); + output_asm_insn ("bnei \t%8,.-28", operands); + return ""; + } +)