[PATCH] 128-bit ABI for x86_64-w64-mingw32 incorrectly generated

Jameson Nash vtjnash at gmail.com
Sat Apr 19 12:08:56 PDT 2014


  I'm having trouble finding a button to update this diff. However, here's my new test, showing the code generated before/after the patch:

  ```
  ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s -check-prefix=X86-64
  ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s -check-prefix=WIN64

  define i128 @mod128(i128 %x) nounwind {
  ; X86-64: movl	$3, %edx
  ; X86-64: xorl	%ecx, %ecx
  ; X86-64: callq	__modti3

  ; WIN64-NOT: movl	$3, %r8d
  ; WIN64-NOT: xorl	%r9d, %r9d
  ; WIN64: leaq    -72(%rsp), %rsp
  ; WIN64: movq    %rdx, 56(%rsp)
  ; WIN64: leaq    32(%rsp), %rdx
  ; WIN64: movq    %rcx, 48(%rsp)
  ; WIN64: leaq    48(%rsp), %rcx
  ; WIN64: movq    $0, 40(%rsp)
  ; WIN64: movq    $3, 32(%rsp)
  ; WIN64: callq   __modti3
  ; WIN64: movd    %xmm0, %rax
  ; WIN64: punpckhqdq      %xmm0, %xmm0
  ; WIN64: movd    %xmm0, %rdx
  ; WIN64: leaq    72(%rsp), %rsp

    %1 = srem i128 %x, 3
    ret i128 %1
  }
  ```
  (this is based on my previous test code posted above, which segfaults without the patch and returns the correct answer with the patch)

http://reviews.llvm.org/D1998






More information about the llvm-commits mailing list