Page 1 of 1

Is there nice forum about gcc dev

Posted: Sat Oct 19, 2013 3:28 am
by blackoil
I have few question about .md file design.

Re: Is there nice forum about gcc dev

Posted: Sat Oct 19, 2013 3:38 am
by Nable
I think that such projects prefer mailing lists. Quick googling -> http://gcc.gnu.org/lists.html

Information for your topic seems to be starting here: http://gcc.gnu.org/onlinedocs/gccint/Machine-Desc.html
Upd: 2nd or 3rd link led me to a rather nice guide with examples: http://www.cse.iitb.ac.in/grc/intdocs/g ... ng-md.html

Re: Is there nice forum about gcc dev

Posted: Sat Oct 19, 2013 4:53 am
by blackoil
Hi,
I want to load abcd address into reg1, then load the value from [reg1].
but no effect.

Code: Select all

mov reg1,0x1234
store reg1,[abcd]


mov reg1,0x1234
mov reg2, abcd     ; abcd is global var
store reg1, [reg2]

Code: Select all

(set (mem (symbol_ref "abcd") ) (const_int 0x1234))

Code: Select all

(define_expand "movsi_symbol_ref" [(set (match_operand:SI 0 "") (match_operand:SI 1 ""))] ""
{
	rtx symbol;

	if (GET_CODE (operands[0]) == MEM)
		{
		symbol = XEXP(operands[0],0);
		if (GET_CODE (symbol) == SYMBOL_REF)
			XEXP(operands[0],0) = force_reg (SImode, symbol);
		}
	else
		if (GET_CODE (operands[1]) == MEM)
			{
			symbol = XEXP(operands[1],0);
			if (GET_CODE (symbol) == SYMBOL_REF)
				XEXP(operands[1],0) = force_reg (SImode, symbol);
			}
}
)