forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm][ARM] Add Addend Checks for MOVT and MOVW instructions. (llvm#1…
…11970) Previously, any value could be used for the MOVT and MOVW instructions, however the ARM ABI dictates that the addend should be a signed 16 bit value. To ensure this is followed, the Assembler will now check that when using these instructions, the addend is a 16bit signed value, and throw an error if this is not the case. Information relating to the ABI requirements can be found here: https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst#addends-and-pc-bias-compensation
- Loading branch information
Showing
7 changed files
with
57 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@RUN: not llvm-mc -triple armv7-eabi -filetype obj -o - %s 2>&1 | FileCheck %s | ||
|
||
.global v | ||
.text | ||
movw r1, #:lower16:v + -65536 | ||
movt r1, #:upper16:v + 65536 | ||
|
||
@CHECK: error: Relocation Not In Range | ||
@CHECK: movw r1, #:lower16:v + -65536 | ||
@CHECK: ^ | ||
@CHECK: error: Relocation Not In Range | ||
@CHECK: movt r1, #:upper16:v + 65536 | ||
@CHECK: ^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s 2>&1 | FileCheck %s | ||
|
||
.global v | ||
.text | ||
movw r1, #:lower16:v + -20000 | ||
movt r1, #:upper16:v + 20000 | ||
|
||
@CHECK-NOT: error: Relocation Not In Range | ||
@CHECK-NOT: movw r1, #:lower16:v + -20000 | ||
@CHECK-NOT: ^ | ||
@CHECK-NOT: error: Relocation Not In Range | ||
@CHECK-NOT: movt r1, #:upper16:v + 20000 | ||
@CHECK-NOT: ^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters