Re: [Mesa-dev] [PATCH 2/2] i965: Optimize intel_batchbuffer_emit_dword().

2015-07-09 Thread Martin Peres
On 09/07/15 11:13, Chris Wilson wrote: On Wed, Jul 08, 2015 at 05:08:11PM -0700, Matt Turner wrote: On Wed, Jul 8, 2015 at 4:53 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: static void upload_viewport_state_pointers(struct brw_context *brw) { BEGIN_BATCH(4); brw-batch.map[0] =

Re: [Mesa-dev] [PATCH 2/2] i965: Optimize intel_batchbuffer_emit_dword().

2015-07-09 Thread Chris Wilson
On Wed, Jul 08, 2015 at 05:08:11PM -0700, Matt Turner wrote: On Wed, Jul 8, 2015 at 4:53 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: static void upload_viewport_state_pointers(struct brw_context *brw) { BEGIN_BATCH(4); brw-batch.map[0] = (_3DSTATE_VIEWPORT_STATE_POINTERS 16 |

[Mesa-dev] [PATCH 2/2] i965: Optimize intel_batchbuffer_emit_dword().

2015-07-08 Thread Matt Turner
By keeping a pointer to the next available location, we reduce the number of memory accesses needed to write to the batchbuffer. A net ~7k reduction of .text size, 7.5k of which is from the change to intel_batchbuffer_emit_dword(). text data bss dec hex filename 4943740

Re: [Mesa-dev] [PATCH 2/2] i965: Optimize intel_batchbuffer_emit_dword().

2015-07-08 Thread Chris Wilson
On Wed, Jul 08, 2015 at 02:00:02PM -0700, Matt Turner wrote: By keeping a pointer to the next available location, we reduce the number of memory accesses needed to write to the batchbuffer. A net ~7k reduction of .text size, 7.5k of which is from the change to intel_batchbuffer_emit_dword().

Re: [Mesa-dev] [PATCH 2/2] i965: Optimize intel_batchbuffer_emit_dword().

2015-07-08 Thread Chris Wilson
On Wed, Jul 08, 2015 at 03:33:17PM -0700, Matt Turner wrote: On Wed, Jul 8, 2015 at 2:07 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Wed, Jul 08, 2015 at 02:00:02PM -0700, Matt Turner wrote: By keeping a pointer to the next available location, we reduce the number of memory accesses

Re: [Mesa-dev] [PATCH 2/2] i965: Optimize intel_batchbuffer_emit_dword().

2015-07-08 Thread Matt Turner
On Wed, Jul 8, 2015 at 2:07 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Wed, Jul 08, 2015 at 02:00:02PM -0700, Matt Turner wrote: By keeping a pointer to the next available location, we reduce the number of memory accesses needed to write to the batchbuffer. A net ~7k reduction of

Re: [Mesa-dev] [PATCH 2/2] i965: Optimize intel_batchbuffer_emit_dword().

2015-07-08 Thread Chris Wilson
On Thu, Jul 09, 2015 at 12:53:23AM +0100, Chris Wilson wrote: This is what I expected to see 0x025e +62: movl $0x780d1c02,(%rcx) 0x0264 +68: mov0x22f08(%rdi),%rax 0x026b +75: mov0x24320(%rdi),%edx 0x0271 +81: mov

Re: [Mesa-dev] [PATCH 2/2] i965: Optimize intel_batchbuffer_emit_dword().

2015-07-08 Thread Matt Turner
On Wed, Jul 8, 2015 at 4:53 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Wed, Jul 08, 2015 at 03:33:17PM -0700, Matt Turner wrote: On Wed, Jul 8, 2015 at 2:07 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Wed, Jul 08, 2015 at 02:00:02PM -0700, Matt Turner wrote: By keeping a