1static int add(int x, int y) 2{ 3 return x + y; 4} 5 6static unsigned int uadd(unsigned int x, unsigned int y) 7{ 8 return x + y; 9} 10 11static float fadd(float x, float y) 12{ 13 return x + y; 14} 15 16static double dadd(double x, double y) 17{ 18 return x + y; 19} 20 21static int sub(int x, int y) 22{ 23 return x - y; 24} 25 26static unsigned int usub(unsigned int x, unsigned int y) 27{ 28 return x - y; 29} 30 31static float fsub(float x, float y) 32{ 33 return x - y; 34} 35 36static double dsub(double x, double y) 37{ 38 return x - y; 39} 40 41static int mul(int x, int y) 42{ 43 return x * y; 44} 45 46static unsigned int umul(unsigned int x, unsigned int y) 47{ 48 return x * y; 49} 50 51static float fmul(float x, float y) 52{ 53 return x * y; 54} 55 56static double dmul(double x, double y) 57{ 58 return x * y; 59} 60 61static int div(int x, int y) 62{ 63 return x / y; 64} 65 66static unsigned int udiv(unsigned int x, unsigned int y) 67{ 68 return x / y; 69} 70 71static float fdiv(float x, float y) 72{ 73 return x / y; 74} 75 76static double ddiv(double x, double y) 77{ 78 return x / y; 79} 80 81static int mod(int x, int y) 82{ 83 return x % y; 84} 85 86static unsigned int umod(unsigned int x, unsigned int y) 87{ 88 return x % y; 89} 90 91static int neg(int x) 92{ 93 return -x; 94} 95 96static unsigned int uneg(unsigned int x) 97{ 98 return -x; 99} 100 101static float fneg(float x) 102{ 103 return -x; 104} 105 106static double dneg(double x) 107{ 108 return -x; 109} 110 111/* 112 * check-name: Arithmetic operator code generation 113 * check-command: sparsec -c $file -o tmp.o 114 */ 115