bfin.md (loadbytes): New pattern.
authorBernd Schmidt <bernd.schmidt@analog.com>
Thu, 15 May 2008 13:25:26 +0000 (13:25 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Thu, 15 May 2008 13:25:26 +0000 (13:25 +0000)
* config/bfin/bfin.md (loadbytes): New pattern.
* config/bfin/bfin.c (enum bfin_builtins): Add BFIN_BUILTIN_LOADBYTES.
(bfin_init_builtins): Initialize it.
(bdesc_1arg): Add it.

From-SVN: r135351

gcc/ChangeLog
gcc/config/bfin/bfin.c
gcc/config/bfin/bfin.md

index 0e0912dbb81be99cd28c8912703f3b1ecb53e5b8..3135d2cffd40df2505162f1626ef54dba72424a2 100644 (file)
@@ -1,3 +1,10 @@
+2008-05-15  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+       * config/bfin/bfin.md (loadbytes): New pattern.
+       * config/bfin/bfin.c (enum bfin_builtins): Add BFIN_BUILTIN_LOADBYTES.
+       (bfin_init_builtins): Initialize it.
+       (bdesc_1arg): Add it.
+
 2008-05-15  Sa Liu  <saliu@de.ibm.com>
 
        * testsuite/gfortran.dg/c_kind_int128_test1.f03: New.
index f48ab0f264b135ab93d4ed9b0b92800c8a34281b..933b12bdab8b337b6d466097e4794ecd26d6b9cc 100644 (file)
@@ -5228,6 +5228,8 @@ enum bfin_builtins
 
   BFIN_BUILTIN_CPLX_SQU,
 
+  BFIN_BUILTIN_LOADBYTES,
+
   BFIN_BUILTIN_MAX
 };
 
@@ -5282,7 +5284,11 @@ bfin_init_builtins (void)
   tree short_ftype_v2hi
     = build_function_type_list (short_integer_type_node, V2HI_type_node,
                                NULL_TREE);
-
+  tree int_ftype_pint
+    = build_function_type_list (integer_type_node,
+                               build_pointer_type (integer_type_node),
+                               NULL_TREE);
+  
   /* Add the remaining MMX insns with somewhat more complicated types.  */
   def_builtin ("__builtin_bfin_csync", void_ftype_void, BFIN_BUILTIN_CSYNC);
   def_builtin ("__builtin_bfin_ssync", void_ftype_void, BFIN_BUILTIN_SSYNC);
@@ -5409,6 +5415,11 @@ bfin_init_builtins (void)
               BFIN_BUILTIN_CPLX_MSU_16_S40);
   def_builtin ("__builtin_bfin_csqu_fr16", v2hi_ftype_v2hi,
               BFIN_BUILTIN_CPLX_SQU);
+
+  /* "Unaligned" load.  */
+  def_builtin ("__builtin_bfin_loadbytes", int_ftype_pint,
+              BFIN_BUILTIN_LOADBYTES);
+
 }
 
 
@@ -5456,6 +5467,8 @@ static const struct builtin_description bdesc_2arg[] =
 
 static const struct builtin_description bdesc_1arg[] =
 {
+  { CODE_FOR_loadbytes, "__builtin_bfin_loadbytes", BFIN_BUILTIN_LOADBYTES, 0 },
+
   { CODE_FOR_ones, "__builtin_bfin_ones", BFIN_BUILTIN_ONES, 0 },
 
   { CODE_FOR_signbitshi2, "__builtin_bfin_norm_fr1x16", BFIN_BUILTIN_NORM_1X16, 0 },
index f535799b6248d8b8a6d98a4677bc0575edde5e14..6b1c1e8e981b8adf57b0cd228b324731c30c10b4 100644 (file)
    %0 = %1 >> %N2 (V)%!"
   [(set_attr "type" "dsp32")])
 
+;; Load without alignment exception (masking off low bits)
+
+(define_insn "loadbytes"
+  [(set (match_operand:SI 0 "register_operand" "=d")
+       (mem:SI (and:SI (match_operand:SI 1 "register_operand" "b")
+                       (const_int -4))))]
+  ""
+  "DISALGNEXCPT || %0 = [%1];"
+  [(set_attr "type" "mcld")
+   (set_attr "length" "8")])