-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[RISCV] Add Qualcomm uC Xqcilia (Large Immediate Arithmetic) extension #124706
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 5 commits
81d1b62
b9501ff
34f05e8
09c3c2d
71206e8
1df40d1
c315e7b
0b40481
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 |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| # Xqcilia - Qualcomm uC Large Immediate Arithmetic extension | ||
| # RUN: not llvm-mc -triple riscv32 -mattr=+experimental-xqcilia < %s 2>&1 \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK,CHECK-PLUS,CHECK-IMM %s | ||
| # RUN: not llvm-mc -triple riscv32 -mattr=-experimental-xqcilia < %s 2>&1 \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK,CHECK-MINUS,CHECK-EXT %s | ||
|
|
||
| # CHECK-PLUS: :[[@LINE+2]]:12: error: register must be a GPR excluding zero (x0) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lenary I just noticed this error isn't worded well when the user didn't provide a register. Maybe we "operand must a GPR register excluding zero (x0)" would be better?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is one of the reasons I intend to work on the DiagnosticPredicate use in RISC-V, but I haven't yet got back to it. AArch64, where they use diagnosticpredicates, they will give you guidance if you're a register, or say "invalid operand for instruction" if you give an immediate where only a register is allowed. My work on this has slowed as we're doing our own release work, but I hope to get back to it. |
||
| # CHECK-MINUS: :[[@LINE+1]]:12: error: invalid operand for instruction | ||
| qc.e.addai 9, 33554432 | ||
|
|
||
| # CHECK: :[[@LINE+1]]:1: error: too few operands for instruction | ||
| qc.e.addai x9 | ||
|
|
||
| # CHECK-IMM: :[[@LINE+1]]:16: error: immediate must be an integer in the range [-2147483648, 2147483647] | ||
| qc.e.addai x9, 20485546494 | ||
|
|
||
| # CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension) | ||
| qc.e.addai x9, 33554432 | ||
|
|
||
|
|
||
| # CHECK-PLUS: :[[@LINE+2]]:16: error: register must be a GPR excluding zero (x0) | ||
| # CHECK-MINUS: :[[@LINE+1]]:16: error: invalid operand for instruction | ||
| qc.e.addi x10, 9, 554432 | ||
|
|
||
| # CHECK: :[[@LINE+1]]:1: error: too few operands for instruction | ||
| qc.e.addi x10, x9 | ||
|
|
||
| # CHECK-IMM: :[[@LINE+1]]:20: error: immediate must be an integer in the range [-33554432, 33554431] | ||
| qc.e.addi x10, x9, 335544312 | ||
|
|
||
| # CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension) | ||
| qc.e.addi x10, x9, 554432 | ||
|
|
||
|
|
||
| # CHECK-PLUS: :[[@LINE+2]]:12: error: register must be a GPR excluding zero (x0) | ||
| # CHECK-MINUS: :[[@LINE+1]]:12: error: invalid operand for instruction | ||
| qc.e.andai 9, 33554432 | ||
|
|
||
| # CHECK: :[[@LINE+1]]:1: error: too few operands for instruction | ||
| qc.e.andai x9 | ||
|
|
||
| # CHECK-IMM: :[[@LINE+1]]:16: error: immediate must be an integer in the range [-2147483648, 2147483647] | ||
| qc.e.andai x9, 20494437494 | ||
|
|
||
| # CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension) | ||
| qc.e.andai x9, 33554432 | ||
|
|
||
|
|
||
| # CHECK-PLUS: :[[@LINE+2]]:16: error: register must be a GPR excluding zero (x0) | ||
| # CHECK-MINUS: :[[@LINE+1]]:16: error: invalid operand for instruction | ||
| qc.e.andi x10, 9, 554432 | ||
|
|
||
| # CHECK: :[[@LINE+1]]:1: error: too few operands for instruction | ||
| qc.e.andi x10, x9 | ||
|
|
||
| # CHECK-IMM: :[[@LINE+1]]:20: error: immediate must be an integer in the range [-33554432, 33554431] | ||
| qc.e.andi x10, x9, 335544312 | ||
|
|
||
| # CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension) | ||
| qc.e.andi x10, x9, 554432 | ||
|
|
||
|
|
||
| # CHECK-PLUS: :[[@LINE+2]]:11: error: register must be a GPR excluding zero (x0) | ||
| # CHECK-MINUS: :[[@LINE+1]]:11: error: invalid operand for instruction | ||
| qc.e.orai 9, 33554432 | ||
|
|
||
| # CHECK: :[[@LINE+1]]:1: error: too few operands for instruction | ||
| qc.e.orai x9 | ||
|
|
||
| # CHECK-IMM: :[[@LINE+1]]:15: error: immediate must be an integer in the range [-2147483648, 2147483647] | ||
| qc.e.orai x9, 20494437494 | ||
|
|
||
| # CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension) | ||
| qc.e.orai x9, 33554432 | ||
|
|
||
|
|
||
| # CHECK-PLUS: :[[@LINE+2]]:15: error: register must be a GPR excluding zero (x0) | ||
| # CHECK-MINUS: :[[@LINE+1]]:15: error: invalid operand for instruction | ||
| qc.e.ori x10, 9, 554432 | ||
|
|
||
| # CHECK: :[[@LINE+1]]:1: error: too few operands for instruction | ||
| qc.e.ori x10, x9 | ||
|
|
||
| # CHECK-IMM: :[[@LINE+1]]:19: error: immediate must be an integer in the range [-33554432, 33554431] | ||
| qc.e.ori x10, x9, 335544312 | ||
|
|
||
| # CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension) | ||
| qc.e.ori x10, x9, 554432 | ||
|
|
||
|
|
||
|
|
||
| # CHECK-PLUS: :[[@LINE+2]]:12: error: register must be a GPR excluding zero (x0) | ||
| # CHECK-MINUS: :[[@LINE+1]]:12: error: invalid operand for instruction | ||
| qc.e.xorai 9, 33554432 | ||
|
|
||
| # CHECK: :[[@LINE+1]]:1: error: too few operands for instruction | ||
| qc.e.xorai x9 | ||
|
|
||
| # CHECK-IMM: :[[@LINE+1]]:16: error: immediate must be an integer in the range [-2147483648, 2147483647] | ||
| qc.e.xorai x9, 20494437494 | ||
|
|
||
| # CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension) | ||
| qc.e.xorai x9, 33554432 | ||
|
|
||
|
|
||
| # CHECK-PLUS: :[[@LINE+2]]:16: error: register must be a GPR excluding zero (x0) | ||
| # CHECK-MINUS: :[[@LINE+1]]:16: error: invalid operand for instruction | ||
| qc.e.xori x10, 9, 554432 | ||
|
|
||
| # CHECK: :[[@LINE+1]]:1: error: too few operands for instruction | ||
| qc.e.xori x10, x9 | ||
|
|
||
| # CHECK-IMM: :[[@LINE+1]]:20: error: immediate must be an integer in the range [-33554432, 33554431] | ||
| qc.e.xori x10, x9, 335544312 | ||
|
|
||
| # CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension) | ||
| qc.e.xori x10, x9, 554432 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # Xqcilia - Qualcomm uC Large Immediate Arithmetic extension | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqcilia -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqcilia < %s \ | ||
| # RUN: | llvm-objdump --mattr=+experimental-xqcilia -M no-aliases --no-print-imm-hex -d - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqcilia -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqcilia < %s \ | ||
| # RUN: | llvm-objdump --mattr=+experimental-xqcilia --no-print-imm-hex -d - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
|
|
||
| # CHECK-INST: qc.e.addai s1, 2147483647 | ||
| # CHECK-ENC: encoding: [0x9f,0x24,0xff,0xff,0xff,0x7f] | ||
| qc.e.addai x9, 2147483647 | ||
|
|
||
| # CHECK-INST: qc.e.addai s1, -2147483648 | ||
| # CHECK-ENC: encoding: [0x9f,0x24,0x00,0x00,0x00,0x80] | ||
| qc.e.addai x9, -2147483648 | ||
|
|
||
|
|
||
| # CHECK-INST: qc.e.addi a0, s1, -33554432 | ||
| # CHECK-ENC: encoding: [0x1f,0xb5,0x04,0x80,0x00,0x80] | ||
| qc.e.addi x10, x9, -33554432 | ||
|
|
||
| # CHECK-INST: qc.e.addi a0, s1, 33554431 | ||
| # CHECK-ENC: encoding: [0x1f,0xb5,0xf4,0xbf,0xff,0x7f] | ||
| qc.e.addi x10, x9, 33554431 | ||
|
|
||
|
|
||
| # CHECK-INST: qc.e.andai s1, 2147483647 | ||
| # CHECK-ENC: encoding: [0x9f,0xa4,0xff,0xff,0xff,0x7f] | ||
| qc.e.andai x9, 2147483647 | ||
|
|
||
| # CHECK-INST: qc.e.andai s1, -2147483648 | ||
| # CHECK-ENC: encoding: [0x9f,0xa4,0x00,0x00,0x00,0x80] | ||
| qc.e.andai x9, -2147483648 | ||
|
|
||
|
|
||
| # CHECK-INST: qc.e.andi a0, s1, -33554432 | ||
| # CHECK-ENC: encoding: [0x1f,0xb5,0x04,0xc0,0x00,0x80] | ||
| qc.e.andi x10, x9, -33554432 | ||
|
|
||
| # CHECK-INST: qc.e.andi a0, s1, 33554431 | ||
| # CHECK-ENC: encoding: [0x1f,0xb5,0xf4,0xff,0xff,0x7f] | ||
| qc.e.andi x10, x9, 33554431 | ||
|
|
||
|
|
||
| # CHECK-INST: qc.e.orai s1, 2147483647 | ||
| # CHECK-ENC: encoding: [0x9f,0x94,0xff,0xff,0xff,0x7f] | ||
| qc.e.orai x9, 2147483647 | ||
|
|
||
| # CHECK-INST: qc.e.orai s1, -2147483648 | ||
| # CHECK-ENC: encoding: [0x9f,0x94,0x00,0x00,0x00,0x80] | ||
| qc.e.orai x9, -2147483648 | ||
|
|
||
|
|
||
| # CHECK-INST: qc.e.ori a0, s1, -33554432 | ||
| # CHECK-ENC: encoding: [0x1f,0xb5,0x04,0x40,0x00,0x80] | ||
| qc.e.ori x10, x9, -33554432 | ||
|
|
||
| # CHECK-INST: qc.e.ori a0, s1, 33554431 | ||
| # CHECK-ENC: encoding: [0x1f,0xb5,0xf4,0x7f,0xff,0x7f] | ||
| qc.e.ori x10, x9, 33554431 | ||
|
|
||
|
|
||
| # CHECK-INST: qc.e.xorai s1, 2147483647 | ||
| # CHECK-ENC: encoding: [0x9f,0x14,0xff,0xff,0xff,0x7f] | ||
| qc.e.xorai x9, 2147483647 | ||
|
|
||
| # CHECK-INST: qc.e.xorai s1, -2147483648 | ||
| # CHECK-ENC: encoding: [0x9f,0x14,0x00,0x00,0x00,0x80] | ||
| qc.e.xorai x9, -2147483648 | ||
|
|
||
|
|
||
| # CHECK-INST: qc.e.xori a0, s1, -33554432 | ||
| # CHECK-ENC: encoding: [0x1f,0xb5,0x04,0x00,0x00,0x80] | ||
| qc.e.xori x10, x9, -33554432 | ||
|
|
||
| # CHECK-INST: qc.e.xori a0, s1, 33554431 | ||
| # CHECK-ENC: encoding: [0x1f,0xb5,0xf4,0x3f,0xff,0x7f] | ||
| qc.e.xori x10, x9, 33554431 |
Uh oh!
There was an error while loading. Please reload this page.