[llvm] [X86][MC] Support encoding optimization & assembler relaxation about immediate operands for APX instructions (PR #78545)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 02:29:34 PST 2024


================
@@ -0,0 +1,18 @@
+// RUN: llvm-mc -triple x86_64-linux-gnu -filetype=obj %s | llvm-readobj -r - | FileCheck %s
+
+// CHECK:      Relocations [
+// CHECK-NEXT:   Section ({{[0-9]+}}) .rela.text {
+{evex}  subw $foo, %ax, %ax                 // CHECK-NEXT:     R_X86_64_16
+{nf}    subw $foo, %ax, %ax                 // CHECK-NEXT:     R_X86_64_16
+{evex}  subw $foo, 123(%r8,%rax,4), %ax     // CHECK-NEXT:     R_X86_64_16
+{nf}    subw $foo, 123(%r8,%rax,4), %ax     // CHECK-NEXT:     R_X86_64_16
+{evex}  subl $foo, %eax, %eax               // CHECK-NEXT:     R_X86_64_32
+{nf}    subl $foo, %eax, %eax               // CHECK-NEXT:     R_X86_64_32
+{evex}  subl $foo, 123(%r8,%rax,4), %eax    // CHECK-NEXT:     R_X86_64_32
+{nf}    subl $foo, 123(%r8,%rax,4), %eax    // CHECK-NEXT:     R_X86_64_32
+{evex}  subq $foo, %rax, %rax               // CHECK-NEXT:     R_X86_64_32S
+{nf}    subq $foo, %rax, %rax               // CHECK-NEXT:     R_X86_64_32S
+{evex}  subq $foo, 123(%r8,%rax,4), %rax    // CHECK-NEXT:     R_X86_64_32S
+{nf}    subq $foo, 123(%r8,%rax,4), %rax    // CHECK-NEXT:     R_X86_64_32S
----------------
KanRobert wrote:

Misplaced...

https://github.com/llvm/llvm-project/pull/78545


More information about the llvm-commits mailing list