-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Adding support in llvm-exegesis for Aarch64 for handling FPR64/128, PPR16 and ZPR128 reg class. #127564
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
Adding support in llvm-exegesis for Aarch64 for handling FPR64/128, PPR16 and ZPR128 reg class. #127564
Changes from 2 commits
624a7ee
4c4d605
f8ce0cc
d34cb6d
566081a
803b9e9
3589838
53b9f0b
caebb7b
230aade
aab854b
f1e561c
25b02b6
b83b52d
433b62e
482a0a3
951e05e
ea8b28b
b5853a9
2c16af6
c21ee8b
5cda550
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,8 @@ | ||
| # RUN: llvm-exegesis -mcpu=neoverse-v2 -mode=latency -opcode-name=ADDVv16i8v | FileCheck %s | ||
| # REQUIRES: aarch64-registered-target | ||
|
|
||
| # Check that warning of not initializing registers is not printed | ||
| # CHECK-NOT: setRegTo is not implemented, results will be unreliable | ||
|
|
||
| # Check that we add ret (bx lr) instr to snippet | ||
| # CHECK: assembled_snippet: {{.*}}C0035FD6 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # RUN: llvm-exegesis -mcpu=neoverse-v2 -mode=latency -opcode-name=ADDVv4i16v 2>&1 | FileCheck %s | ||
|
|
||
| # Check that warning of not initializing registers is not printed | ||
| # CHECK-NOT: setRegTo is not implemented, results will be unreliable | ||
|
|
||
| # Check that we add ret (bx lr) instr to snippet | ||
| # CHECK: assembled_snippet: {{.*}}C0035FD6 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # RUN: llvm-exegesis -mcpu=neoverse-v2 -mode=latency -opcode-name=FADDV_VPZ_D | FileCheck %s | ||
| # REQUIRES: aarch64-registered-target | ||
|
|
||
| # Check that warning of not initializing registers is not printed | ||
| # CHECK-NOT: setRegTo is not implemented, results will be unreliable | ||
|
|
||
| # Check that we add ret (bx lr) instr to snippet | ||
| # CHECK: assembled_snippet: {{.*}}C0035FD6 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # RUN: llvm-exegesis -mcpu=neoverse-v2 -mode=latency -opcode-name=FADDV_VPZ_S | FileCheck %s | ||
| # REQUIRES: aarch64-registered-target | ||
|
|
||
| # Check that warning of not initializing registers is not printed | ||
| # CHECK-NOT: setRegTo is not implemented, results will be unreliable | ||
|
|
||
| # Check that we add ret (bx lr) instr to snippet | ||
| # CHECK: assembled_snippet: {{.*}}C0035FD6 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,31 +28,28 @@ static unsigned getLoadImmediateOpcode(unsigned RegBitWidth) { | |
| // Generates instruction to load an immediate value into a register. | ||
| static MCInst loadImmediate(MCRegister Reg, unsigned RegBitWidth, | ||
| const APInt &Value) { | ||
| if (Value.getBitWidth() > RegBitWidth) | ||
| llvm_unreachable("Value must fit in the Register"); | ||
| assert(Value.getBitWidth() <= RegBitWidth && "Value must fit in the Register"); | ||
| return MCInstBuilder(getLoadImmediateOpcode(RegBitWidth)) | ||
| .addReg(Reg) | ||
| .addImm(Value.getZExtValue()); | ||
| } | ||
|
|
||
| static MCInst loadZPRImmediate(MCRegister Reg, unsigned RegBitWidth, | ||
| const APInt &Value) { | ||
| if (Value.getBitWidth() > RegBitWidth) | ||
| llvm_unreachable("Value must fit in the ZPR Register"); | ||
| assert(Value.getBitWidth() <= RegBitWidth && "Value must fit in the PPR Register"); | ||
| // For ZPR, we typically use DUPM instruction to load immediate values | ||
| return MCInstBuilder(AArch64::DUPM_ZI) | ||
|
||
| .addReg(Reg) | ||
| .addImm(Value.getZExtValue()); | ||
| .addImm(0x1); | ||
lakshayk-nv marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| static MCInst loadPPRImmediate(MCRegister Reg, unsigned RegBitWidth, | ||
| const APInt &Value) { | ||
| if (Value.getBitWidth() > RegBitWidth) | ||
| llvm_unreachable("Value must fit in the PPR Register"); | ||
| assert(Value.getBitWidth() <= RegBitWidth && "Value must fit in the PPR Register"); | ||
| // For PPR, we typically use PTRUE instruction to set predicate registers | ||
| return MCInstBuilder(AArch64::PTRUE_B) | ||
| .addReg(Reg) | ||
| .addImm(31); // All lanes true | ||
| .addImm(0xFFFF); // All lanes true for 16 bits | ||
lakshayk-nv marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| // Generates instruction to load an FP immediate value into a register. | ||
|
|
@@ -70,8 +67,7 @@ static unsigned getLoadFPImmediateOpcode(unsigned RegBitWidth) { | |
| // Generates instruction to load an FP immediate value into a register. | ||
| static MCInst loadFPImmediate(MCRegister Reg, unsigned RegBitWidth, | ||
| const APInt &Value) { | ||
| if (Value.getBitWidth() > RegBitWidth) | ||
| llvm_unreachable("Value must fit in the FP Register"); | ||
| assert(Value.getBitWidth() <= RegBitWidth && "Value must fit in the FP Register"); | ||
| return MCInstBuilder(getLoadFPImmediateOpcode(RegBitWidth)) | ||
davemgreen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| .addReg(Reg) | ||
| .addImm(Value.getZExtValue()); | ||
|
|
@@ -131,4 +127,4 @@ void InitializeAArch64ExegesisTarget() { | |
| } | ||
|
|
||
| } // namespace exegesis | ||
lakshayk-nv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } // namespace llvm | ||
| } // namespace llvm | ||
Uh oh!
There was an error while loading. Please reload this page.