This Article 
 Bibliographic References 
 Add to: 
XOR-Based Hash Functions
July 2005 (vol. 54 no. 7)
pp. 800-812
Koen De Bosschere, IEEE Computer Society
Bank conflicts can severely reduce the bandwidth of an interleaved multibank memory and conflict misses increase the miss rate of a cache or a predictor. Both occurrences are manifestations of the same problem: Objects which should be mapped to different indices are accidentally mapped to the same index. Suitable chosen hash functions can avoid conflicts in each of these situations by mapping the most frequently occurring patterns conflict-free. A particularly interesting class of hash functions are the XOR-based hash functions, which compute each set index bit as the exclusive-or of a subset of the address bits. When implementing an XOR-based hash function, it is extremely important to understand what patterns are mapped conflict-free and how a hash function can be constructed to map the most frequently occurring patterns without conflicts. Hereto, this paper presents two ways to reason about hash functions: by their null space and by their column space. The null space helps to quickly determine whether a pattern is mapped conflict-free. The column space is more useful for other purposes, e.g., to reduce the fan-in of the XOR-gates without introducing conflicts or to evaluate interbank dispersion in skewed-associative caches. Examples illustrate how these ideas can be applied to construct conflict-free hash functions.

[1] H. Vandierendonck and K. De Bosschere, “Randomized Caches for Power-Efficiency,” IEICE Trans. Electronics, vol. E86-C, no. 10, pp. 2137-2144, 2003.
[2] D.J. Kuck, “ILLIAC IV Software and Application Programming,” IEEE Trans. Computers, vol. 17, no. 8, pp. 758-770, Aug. 1968.
[3] G.S. Sohi, “High-Bandwidth Interleaved Memories for Vector Processors— A Simulation Study,” IEEE Trans. Computers, vol. 42, no. 1, pp. 34-44, Jan. 1993.
[4] D.J. Kuck and R.A. Stokes, “The Burroughs Scientific Processor (BSP),” IEEE Trans. Computers, vol. 31, no. 5, pp. 363-376, May 1982.
[5] D.H. Lawrie and C.R. Vora, “The Prime Memory System for Array Access,” IEEE Trans. Computers, vol. 31, no. 5, pp. 435-442, May 1982.
[6] Q.S. Gao, “The Chinese Remainder Theorem and the Prime Memory System,” Proc. 20th Ann. Int'l Symp. Computer Architecture, pp. 337-340, May 1993.
[7] M. Kharbutli, K. Irwin, Y. Solihin, and J. Lee, “Using Prime Numbers for Cache Indexing to Eliminate Conflict Misses,” Proc. 10th Int'l Symp. High Performance Computer Architecture, pp. 288-299, Feb. 2004.
[8] A. Seznec and J. Lenfant, “Odd Memory Systems May Be Quite Interesting,” Proc. 20th Ann. Int'l Symp. Computer Architecture, pp. 341-350, May 1993.
[9] B.R. Rau, “Pseudo-Randomly Interleaved Memory,” Proc. 18th Ann. Int'l Symp. Computer Architecture, pp. 74-83, May 1991.
[10] R. Raghavan and J.P. Hayes, “On Randomly Interleaved Memories,” SC90: Proc. Supercomputing '90, pp. 49-58, Nov. 1990.
[11] J.M. Frailong, W. Jalby, and J. Lenfant, “XOR-Schemes: A Flexible Data Organization in Parallel Memories,” Proc. 1985 Int'l Conf. Parallel Processing, pp. 276-283, Aug. 1985.
[12] F. Bodin and A. Seznec, “Skewed Associativity Improves Program Performance and Enhances Predictability,” IEEE Trans. Computers, vol. 46, no. 5, pp. 530-544, May 1997.
[13] M. Schlansker, R. Shaw, and S. Sivaramakrishnan, “Randomization and Associativity in the Design of Placement-Insensitive Caches,” Technical Report HPL-93-41, HP Laboratories, June 1993.
[14] N. Topham and A. González, “Randomized Cache Placement for Eliminating Conflicts,” IEEE Trans. Computers, vol. 48, no. 2, pp. 185-192, Feb. 1999.
[15] A. Seznec, “A New Case for Skewed-Associativity,” Technical Report PI-1114, IRISA, July 1997.
[16] P. Michaud, “A Statistical Model for Skewed-Associativity,” Proc. Third Int'l Symp. Performance Analysis of Systems and Software, pp. 204-213, Mar. 2003.
[17] A. Seznec, “A Case for Two-Way Skewed Associative Caches,” Proc. 20th Ann. Int'l Symp. Computer Architecture, pp. 169-178, May 1993.
[18] H. Vandierendonck and K. De Bosschere, “Trade-Offs for Skewed-Associative Caches,” Proc. Int'l Conf. Parallel Computing (ParCo2003), Aug. 2003.
[19] S. McFarling, “Combining Branch Predictors,” Technical Report WRL-TN36, Western Research Laboratory, Palo Alto, Calif., June 1993.
[20] T.-Y. Yeh and Y.N. Patt, “Two-Level Adaptive Training Branch Prediction,” Proc. 24th Conf. Microprogramming and Microarchitecture, pp. 51-61, Nov. 1991.
[21] C. Young, N. Gloy, and M.D. Smith, “A Comparative Analysis of Schemes for Correlated Branch Prediction,” Proc. 22nd Ann. Int'l Symp. Computer Architecture, pp. 276-286, June 1995.
[22] T. Juan, S. Sanjeevan, and J.J. Navarro, “Dynamic History-Length Fitting: A Third Level of Adaptivity for Branch Prediction,” Proc. 25th Ann. Int'l Symp. Computer Architecture, pp. 155-166, 1998.
[23] S. Sechrest, C.-C. Lee, and T. Mudge, “Correlation and Aliasing in Dynamic Branch Predictors,” Proc. 23rd Ann. Int'l Symp. Computer Architecture, pp. 22-32, May 1996.
[24] A.J. Smith, “Cache Memories,” ACM Computing Surveys, vol. 14, no. 3, pp. 473-530, Sept. 1982.
[25] Z. Zhang, Z. Zhu, and X. Zhang, “A Permutation-Based Page Interleaving Scheme to Reduce Row-Buffer Conflicts and Exploit Data Locality,” Proc. 33rd Conf. Microprogramming and Microarchitecture, pp. 32-41, Dec. 2000.
[26] G. Birkhoff and T.C. Bartee, Modern Applied Algebra. McGraw-Hill, 1970.
[27] P.R. Halmos, Finite-Dimensional Vector Spaces. Van Nostrand Reinhold, 1958.
[28] M.D. Hill and A.J. Smith, “Evaluating Associativity in CPU Caches,” IEEE Trans. Computers, vol. 38, no. 12, pp. 1612-1630, Dec. 1989.
[29] H. Vandierendonck and K. De Bosschere, “Evaluation of the Performance of Polynomial Set Index Functions,” Proc. Workshop Duplicating, Deconstructing, and Debunking, pp. 31-41, May 2002.
[30] H. Vandierendonck, “Avoiding Mapping Conflicts in Microprocessors,” PhD dissertation, Ghent Univ., 2004.
[31] A. González, M. Valero, N. Topham, and J.M. Parcerisa, “Eliminating Cache Conflict Misses through XOR-Based Placement Functions,” Proc. 1997 Int'l Conf. Supercomputing, pp. 76-83, July 1997.
[32] P. Michaud, A. Seznec, and R. Uhlig, “Trading Conflict and Capacity Aliasing in Conditional Branch Predictors,” Proc. 24th Ann. Int'l Symp. Computer Architecture, June 1997.
[33] A. Seznec, S. Felix, V. Krishnan, and Y. Sazeides, “Design Trade-Offs for the Alpha EV8 Conditional Branch Predictor,” Proc. 29th Ann. Int'l Symp. Computer Architecture, pp. 295-306, June 2002.
[34] F. MacWilliams and N. Sloane, The Theory of Error-Correcting Codes. North-Holland, 1978.
[35] W. Peterson, Error-Correcting Codes. MIT Press, 1961.

Index Terms:
Index Terms- XOR-based hash function, conflict-free mapping, null space, column space, skewed-associative cache, interbank dispersion.
Hans Vandierendonck, Koen De Bosschere, "XOR-Based Hash Functions," IEEE Transactions on Computers, vol. 54, no. 7, pp. 800-812, July 2005, doi:10.1109/TC.2005.122
Usage of this product signifies your acceptance of the Terms of Use.