-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[Xtensa] Implement Xtensa Boolean Option. #126022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,9 @@ class XtensaSubtarget : public XtensaGenSubtargetInfo { | |
| // Enabled Xtensa Windowed Register Option | ||
| bool HasWindowed; | ||
|
|
||
| // Enabled Boolean Option | ||
| bool HasBoolean; | ||
|
||
|
|
||
| XtensaSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS); | ||
|
|
||
| public: | ||
|
|
@@ -69,6 +72,8 @@ class XtensaSubtarget : public XtensaGenSubtargetInfo { | |
|
|
||
| bool hasWindowed() const { return HasWindowed; } | ||
|
|
||
| bool hasBoolean() const { return HasBoolean; } | ||
|
|
||
| // Automatically generated by tblgen. | ||
| void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS); | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 5 | ||
| # RUN: llvm-mc -triple=xtensa -mattr=+bool -disassemble %s | FileCheck -check-prefixes=CHECK-BOOLEAN %s | ||
| # RUN: not llvm-mc -triple=xtensa -disassemble %s 2>&1 | FileCheck --implicit-check-not=warning: -check-prefixes=CHECK-CORE %s | ||
|
|
||
| ## Verify that binary code is correctly disassembled with | ||
| ## boolean option enabled. Also verify that dissasembling without | ||
| ## boolean option generates warnings. | ||
|
|
||
| [0x10,0x94,0x00] | ||
| # CHECK-BOOLEAN: all4 b1, b4 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x10,0xb8,0x00] | ||
| # CHECK-BOOLEAN: all8 b1, b8 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x30,0x12,0x02] | ||
| # CHECK-BOOLEAN: andb b1, b2, b3 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x30,0x12,0x12] | ||
| # CHECK-BOOLEAN: andbc b1, b2, b3 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x30,0x12,0x22] | ||
| # CHECK-BOOLEAN: orb b1, b2, b3 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x30,0x12,0x32] | ||
| # CHECK-BOOLEAN: orbc b1, b2, b3 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x30,0x12,0x42] | ||
| # CHECK-BOOLEAN: xorb b1, b2, b3 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x10,0x84,0x00] | ||
| # CHECK-BOOLEAN: any4 b1, b4 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x10,0xa8,0x00] | ||
| # CHECK-BOOLEAN: any8 b1, b8 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x76,0x11,0x10] | ||
| # CHECK-BOOLEAN: bt b1, . +20 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x76,0x00,0x10] | ||
| # CHECK-BOOLEAN: bf b0, . +20 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x10,0x23,0xc3] | ||
| # CHECK-BOOLEAN: movf a2, a3, b1 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding | ||
|
|
||
| [0x20,0x34,0xd3] | ||
| # CHECK-BOOLEAN: movt a3, a4, b2 | ||
| # CHECK-CORE: :[[@LINE-2]]:2: warning: invalid instruction encoding |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # RUN: llvm-mc %s -triple=xtensa -show-encoding --mattr=+bool \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK,CHECK-INST %s | ||
|
|
||
| .align 4 | ||
| // CHECK: .p2align 4 | ||
|
|
||
| LBL0: | ||
| // CHECK: LBL0: | ||
|
|
||
| all4 b1, b4 | ||
| // CHECK: all4 b1, b4 # encoding: [0x10,0x94,0x00] | ||
|
|
||
| all8 b1, b8 | ||
| // CHECK: all8 b1, b8 # encoding: [0x10,0xb8,0x00] | ||
|
|
||
| andb b1, b2, b3 | ||
| // CHECK: andb b1, b2, b3 # encoding: [0x30,0x12,0x02] | ||
|
|
||
| andbc b1, b2, b3 | ||
| // CHECK: andbc b1, b2, b3 # encoding: [0x30,0x12,0x12] | ||
|
|
||
| orb b1, b2, b3 | ||
| // CHECK: orb b1, b2, b3 # encoding: [0x30,0x12,0x22] | ||
|
|
||
| orbc b1, b2, b3 | ||
| // CHECK: orbc b1, b2, b3 # encoding: [0x30,0x12,0x32] | ||
|
|
||
| xorb b1, b2, b3 | ||
| // CHECK: xorb b1, b2, b3 # encoding: [0x30,0x12,0x42] | ||
|
|
||
| any4 b1, b4 | ||
| // CHECK: any4 b1, b4 # encoding: [0x10,0x84,0x00] | ||
|
|
||
| any8 b1, b8 | ||
| // CHECK: any8 b1, b8 # encoding: [0x10,0xa8,0x00] | ||
|
|
||
| bt b1, LBL0 | ||
| // CHECK: bt b1, LBL0 # encoding: [0x76,0x11,A] | ||
| // CHECK-NEXT: # fixup A - offset: 0, value: LBL0, kind: fixup_xtensa_branch_8 | ||
|
|
||
| bf b0, LBL0 | ||
| // CHECK: bf b0, LBL0 # encoding: [0x76,0x00,A] | ||
| // CHECK-NEXT: # fixup A - offset: 0, value: LBL0, kind: fixup_xtensa_branch_8 | ||
|
|
||
| movf a2, a3, b1 | ||
| // CHECK: movf a2, a3, b1 # encoding: [0x10,0x23,0xc3] | ||
|
|
||
| movt a3, a4, b2 | ||
| // CHECK: movt a3, a4, b2 # encoding: [0x20,0x34,0xd3] | ||
|
|
||
| xsr a3, br | ||
| // CHECK: xsr a3, br # encoding: [0x30,0x04,0x61] | ||
|
|
||
| xsr.br a3 | ||
| // CHECK: xsr a3, br # encoding: [0x30,0x04,0x61] | ||
|
|
||
| xsr a3, 4 | ||
| // CHECK: xsr a3, br # encoding: [0x30,0x04,0x61] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MCPhysReg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for comments. Fixed.