D.gnu - Array Operations
- Jonathan Crapuchettes (4/4) Aug 19 2010 I have been trying to add the SSE2 array operation code to the compilati...
- Michael Parrott (9/13) Aug 19 2010 Did you set DFLAGS before running configure? If you didn't, that might b...
- Jonathan Crapuchettes (7/20) Aug 19 2010 I followed the example in issue #30:
- Michael Parrott (4/32) Aug 19 2010 No, that should be fine.
- Jonathan Crapuchettes (17/49) Aug 19 2010 I did uncommented the version sections, but thank you for the reminder.
- Michael Parrott (3/63) Aug 19 2010 Well, off the top of my head I can't think of anything else other than j...
- Iain Buclaw (12/65) Aug 20 2010 suggestions?
- Jonathan Crapuchettes (10/68) Aug 20 2010 Michael and Iain,
I have been trying to add the SSE2 array operation code to the compilation, but it seems like the DFLAGS variable isn't being used. Can you offer any suggestions? Thank you, JC
Aug 19 2010
Jonathan Crapuchettes Wrote:I have been trying to add the SSE2 array operation code to the compilation, but it seems like the DFLAGS variable isn't being used. Can you offer any suggestions? Thank you, JCDid you set DFLAGS before running configure? If you didn't, that might be why. Example: DFLAGS="-g" export DFLAGS ../configure --enable-languages=d ..... make sudo make install Something like that should work.
Aug 19 2010
http://bitbucket.org/goshawk/gdc/issue/30/d_inlineasm-updates DFLAGS='-O2 -g -frelease -march=pentium3' ../configure --enable-languages=d --disable-multilib --disable-shared Is this wrong? JC Michael Parrott wrote:Jonathan Crapuchettes Wrote:I have been trying to add the SSE2 array operation code to the compilation, but it seems like the DFLAGS variable isn't being used. Can you offer any suggestions? Thank you, JCDid you set DFLAGS before running configure? If you didn't, that might be why. Example: DFLAGS="-g" export DFLAGS ../configure --enable-languages=d ..... make sudo make install Something like that should work.
Aug 19 2010
Jonathan Crapuchettes Wrote:http://bitbucket.org/goshawk/gdc/issue/30/d_inlineasm-updates DFLAGS='-O2 -g -frelease -march=pentium3' ../configure --enable-languages=d --disable-multilib --disable-shared Is this wrong? JC Michael Parrott wrote:No, that should be fine. What is wrong when you do that? Are there errors when you build? Does Phobos not seem to be taking advantage of the SSE operations? In phobos/internal/array{byte, double, float, int, short}.d, you need to uncomment the sections labelled "version (D_InlineAsm_X86)" to enable the ASM code.Jonathan Crapuchettes Wrote:I have been trying to add the SSE2 array operation code to the compilation, but it seems like the DFLAGS variable isn't being used. Can you offer any suggestions? Thank you, JCDid you set DFLAGS before running configure? If you didn't, that might be why. Example: DFLAGS="-g" export DFLAGS ../configure --enable-languages=d ..... make sudo make install Something like that should work.
Aug 19 2010
Michael Parrott wrote:Jonathan Crapuchettes Wrote:I did uncommented the version sections, but thank you for the reminder. I can tell that the SSE code is not being used because I compared two pieces of code: for (int i = 0; i < a.length; i++) c[i] = a[i] / 1000; and c[] = a[] / 1000; They should produce the same result and they do, but the array operation code should be much faster. I base this assumption off of the same speed test using DMD. The execution time for the two code segments, produced by GDC, are about the same. I also compared the assembly for the objects created by GDC and DMD. The GDC code is not using the SSE code as specified in the arrayDouble.d file, but the DMD code is. If you have suggestions, I am all ears. Thank you for taking the time to help me, JChttp://bitbucket.org/goshawk/gdc/issue/30/d_inlineasm-updates DFLAGS='-O2 -g -frelease -march=pentium3' ../configure --enable-languages=d --disable-multilib --disable-shared Is this wrong? JC Michael Parrott wrote:No, that should be fine. What is wrong when you do that? Are there errors when you build? Does Phobos not seem to be taking advantage of the SSE operations? In phobos/internal/array{byte, double, float, int, short}.d, you need to uncomment the sections labelled "version (D_InlineAsm_X86)" to enable the ASM code.Jonathan Crapuchettes Wrote:I have been trying to add the SSE2 array operation code to the compilation, but it seems like the DFLAGS variable isn't being used. Can you offer any suggestions? Thank you, JCDid you set DFLAGS before running configure? If you didn't, that might be why. Example: DFLAGS="-g" export DFLAGS ../configure --enable-languages=d ..... make sudo make install Something like that should work.
Aug 19 2010
Jonathan Crapuchettes Wrote:Michael Parrott wrote:Well, off the top of my head I can't think of anything else other than just trying to install GDC again. Perhaps you are giving the wrong -march option? (Maybe something other than pentium3?)Jonathan Crapuchettes Wrote:I did uncommented the version sections, but thank you for the reminder. I can tell that the SSE code is not being used because I compared two pieces of code: for (int i = 0; i < a.length; i++) c[i] = a[i] / 1000; and c[] = a[] / 1000; They should produce the same result and they do, but the array operation code should be much faster. I base this assumption off of the same speed test using DMD. The execution time for the two code segments, produced by GDC, are about the same. I also compared the assembly for the objects created by GDC and DMD. The GDC code is not using the SSE code as specified in the arrayDouble.d file, but the DMD code is. If you have suggestions, I am all ears. Thank you for taking the time to help me, JChttp://bitbucket.org/goshawk/gdc/issue/30/d_inlineasm-updates DFLAGS='-O2 -g -frelease -march=pentium3' ../configure --enable-languages=d --disable-multilib --disable-shared Is this wrong? JC Michael Parrott wrote:No, that should be fine. What is wrong when you do that? Are there errors when you build? Does Phobos not seem to be taking advantage of the SSE operations? In phobos/internal/array{byte, double, float, int, short}.d, you need to uncomment the sections labelled "version (D_InlineAsm_X86)" to enable the ASM code.Jonathan Crapuchettes Wrote:I have been trying to add the SSE2 array operation code to the compilation, but it seems like the DFLAGS variable isn't being used. Can you offer any suggestions? Thank you, JCDid you set DFLAGS before running configure? If you didn't, that might be why. Example: DFLAGS="-g" export DFLAGS ../configure --enable-languages=d ..... make sudo make install Something like that should work.
Aug 19 2010
== Quote from Jonathan Crapuchettes (jcrapuchettes gmail.com)'s articleMichael Parrott wrote:compilation, butJonathan Crapuchettes Wrote:http://bitbucket.org/goshawk/gdc/issue/30/d_inlineasm-updates DFLAGS='-O2 -g -frelease -march=pentium3' ../configure --enable-languages=d --disable-multilib --disable-shared Is this wrong? JC Michael Parrott wrote:Jonathan Crapuchettes Wrote:I have been trying to add the SSE2 array operation code to thesuggestions?it seems like the DFLAGS variable isn't being used. Can you offer anywhy.Thank you, JCDid you set DFLAGS before running configure? If you didn't, that might benot seem to be taking advantage of the SSE operations?No, that should be fine. What is wrong when you do that? Are there errors when you build? Does PhobosExample: DFLAGS="-g" export DFLAGS ../configure --enable-languages=d ..... make sudo make install Something like that should work.uncomment the sections labelled "version (D_InlineAsm_X86)" to enable the ASM code.In phobos/internal/array{byte, double, float, int, short}.d, you need toI did uncommented the version sections, but thank you for the reminder. I can tell that the SSE code is not being used because I compared two piecesofcode: for (int i = 0; i < a.length; i++) c[i] = a[i] / 1000; and c[] = a[] / 1000; They should produce the same result and they do, but the array operation code should be much faster. I base this assumption off of the same speed test using DMD. The execution time for the two code segments, produced by GDC, are about the same. I also compared the assembly for the objects created by GDC and DMD. The GDC code is not using the SSE code as specified in the arrayDouble.d file, but the DMD code is. If you have suggestions, I am all ears. Thank you for taking the time to help me, JCThat's because the function called to perform the operation (_arraySliceExpDivSliceAssign_i) is not implemented in phobos - so a stock function is generated by the compiler instead. Regards
Aug 20 2010
Jonathan Crapuchettes wrote:Michael Parrott wrote:Michael and Iain, Thank you for your input. I just realized what my mistake was and now feel like I have wasted you time. The issue was that I was compiling the compiler as x86_64, which I need, and the version tag for the SSE2 is D_InlineAsm_X86 not D_InlineAsm_X86_64. I'm thinking that I might play with converting the code in arrayDouble.d to x86_64, but I wouldn't hold my breath. Thank you again for your help, JCJonathan Crapuchettes Wrote:I did uncommented the version sections, but thank you for the reminder. I can tell that the SSE code is not being used because I compared two pieces of code: for (int i = 0; i < a.length; i++) c[i] = a[i] / 1000; and c[] = a[] / 1000; They should produce the same result and they do, but the array operation code should be much faster. I base this assumption off of the same speed test using DMD. The execution time for the two code segments, produced by GDC, are about the same. I also compared the assembly for the objects created by GDC and DMD. The GDC code is not using the SSE code as specified in the arrayDouble.d file, but the DMD code is. If you have suggestions, I am all ears. Thank you for taking the time to help me, JChttp://bitbucket.org/goshawk/gdc/issue/30/d_inlineasm-updates DFLAGS='-O2 -g -frelease -march=pentium3' ../configure --enable-languages=d --disable-multilib --disable-shared Is this wrong? JC Michael Parrott wrote:No, that should be fine. What is wrong when you do that? Are there errors when you build? Does Phobos not seem to be taking advantage of the SSE operations? In phobos/internal/array{byte, double, float, int, short}.d, you need to uncomment the sections labelled "version (D_InlineAsm_X86)" to enable the ASM code.Jonathan Crapuchettes Wrote:I have been trying to add the SSE2 array operation code to the compilation, but it seems like the DFLAGS variable isn't being used. Can you offer any suggestions? Thank you, JCDid you set DFLAGS before running configure? If you didn't, that might be why. Example: DFLAGS="-g" export DFLAGS ../configure --enable-languages=d ..... make sudo make install Something like that should work.
Aug 20 2010