how to disable sse and avx

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

how to disable sse and avx

zhi chen
Hello,

I want to disable LLVM to use any SIMD registers like sse and avx. I tried -mno-sse and -mno-avx on my Core i7 machine. It seems that the generated assembly still uses xmm registers. Is there any way for LLVM to only use scalar registers? 

Thanks,
Zhi

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: how to disable sse and avx

mats petersson
Sounds like a bug, as far as I can tell, -mno-sse should disable all use of SSE instructions (and thus all uses of xmm registers). Exactly what version of LLVM, and what instructions from what LLVM IR or C source?

--
Mats

On 14 May 2015 at 18:12, zhi chen <[hidden email]> wrote:
Hello,

I want to disable LLVM to use any SIMD registers like sse and avx. I tried -mno-sse and -mno-avx on my Core i7 machine. It seems that the generated assembly still uses xmm registers. Is there any way for LLVM to only use scalar registers? 

Thanks,
Zhi

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: how to disable sse and avx

Zhi Chen-2
Thanks, Mats. Actually, it is able to generate the assembly now  if I use the follow command: clang++ -O3 -S -mllvm --x86-asm-syntax=intel -mno-sse -o test_nosee.s test.cpp
However, when I use g++ -O3 -o test_nosse test_nosse.s -lm to generate the executable, if gives me the following errors:

 Error: too many memory references for `sub'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: junk `ptr [rsp+112]' after expression
 Error: junk `ptr [rsp+128]' after expression
 Error: junk `(1)' after expression
 Error: operand size mismatch for `fsubrp'

Any idea? Thanks.

--
Zhi


On Thu, May 14, 2015 at 10:50 AM, mats petersson <[hidden email]> wrote:
Sounds like a bug, as far as I can tell, -mno-sse should disable all use of SSE instructions (and thus all uses of xmm registers). Exactly what version of LLVM, and what instructions from what LLVM IR or C source?

--
Mats

On 14 May 2015 at 18:12, zhi chen <[hidden email]> wrote:
Hello,

I want to disable LLVM to use any SIMD registers like sse and avx. I tried -mno-sse and -mno-avx on my Core i7 machine. It seems that the generated assembly still uses xmm registers. Is there any way for LLVM to only use scalar registers? 

Thanks,
Zhi

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





--
PhD Student
Department of Computer Science
University of California, Irvine

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: how to disable sse and avx

Michael Zolotukhin

On May 14, 2015, at 11:03 AM, Zhi Chen <[hidden email]> wrote:

Thanks, Mats. Actually, it is able to generate the assembly now  if I use the follow command: clang++ -O3 -S -mllvm --x86-asm-syntax=intel -mno-sse -o test_nosee.s test.cpp
However, when I use g++ -O3 -o test_nosse test_nosse.s -lm to generate the executable, if gives me the following errors:

 Error: too many memory references for `sub'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: junk `ptr [rsp+112]' after expression
 Error: junk `ptr [rsp+128]' after expression
 Error: junk `(1)' after expression
 Error: operand size mismatch for `fsubrp'

Any idea? Thanks.
I guess the problem is that g++ might expect AT&T syntax in asm files. Could you try changing ‘--x86-asm-syntax=intel’ to ‘--x86-asm-syntax=att’?

Michael

--
Zhi


On Thu, May 14, 2015 at 10:50 AM, mats petersson <[hidden email]> wrote:
Sounds like a bug, as far as I can tell, -mno-sse should disable all use of SSE instructions (and thus all uses of xmm registers). Exactly what version of LLVM, and what instructions from what LLVM IR or C source?

--
Mats

On 14 May 2015 at 18:12, zhi chen <[hidden email]> wrote:
Hello,

I want to disable LLVM to use any SIMD registers like sse and avx. I tried -mno-sse and -mno-avx on my Core i7 machine. It seems that the generated assembly still uses xmm registers. Is there any way for LLVM to only use scalar registers? 

Thanks,
Zhi

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





-- 
PhD Student
Department of Computer Science
University of California, Irvine
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: how to disable sse and avx

Eric Christopher
In reply to this post by Zhi Chen-2
Probably just issues in our intel syntax generation.

Why are you using that?

-eric

On Thu, May 14, 2015 at 11:07 AM Zhi Chen <[hidden email]> wrote:
Thanks, Mats. Actually, it is able to generate the assembly now  if I use the follow command: clang++ -O3 -S -mllvm --x86-asm-syntax=intel -mno-sse -o test_nosee.s test.cpp
However, when I use g++ -O3 -o test_nosse test_nosse.s -lm to generate the executable, if gives me the following errors:

 Error: too many memory references for `sub'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: junk `ptr [rsp+112]' after expression
 Error: junk `ptr [rsp+128]' after expression
 Error: junk `(1)' after expression
 Error: operand size mismatch for `fsubrp'

Any idea? Thanks.

--
Zhi


On Thu, May 14, 2015 at 10:50 AM, mats petersson <[hidden email]> wrote:
Sounds like a bug, as far as I can tell, -mno-sse should disable all use of SSE instructions (and thus all uses of xmm registers). Exactly what version of LLVM, and what instructions from what LLVM IR or C source?

--
Mats

On 14 May 2015 at 18:12, zhi chen <[hidden email]> wrote:
Hello,

I want to disable LLVM to use any SIMD registers like sse and avx. I tried -mno-sse and -mno-avx on my Core i7 machine. It seems that the generated assembly still uses xmm registers. Is there any way for LLVM to only use scalar registers? 

Thanks,
Zhi

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





--
PhD Student
Department of Computer Science
University of California, Irvine
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: how to disable sse and avx

Reid Kleckner-2
In reply to this post by Zhi Chen-2
Try not using intel assembly syntax, it is the less supported dialect.

On Thu, May 14, 2015 at 11:03 AM, Zhi Chen <[hidden email]> wrote:
Thanks, Mats. Actually, it is able to generate the assembly now  if I use the follow command: clang++ -O3 -S -mllvm --x86-asm-syntax=intel -mno-sse -o test_nosee.s test.cpp
However, when I use g++ -O3 -o test_nosse test_nosse.s -lm to generate the executable, if gives me the following errors:

 Error: too many memory references for `sub'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: junk `ptr [rsp+112]' after expression
 Error: junk `ptr [rsp+128]' after expression
 Error: junk `(1)' after expression
 Error: operand size mismatch for `fsubrp'

Any idea? Thanks.

--
Zhi


On Thu, May 14, 2015 at 10:50 AM, mats petersson <[hidden email]> wrote:
Sounds like a bug, as far as I can tell, -mno-sse should disable all use of SSE instructions (and thus all uses of xmm registers). Exactly what version of LLVM, and what instructions from what LLVM IR or C source?

--
Mats

On 14 May 2015 at 18:12, zhi chen <[hidden email]> wrote:
Hello,

I want to disable LLVM to use any SIMD registers like sse and avx. I tried -mno-sse and -mno-avx on my Core i7 machine. It seems that the generated assembly still uses xmm registers. Is there any way for LLVM to only use scalar registers? 

Thanks,
Zhi

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





--
PhD Student
Department of Computer Science
University of California, Irvine

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: how to disable sse and avx

Zhi Chen-2
Thanks for all your replies. Yes, it was the because I specified "--x86-asm-syntax=intel". I just wanted to see the performance difference between the code w/ and w/o using SSE/AVX registers.

Best,
Zhi

On Thu, May 14, 2015 at 11:15 AM, Reid Kleckner <[hidden email]> wrote:
Try not using intel assembly syntax, it is the less supported dialect.

On Thu, May 14, 2015 at 11:03 AM, Zhi Chen <[hidden email]> wrote:
Thanks, Mats. Actually, it is able to generate the assembly now  if I use the follow command: clang++ -O3 -S -mllvm --x86-asm-syntax=intel -mno-sse -o test_nosee.s test.cpp
However, when I use g++ -O3 -o test_nosse test_nosse.s -lm to generate the executable, if gives me the following errors:

 Error: too many memory references for `sub'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: too many memory references for `mov'
 Error: junk `ptr [rsp+112]' after expression
 Error: junk `ptr [rsp+128]' after expression
 Error: junk `(1)' after expression
 Error: operand size mismatch for `fsubrp'

Any idea? Thanks.

--
Zhi


On Thu, May 14, 2015 at 10:50 AM, mats petersson <[hidden email]> wrote:
Sounds like a bug, as far as I can tell, -mno-sse should disable all use of SSE instructions (and thus all uses of xmm registers). Exactly what version of LLVM, and what instructions from what LLVM IR or C source?

--
Mats

On 14 May 2015 at 18:12, zhi chen <[hidden email]> wrote:
Hello,

I want to disable LLVM to use any SIMD registers like sse and avx. I tried -mno-sse and -mno-avx on my Core i7 machine. It seems that the generated assembly still uses xmm registers. Is there any way for LLVM to only use scalar registers? 

Thanks,
Zhi

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





--
PhD Student
Department of Computer Science
University of California, Irvine

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





--
PhD Student
Department of Computer Science
University of California, Irvine

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev