Hello! Attached patch implements reg->reg move cost function for x86, as required by new lower-subreg.c patch. The patch fixes:
FAIL: gcc.dg/lower-subreg-1.c scan-rtl-dump subreg1 "Splitting reg" failure on 32bit x86 targets, and for following testcase: long long test (long long a, long long b) { return a * b; } reverts generated asm code from: test: subl $12, %esp movl %edi, 8(%esp) movl 28(%esp), %edi movl %ebx, (%esp) movl 16(%esp), %ecx movl %esi, 4(%esp) movl 20(%esp), %ebx movl 24(%esp), %esi movl %edi, %eax imull %ecx, %eax imull %esi, %ebx addl %eax, %ebx movl %ecx, %eax mull %esi movl 4(%esp), %esi movl %edx, %edi addl %ebx, %edi movl (%esp), %ebx movl %edi, %edx movl 8(%esp), %edi addl $12, %esp ret back to: test: pushl %ebx movl 8(%esp), %edx movl 16(%esp), %eax movl 12(%esp), %ebx movl 20(%esp), %ecx imull %eax, %ebx imull %edx, %ecx mull %edx addl %ebx, %ecx addl %ecx, %edx popl %ebx ret Patch was tested on x86_64-pc-linux-gnu {,-m32}. I have also #define LOG_COST 1 temporarily and looked at generated cost calculations for various -msse* settings. I will wait for a day for possible comments on the implementation before the patch will be committed to mainline SVN. Uros.