Why can the kernel not use SSE/AVX registers and instructions?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
This post from StackOverflow has this,
In some environments there there is a restriction on certain instructions or using certain registers. For example, in the Linux kernel, use of SSE/AVX or FP registers is generally disallowed. Therefore most of the optimized memcpy variants cannot be used as they rely on SSE or AVX registers, and a plain 64-bit mov-based copy is used on x86. For these platforms, using rep movsb allows most of the performance of an optimized memcpy without breaking the restriction on SIMD code.
Why is that, that the x86_64 Kernel can not use SSE/AVX? If it would make memcopy()
faster it seems like it should be allowed. I'm just learning Intel Assembly, and specifically looking to learn SEE/AVX when I saw this comment.
Specifically interested in SSE/MME and AVX optimizations in the Linux Kernel.
kernel intel assembly optimization syscalls
add a comment |Â
up vote
0
down vote
favorite
This post from StackOverflow has this,
In some environments there there is a restriction on certain instructions or using certain registers. For example, in the Linux kernel, use of SSE/AVX or FP registers is generally disallowed. Therefore most of the optimized memcpy variants cannot be used as they rely on SSE or AVX registers, and a plain 64-bit mov-based copy is used on x86. For these platforms, using rep movsb allows most of the performance of an optimized memcpy without breaking the restriction on SIMD code.
Why is that, that the x86_64 Kernel can not use SSE/AVX? If it would make memcopy()
faster it seems like it should be allowed. I'm just learning Intel Assembly, and specifically looking to learn SEE/AVX when I saw this comment.
Specifically interested in SSE/MME and AVX optimizations in the Linux Kernel.
kernel intel assembly optimization syscalls
One reason some OSes restrict the use of certain registers is that if they are used, then they must be saved on a context switch, which means that context switches take longer and thread contexts grow larger. I don't know whether this the/a reason why Linux puts restrictions on SIMD registers.
â Gilles
8 mins ago
I'm in two minds about this question. It's off-topic here since it's about programming: a user or system administrator wouldn't care at all. Its rightful place is Stack Overflow. But I know that Stack Overflow has an epidermic reaction against âÂÂwhyâÂÂ, even though this is a perfectly legitimate, answerable question that's on-topic on Stack Overflow. And Unix & Linux probably has enough expertise to answer it, even though it's on the outer side of the topic border.
â Gilles
4 mins ago
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This post from StackOverflow has this,
In some environments there there is a restriction on certain instructions or using certain registers. For example, in the Linux kernel, use of SSE/AVX or FP registers is generally disallowed. Therefore most of the optimized memcpy variants cannot be used as they rely on SSE or AVX registers, and a plain 64-bit mov-based copy is used on x86. For these platforms, using rep movsb allows most of the performance of an optimized memcpy without breaking the restriction on SIMD code.
Why is that, that the x86_64 Kernel can not use SSE/AVX? If it would make memcopy()
faster it seems like it should be allowed. I'm just learning Intel Assembly, and specifically looking to learn SEE/AVX when I saw this comment.
Specifically interested in SSE/MME and AVX optimizations in the Linux Kernel.
kernel intel assembly optimization syscalls
This post from StackOverflow has this,
In some environments there there is a restriction on certain instructions or using certain registers. For example, in the Linux kernel, use of SSE/AVX or FP registers is generally disallowed. Therefore most of the optimized memcpy variants cannot be used as they rely on SSE or AVX registers, and a plain 64-bit mov-based copy is used on x86. For these platforms, using rep movsb allows most of the performance of an optimized memcpy without breaking the restriction on SIMD code.
Why is that, that the x86_64 Kernel can not use SSE/AVX? If it would make memcopy()
faster it seems like it should be allowed. I'm just learning Intel Assembly, and specifically looking to learn SEE/AVX when I saw this comment.
Specifically interested in SSE/MME and AVX optimizations in the Linux Kernel.
kernel intel assembly optimization syscalls
kernel intel assembly optimization syscalls
asked 11 mins ago
Evan Carroll
4,73693875
4,73693875
One reason some OSes restrict the use of certain registers is that if they are used, then they must be saved on a context switch, which means that context switches take longer and thread contexts grow larger. I don't know whether this the/a reason why Linux puts restrictions on SIMD registers.
â Gilles
8 mins ago
I'm in two minds about this question. It's off-topic here since it's about programming: a user or system administrator wouldn't care at all. Its rightful place is Stack Overflow. But I know that Stack Overflow has an epidermic reaction against âÂÂwhyâÂÂ, even though this is a perfectly legitimate, answerable question that's on-topic on Stack Overflow. And Unix & Linux probably has enough expertise to answer it, even though it's on the outer side of the topic border.
â Gilles
4 mins ago
add a comment |Â
One reason some OSes restrict the use of certain registers is that if they are used, then they must be saved on a context switch, which means that context switches take longer and thread contexts grow larger. I don't know whether this the/a reason why Linux puts restrictions on SIMD registers.
â Gilles
8 mins ago
I'm in two minds about this question. It's off-topic here since it's about programming: a user or system administrator wouldn't care at all. Its rightful place is Stack Overflow. But I know that Stack Overflow has an epidermic reaction against âÂÂwhyâÂÂ, even though this is a perfectly legitimate, answerable question that's on-topic on Stack Overflow. And Unix & Linux probably has enough expertise to answer it, even though it's on the outer side of the topic border.
â Gilles
4 mins ago
One reason some OSes restrict the use of certain registers is that if they are used, then they must be saved on a context switch, which means that context switches take longer and thread contexts grow larger. I don't know whether this the/a reason why Linux puts restrictions on SIMD registers.
â Gilles
8 mins ago
One reason some OSes restrict the use of certain registers is that if they are used, then they must be saved on a context switch, which means that context switches take longer and thread contexts grow larger. I don't know whether this the/a reason why Linux puts restrictions on SIMD registers.
â Gilles
8 mins ago
I'm in two minds about this question. It's off-topic here since it's about programming: a user or system administrator wouldn't care at all. Its rightful place is Stack Overflow. But I know that Stack Overflow has an epidermic reaction against âÂÂwhyâÂÂ, even though this is a perfectly legitimate, answerable question that's on-topic on Stack Overflow. And Unix & Linux probably has enough expertise to answer it, even though it's on the outer side of the topic border.
â Gilles
4 mins ago
I'm in two minds about this question. It's off-topic here since it's about programming: a user or system administrator wouldn't care at all. Its rightful place is Stack Overflow. But I know that Stack Overflow has an epidermic reaction against âÂÂwhyâÂÂ, even though this is a perfectly legitimate, answerable question that's on-topic on Stack Overflow. And Unix & Linux probably has enough expertise to answer it, even though it's on the outer side of the topic border.
â Gilles
4 mins ago
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475956%2fwhy-can-the-kernel-not-use-sse-avx-registers-and-instructions%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
One reason some OSes restrict the use of certain registers is that if they are used, then they must be saved on a context switch, which means that context switches take longer and thread contexts grow larger. I don't know whether this the/a reason why Linux puts restrictions on SIMD registers.
â Gilles
8 mins ago
I'm in two minds about this question. It's off-topic here since it's about programming: a user or system administrator wouldn't care at all. Its rightful place is Stack Overflow. But I know that Stack Overflow has an epidermic reaction against âÂÂwhyâÂÂ, even though this is a perfectly legitimate, answerable question that's on-topic on Stack Overflow. And Unix & Linux probably has enough expertise to answer it, even though it's on the outer side of the topic border.
â Gilles
4 mins ago