Skip to content

Conversation

@tcptomato
Copy link

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.

@aolofsson
Copy link
Member

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*(c + n) = ~*(a + n); \

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants