From 0850f0a8d66af028e32a79063cdad328b70db909 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 11 Oct 2024 16:14:01 +0200 Subject: Implement if statements with equality --- lib/Language/Elna/Architecture/RiscV.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/Language/Elna/Architecture') diff --git a/lib/Language/Elna/Architecture/RiscV.hs b/lib/Language/Elna/Architecture/RiscV.hs index 03895a3..6619160 100644 --- a/lib/Language/Elna/Architecture/RiscV.hs +++ b/lib/Language/Elna/Architecture/RiscV.hs @@ -146,6 +146,7 @@ data RelocationType | RLower12S Text Funct3 XRegister XRegister | RHigher20 XRegister Text -- Type U. | RBranch Text Funct3 XRegister XRegister -- Type B. + | RJal XRegister Text -- Type J. deriving Eq data Instruction @@ -304,6 +305,7 @@ relocationType (RLower12I rd funct3' rs1 _) = type' $ I rd funct3' rs1 0 relocationType (RLower12S _ funct3' rs1 rs2) = type' $ S 0 funct3' rs1 rs2 relocationType (RHigher20 rd _) = type' $ U rd 0 relocationType (RBranch _ funct3' rs1 rs2) = type' $ B 0 funct3' rs1 rs2 +relocationType (RJal rd _) = type' $ J rd 0 instruction :: Instruction -> ByteString.Builder.Builder instruction = \case -- cgit v1.2.3