{"action":"opened","issue":{"url":"https://api.github.com/repos/CTSRD-CHERI/llvm/issues/256","repository_url":"https://api.github.com/repos/CTSRD-CHERI/llvm","labels_url":"https://api.github.com/repos/CTSRD-CHERI/llvm/issues/256/labels{/name}","comments_url":"https://api.github.com/repos/CTSRD-CHERI/llvm/issues/256/comments","events_url":"https://api.github.com/repos/CTSRD-CHERI/llvm/issues/256/events","html_url":"https://github.com/CTSRD-CHERI/llvm/issues/256","id":270616467,"number":256,"title":"Not using branch delay slot after JALR","user":{"login":"jonwoodruff","id":6596423,"avatar_url":"https://avatars0.githubusercontent.com/u/6596423?v=4","gravatar_id":"","url":"https://api.github.com/users/jonwoodruff","html_url":"https://github.com/jonwoodruff","followers_url":"https://api.github.com/users/jonwoodruff/followers","following_url":"https://api.github.com/users/jonwoodruff/following{/other_user}","gists_url":"https://api.github.com/users/jonwoodruff/gists{/gist_id}","starred_url":"https://api.github.com/users/jonwoodruff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonwoodruff/subscriptions","organizations_url":"https://api.github.com/users/jonwoodruff/orgs","repos_url":"https://api.github.com/users/jonwoodruff/repos","events_url":"https://api.github.com/users/jonwoodruff/events{/privacy}","received_events_url":"https://api.github.com/users/jonwoodruff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-02T11:16:13Z","updated_at":"2017-11-02T11:16:13Z","closed_at":null,"author_association":"NONE","body":"When this is built:\r\n\"\r\nint partition( int a[], int l, int r) {\r\n  int pivot, i, j, t;\r\n  pivot = a[l];\r\n  i = l; j = r+1;\r\n\t\t\r\n  while( 1)\r\n  {\r\n   \tdo ++i; while( a[i] <= pivot && i <= r );\r\n   \tdo --j; while( a[j] > pivot );\r\n   \tif( i >= j ) break;\r\n    t = a[i]; a[i] = a[j]; a[j] = t;\r\n  }\r\n  t = a[l]; a[l] = a[j]; a[j] = t;\r\n  return j;\r\n}\r\n\r\nvoid quickSort( int a[], int l, int r)\r\n{\r\n  int j;\r\n\r\n  if( l < r ) {\r\n    j = partition( a, l, r);\r\n    quickSort( a, l, j-1);\r\n    quickSort( a, j+1, r);\r\n  }\r\n}\r\n\"\r\nThe instructions around the \"JALR\" (the only one) when built in purecap are:\r\n\"\r\n\tsll\t$5, $1, 0\r\n\tcmove\t$c13,  $c19\r\n\tcgetpccsetoffset\t$c12, $3\r\n\tcjalr\t$c12, $c17\r\n\tnop\r\n\"\r\nThe cmove or the sll could be in the branch delay slot.\r\nWhen built for MIPS the branch delay slot is filled:\r\n\"\r\n\tmove\t $4, $17\r\n\tmove\t $5, $2\r\n\tsw\t$1, 0($8)\r\n\taddiu\t$1, $21, -1\r\n\tjalr\t$25\r\n\tsll\t$6, $1, 0\r\n\""}}
{"actor":{"display_login":"jonwoodruff"}}