From 36fb9e4dac90ba5382452478ffcecee3b8dd1b76 Mon Sep 17 00:00:00 2001 From: Jannis Frank Date: Tue, 23 Apr 2024 08:56:26 +0000 Subject: [PATCH 1/2] offset calculation is multiplicative --- genapi/src/elem_type.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genapi/src/elem_type.rs b/genapi/src/elem_type.rs index 83a252be..306b7d3a 100644 --- a/genapi/src/elem_type.rs +++ b/genapi/src/elem_type.rs @@ -312,7 +312,7 @@ impl RegPIndex { let base = self.p_index.value(device, store, cx)?; if let Some(offset) = &self.offset { let offset: i64 = offset.value(device, store, cx)?; - Ok(base + offset) + Ok(base * offset) } else { Ok(base) } From 67167c617cf6efcf680d27077c8eb2b322c5dcdd Mon Sep 17 00:00:00 2001 From: Jannis Frank Date: Tue, 23 Apr 2024 10:06:13 +0000 Subject: [PATCH 2/2] Default increment for Integer Nodes is 1 --- genapi/src/parser/integer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genapi/src/parser/integer.rs b/genapi/src/parser/integer.rs index 8425a54e..8f6f3479 100644 --- a/genapi/src/parser/integer.rs +++ b/genapi/src/parser/integer.rs @@ -45,7 +45,7 @@ impl Parse for IntegerNode { let inc = node .parse_if(INC, node_builder, value_builder, cache_builder) .or_else(|| node.parse_if(P_INC, node_builder, value_builder, cache_builder)) - .unwrap_or(ImmOrPNode::Imm(10)); + .unwrap_or(ImmOrPNode::Imm(1)); let unit = node.parse_if(UNIT, node_builder, value_builder, cache_builder); let representation: IntegerRepresentation = node .parse_if(REPRESENTATION, node_builder, value_builder, cache_builder)