[LLVMdev] How to partition registers into different RegisterClass?

Tzu-Chien Chiu tzuchien.chiu at gmail.com
Fri Jul 22 18:36:20 PDT 2005


2005/7/23, Chris Lattner <sabre at nondot.org>:
> 
> What does a 'read only' register mean?  Is it a constant (e.g. returns
> 1.0)?  Otherwise, how can it be a useful value?

Yes, it's a constant register.

Because the instruction cannot contain an immediate value, a constant
value may be stored in a constant register, and it's defined _before_
the program starts by API. For example:

  SetConstantValue( 5, Vector4( 1, 2, 3, 4 ); // C5 = <1,2,3,4>
  HANDLE handle = LoadCodeFromFile( filename );
  SetCode( handle );  // C5 is referenced here
  Execute();

-- 
Tzu-Chien Chiu,
3D Graphics Hardware Enginner,
<URL:http://www.csie.nctu.edu.tw/~jwchiu>




More information about the llvm-dev mailing list