{"id":6533,"date":"2017-06-15T23:58:13","date_gmt":"2017-06-15T14:58:13","guid":{"rendered":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=6533"},"modified":"2017-06-16T02:13:28","modified_gmt":"2017-06-15T17:13:28","slug":"gccclang-%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%e5%ae%9a%e6%95%b0%e3%82%92%e3%83%97%e3%83%ac%e3%83%95%e3%82%a3%e3%83%83%e3%82%af","status":"publish","type":"post","link":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=6533","title":{"rendered":"GCC\/Clang \u306e\u30a4\u30f3\u30e9\u30a4\u30f3\u30a2\u30bb\u30f3\u30d6\u30e9\u3067\u5b9a\u6570\u3092\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u306a\u3057\u3067\u57cb\u3081\u8fbc\u3080\u65b9\u6cd5"},"content":{"rendered":"<p>i386\/x86_64 \u5411\u3051\u306e GCC\/Clang \u306e\u30a4\u30f3\u30e9\u30a4\u30f3\u30a2\u30bb\u30f3\u30d6\u30e9\u3067 <code>\"i\"<\/code> \u5236\u7d04\u306b\u3088\u3063\u3066\u5b9a\u6570\u3092\u57cb\u3081\u8fbc\u3080\u6642\u3001AT&#038;T \u8a18\u6cd5\u306e\u5834\u5408\u3060\u3068 <code>$<\/code> \u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u304c\u4ed8\u304d\u307e\u3059\u3002 AT&#038;T \u8a18\u6cd5\u306e\u5834\u5408\u306f\u5373\u5024\u306b\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u4ed8\u3051\u308b\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u306e\u6319\u52d5\u306f\u59a5\u5f53\u3067\u3059\u3002\u5373\u5024\u306b\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u4ed8\u3051\u306a\u304f\u3066\u3082\u30a2\u30bb\u30f3\u30d6\u30eb\u306f\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u304c\u3002\uff08\u4eca\u8a66\u3057\u3066\u6c17\u3065\u3044\u305f\uff09<\/p>\n<p><!--more--><\/p>\n<blockquote>\n<pre>\r\n    asm volatile(\r\n        \"movl    %0, %%eax\\n\"\r\n    :: \"i\"(42));\r\n<\/pre>\n<\/blockquote>\n<p>\u3053\u308c\u306f\u6b21\u306e\u3088\u3046\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n<blockquote>\n<pre>\r\n    asm volatile(\r\n        \"movl    <b>$<\/b>42, %%eax\\n\"\r\n    ::);\r\n<\/pre>\n<\/blockquote>\n<p>\u4e00\u65b9\u3001\u30e1\u30e2\u30ea\u30a2\u30af\u30bb\u30b9\u6642\u306a\u3069\u3001\u6570\u5024\u3092\u66f8\u304f\u3068\u3053\u308d\u3067\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u306a\u3057\u306b\u3059\u308b\u3079\u304d\u3068\u3053\u308d\u3082\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u7b87\u6240\u3067\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u4ed8\u3051\u305f\u5834\u5408\u3001\u30b7\u30f3\u30dc\u30eb\uff08\u30e9\u30d9\u30eb\uff09\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u304b\u3001\u30a8\u30e9\u30fc\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002\uff08GCC \u3068 Clang \u3068\u3067\u3053\u3053\u306e\u6319\u52d5\u304c\u5fae\u5999\u306b\u9055\u3063\u305f\u308a\u3059\u308b\uff09<\/p>\n<blockquote>\n<pre>\r\n    asm volatile(\r\n        \"movl    <b>100<\/b>(%%ebx), %%eax\\n\"\r\n        \"movl    (%%ebx,%%ecx,<b>4<\/b>), %%eax\\n\"\r\n        \".equ    hoge, <b>200<\/b>\\n\"\r\n        \"movl    hoge, %%eax\\n\"\r\n    ::);\r\n<\/pre>\n<\/blockquote>\n<p>\u3067\u3001\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u306a\u3057\u306e\u6570\u5024\u3092\u57cb\u3081\u8fbc\u3080\u306b\u306f\u3069\u3046\u3057\u305f\u3089\u3044\u3044\u304b\u3067\u3059\u304c\u3001\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<pre>\r\n    asm volatile(\r\n        \"movl    %<b>c<\/b>0(%%ebx), %%eax\\n\"\r\n        \"movl    (%%ebx,%%ecx,%<b>c<\/b>1), %%eax\\n\"\r\n        \".equ    hoge, %<b>c<\/b>2\\n\"\r\n        \"movl    hoge, %%eax\\n\"\r\n    :: \"i\"(100), \"i\"(4), \"i\"(200));\r\n<\/pre>\n<\/blockquote>\n<p>\u3053\u3046\u3057\u305f\u5834\u5408\u3001 AT&#038;T \u8a18\u6cd5\u3067\u3082\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u306a\u3057\u306e\u6570\u5024\u306b\u306a\u308a\u307e\u3059\u3002\u3082\u3061\u308d\u3093 Intel \u8a18\u6cd5\u306e\u5834\u5408\u3067\u3082\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u306a\u3057\u3067\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u30b7\u30f3\u30dc\u30eb\u540d\u3067\u57cb\u3081\u8fbc\u307f\u3092\u8a18\u8ff0\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<pre>\r\n    asm volatile(\r\n        \"movl    %<b>c[hoge]<\/b>(%%ebx), %%eax\\n\"\r\n    :: <b>[hoge]<\/b>\"i\"(100));\r\n<\/pre>\n<\/blockquote>\n<p>\u3053\u308c\u3089\u306e\u3053\u3068\u306f <a href=\"https:\/\/gcc.gnu.org\/onlinedocs\/gcc\/Extended-Asm.html#x86Operandmodifiers\">GCC \u306e\u30de\u30cb\u30e5\u30a2\u30eb\u306e Extended Asm \u306e x86 Operand Modifiers \u306e\u3068\u3053\u308d<\/a>\u306b\u66f8\u3044\u3066\u3042\u3063\u3066\u30bf\u30fc\u30b2\u30c3\u30c8\u4f9d\u5b58\u306e\u6a5f\u80fd\u306e\u3088\u3046\u306b\u8aad\u3081\u308b\u306e\u3067\u3059\u304c\u3001\u5c11\u306a\u304f\u3068\u3082 aarch64 \uff08ARM \u306e 64bit\uff09\u3067\u3082\u53d7\u3051\u4ed8\u3051\u3089\u308c\u308b\u3088\u3046\u3067\u3059\u3002\u305f\u3060\u3057\u3001aarch64 \u306e\u5834\u5408\u306f\u5373\u5024\u3092\u57cb\u3081\u8fbc\u3093\u3067\u3082\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u306f\u5143\u3005\u4ed8\u304b\u306a\u3044\u306e\u3067\u3001\u30a8\u30e9\u30fc\u306b\u306a\u3089\u306a\u3044\u3060\u3051\u3067\u5229\u70b9\u306f\u7279\u306b\u3042\u308a\u307e\u305b\u3093\u3002\u4ed6\u306e\u30bf\u30fc\u30b2\u30c3\u30c8\u306f\u74b0\u5883\u304c\u624b\u5143\u306b\u306a\u3044\u306e\u3067\u5206\u304b\u308a\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>i386\/x86_64 \u5411\u3051\u306e GCC\/Clang \u306e\u30a4\u30f3\u30e9\u30a4\u30f3\u30a2\u30bb\u30f3\u30d6\u30e9\u3067 &#8220;i&#8221; \u5236\u7d04\u306b\u3088\u3063\u3066\u5b9a\u6570\u3092\u57cb\u3081\u8fbc\u3080\u6642\u3001AT&#038;T \u8a18\u6cd5\u306e\u5834\u5408\u3060\u3068 $ \u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u304c\u4ed8\u304d\u307e\u3059\u3002 AT&#038;T \u8a18\u6cd5\u306e\u5834\u5408\u306f\u5373\u5024 [&hellip;]<\/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-6533","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\/6533","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=6533"}],"version-history":[{"count":14,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6533\/revisions"}],"predecessor-version":[{"id":6547,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6533\/revisions\/6547"}],"wp:attachment":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6533"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}