]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fixes to add .machine directives for assembly instructions
authorCarl Love <cel@us.ibm.com>
Fri, 17 Sep 2021 00:33:14 +0000 (00:33 +0000)
committerCarl Love <cel@us.ibm.com>
Thu, 30 Sep 2021 22:30:05 +0000 (17:30 -0500)
VEX/priv/guest_ppc_helpers.c
configure.ac
none/tests/ppc64/Makefile.am
none/tests/ppc64/scv_test.c

index 689aa8f34eb7fad7f3ae40bdbe864add3c1efab7..54318b6d5cdaa2392f10eadf13e299aa59021612 100644 (file)
@@ -1899,7 +1899,9 @@ static Double conv_f16_to_double( ULong input )
    __attribute__ ((aligned (64))) ULong src;
    __attribute__ ((aligned (64))) Double result;
    src = input;
-   __asm__ __volatile__ ("xscvhpdp %x0,%x1" : "=wa" (result) : "wa" (src));
+   __asm__ __volatile__ (".machine push;\n" ".machine power9;\n" \
+                         "xscvhpdp %x0,%x1 ;\n .machine pop" \
+                         : "=wa" (result) : "wa" (src) );
    return result;
 #  else
    return 0.0;
index 81f2e234977b1ded48ecb30a7adfc8f9e959e86b..d755b0248b6a4b442598cdc6296834953afd0401 100755 (executable)
@@ -1658,7 +1658,8 @@ AC_MSG_CHECKING([that assembler knows ISA 3.00 ])
 
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 ]], [[
-  __asm__ __volatile__("cnttzw 1,2 ");
+__asm__ __volatile__ (".machine power9;\n" \
+       "cnttzw   1,3; \n" );
 ]])], [
 # guest_ppc_helpers.c needs the HAS_ISA_3_OO to enable copy, paste,
 # cpabort support
@@ -1677,7 +1678,8 @@ AC_MSG_CHECKING([that assembler knows xscvhpdp ])
 
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 ]], [[
-  __asm__ __volatile__("xscvhpdp 1,2 ");
+__asm__ __volatile__ (".machine power9;\n" \
+       "xscvhpdp 1,2;\n" );
 ]])], [
 ac_asm_have_xscvhpdp=yes
 AC_MSG_RESULT([yes])
@@ -1704,7 +1706,8 @@ AC_MSG_RESULT([no])
 AC_MSG_CHECKING([that assembler knows ISA 3.1 ])
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 ]], [[
-  __asm__ __volatile__("brh 1,2 ");
+__asm__ __volatile__ (".machine power10;\n" \
+       "brh 1,2;\n ");
 ]])], [
 ac_asm_have_isa_3_1=yes
 AC_MSG_RESULT([yes])
index 15e90ebfdba9b44e25fe854a813e8b9d50ff4c96..1e5398575fffd987eb89c0354ab6ef7c501136b0 100644 (file)
@@ -147,7 +147,7 @@ HTM_FLAG =
 endif
 
 if HAS_ISA_3_00
-BUILD_FLAGS_ISA_3_00 = -mcpu=power8
+BUILD_FLAGS_ISA_3_00 = -mcpu=power9
 ISA_3_00_FLAG = -DHAS_ISA_3_00
 else
 BUILD_FLAGS_ISA_3_00 =
index 39bf82aa2074cb8a3a0687cb13b98dec9c60c551..5c8df226f489fc2ef49bee52568e4c0e3db42669 100644 (file)
@@ -19,7 +19,8 @@
     register long int r8  __asm__ ("r8");                               \
     r0=name;                                                            \
     __asm__ __volatile__                                                \
-      ("scv 0\n\t"                                                      \
+      (".machine power9\n"                                              \
+       "scv 0\n\t"                                                      \
        "0:"                                                             \
        : "=&r" (r0),                                                    \
          "=&r" (r3), "=&r" (r4), "=&r" (r5),                            \