diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Helium/Instructions.agda | 2 | ||||
-rw-r--r-- | src/Helium/Semantics/Denotational.agda | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/Helium/Instructions.agda b/src/Helium/Instructions.agda index 256f9c4..1fa2829 100644 --- a/src/Helium/Instructions.agda +++ b/src/Helium/Instructions.agda @@ -41,6 +41,8 @@ record VecOp₂ : Set where VAdd = VecOp₂ +VSub = VecOp₂ + record VHSub : Set where field op₂ : VecOp₂ diff --git a/src/Helium/Semantics/Denotational.agda b/src/Helium/Semantics/Denotational.agda index c2a4d6e..93c784c 100644 --- a/src/Helium/Semantics/Denotational.agda +++ b/src/Helium/Semantics/Denotational.agda @@ -152,6 +152,9 @@ module _ vadd : VAdd → Procedure 2 (Beat , ElmtMask , _) vadd d = vec-op₂ d (λ x y → sliceᶻ _ zero (uint x +ᶻ uint y)) + vsub : VSub → Procedure 2 (Beat , ElmtMask , _) + vsub d = vec-op₂ d (λ x y → sliceᶻ _ zero (uint x +ᶻ -ᶻ uint y)) + vhsub : VHSub → Procedure 2 (Beat , ElmtMask , _) vhsub d = vec-op₂ op₂ (λ x y → sliceᶻ _ (suc zero) (int x +ᶻ -ᶻ int y)) where open VHSub d ; int = Bool.if unsigned then uint else sint |