Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-142342: Fix m68k assembler operand constraints for %fpcr access#142343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
colesbury merged 3 commits intopython:mainfromglaubitz:m68k-fix-asm-constraints
Dec 9, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
gh-142342: Fix m68k assembler operand constraints for %fpcr access
On m68k, an fmove instruction accessing %fpcr may only move fromor to a data register or a memory operand. The constraint "g" alsopermits the use of address registers, which is invalid. The correctconstraint is "dm". Beginning with GCC 15, the register allocatorpicks an address register in the code which causes SIGILL duringruntime.Co-authored-by: Michael Karcher <github@mkarcher.dialup.fu-berlin.de>
  • Loading branch information
@glaubitz@karcherm
glaubitz andkarcherm committedDec 6, 2025
commit0926439c20ae4dac39ce76a8b0bd8ca88cd23f12
6 changes: 3 additions & 3 deletionsInclude/internal/pycore_pymath.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,17 +146,17 @@ extern void _Py_set_387controlword(unsigned short);
unsigned int old_fpcr, new_fpcr
#define _Py_SET_53BIT_PRECISION_START \
do { \
__asm__ ("fmove.l %%fpcr,%0" : "=g" (old_fpcr)); \
__asm__ ("fmove.l %%fpcr,%0" : "=dm" (old_fpcr)); \
/* Set double precision / round to nearest. */ \
new_fpcr = (old_fpcr & ~0xf0) | 0x80; \
if (new_fpcr != old_fpcr) { \
__asm__ volatile ("fmove.l %0,%%fpcr" : : "g" (new_fpcr));\
__asm__ volatile ("fmove.l %0,%%fpcr" : : "dm" (new_fpcr));\
} \
} while (0)
#define _Py_SET_53BIT_PRECISION_END \
do { \
if (new_fpcr != old_fpcr) { \
__asm__ volatile ("fmove.l %0,%%fpcr" : : "g" (old_fpcr)); \
__asm__ volatile ("fmove.l %0,%%fpcr" : : "dm" (old_fpcr)); \
} \
} while (0)
#endif
Expand Down
4 changes: 2 additions & 2 deletionsconfigure
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

4 changes: 2 additions & 2 deletionsconfigure.ac
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6126,8 +6126,8 @@ AS_VAR_IF([ac_cv_gcc_asm_for_x87], [yes], [
AC_CACHE_CHECK([whether we can use gcc inline assembler to get and set mc68881 fpcr], [ac_cv_gcc_asm_for_mc68881], [
AC_LINK_IFELSE( [AC_LANG_PROGRAM([[]], [[
unsigned int fpcr;
__asm__ __volatile__ ("fmove.l %%fpcr,%0" : "=g" (fpcr));
__asm__ __volatile__ ("fmove.l %0,%%fpcr" : : "g" (fpcr));
__asm__ __volatile__ ("fmove.l %%fpcr,%0" : "=dm" (fpcr));
__asm__ __volatile__ ("fmove.l %0,%%fpcr" : : "dm" (fpcr));
]])],[ac_cv_gcc_asm_for_mc68881=yes],[ac_cv_gcc_asm_for_mc68881=no])
])
AS_VAR_IF([ac_cv_gcc_asm_for_mc68881], [yes], [
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp