@@ -20,24 +20,34 @@ class AArch64Reg<bits<16> enc, string n, list<Register> subregs = [],
2020
2121let Namespace = "AArch64" in {
2222 // SubRegIndexes for GPR registers
23- def sub_32 : SubRegIndex<32, 0>;
24- def sub_32_hi: SubRegIndex<32, 32>;
23+ def sub_32 : SubRegIndex<32>;
2524 def sube64 : SubRegIndex<64>;
2625 def subo64 : SubRegIndex<64>;
2726 def sube32 : SubRegIndex<32>;
2827 def subo32 : SubRegIndex<32>;
2928
3029 // SubRegIndexes for FPR/Vector registers
3130 def bsub : SubRegIndex<8, 0>;
32- def bsub_hi : SubRegIndex<8, 8>;
3331 def hsub : SubRegIndex<16, 0>;
34- def hsub_hi : SubRegIndex<16, 16>;
3532 def ssub : SubRegIndex<32, 0>;
36- def ssub_hi : SubRegIndex<32, 32>;
3733 def dsub : SubRegIndex<64, 0>;
38- def dsub_hi : SubRegIndex<64, 64>;
3934 def zsub : SubRegIndex<128, 0>;
40- def zsub_hi : SubRegIndex<-1, 128>;
35+
36+ // The _hi SubRegIndexes describe the high bits of a register which are not
37+ // separately addressable. They need to be described so that partially
38+ // overlapping registers end up with a different lane mask. This is required
39+ // to enable subreg liveness tracking.
40+ //
41+ // For example: 8-bit B0 is a sub-register of 16-bit H0.
42+ // * B0 is described with 'bsub'.
43+ // * H0 is described with 'bsub + bsub_hi' == 'hsub'.
44+ def bsub_hi : SubRegIndex<8, 8>;
45+ def hsub_hi : SubRegIndex<16, 16>;
46+ def ssub_hi : SubRegIndex<32, 32>;
47+ def dsub_hi : SubRegIndex<64, 64>;
48+ def zsub_hi : SubRegIndex<-1, 128>;
49+ // sub_32_hi describes the top 32 bits in e.g. X0
50+ def sub_32_hi : SubRegIndex<32, 32>;
4151 // Note: Code depends on these having consecutive numbers
4252 def zsub0 : SubRegIndex<-1>;
4353 def zsub1 : SubRegIndex<-1>;
0 commit comments