GCC: Specifying mmx register for a local variable fails2019 Community Moderator Electionerror: command 'gcc' failed with exit status 1How do I achieve the theoretical maximum of 4 FLOPs per cycle?Is codecvt not a std header?Error: `#elif with no expression` - happens only on WindowsApplication segmentation fault, only when compiling on Windows with MinGWc++11 GCC compiling failingHow to use va_list object in a nested way, especially on gcc x64 compilerHow do I tell GCC asm that an input register is clobbered?error: 'unordered_set' is not a member of 'std'gcc cannot find -lgcc, g++.exe: error: CreateProcess: No such file or directory
The meaning of ‘otherwise’
In the late 1940’s to early 1950’s what technology was available that could melt a LOT of ice?
After `ssh` without `-X` to a machine, is it possible to change `$DISPLAY` to make it work like `ssh -X`?
How do electrons receive energy when a body is heated?
What will happen if my luggage gets delayed?
How does Ehrenfest's theorem apply to the quantum harmonic oscillator?
Why do phishing e-mails use faked e-mail addresses instead of the real one?
Outlet with 3 sets of wires
Can the alpha, lambda values of a glmnet object output determine whether ridge or Lasso?
Specifying a starting column with colortbl package and xcolor
From an axiomatic set theoric approach why can we take uncountable unions?
How exactly does an Ethernet collision happen in the cable, since nodes use different circuits for Tx and Rx?
Is this Paypal Github SDK reference really a dangerous site?
PTIJ: Why does only a Shor Tam ask at the Seder, and not a Shor Mu'ad?
Can one live in the U.S. and not use a credit card?
Windows Server Data Center Edition - Unlimited Virtual Machines
How do we create new idioms and use them in a novel?
For which categories of spectra is there an explicit description of the fibrant objects via lifting properties?
Having the player face themselves after the mid-game
Gaining more land
Finitely many repeated replacements
What is the population of Romulus in the TNG era?
Is it possible to avoid unpacking when merging Association?
When Schnorr signatures are part of Bitcoin will it be possible validate each block with only one signature validation?
GCC: Specifying mmx register for a local variable fails
2019 Community Moderator Electionerror: command 'gcc' failed with exit status 1How do I achieve the theoretical maximum of 4 FLOPs per cycle?Is codecvt not a std header?Error: `#elif with no expression` - happens only on WindowsApplication segmentation fault, only when compiling on Windows with MinGWc++11 GCC compiling failingHow to use va_list object in a nested way, especially on gcc x64 compilerHow do I tell GCC asm that an input register is clobbered?error: 'unordered_set' is not a member of 'std'gcc cannot find -lgcc, g++.exe: error: CreateProcess: No such file or directory
Im trying to achieve the following on a Windows environment c++, MINGW GCC:
Im trying to define a local variable as such:
register DWORD index __asm ("%mm7");
this definition compiles with MINGW GCC x64 , but fails on x86 compilation with the error error: invalid register name for 'index'
register DWORD index __asm ("%mm7");
I have already tried to reference the register as __asm ("mm7");
but to no avail. any help on the matter would be very appreciated
c++ assembly x86 g++ mingw
New contributor
|
show 4 more comments
Im trying to achieve the following on a Windows environment c++, MINGW GCC:
Im trying to define a local variable as such:
register DWORD index __asm ("%mm7");
this definition compiles with MINGW GCC x64 , but fails on x86 compilation with the error error: invalid register name for 'index'
register DWORD index __asm ("%mm7");
I have already tried to reference the register as __asm ("mm7");
but to no avail. any help on the matter would be very appreciated
c++ assembly x86 g++ mingw
New contributor
I'm pretty sure you can only use general purpose registers with this feature. What are you trying to do?
– fuz
Mar 6 at 14:29
Whats weird is that it does succeed on a x64 toolchain compilation. im trying to save the value in this register to be referenced later by a different func, by accessing the register
– win32api
Mar 6 at 14:31
2
Try specifying-march=native
or-mmmx
.
– Maxim Egorushkin
Mar 6 at 16:17
1
I'd also question how this is being used.It should be noted that usingregister DWORD index __asm ("%mm7");
doesn't guarantee the variableindex
would be in mm7. The only guarantee is that ifindex
was used as an operand to inline assembly using a"y"
constraint, mm7 would be the register used. As @MaximEgorushkin points out to even get this going you'd have to tell the compiler to use MMX via the-mmmx
option. x86-64 should compile without error b/c all x86-64 processors can use MMX registers,but not all x86 targets support MMX so the compiler has to be told to use them or not.
– Michael Petch
Mar 6 at 18:34
1
Compiling without error and generating the code you expect are two different issues.
– Michael Petch
Mar 6 at 18:35
|
show 4 more comments
Im trying to achieve the following on a Windows environment c++, MINGW GCC:
Im trying to define a local variable as such:
register DWORD index __asm ("%mm7");
this definition compiles with MINGW GCC x64 , but fails on x86 compilation with the error error: invalid register name for 'index'
register DWORD index __asm ("%mm7");
I have already tried to reference the register as __asm ("mm7");
but to no avail. any help on the matter would be very appreciated
c++ assembly x86 g++ mingw
New contributor
Im trying to achieve the following on a Windows environment c++, MINGW GCC:
Im trying to define a local variable as such:
register DWORD index __asm ("%mm7");
this definition compiles with MINGW GCC x64 , but fails on x86 compilation with the error error: invalid register name for 'index'
register DWORD index __asm ("%mm7");
I have already tried to reference the register as __asm ("mm7");
but to no avail. any help on the matter would be very appreciated
c++ assembly x86 g++ mingw
c++ assembly x86 g++ mingw
New contributor
New contributor
edited Mar 6 at 23:22
Michael Petch
26.5k556105
26.5k556105
New contributor
asked Mar 6 at 14:24
win32apiwin32api
1
1
New contributor
New contributor
I'm pretty sure you can only use general purpose registers with this feature. What are you trying to do?
– fuz
Mar 6 at 14:29
Whats weird is that it does succeed on a x64 toolchain compilation. im trying to save the value in this register to be referenced later by a different func, by accessing the register
– win32api
Mar 6 at 14:31
2
Try specifying-march=native
or-mmmx
.
– Maxim Egorushkin
Mar 6 at 16:17
1
I'd also question how this is being used.It should be noted that usingregister DWORD index __asm ("%mm7");
doesn't guarantee the variableindex
would be in mm7. The only guarantee is that ifindex
was used as an operand to inline assembly using a"y"
constraint, mm7 would be the register used. As @MaximEgorushkin points out to even get this going you'd have to tell the compiler to use MMX via the-mmmx
option. x86-64 should compile without error b/c all x86-64 processors can use MMX registers,but not all x86 targets support MMX so the compiler has to be told to use them or not.
– Michael Petch
Mar 6 at 18:34
1
Compiling without error and generating the code you expect are two different issues.
– Michael Petch
Mar 6 at 18:35
|
show 4 more comments
I'm pretty sure you can only use general purpose registers with this feature. What are you trying to do?
– fuz
Mar 6 at 14:29
Whats weird is that it does succeed on a x64 toolchain compilation. im trying to save the value in this register to be referenced later by a different func, by accessing the register
– win32api
Mar 6 at 14:31
2
Try specifying-march=native
or-mmmx
.
– Maxim Egorushkin
Mar 6 at 16:17
1
I'd also question how this is being used.It should be noted that usingregister DWORD index __asm ("%mm7");
doesn't guarantee the variableindex
would be in mm7. The only guarantee is that ifindex
was used as an operand to inline assembly using a"y"
constraint, mm7 would be the register used. As @MaximEgorushkin points out to even get this going you'd have to tell the compiler to use MMX via the-mmmx
option. x86-64 should compile without error b/c all x86-64 processors can use MMX registers,but not all x86 targets support MMX so the compiler has to be told to use them or not.
– Michael Petch
Mar 6 at 18:34
1
Compiling without error and generating the code you expect are two different issues.
– Michael Petch
Mar 6 at 18:35
I'm pretty sure you can only use general purpose registers with this feature. What are you trying to do?
– fuz
Mar 6 at 14:29
I'm pretty sure you can only use general purpose registers with this feature. What are you trying to do?
– fuz
Mar 6 at 14:29
Whats weird is that it does succeed on a x64 toolchain compilation. im trying to save the value in this register to be referenced later by a different func, by accessing the register
– win32api
Mar 6 at 14:31
Whats weird is that it does succeed on a x64 toolchain compilation. im trying to save the value in this register to be referenced later by a different func, by accessing the register
– win32api
Mar 6 at 14:31
2
2
Try specifying
-march=native
or -mmmx
.– Maxim Egorushkin
Mar 6 at 16:17
Try specifying
-march=native
or -mmmx
.– Maxim Egorushkin
Mar 6 at 16:17
1
1
I'd also question how this is being used.It should be noted that using
register DWORD index __asm ("%mm7");
doesn't guarantee the variable index
would be in mm7. The only guarantee is that if index
was used as an operand to inline assembly using a "y"
constraint, mm7 would be the register used. As @MaximEgorushkin points out to even get this going you'd have to tell the compiler to use MMX via the -mmmx
option. x86-64 should compile without error b/c all x86-64 processors can use MMX registers,but not all x86 targets support MMX so the compiler has to be told to use them or not.– Michael Petch
Mar 6 at 18:34
I'd also question how this is being used.It should be noted that using
register DWORD index __asm ("%mm7");
doesn't guarantee the variable index
would be in mm7. The only guarantee is that if index
was used as an operand to inline assembly using a "y"
constraint, mm7 would be the register used. As @MaximEgorushkin points out to even get this going you'd have to tell the compiler to use MMX via the -mmmx
option. x86-64 should compile without error b/c all x86-64 processors can use MMX registers,but not all x86 targets support MMX so the compiler has to be told to use them or not.– Michael Petch
Mar 6 at 18:34
1
1
Compiling without error and generating the code you expect are two different issues.
– Michael Petch
Mar 6 at 18:35
Compiling without error and generating the code you expect are two different issues.
– Michael Petch
Mar 6 at 18:35
|
show 4 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
win32api is a new contributor. Be nice, and check out our Code of Conduct.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55025376%2fgcc-specifying-mmx-register-for-a-local-variable-fails%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
win32api is a new contributor. Be nice, and check out our Code of Conduct.
win32api is a new contributor. Be nice, and check out our Code of Conduct.
win32api is a new contributor. Be nice, and check out our Code of Conduct.
win32api is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55025376%2fgcc-specifying-mmx-register-for-a-local-variable-fails%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I'm pretty sure you can only use general purpose registers with this feature. What are you trying to do?
– fuz
Mar 6 at 14:29
Whats weird is that it does succeed on a x64 toolchain compilation. im trying to save the value in this register to be referenced later by a different func, by accessing the register
– win32api
Mar 6 at 14:31
2
Try specifying
-march=native
or-mmmx
.– Maxim Egorushkin
Mar 6 at 16:17
1
I'd also question how this is being used.It should be noted that using
register DWORD index __asm ("%mm7");
doesn't guarantee the variableindex
would be in mm7. The only guarantee is that ifindex
was used as an operand to inline assembly using a"y"
constraint, mm7 would be the register used. As @MaximEgorushkin points out to even get this going you'd have to tell the compiler to use MMX via the-mmmx
option. x86-64 should compile without error b/c all x86-64 processors can use MMX registers,but not all x86 targets support MMX so the compiler has to be told to use them or not.– Michael Petch
Mar 6 at 18:34
1
Compiling without error and generating the code you expect are two different issues.
– Michael Petch
Mar 6 at 18:35