Comments (6)
I modify the asm code to this manually
.LCPI1_0:
.quad -9223372036854775808 # 0x8000000000000000
.quad -9223372036854775808 # 0x8000000000000000
.quad -9223372036854775808 # 0x8000000000000000
.quad -9223372036854775808 # 0x8000000000000000
.section .rodata,"a",@progbits
.LCPI1_1:
.long 0 # 0x0
.long 2 # 0x2
.long 4 # 0x4
.long 6 # 0x6
.zero 4
.zero 4
.zero 4
.zero 4
.text
.globl sample_max_avx2
and it works. Is it a correct way and a safely way?
from c2goasm.
Yes, that looks correct and should be ok.
from c2goasm.
@fwessels thanks for your reply.
Does clang have a flag to enable/disable move the local variables to constant? I doesnot find a relevant flag and I does not know clang well .
from c2goasm.
@iRita Sorry for responding late to your question. Looks like your question got answered on https://stackoverflow.com/questions/50126786/how-to-prevent-clang-llvm-compile-local-variables-to-global . Did you get a chance to test the suggestion? Also, clang
has lots of flags that the result can be different with different combinations of flags. so, please try with the options given here https://clang.llvm.org/docs/ClangCommandLineReference.html
from c2goasm.
Hi @kannappanr,
If using -Os
instead of -O3
, the clang generate asm code without AVX2 instructions. It is not we wanted, we want the asm codes which is optimized for performance.
There are too many optimizations in -O3
, and which one affects the move local variables to constant
should be tested.
I do not find a quickly and easy way to do the test. Do I must generate the asm code by a hard way (llvm->opt->llc) ?
https://laure.gonnord.org/pro/teaching/CAP1718_ENSL/llvm_fernando.pdf
from c2goasm.
Hello @lrita , I am afraid you will need to do some testing on your own, clang has a ton of options and we only know the (bare) basics of it.
Going the opt / llc
way is certainly another option, but these tools have their own set of flags etc so you will need to study this.
from c2goasm.
Related Issues (20)
- "panic: Unknown line for table: push rbp"
- linux gcc8 fun name error HOT 3
- is not compatible with clang 3.4 HOT 1
- Can companion declarations be avoided for private functions? HOT 3
- Automate generation of companion declarations from C headers HOT 1
- Crashes on a function with no arguments HOT 1
- go BLAS HOT 2
- c++ function names HOT 1
- "panic: Offset for higher number argument asked for than reserved" HOT 1
- how to add -L or -lpthread ? HOT 3
- c2goasm generates asm which triggers expected identifier, found "." HOT 1
- Vectorized loop crashing? HOT 1
- go bin keep not set
- when your gihub works well can I set up in background variable on my windows setup for enable an asm compiler ?
- Q: c2goasm HOT 2
- Took forever to generate the goasm HOT 2
- Address alignment in go HOT 1
- best clang and gcc flags and more examples from start to finish HOT 1
- "Too many fields found: 3" on a line like ".p2align 2, 0x90" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c2goasm.