Basic math and bitwise operators#154
Conversation
…ces for each variable type.
…templates for all data types.
|
Cool reuse! Does anyone object to the use of these kinds of macro functions? What kind of efficiency do you get? Loops are quite simple and shallow? What does the generated code look like? |
src/math/p_not.c
Outdated
There was a problem hiding this comment.
@mateunho Thanks, fixed.
@aolofsson Yes, loops are very shallow ( will look into the possibility of using a duff's device to do some unrolling, or if -funroll-all-loops can be used without pigging out on size). Also I noticed it can be counterproductive to have a decreasing index.
What I think we should do now is to define a number of platforms we want to target and the compiler flags we want to use ( O2 or O3, and more importantly on x86 the SSE flags. Or should we split x86 in 2 ).
What is the preferred method of implementing platform specific code? #ifdef tree?
Signed-off-by: Thomas Böhm <boehm@fortiss.org>
Implemented the basic mathematical operator ( addition, subtraction, multiplication, division ) and logical bit operators ( and, or, xor, not ) as templates and instantiated them for all data types supported by Epiphany.