From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Wed, 21 Aug 2013 14:36:40 -0400 To: 9fans@9fans.net Message-ID: <2332222c9f75f30c6395f16787280535@brasstown.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] more on why vc can't produce amd64 executables Topicbox-Message-UUID: 73825fce-ead8-11e9-9d60-3106f5b1d025 vc vlongs are broken for cast for example, _v2uc produces the code: acid; asm(_v2uc) _v2uc 0x00005360 MOVW rv+8(FP),R1 _v2uc+0x4 0x00005364 JMP (R31) _v2uc+0x8 0x00005368 AND $0xff,R1 i think this should be MOVW rv+12(FP),R1 JMP (R31) AND $0xff,R1 since the high 32-bits of the vlong should be first, since this is a BE machine. perhaps there's supposed to be a special calling convention for vlongs? here's an example of the issue: void main(void) { uvlong x; x = 0x012345678abcdefull; print("(uchar)x %.2ux\n", (uchar)x); exits(""); } mikro; v.x x = 0012345678abcdef (uchar)x ef marshalling a 64-bit pointer in this way will lay down the bytes with the hi and lo reversed. - erik