From 067097aa1f22fd823c44bb6aa360008d69466026 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 7 Oct 2020 18:51:34 +0100 Subject: [PATCH] identify FR (FP) regs --- openpower/opcode_regs_deduped.mdwn | 122 +++++++++++++++++++---------- openpower/sv_analysis.py | 7 +- 2 files changed, 87 insertions(+), 42 deletions(-) diff --git a/openpower/opcode_regs_deduped.mdwn b/openpower/opcode_regs_deduped.mdwn index a168f9ad4..a9aa5f6a5 100644 --- a/openpower/opcode_regs_deduped.mdwn +++ b/openpower/opcode_regs_deduped.mdwn @@ -10,6 +10,8 @@ in1 | in2 | in3 | out | CR in | CR out | ldst len| 0 | 0 | 0 | R | 1 | 0 | 0| 0 | 0 | R | R | 0 | 1 | 0| 0 | R | 0 | 0 | 0 | 0 | 0| +0 | R | 0 | 0 | 1 | 1 | 0| +0 | R | 0 | R | 1 | 1 | 0| 0 | R | R | R | 0 | 1 | 0| R | 0 | 0 | 0 | 0 | 0 | 0| R | 0 | 0 | 0 | 0 | 1 | 0| @@ -20,14 +22,18 @@ R | 0 | 0 | R | 0 | 1 | 0| R | 0 | 0 | R | 0 | 1 | 1| R | 0 | R | 0 | 0 | 0 | 1| R | 0 | R | R | 0 | 1 | 0| +R | 0 | R | R | 1 | 1 | 0| R | R | 0 | 0 | 0 | 0 | 0| R | R | 0 | 0 | 0 | 1 | 0| +R | R | 0 | 0 | 1 | 1 | 0| R | R | 0 | R | 0 | 0 | 0| R | R | 0 | R | 0 | 0 | 1| R | R | 0 | R | 0 | 1 | 0| R | R | 0 | R | 1 | 0 | 0| +R | R | 0 | R | 1 | 1 | 0| R | R | R | 0 | 0 | 0 | 1| R | R | R | 0 | 0 | 1 | 1| +R | R | R | R | 1 | 1 | 0| """]] ## in1: 0 in2: 0 in3: 0 out: 0 CR in: 0 CR out: 0 ldst len: 0 @@ -75,50 +81,10 @@ minor_19.csv | 0b0100000001 | crand | XL-Form| minor_19.csv | 0b0100100001 | creqv | XL-Form| minor_19.csv | 0b0110100001 | crorc | XL-Form| minor_19.csv | 0b0111000001 | cror | XL-Form| -minor_63h.csv | 0b0010 | fdiv | -Form| -minor_63h.csv | 0b0100 | fsub | -Form| -minor_63h.csv | 0b0101 | fadd | -Form| -minor_63h.csv | 0b0110 | fsqrt | -Form| -minor_63h.csv | 0b0111 | fsel | -Form| -minor_63h.csv | 0b1000 | fre | -Form| -minor_63h.csv | 0b1001 | fmul | -Form| -minor_63h.csv | 0b1010 | frsqrte | -Form| -minor_63h.csv | 0b1100 | fmsub | -Form| -minor_63h.csv | 0b1101 | fmadd | -Form| -minor_63h.csv | 0b1110 | fnmsub | -Form| -minor_63h.csv | 0b1111 | fnmadd | -Form| -minor_63l.csv | 0b000000000 | 0/0=fcmpu | -Form| -minor_63l.csv | 0b000000001 | 1/0=fcmpo | -Form| minor_63l.csv | 0b000000010 | 2/0=mcrfs | -Form| -minor_63l.csv | 0b000000100 | 4/0=ftdiv | -Form| -minor_63l.csv | 0b000000101 | 5/0=ftsqrt | -Form| minor_63l.csv | 0b011000001 | 1/6=mtfsb1 | -Form| minor_63l.csv | 0b011000010 | 2/6=mtfsb0 | -Form| minor_63l.csv | 0b011000100 | 4/6=mtfsfi | -Form| -minor_63l.csv | 0b011011010 | 26/6=fmrgow | -Form| -minor_63l.csv | 0b011011110 | 30/6=fmrgew | -Form| -minor_63l.csv | 0b011110010 | 18/7=mffsfamily | -Form| -minor_63l.csv | 0b011110110 | 22/7=mtfsf | -Form| -minor_63l.csv | 0b100000000 | 0/8=fcpsgn | -Form| -minor_63l.csv | 0b100000001 | 1/8=fneg | -Form| -minor_63l.csv | 0b100000010 | 2/8=fmr | -Form| -minor_63l.csv | 0b100000100 | 4/8=fnabs | -Form| -minor_63l.csv | 0b100001000 | 8/8=fabs | -Form| -minor_63l.csv | 0b100001100 | 12/8=frin | -Form| -minor_63l.csv | 0b100001101 | 13/8=friz | -Form| -minor_63l.csv | 0b100001110 | 14/8=frip | -Form| -minor_63l.csv | 0b100001111 | 15/8=frim | -Form| -minor_63l.csv | 0b110000000 | 0/12=frsp | -Form| -minor_63l.csv | 0b111000000 | 0/14=fctiw | -Form| -minor_63l.csv | 0b111000100 | 4/14=fctiwu | -Form| -minor_63l.csv | 0b111011001 | 25/14=fctid | -Form| -minor_63l.csv | 0b111011010 | 26/14=fcfid | -Form| -minor_63l.csv | 0b111011101 | 29/14=fctidu | -Form| -minor_63l.csv | 0b111011110 | 30/14=fcfidu | -Form| -minor_63l.csv | 0b111100000 | 0/15=fctiwz | -Form| -minor_63l.csv | 0b111100100 | 4/15=fctiwuz | -Form| -minor_63l.csv | 0b111111001 | 25/15=fctidz | -Form| -minor_63l.csv | 0b111111101 | 29/15=fctiduz | -Form| """]] ## in1: 0 in2: 0 in3: 0 out: 0 CR in: 1 CR out: 1 ldst len: 1 @@ -174,6 +140,43 @@ minor_31.csv | 0b0100010010 | tlbiel | X-Form| minor_31.csv | 0b0100110010 | tlbie | X-Form| """]] +## in1: 0 in2: R in3: 0 out: 0 CR in: 1 CR out: 1 ldst len: 0 + +[[!table data=""" +CSV | opcode | asm | form| +minor_63l.csv | 0b000000101 | 5/0=ftsqrt | -Form| +minor_63l.csv | 0b011110110 | 22/7=mtfsf | -Form| +"""]] + +## in1: 0 in2: R in3: 0 out: R CR in: 1 CR out: 1 ldst len: 0 + +[[!table data=""" +CSV | opcode | asm | form| +minor_63h.csv | 0b0110 | fsqrt | -Form| +minor_63h.csv | 0b1000 | fre | -Form| +minor_63h.csv | 0b1010 | frsqrte | -Form| +minor_63l.csv | 0b011110010 | 18/7=mffsfamily | -Form| +minor_63l.csv | 0b100000001 | 1/8=fneg | -Form| +minor_63l.csv | 0b100000010 | 2/8=fmr | -Form| +minor_63l.csv | 0b100000100 | 4/8=fnabs | -Form| +minor_63l.csv | 0b100001000 | 8/8=fabs | -Form| +minor_63l.csv | 0b100001100 | 12/8=frin | -Form| +minor_63l.csv | 0b100001101 | 13/8=friz | -Form| +minor_63l.csv | 0b100001110 | 14/8=frip | -Form| +minor_63l.csv | 0b100001111 | 15/8=frim | -Form| +minor_63l.csv | 0b110000000 | 0/12=frsp | -Form| +minor_63l.csv | 0b111000000 | 0/14=fctiw | -Form| +minor_63l.csv | 0b111000100 | 4/14=fctiwu | -Form| +minor_63l.csv | 0b111011001 | 25/14=fctid | -Form| +minor_63l.csv | 0b111011010 | 26/14=fcfid | -Form| +minor_63l.csv | 0b111011101 | 29/14=fctidu | -Form| +minor_63l.csv | 0b111011110 | 30/14=fcfidu | -Form| +minor_63l.csv | 0b111100000 | 0/15=fctiwz | -Form| +minor_63l.csv | 0b111100100 | 4/15=fctiwuz | -Form| +minor_63l.csv | 0b111111001 | 25/15=fctidz | -Form| +minor_63l.csv | 0b111111101 | 29/15=fctiduz | -Form| +"""]] + ## in1: 0 in2: R in3: R out: R CR in: 0 CR out: 1 ldst len: 0 [[!table data=""" @@ -307,6 +310,13 @@ minor_30.csv | 0b0110 | rldimi | MD-Form| minor_30.csv | 0b0111 | rldimi | MD-Form| """]] +## in1: R in2: 0 in3: R out: R CR in: 1 CR out: 1 ldst len: 0 + +[[!table data=""" +CSV | opcode | asm | form| +minor_63h.csv | 0b1001 | fmul | -Form| +"""]] + ## in1: R in2: R in3: 0 out: 0 CR in: 0 CR out: 0 ldst len: 0 [[!table data=""" @@ -325,6 +335,15 @@ minor_31.csv | 0b0000100000 | cmpl | X-Form| minor_31.csv | 0b0011100000 | cmpeqb | X-Form| """]] +## in1: R in2: R in3: 0 out: 0 CR in: 1 CR out: 1 ldst len: 0 + +[[!table data=""" +CSV | opcode | asm | form| +minor_63l.csv | 0b000000000 | 0/0=fcmpu | -Form| +minor_63l.csv | 0b000000001 | 1/0=fcmpo | -Form| +minor_63l.csv | 0b000000100 | 4/0=ftdiv | -Form| +"""]] + ## in1: R in2: R in3: 0 out: R CR in: 0 CR out: 0 ldst len: 0 [[!table data=""" @@ -458,6 +477,18 @@ minor_31.csv | 0b1111001111 | isel | A-Form| minor_31.csv | 0b1111101111 | isel | A-Form| """]] +## in1: R in2: R in3: 0 out: R CR in: 1 CR out: 1 ldst len: 0 + +[[!table data=""" +CSV | opcode | asm | form| +minor_63h.csv | 0b0010 | fdiv | -Form| +minor_63h.csv | 0b0100 | fsub | -Form| +minor_63h.csv | 0b0101 | fadd | -Form| +minor_63l.csv | 0b011011010 | 26/6=fmrgow | -Form| +minor_63l.csv | 0b011011110 | 30/6=fmrgew | -Form| +minor_63l.csv | 0b100000000 | 0/8=fcpsgn | -Form| +"""]] + ## in1: R in2: R in3: R out: 0 CR in: 0 CR out: 0 ldst len: 1 [[!table data=""" @@ -489,3 +520,14 @@ minor_31.csv | 0b0011110111 | stbux | X-Form| minor_31.csv | 0b1010110110 | stbcx | X-Form| """]] +## in1: R in2: R in3: R out: R CR in: 1 CR out: 1 ldst len: 0 + +[[!table data=""" +CSV | opcode | asm | form| +minor_63h.csv | 0b0111 | fsel | -Form| +minor_63h.csv | 0b1100 | fmsub | -Form| +minor_63h.csv | 0b1101 | fmadd | -Form| +minor_63h.csv | 0b1110 | fnmsub | -Form| +minor_63h.csv | 0b1111 | fnmadd | -Form| +"""]] + diff --git a/openpower/sv_analysis.py b/openpower/sv_analysis.py index aeab536a4..aa9168f72 100644 --- a/openpower/sv_analysis.py +++ b/openpower/sv_analysis.py @@ -27,6 +27,9 @@ def blank_key(row): return False return True +def isreg(field): + return field.startswith('R') or field.startswith('FR') + keycolumns = ['in1', 'in2', 'in3', 'out', 'CR in', 'CR out', 'ldst len'] # don't think we need these: , 'rc', 'lk'] @@ -39,13 +42,13 @@ def create_key(row): if key in ['in1', 'in2', 'in3']: # TODO: replace this with a counter row['in'] # will need row['in'] initialising to 0 *outside* of the for-loop - if row[key].startswith('R'): + if isreg(row[key]): res[key] = 'R' else: res[key] = '0' # registers OUT if key == 'out': - if row[key].startswith('R'): + if isreg(row[key]): res[key] = 'R' else: res[key] = '0' -- 2.30.2