Hello!

> Here is a patch to add size relocation and instruction to obtain object's 
> size in i386 target.

+(define_insn "move_size_reloc_<mode>"
+  [(set (match_operand:SWI48 0 "register_operand" "=r")
+        (match_operand:<MODE> 1 "size_relocation" "Z"))]
+  ""
+{
+  return "mov{<imodesuffix>}\t{%1, %0|%0, %1}";

Please don't change x86_64_immediate_operand just to use "Z"
constraint The predicate is used in a couple of other places that for
sure don't accept your change.

Better write this insn in an explicit way (see for example
tls_initial_exec_64_sun). Something like:

(define_insn "move_size_reloc_<mode>"
  [(set (match_operand:SWI48 0 "register_operand" "=r")
    (unspec:SWI48
     [(match_operand 1 "symbolic_operand" "..." )]
     UNSPEC_SIZEOF))]
  ""
  "mov{<imodesuffix>}\t{%a1@SIZE, %0|%0, %a1@SIZE}")

You will probably need to define new operand 1 predicate and constraint.

Uros.

Reply via email to