This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
question about switch table
- From: ligang at sunnorth dot com dot cn
- To: gcc at gcc dot gnu dot org
- Date: Mon, 4 Jun 2007 16:04:23 +0800
- Subject: question about switch table
Hi,
Now, i wanna generate a switch table just like ARM tbb instruction.
The switch table should be located at .rdata section, so I should use
.L3-.L8_1, but not .L3-.L8.
How could i implement this? Any target macro can do it?
Please look at the following code fragment. (.L3-.L8_1)/2 is what i want,
but not .L3-.L8.
la r7, $L8
tbb [r7, r6]
.L8_1
.rdata
.L8:
.byte (.L3-.L8)/2
.byte (.L4-.L8)/2
.byte (.L5-.L8)/2
.byte (.L6-.L8)/2
.byte (.L7-.L8)/2
.text
Best regards
Ligang