wmops.c
上传用户:csczyc
上传日期:2021-02-19
资源大小:1051k
文件大小:1k
- /*
- wmops_lib.c: dummy routines for weighted MOPS estimation.
- */
- /* compiler include files */
- #include <stdio.h>
- #include <math.h>
- #include "spbstd.h"
- #include "wmops.h"
- extern int complexity;
- /*
- Data Move: constant -> variable
- variable -> variable
- result of operation -> array variable
- arithmetic test on array variable
- */
- void data_move()
- {
- complexity += 1;
- }
- void L_data_move()
- {
- complexity += 2;
- }
- /*
- Logical operation: AND, OR, XOR, NOT
- */
- void logic()
- {
- complexity += 1;
- }
- void L_logic()
- {
- complexity += 2;
- }
- /*
- Arithmetic test: IF, WHILE, DO..WHILE
- */
- void compare_zero()
- {
- complexity += 2;
- }
- void compare_nonzero()
- {
- /* To perform a comparison between two short variables or a short variable
- and a non-zero constant, a subtract (sub) must be performed first. */
- complexity += 3;
- }
- void L_compare_nonzero()
- {
- /* To perform a comparison between two long variables or a long variable
- and a non-zero constant, a subtract (L_sub) must be performed first. */
- complexity += 4;
- }