发明名称 Character data string match determination by loading registers at most up to memory block boundary and comparing to avoid unwarranted exception
摘要 Multiple sets of character data having termination characters are compared using parallel processing and without causing unwarranted exceptions. Each set of character data to be compared is loaded within one or more vector registers. In particular, in one embodiment, for each set of character data to be compared, an instruction is used that loads data in a vector register to a specified boundary, and provides a way to determine the number of characters loaded. Further, an instruction is used to find the index of the first delimiter character, i.e., the first zero or null character, or the index of unequal characters. Using these instructions, a location of the end of one of the sets of data or a location of an unequal character is efficiently provided.
申请公布号 US9477468(B2) 申请公布日期 2016.10.25
申请号 US201414560001 申请日期 2014.12.04
申请人 INTERNATIONAL BUSINESS MACHINES CORPORATION 发明人 Bradbury Jonathan D.;Gschwind Michael K.;Slegel Timothy J.
分类号 G06F9/30;G06F7/04;G06F7/20;G06F7/02;G06F17/27;G06F17/30 主分类号 G06F9/30
代理机构 Heslin Rothenberg Farley & Mesiti P.C. 代理人 Kinnaman, Jr., Esq. William A.;Hulihan, Esq. Matthew M.;Heslin Rothenberg Farley & Mesiti P.C.
主权项 1. A method of comparing characters of a plurality of sets of data, the method comprising: loading from memory to a first register, a variable amount of first data that is within a first specified block of memory, the first data being at least a portion of a first set of data to be compared, and the loading comprising loading from memory the first data into the first register without crossing a first specified boundary of the memory from which the data is loaded, the first specified boundary being based on a pre-defined size of the first specified block of memory, and wherein the loading starts at a first starting address within the first specified block of memory and terminates at a first ending address within the first specified block of memory, the first ending address determined based on the pre-defined size such that the first specified boundary is not crossed; loading from memory to a second register, second data that is within a second specified block of memory, the second data being at least a portion of a second set of data to be compared; computing a first count of an amount of the first data loaded in the first register and a second count of an amount of second data loaded in the second register; determining, by a processor, a value, the determining including performing at least one of A) or B): A) comparing the first data loaded in the first register with the second data loaded in the second register searching for an unequal character; andB) searching at least one of the first register and the second register for a termination character; andbased on at least one of the comparing and the searching, setting the value to one of a location of the unequal character, a location of the termination character, or a pre-specified value based on not finding an unequal character or a termination character; checking whether the first set of data or the second set of data has additional data to be compared, the checking using at least one of the first count and the second count; and based on the checking indicating additional data is to be compared, comparing the additional data of the first set of data or the second set of data with data of the other set of the first set of data or the second set of data.
地址 Armonk NY US