From 22e36f48702ebbfdf809fefd40b5b4c94f294293 Mon Sep 17 00:00:00 2001 From: JanLJL Date: Wed, 21 Oct 2020 12:14:21 +0200 Subject: [PATCH] enhanced hanlding for immediates with shifting --- osaca/data/a64fx.yml | 9 +++++++++ osaca/parser/parser_AArch64.py | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/osaca/data/a64fx.yml b/osaca/data/a64fx.yml index 3cb7174..598d07f 100644 --- a/osaca/data/a64fx.yml +++ b/osaca/data/a64fx.yml @@ -137,6 +137,15 @@ instruction_forms: throughput: 1.0 latency: 0.0 port_pressure: [[1, '7']] +- name: cmp + operands: + - class: register + prefix: x + - class: immediate + imd: int + throughput: 0.5 + latency: 1.0 # 1*p34 + port_pressure: [[1, '34']] - name: cmp operands: - class: register diff --git a/osaca/parser/parser_AArch64.py b/osaca/parser/parser_AArch64.py index 3978eb0..1693bb7 100755 --- a/osaca/parser/parser_AArch64.py +++ b/osaca/parser/parser_AArch64.py @@ -406,7 +406,9 @@ class ParserAArch64(BaseParser): # normal integer value, nothing to do return AttrDict({self.IMMEDIATE_ID: immediate}) if 'base_immediate' in immediate: - # arithmetic immediate, nothing to do + # arithmetic immediate, add calculated value as value + immediate['shift'] = immediate['shift'][0] + immediate['value'] = int(immediate['base_immediate']['value']) << int(immediate['shift']['value']) return AttrDict({self.IMMEDIATE_ID: immediate}) if 'float' in immediate: dict_name = 'float'