[LoongArch][MC] Add relocation support for fld fst [x]vld [x]vst ยท llvm/llvm-project@e256eda (original) (raw)

`@@ -3,9 +3,6 @@

`

3

3

`# RUN: llvm-mc --filetype=obj --triple=loongarch64 < %s \

`

4

4

`# RUN: | llvm-readobj -r - | FileCheck --check-prefix=RELOC %s

`

5

5

``

6

``

`-

RUN: not llvm-mc --triple=loongarch64 --defsym=FIXME=1 < %s 2>&1 \

`

7

``

`-

RUN: | FileCheck --check-prefix=ERROR %s

`

8

``

-

9

6

`## Check prefixes:

`

10

7

`## RELOC - Check the relocation in the object.

`

11

8

`## FIXUP - Check the fixup on the instruction.

`

`@@ -312,24 +309,32 @@ pcaddi $t1, %desc_pcrel_20(foo)

`

312

309

`# INSTR: pcaddi $t1, %desc_pcrel_20(foo)

`

313

310

`# FIXUP: fixup A - offset: 0, value: %desc_pcrel_20(foo), kind: FK_NONE

`

314

311

``

315

``

`-

.ifdef FIXME

`

316

``

-

317

312

`fld.s ft1,ft1, ft1,a0, %pc_lo12(foo)

`

318

``

`-

ERROR: :[[#@LINE-1]]๐Ÿ”ž error: immediate must be an integer in the range [-2048, 2047]

`

``

313

`+

RELOC: R_LARCH_PCALA_LO12 foo 0x0

`

``

314

`+

INSTR: fld.s ft1,ft1, ft1,a0, %pc_lo12(foo)

`

``

315

`+

FIXUP: fixup A - offset: 0, value: %pc_lo12(foo), kind: FK_NONE

`

319

316

``

320

317

`fst.d ft1,ft1, ft1,a0, %pc_lo12(foo)

`

321

``

`-

ERROR: :[[#@LINE-1]]๐Ÿ”ž error: immediate must be an integer in the range [-2048, 2047]

`

``

318

`+

RELOC: R_LARCH_PCALA_LO12 foo 0x0

`

``

319

`+

INSTR: fst.d ft1,ft1, ft1,a0, %pc_lo12(foo)

`

``

320

`+

FIXUP: fixup A - offset: 0, value: %pc_lo12(foo), kind: FK_NONE

`

322

321

``

323

322

`vld vr9,vr9, vr9,a0, %pc_lo12(foo)

`

324

``

`-

ERROR: :[[#@LINE-1]]:16: error: immediate must be an integer in the range [-2048, 2047]

`

``

323

`+

RELOC: R_LARCH_PCALA_LO12 foo 0x0

`

``

324

`+

INSTR: vld vr9,vr9, vr9,a0, %pc_lo12(foo)

`

``

325

`+

FIXUP: fixup A - offset: 0, value: %pc_lo12(foo), kind: FK_NONE

`

325

326

``

326

327

`vst vr9,vr9, vr9,a0, %pc_lo12(foo)

`

327

``

`-

ERROR: :[[#@LINE-1]]:16: error: immediate must be an integer in the range [-2048, 2047]

`

``

328

`+

RELOC: R_LARCH_PCALA_LO12 foo 0x0

`

``

329

`+

INSTR: vst vr9,vr9, vr9,a0, %pc_lo12(foo)

`

``

330

`+

FIXUP: fixup A - offset: 0, value: %pc_lo12(foo), kind: FK_NONE

`

328

331

``

329

332

`xvld xr9,xr9, xr9,a0, %pc_lo12(foo)

`

330

``

`-

ERROR: :[[#@LINE-1]]:17: error: immediate must be an integer in the range [-2048, 2047]

`

``

333

`+

RELOC: R_LARCH_PCALA_LO12 foo 0x0

`

``

334

`+

INSTR: xvld xr9,xr9, xr9,a0, %pc_lo12(foo)

`

``

335

`+

FIXUP: fixup A - offset: 0, value: %pc_lo12(foo), kind: FK_NONE

`

331

336

``

332

337

`xvst xr9,xr9, xr9,a0, %pc_lo12(foo)

`

333

``

`-

ERROR: :[[#@LINE-1]]:17: error: immediate must be an integer in the range [-2048, 2047]

`

334

``

-

335

``

`-

.endif

`

``

338

`+

RELOC: R_LARCH_PCALA_LO12 foo 0x0

`

``

339

`+

INSTR: xvst xr9,xr9, xr9,a0, %pc_lo12(foo)

`

``

340

`+

FIXUP: fixup A - offset: 0, value: %pc_lo12(foo), kind: FK_NONE

`