1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00
James Molloy 69a7afba11 Fix for pr24346: arm asm label calculation error in sub
Some ARM instructions encode 32-bit immediates as a 8-bit integer (0-255)
and a 4-bit rotation (0-30, even) in its least significant 12 bits. The
original fixup, FK_Data_4, patches the instruction by the value bit-to-bit,
regardless of the encoding. For example, assuming the label L1 and L2 are
0x0 and 0x104 respectively, the following instruction:

  add r0, r0, #(L2 - L1) ; expects 0x104, i.e., 260

would be assembled to the following, which adds 1 to r0, instead of 260:

  e2800104 add r0, r0, #4, 2 ; equivalently 1

The new fixup kind fixup_arm_mod_imm takes care of the encoding:

  e2800f41 add r0, r0, #260

Patch by Ting-Yuan Huang!

llvm-svn: 265122
2016-04-01 09:40:47 +00:00
..
2013-10-29 09:47:35 +00:00
2014-11-05 12:40:21 +00:00
2015-11-16 14:05:32 +00:00
2014-06-19 16:35:19 +00:00
2014-01-30 04:46:24 +00:00
2014-05-05 17:58:46 +00:00
2014-01-24 17:20:08 +00:00
2014-01-28 23:13:30 +00:00
2013-09-18 09:46:49 +00:00
2014-04-03 11:29:15 +00:00
2014-01-17 13:53:08 +00:00
2015-04-15 17:28:23 +00:00
2013-06-24 09:11:53 +00:00
2012-04-26 01:38:10 +00:00