cpprisc16  June 16, 2020
Namespaces | Macros | Functions
cppextendedrisc16.hpp File Reference

Extended instructions set: some extra operations x_* implemented with RiSC16. More...

#include "cpprisc16.hpp"
Include dependency graph for cppextendedrisc16.hpp:

Go to the source code of this file.

Namespaces

 cpprisc16
 

Macros

#define x_branch(label)
 Jump to label. More...
 

Functions

void cpprisc16::x_add32 (unsigned int a2, unsigned int a1, unsigned int b2, unsigned int b1, unsigned int tmp1, unsigned int tmp2, unsigned int tmp3)
 R[a2]:R[a1] <– R[a2]:R[a1] + R[b2]:R[b1]. More...
 
void cpprisc16::x_addc (unsigned int a, unsigned int b, unsigned int tmp1, unsigned int tmp2, unsigned int tmp3)
 R[b]:R[a] <– R[a] + R[b]. More...
 
void cpprisc16::x_and_to (unsigned int result, unsigned int a, unsigned int b)
 R[result] <– R[a] & R[b]. More...
 
void cpprisc16::x_inc32 (unsigned int a2, unsigned int a1)
 R[a2]:R[a1] <– R[a2]:R[a1] + 1. More...
 
void cpprisc16::x_is_lower_to (unsigned int result, unsigned int a, unsigned int b, unsigned int tmp)
 R[result] <– (positive value) if a < b, 0 else. More...
 
void cpprisc16::x_lshift (unsigned int a)
 R[a] <– R[a] << 1 (== R[a]*2) More...
 
void cpprisc16::x_lshift_to (unsigned int result, unsigned int a)
 R[result] <– R[a] << 1 (== R[a]*2) More...
 
void cpprisc16::x_lshift32 (unsigned int a2, unsigned int a1, unsigned int tmp)
 R[a2]:R[a1] <– (R[a2]:R[a1]) << 1 (== (R[a2]:R[a1])*2) More...
 
void cpprisc16::x_lshift_8 (unsigned int a)
 R[a] <– R[a] << 8 (== R[a]*256) More...
 
void cpprisc16::x_lshift_8_to (unsigned int result, unsigned int a)
 R[result] <– R[a] << 8 (== R[a]*256) More...
 
void cpprisc16::x_lshift32_8 (unsigned int a2, unsigned int a1, unsigned int tmp1, unsigned int tmp2, unsigned int tmp3)
 R[a2]:R[a1] <– (R[a2]:R[a1]) << 8 (== (R[a2]:R[a1])*256) More...
 
void cpprisc16::x_mask0x8000 (unsigned int a, unsigned int tmp)
 R[a] <– R[a] & 0x8000 (== R[a] & 0b1000000000000000 == R[a] & 32768) More...
 
void cpprisc16::x_mask0x8000_to (unsigned int result, unsigned int a)
 R[result] <– R[a] & 0x8000 (== R[a] & 0b1000000000000000 == R[a] & 32768) More...
 
void cpprisc16::x_mov (unsigned int result, unsigned int a)
 R[result] <– R[a]. More...
 
void cpprisc16::x_mul (unsigned int a, unsigned int b, unsigned int tmp1, unsigned int tmp2, unsigned int tmp3, unsigned int tmp4, unsigned int tmp5)
 R[b]:R[a] <– R[a] * R[b] by standard algorithm: https://en.wikipedia.org/wiki/Multiplication_algorithm#Long_multiplication. More...
 
void cpprisc16::x_mul_karatsuba (unsigned int a, unsigned int b, unsigned int tmp1, unsigned int tmp2, unsigned int tmp3, unsigned int tmp4, unsigned int tmp5)
 R[b]:R[a] <– R[a] * R[b] by Karatsuba algorithm: https://en.wikipedia.org/wiki/Karatsuba_algorithm. More...
 
void cpprisc16::x_mul8_to (unsigned int result, unsigned int a, unsigned int b, unsigned int tmp1, unsigned int tmp2)
 R[result] <– R[a] * R[b]. More...
 
void cpprisc16::x_neg (unsigned int a)
 R[a] <– -R[a] (two's complement) More...
 
void cpprisc16::x_not (unsigned int a)
 R[a] <– ~R[a]. More...
 
void cpprisc16::x_not_to (unsigned int result, unsigned int a)
 R[result] <– ~R[a]. More...
 
void cpprisc16::x_or_to (unsigned int result, unsigned int a, unsigned int b)
 R[result] <– R[a] | R[b]. More...
 
void cpprisc16::x_rshift_to (unsigned int result, unsigned int a, unsigned int tmp1, unsigned int tmp2)
 R[result] <– R[a] >> 1 (== R[a]/2) More...
 
void cpprisc16::x_rshift_8_to (unsigned int result, unsigned int a, unsigned int tmp1, unsigned int tmp2)
 R[result] <– R[a] >> 8 (== R[a]/256) More...
 
void cpprisc16::x_rshift_8_duo_to (unsigned int resulta, unsigned int a, unsigned int resultb, unsigned int b, unsigned int tmp1, unsigned int tmp2, unsigned int tmp3)
 R[resulta] <– R[a] >> 8 (== R[a]/256) R[resultb] <– R[b] >> 8. More...
 
void cpprisc16::x_rshift_8_signed_to (unsigned int result, unsigned int a, unsigned int tmp1, unsigned int tmp2, unsigned int tmp3)
 R[result] <– R[a] >> 8 with extension of the sign. More...
 
void cpprisc16::x_set0 (unsigned int a)
 R[a] <– 0. More...
 
void cpprisc16::x_set0x8000 (unsigned int result)
 R[result] <– 0x8000 (== 0b1000000000000000 == 32768) More...
 
void cpprisc16::x_sqr (unsigned int a, unsigned int result2, unsigned int tmp1, unsigned int tmp2, unsigned int tmp3, unsigned int tmp4, unsigned int tmp5)
 R[result2]:R[a] <– R[a]*R[a]. More...
 
void cpprisc16::x_sqr8_to (unsigned int result, unsigned int a, unsigned int tmp1, unsigned int tmp2, unsigned int tmp3)
 R[result] <– R[a] * R[a]. More...
 
void cpprisc16::x_sub_from (unsigned int a, unsigned int b)
 R[a] <– -R[a] + R[b]. More...
 
void cpprisc16::x_sub_to (unsigned int result, unsigned int a, unsigned int b)
 R[result] <– R[a] - R[b]. More...
 
void cpprisc16::x_swap (unsigned int a, unsigned int b, unsigned int tmp)
 R[a], R[b] <– R[b], R[a]. More...
 

Detailed Description

Extended instructions set: some extra operations x_* implemented with RiSC16.

(March 15, 2017) Piece of cpprisc16. https://bitbucket.org/OPiMedia/cpprisc16

GPLv3 — Copyright (C) 2017 Olivier Pirson http://www.opimedia.be/

Definition in file cppextendedrisc16.hpp.

Macro Definition Documentation

◆ x_branch

#define x_branch (   label)
Value:
{ \
goto label; \
}
uint64_t nb_executed
Number of instructions executed.
Definition: cpprisc16.cpp:41

Jump to label.

Definition at line 26 of file cppextendedrisc16.hpp.