{"id":6340,"date":"2017-02-19T22:49:20","date_gmt":"2017-02-19T13:49:20","guid":{"rendered":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=6340"},"modified":"2017-02-21T00:40:32","modified_gmt":"2017-02-20T15:40:32","slug":"clang-%e3%81%ae%e3%82%a4%e3%83%b3%e3%83%a9%e3%82%a4%e3%83%b3%e3%82%a2%e3%82%bb%e3%83%b3%e3%83%96%e3%83%a9%e3%81%a7-intel-%e8%a8%98%e6%b3%95%e3%82%92%e4%bd%bf%e3%81%86-%ef%bc%88%e3%81%9d%e3%81%ae","status":"publish","type":"post","link":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=6340","title":{"rendered":"Clang \u306e\u30a4\u30f3\u30e9\u30a4\u30f3\u30a2\u30bb\u30f3\u30d6\u30e9\u3067 Intel \u8a18\u6cd5\u3092\u4f7f\u3046 \uff08\u305d\u306e\uff12\uff09"},"content":{"rendered":"<p><a href=\"http:\/\/umezawa.dyndns.info\/wordpress\/?p=6266\">\u305d\u306e\uff11<\/a>\u306e\u7d9a\u304d<\/p>\n<p>\u4e00\u3064\u91cd\u8981\u306a\u30c6\u30b9\u30c8\u3092\u5fd8\u308c\u3066\u3044\u307e\u3057\u305f\u3002 Extended Asm \u306e Input Operand \u3067\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<blockquote>\n<pre>\r\n[umezawa@metis:ttys002 ~]$ cat intel.c\r\nint main(int argc, char** argv)\r\n{\r\n        int ret;\r\n        asm volatile(\r\n                \".intel_syntax\\n\"\r\n                \"mov  eax, %1\\n\"\r\n                : \"=a\"(ret)\r\n                : \"r\"(argc) );\r\n        return ret;\r\n}\r\n[umezawa@metis:ttys002 ~]$ clang -masm=intel intel.c\r\nintel.c:6:4: error: unknown token in expression\r\n                \"mov  eax, %1\\n\"\r\n                 ^\r\n<inline asm>:2:11: note: instantiated into assembly here\r\nmov  eax, %edi\r\n          ^\r\nintel.c:6:4: error: unknown token in expression\r\n                \"mov  eax, %1\\n\"\r\n                 ^\r\n<\/inline><inline asm>:2:11: note: instantiated into assembly here\r\nmov  eax, %edi\r\n          ^\r\n2 errors generated.\r\n<\/inline><\/pre>\n<\/blockquote>\n<p>Intel \u8a18\u6cd5\u3060\u3063\u3066\u8a00\u3063\u3066\u308b\u306e\u306b AT&amp;T \u8a18\u6cd5\u3067\u30aa\u30da\u30e9\u30f3\u30c9\u3092\u57cb\u3081\u8fbc\u3082\u3046\u3068\u3057\u3066\u3044\u307e\u3059\u3002\u30c0\u30e1\u3058\u3083\u306d\u3047\u304b\u3002<\/p>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u3001\u6a19\u6e96\u30b3\u30f3\u30d1\u30a4\u30e9\u304c Clang \u3067\u3042\u308b\u3088\u3046\u306a\u4e16\u754c\u3067\u306f\u30a4\u30f3\u30e9\u30a4\u30f3\u30a2\u30bb\u30f3\u30d6\u30e9\u306e Intel \u8a18\u6cd5\u3068 input operand \uff08\u306e i\/r\/m \u5236\u7d04\u3042\u305f\u308a\uff09\u306f\u30ed\u30af\u306b\u4f75\u7528\u3067\u304d\u306a\u3044\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u308f\u3056\u308f\u3056 GCC \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3082\u3044\u3044\u3093\u3067\u3059\u304c\u3001 Mac \uff08\u3068\u3044\u3046\u304b Xcode\uff09\u3060\u3068\u305d\u308c\u3082\u5927\u5909\u3067\u3059\u3002<\/p>\n<p>\u3088\u304f\u3082\u307e\u3042\u3053\u3093\u306a\u72b6\u614b\u3067 <a href=\"http:\/\/clang.llvm.org\/compatibility.html#inline-asm\">&#8220;In general, Clang is highly compatible with the GCC inline assembly extensions&#8221;<\/a> \u306a\u3069\u3068\u66f8\u3051\u305f\u3082\u3093\u3067\u3042\u308b\u3002\u30d0\u30b0\u30ec\u30dd\u30fc\u30c8\u306f\u3055\u308c\u3066\u3044\u308b (<a href=\"https:\/\/bugs.llvm.org\/\/show_bug.cgi?id=24232\">1<\/a>, <a href=\"https:\/\/bugs.llvm.org\/\/show_bug.cgi?id=23933\">2<\/a>) \u3051\u30691\u5e74\u534a\u305f\u3063\u3066\u308b\u3057\u76f4\u3059\u6c17\u304c\u7121\u3044\u3089\u3057\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u306e\uff11\u306e\u7d9a\u304d \u4e00\u3064\u91cd\u8981\u306a\u30c6\u30b9\u30c8\u3092\u5fd8\u308c\u3066\u3044\u307e\u3057\u305f\u3002 Extended Asm \u306e Input Operand \u3067\u3059\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-6340","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6340"}],"version-history":[{"count":8,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6340\/revisions"}],"predecessor-version":[{"id":6354,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6340\/revisions\/6354"}],"wp:attachment":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6340"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}