Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 502 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hardware square root gcc

#1
I'm trying to use the hardware instructions to compute some mathematical functions. For example the square root (sqrtpd instruction). I'm compiling my C code with GCC.

Does Anybody know what are the gcc options to force to compile with the hardware instructions and not to use the libc? Or if I need to do something special on my source code? (Without writing asm code).
Reply

#2
On gcc you should use `__builtin_ia32_sqrtpd`.
Reply

#3
The easiest way is to use optimization flags. -O1 generates

`sqrtsd %xmm1, %xmm0`

in assembly code. Try using -S flag with gcc to generate assembly and look how optimization flags works.
Reply

#4
Why don't you just write the desired hardware instruction in assembly code directly.

As far as I know, writing assembly code directly in c code is possible. It is called Inline Assembly. [ See here:

[To see links please register here]

]
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through