diff mbox series

[v5,53/55] plugins: add sparc64 instruction classification table

Message ID 20191014104948.4291-54-alex.bennee@linaro.org (mailing list archive)
State New, archived
Headers show
Series Support for TCG plugins | expand

Commit Message

Alex Bennée Oct. 14, 2019, 10:49 a.m. UTC
As an example of another set of instructions.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/plugin/howvec.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Richard Henderson Oct. 14, 2019, 5:01 p.m. UTC | #1
On 10/14/19 3:49 AM, Alex Bennée wrote:
> +InsnClassExecCount sparc32_insn_classes[] = {
> +    { "Call",                "call",   0xc0000000, 0x40000000, COUNT_CLASS},
> +    { "Branch ICond",        "bcc",    0xc1c00000, 0x00800000, COUNT_CLASS},
> +    { "Branch Fcond",        "fbcc",   0xc1c00000, 0x01800000, COUNT_CLASS},
> +    { "SetHi",               "sethi",  0xc1c00000, 0x01000000, COUNT_CLASS},
> +    { "FPU ALU",             "fpu",    0xc1f00000, 0x81a00000, COUNT_CLASS},
> +    { "ALU",                 "alu",    0xc0000000, 0x80000000, COUNT_CLASS},
> +    { "Load/Store",          "ldst",   0xc0000000, 0xc0000000, COUNT_CLASS},
> +    /* Unclassified */
> +    { "Unclassified",        "unclas", 0x00000000, 0x00000000, COUNT_INDIVIDUAL},
> +};
> +

Unused.  You'd see this if they were static.


r~
Alex Bennée Oct. 15, 2019, 7:09 p.m. UTC | #2
Richard Henderson <richard.henderson@linaro.org> writes:

> On 10/14/19 3:49 AM, Alex Bennée wrote:
>> +InsnClassExecCount sparc32_insn_classes[] = {
>> +    { "Call",                "call",   0xc0000000, 0x40000000, COUNT_CLASS},
>> +    { "Branch ICond",        "bcc",    0xc1c00000, 0x00800000, COUNT_CLASS},
>> +    { "Branch Fcond",        "fbcc",   0xc1c00000, 0x01800000, COUNT_CLASS},
>> +    { "SetHi",               "sethi",  0xc1c00000, 0x01000000, COUNT_CLASS},
>> +    { "FPU ALU",             "fpu",    0xc1f00000, 0x81a00000, COUNT_CLASS},
>> +    { "ALU",                 "alu",    0xc0000000, 0x80000000, COUNT_CLASS},
>> +    { "Load/Store",          "ldst",   0xc0000000, 0xc0000000, COUNT_CLASS},
>> +    /* Unclassified */
>> +    { "Unclassified",        "unclas", 0x00000000, 0x00000000, COUNT_INDIVIDUAL},
>> +};
>> +
>
> Unused.  You'd see this if they were static.

How similar are the sparc and sparc64 decodes? Is there a canonical
table you can point to?

>
>
> r~


--
Alex Bennée
Richard Henderson Oct. 15, 2019, 7:37 p.m. UTC | #3
On 10/15/19 12:09 PM, Alex Bennée wrote:
> How similar are the sparc and sparc64 decodes? Is there a canonical
> table you can point to?

sparc64 is a superset of sparc32.

Appendix A of https://community.oracle.com/docs/DOC-1005258


r~
diff mbox series

Patch

diff --git a/tests/plugin/howvec.c b/tests/plugin/howvec.c
index 5f7c740833..9ec0d25e3b 100644
--- a/tests/plugin/howvec.c
+++ b/tests/plugin/howvec.c
@@ -112,6 +112,27 @@  InsnClassExecCount aarch64_insn_classes[] = {
     { "Unclassified",        "unclas", 0x00000000, 0x00000000, COUNT_CLASS},
 };
 
+InsnClassExecCount sparc32_insn_classes[] = {
+    { "Call",                "call",   0xc0000000, 0x40000000, COUNT_CLASS},
+    { "Branch ICond",        "bcc",    0xc1c00000, 0x00800000, COUNT_CLASS},
+    { "Branch Fcond",        "fbcc",   0xc1c00000, 0x01800000, COUNT_CLASS},
+    { "SetHi",               "sethi",  0xc1c00000, 0x01000000, COUNT_CLASS},
+    { "FPU ALU",             "fpu",    0xc1f00000, 0x81a00000, COUNT_CLASS},
+    { "ALU",                 "alu",    0xc0000000, 0x80000000, COUNT_CLASS},
+    { "Load/Store",          "ldst",   0xc0000000, 0xc0000000, COUNT_CLASS},
+    /* Unclassified */
+    { "Unclassified",        "unclas", 0x00000000, 0x00000000, COUNT_INDIVIDUAL},
+};
+
+InsnClassExecCount sparc64_insn_classes[] = {
+    { "SetHi & Branches",     "op0",   0xc0000000, 0x00000000, COUNT_CLASS},
+    { "Call",                 "op1",   0xc0000000, 0x40000000, COUNT_CLASS},
+    { "Arith/Logical/Move",   "op2",   0xc0000000, 0x80000000, COUNT_CLASS},
+    { "Arith/Logical/Move",   "op3",   0xc0000000, 0xc0000000, COUNT_CLASS},
+    /* Unclassified */
+    { "Unclassified",        "unclas", 0x00000000, 0x00000000, COUNT_INDIVIDUAL},
+};
+
 /* Default matcher for currently unclassified architectures */
 InsnClassExecCount default_insn_classes[] = {
     { "Unclassified",        "unclas", 0x00000000, 0x00000000, COUNT_INDIVIDUAL},
@@ -126,6 +147,7 @@  typedef struct {
 ClassSelector class_tables[] =
 {
     { "aarch64", aarch64_insn_classes, ARRAY_SIZE(aarch64_insn_classes) },
+    { "sparc64", sparc64_insn_classes, ARRAY_SIZE(sparc64_insn_classes) },
     { NULL, default_insn_classes, ARRAY_SIZE(default_insn_classes) },
 };