Supporting multiple vector lengths with configurable vector register file
Systems and methods are disclosed for supporting multiple vector lengths with a configurable vector register file. For example, an integrated circuit (e.g., a processor) includes a data store configured to store a vector length parameter; a processor core including a vector register, wherein the processor core is configured to: while a first value of the vector length parameter is stored in the data store, store a single architectural register of an instruction set architecture in the vector register; and, while a second value of the vector length parameter is stored in the data store, store multiple architectural registers of the instruction set architecture in respective disjoint portions of the vector register. For example, the integrated circuit may be used to emulate a processor with smaller vector registers for the purpose of migrating a thread to a processor core of the integrated circuit for continued execution.
1 . An integrated circuit comprising:
a data store configured to store a vector length parameter;
a hardware processor core including:
a vector register;
a vector execution unit comprising an operand buffer, wherein the vector register and the operand buffer have a same length in bits; and
one or more multiplexors configured to selectively route data of a first architectural register stored in a first portion of the vector register to one of multiple disjoint portions of the operand buffer based on an identity of a second architectural register providing a second operand for an instruction being executed;
wherein the hardware processor core is configured to:
while a first value of the vector length parameter is stored in the data store, store a single architectural register of an instruction set architecture in the vector register; and
while a second value of the vector length parameter is stored in the data store, store multiple architectural registers of the instruction set architecture in respective disjoint portions of the vector register.
2 . The integrated circuit of claim 1 , wherein the vector register is of length N bits and the vector execution unit is connected to the vector register by a datapath of width N bits, wherein N is a positive integer.
3 . The integrated circuit of claim 1 , in which the vector register is part of a vector register file of the hardware processor core and, when the second value of the vector length parameter is stored in the data store, the hardware processor core is configured to shut down a first subset of vector registers in the vector register file while the architectural registers are packed into a second subset of vector registers in the vector register file that is disjoint from the first subset.
4 . The integrated circuit of claim 1 , in which the vector register is partitioned into K portions that each store a respective architectural register of the instruction set architecture, where K is a power of two and is a positive integer.
5 . The integrated circuit of claim 1 , in which the data store is a control status register of the hardware processor core.
6 . The integrated circuit of claim 1 , in which the instruction set architecture is a RISC-V instruction set architecture.
7 . A method comprising:
changing a configuration of a processor core including a vector register from a first mode where a single architectural register of an instruction set architecture is stored in the vector register to a second mode where multiple architectural registers of the instruction set architecture are stored in respective disjoint portions of the vector register; and
while operating in the second mode, selectively routing, using one or more multiplexors of the processor core, data of a first architectural register stored in a first portion of the vector register to one of multiple disjoint portions of an operand buffer within a vector execution unit of the processor core based at least in part on an identity of a second architectural register providing a second operand for an instruction being executed, wherein the vector register and the operand buffer have a same length in bits.
8 . The method of claim 7 , in which the configuration of the processor core is changed from the first mode to the second mode by writing a vector length parameter to a control status register of the processor core.
9 . The method of claim 7 , in which the vector register is of length N bits, further comprising:
performing an operation on elements of the multiple architectural registers stored in the vector register in parallel using a single transfer of data from the vector register to the vector execution unit via a datapath of width N bits, wherein N is a positive integer.
10 . The method of claim 7 , in which the vector register is part of a vector register file of the processor core, and further comprising:
in the second mode of the processor core, shutting down a first subset of vector registers in the vector register file while architectural vector registers are packed into a second subset of vector registers in the vector register file that is disjoint from the first subset.
11 . The method of claim 7 , in which the vector register is partitioned into K portions that each store a respective architectural register of the instruction set architecture, where K is a power of two and is a positive integer.
12 . The method of claim 7 , further comprising:
loading a state of a thread that has run on a second processor core with a smaller maximum vector length than the processor core into registers of the processor core, including the vector register; and
continuing execution of the thread using the processor core in the second mode to emulate a maximum vector length equal to the maximum vector length of the second processor core.
13 . The method of claim 7 , further comprising:
selectively routing data of a portion of the operand buffer in the vector execution unit to one of multiple disjoint portions of the vector register corresponding to a respective architectural register stored in the vector register.
14 . The method of claim 7 , in which the instruction set architecture is a RISC-V instruction set architecture.
15 . A non-transitory computer readable medium comprising a circuit representation that, when processed by a computer, is used to program or manufacture an integrated circuit comprising:
a data store configured to store a vector length parameter;
a processor core including:
a vector register;
a vector execution unit comprising an operand buffer, wherein the vector register and the operand buffer have a same length in bits; and
one or more multiplexors configured to selectively route data of a first architectural register stored in a first portion of the vector register to one of multiple disjoint portions of the operand buffer based on an identity of a second architectural register providing a second operand for an instruction being executed;
wherein the processor core is configured to:
while a first value of the vector length parameter is stored in the data store, store a single architectural register of an instruction set architecture in the vector register; and
while a second value of the vector length parameter is stored in the data store, store multiple architectural registers of the instruction set architecture in respective disjoint portions of the vector register.
16 . The non-transitory computer readable medium of claim 15 , wherein the vector register is of length N bits and the vector execution unit is connected to the vector register by a datapath of width N bits, wherein N is a positive integer.