Commit 162ac7f6 authored by Benedikt Geßele's avatar Benedikt Geßele

mips cmp.condn.fmt implemented

parent 3d73929e
......@@ -100,26 +100,6 @@ val show/format format =
| _ : revision/show/format format
end
val show/condop cond =
case cond of
C_F: "F"
| C_UN: "UN"
| C_EQ: "EQ"
| C_UEQ: "UEQ"
| C_OLT: "OLT"
| C_ULT: "ULT"
| C_OLE: "OLE"
| C_ULE: "ULE"
| C_SF: "SF"
| C_NGLE: "NGLE"
| C_SEQ: "SEQ"
| C_NGL: "NGL"
| C_LT: "LT"
| C_NGE: "NGE"
| C_LE: "LE"
| C_NGT: "NGT"
end
val show/fccode fcc =
case fcc of
FCC0: as-prefix +++ "fcc0"
......
val show/condop cond =
case cond of
C_F: "F"
| C_UN: "UN"
| C_EQ: "EQ"
| C_UEQ: "UEQ"
| C_OLT: "OLT"
| C_ULT: "ULT"
| C_OLE: "OLE"
| C_ULE: "ULE"
| C_SF: "SF"
| C_NGLE: "NGLE"
| C_SEQ: "SEQ"
| C_NGL: "NGL"
| C_LT: "LT"
| C_NGE: "NGE"
| C_LE: "LE"
| C_NGT: "NGT"
end
val revision/show/immediate imm = "ERROR"
val revision/show/format format =
case format of
PS : "PS"
end
val show/condop cond =
case cond of
C_AF: "AF"
| C_UN: "UN"
| C_EQ: "EQ"
| C_UEQ: "UEQ"
| C_LT: "LT"
| C_ULT: "ULT"
| C_LE: "LE"
| C_ULE: "ULE"
| C_SAF: "SAF"
| C_SUN: "SUN"
| C_SEQ: "SEQ"
| C_SUEQ: "SUEQ"
| C_SLT: "SLT"
| C_SULT: "SULT"
| C_SLE: "SLE"
| C_SULE: "SULE"
| C_AT: "AT"
| C_OR: "OR"
| C_UNE: "UNE"
| C_NE: "NE"
| C_UGE: "UGE"
| C_OGE: "OGE"
| C_UGT: "UGT"
| C_OGT: "OGT"
| C_SAT: "SAT"
| C_SOR: "SOR"
| C_SUNE: "SUNE"
| C_SNE: "SNE"
| C_SUGE: "SUGE"
| C_SOGE: "SOGE"
| C_SUGT: "SUGT"
| C_SOGT: "SOGT"
end
val revision/show/immediate imm =
case imm of
IMM21 x: show-int (zx x)
......
......@@ -251,4 +251,5 @@ val revision/semantics i =
| BOVC x: sem-bovc x
| BNVC x: sem-bnvc x
| CLASS-fmt x: sem-default-binop-flr-generic i x
| CMP-condn-fmt x: sem-default-ternop-cflrr-generic i x
end
......@@ -33,4 +33,5 @@ val revision/traverse f insn =
| BOVC x: f "BOVC" (TERNOP_RRR x)
| BNVC x: f "BNVC" (TERNOP_RRR x)
| CLASS-fmt x: f "CLASS" (BINOP_FLR x)
| CMP-condn-fmt x: f "CMP" (TERNOP_CFLRR x)
end
......@@ -118,25 +118,6 @@ type cop2ccode =
# - only in C-cond-fmt instr.
####
type condop =
C_F
| C_UN
| C_EQ
| C_UEQ
| C_OLT
| C_ULT
| C_OLE
| C_ULE
| C_SF
| C_NGLE
| C_SEQ
| C_NGL
| C_LT
| C_NGE
| C_LE
| C_NGT
################
# transform a lvalue to rvalue
####
......@@ -998,7 +979,6 @@ val /sa ['sa:5'] = update@{sa=sa}
val /instr_index ['instr_index:26'] = update@{instr_index=instr_index}
val /cofun ['cofun:25'] = update@{cofun=cofun}
val /cc ['cc:3'] = update@{cc=cc}
val /cond ['cond:4'] = update@{cond=cond}
val /op ['op:5'] = update@{op=op}
val /hint5 ['hint:5'] = update@{hint=hint}
val /hint5zero ['00000'] = update@{hint='00000'}
......@@ -1159,11 +1139,6 @@ val c2cc = do
return (C2CC (c2cc-from-bits cc))
end
val cond = do
cond <- query $cond;
return (cond-from-bits (cond))
end
val op = do
op <- query $op;
return (IMM (OP op))
......@@ -1711,23 +1686,3 @@ val c2cc-from-bits bits =
| '110': C2CC6
| '111': C2CC7
end
val cond-from-bits bits =
case bits of
'0000': C_F
| '0001': C_UN
| '0010': C_EQ
| '0011': C_UEQ
| '0100': C_OLT
| '0101': C_ULT
| '0110': C_OLE
| '0111': C_ULE
| '1000': C_SF
| '1001': C_NGLE
| '1010': C_SEQ
| '1011': C_NGL
| '1100': C_LT
| '1101': C_NGE
| '1110': C_LE
| '1111': C_NGT
end
......@@ -186,7 +186,51 @@ type instruction =
type format =
PS
type condop =
C_F
| C_UN
| C_EQ
| C_UEQ
| C_OLT
| C_ULT
| C_OLE
| C_ULE
| C_SF
| C_NGLE
| C_SEQ
| C_NGL
| C_LT
| C_NGE
| C_LE
| C_NGT
val /cond ['cond:4'] = update@{cond=cond}
val /fmt5sdps ['10 /fmt3sdps'] = return void
val /fmt3sdps [/fmt3sd] = return void
val /fmt3sdps ['110'] = update@{fmt=PS}
val cond = do
cond <- query $cond;
return (cond-from-bits (cond))
end
val cond-from-bits bits =
case bits of
'0000': C_F
| '0001': C_UN
| '0010': C_EQ
| '0011': C_UEQ
| '0100': C_OLT
| '0101': C_ULT
| '0110': C_OLE
| '0111': C_ULE
| '1000': C_SF
| '1001': C_NGLE
| '1010': C_SEQ
| '1011': C_NGL
| '1100': C_LT
| '1101': C_NGE
| '1110': C_LE
| '1111': C_NGT
end
......@@ -183,7 +183,7 @@ val / ['010001 /fmt5sd 00000 /fs /fd 011011'] = binop-fmt CLASS-fmt fmt fd (righ
### CMP-condn-fmt
### - Floating Point Compare setting Mask
val / ['010001 /fmt5sd/wl /ft /fs /fd 0 condn'] = binop-fmt CLASS-fmt fmt fd (right fs)
val / ['010001 /fmt5sd/wl /ft /fs /fd 0 /condn'] = ternop-cond-fmt CMP-condn-fmt condn fmt fd (right fs) (right ft)
### LUI
### - Load Upper Immediate
......@@ -224,6 +224,7 @@ type instruction =
| BOVC of ternop-rrr
| BNVC of ternop-rrr
| CLASS-fmt of binop-flr
| CMP-condn-fmt of ternop-cflrr
type imm =
IMM21 of 21
......@@ -245,7 +246,7 @@ val /bp ['bp:2'] = update@{bp=bp}
val /ct ['ct:5'] = update@{ct=ct}
val /fmt5sd/wl ['10100'] = update@{fmt=S}
val /fmt5sd/wl ['10101'] = update@{fmt=D}
val /condn [''] =
val /condn ['condn:5'] = update@{condn=condn}
###########################
......@@ -277,11 +278,86 @@ val bp = do
return (IMM (BP bp))
end
val condn = do
condn <- query $condn;
return (condn-from-bits (condn))
end
val ct = do
ct <- query $ct;
return (IMM (C2CONDITION ct))
end
val condn-from-bits bits =
case bits of
'00000': C_AF
| '00001': C_UN
| '00010': C_EQ
| '00011': C_UEQ
| '00100': C_LT
| '00101': C_ULT
| '00110': C_LE
| '00111': C_ULE
| '01000': C_SAF
| '01001': C_SUN
| '01010': C_SEQ
| '01011': C_SUEQ
| '01100': C_SLT
| '01101': C_SULT
| '01110': C_SLE
| '01111': C_SULE
| '10000': C_AT
| '10001': C_OR
| '10010': C_UNE
| '10011': C_NE
| '10100': C_UGE
| '10101': C_OGE
| '10110': C_UGT
| '10111': C_OGT
| '11000': C_SAT
| '11001': C_SOR
| '11010': C_SUNE
| '11011': C_SNE
| '11100': C_SUGE
| '11101': C_SOGE
| '11110': C_SUGT
| '11111': C_SOGT
end
type condop =
C_AF
| C_UN
| C_EQ
| C_UEQ
| C_LT
| C_ULT
| C_LE
| C_ULE
| C_SAF
| C_SUN
| C_SEQ
| C_SUEQ
| C_SLT
| C_SULT
| C_SLE
| C_SULE
| C_AT
| C_OR
| C_UNE
| C_NE
| C_UGE
| C_OGE
| C_UGT
| C_OGT
| C_SAT
| C_SOR
| C_SUNE
| C_SNE
| C_SUGE
| C_SOGE
| C_SUGT
| C_SOGT
#################################
# to be removed ;)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment