public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
From: Dave Brolley <brolley@redhat.com>
To: sid@sources.redhat.com
Subject: [patch][commit] Add hw-cache-buffer-8 and hw-blocking-cache-buffer-8
Date: Wed, 10 May 2006 20:31:00 -0000	[thread overview]
Message-ID: <44624DAA.3070000@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

Hi,

I've committed the attached patch which adds the hardware types 
hw-cache-buffer-8 and hw-blocking-cache-buffer-8. The patch adds a table 
of allowable lengths for these caches, so future expansion need only 
update the table.

Dave

[-- Attachment #2: sid-cache.ChangeLog --]
[-- Type: text/plain, Size: 303 bytes --]

2006-05-10  Dave Brolley  <brolley@redhat.com>

	* cache.cxx (buffer_sizes): New static table.
	(CacheListTypes): List hw-cache-buffer-* using buffer_sizes. Same for
	hw-blocking-cache-buffer-*.
	(CacheCreate): Parse hw-cache-buffer-N and hw-blocking-cache-buffer-N
	in order to determine buffer size.


[-- Attachment #3: sid-cache.patch.txt --]
[-- Type: text/plain, Size: 2874 bytes --]

Index: sid/component/cache/cache.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/cache/cache.cxx,v
retrieving revision 1.21
diff -c -p -r1.21 cache.cxx
*** sid/component/cache/cache.cxx	1 Mar 2006 21:07:00 -0000	1.21
--- sid/component/cache/cache.cxx	10 May 2006 20:23:23 -0000
*************** using std::endl;
*** 26,31 ****
--- 26,34 ----
  
  #include "cache.h"
  
+ static string buffer_sizes[] =
+   { "4", "8" };
+ 
  static string line_sizes[] =
    { "16", "32", "64", "128" };
  
*************** CacheListTypes ()
*** 1054,1061 ****
  
    types.push_back ("hw-cache-basic");
    types.push_back ("hw-blocking-cache-basic");
!   types.push_back ("hw-cache-buffer-8");
!   types.push_back ("hw-blocking-cache-buffer-8");
  
    for (unsigned i = 0; i < (sizeof (assocs) / sizeof (string)); i++)
      for (unsigned j = 0; j < (sizeof (cache_sizes) / sizeof (string)); j++)
--- 1057,1068 ----
  
    types.push_back ("hw-cache-basic");
    types.push_back ("hw-blocking-cache-basic");
! 
!   for (unsigned i = 0; i < (sizeof (buffer_sizes) / sizeof (string)); i++)
!     {
!       types.push_back ("hw-cache-buffer-" + buffer_sizes[i]);
!       types.push_back ("hw-blocking-cache-buffer-" + buffer_sizes[i]);
!     }
  
    for (unsigned i = 0; i < (sizeof (assocs) / sizeof (string)); i++)
      for (unsigned j = 0; j < (sizeof (cache_sizes) / sizeof (string)); j++)
*************** CacheCreate (const string& typeName)
*** 1095,1106 ****
    if (typeName == "hw-blocking-cache-basic")
      return new blocking_cache_component (1, 16384, 32, null_replacement, internal_line_factory);
  
!   if (typeName == "hw-cache-buffer-8")
!     return new cache_component (0, 8, 8, null_replacement, internal_line_factory);
    
-   if (typeName == "hw-blocking-cache-buffer-8")
-     return new blocking_cache_component (0, 8, 8, null_replacement, internal_line_factory);
-    
    vector<string> parts = sidutil::tokenize (typeName, "-/");
  
    unsigned extra_ix;
--- 1102,1123 ----
    if (typeName == "hw-blocking-cache-basic")
      return new blocking_cache_component (1, 16384, 32, null_replacement, internal_line_factory);
  
!   if (typeName.substr (0, 16) == "hw-cache-buffer-")
!     {
!       unsigned size;
!       if (parse_attribute (typeName.substr (16), size) != sid::component::ok)
! 	return 0;
!       return new cache_component (0, size, size, null_replacement, internal_line_factory);
!     }
!   
!   if (typeName.substr (0, 25) == "hw-blocking-cache-buffer-")
!     {
!       unsigned size;
!       if (parse_attribute (typeName.substr (25), size) != sid::component::ok)
! 	return 0;
!       return new blocking_cache_component (0, size, size, null_replacement, internal_line_factory);
!     }
    
    vector<string> parts = sidutil::tokenize (typeName, "-/");
  
    unsigned extra_ix;

                 reply	other threads:[~2006-05-10 20:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44624DAA.3070000@redhat.com \
    --to=brolley@redhat.com \
    --cc=sid@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).