Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add foreign call test for arm64 #229

Closed
wants to merge 2 commits into from

Conversation

YoheiKakiuchi
Copy link
Member

64bit環境でのforeign callの確認プログラムをarm環境にも使えるように修正しました。
現状では、defforeignした関数でfloat(double)の引数が正しく渡せていないように見えます。
(irteusの起動には問題にならないとおもいますが、defun-c-callableも使えていません)

arm64での結果(jetson)

multiple arguments passing
expected result
100 101 102
103 104 105
1000.000000 1010.000000 1020.000000 1030.000000
1040.000000 1050.000000 1060.000000 1070.000000
2080.000000 2090.000000
206 207
test-testd = 1.23456

exec in eus
100 101 102
103 104 105
2090.000000 0.000000 7880250456356283908564604316541551861735020379040734176922828969701338131516486153525912386248205537672376726431473213772565472275935434274045813587968.000000 -0.000000
0.000000 0.000000 0.000000 -0.000000
0.000000 0.000000
0 1083129856
test-testd = 1.23456


float-test
expected result
0: 1.000000e-01 ..
0: 2.000000e-01 ..
0: 3.000000e-01 ..
0: 4.000000e-01 ..

float-test(success, exec in eus)
0: 4.00000006e-01 3ECCCCCD
0: 2.59566264e-06 362E3125
0: 4.46505236e+30 72616D73
0: 0.00000000e+00 0

float2-test(fail, exec in eus)
0: -1.58818684e-23 9999999A
0: 7.26234208e+14 58252065
0: 5.37736191e+22 6536312E
0: 0.00000000e+00 0

float3-test(depend on architecture, exec in eus)
0: 4.00000006e-01 3ECCCCCD
0: 7.26234208e+14 58252065
0: 5.37736191e+22 6536312E
0: 0.00000000e+00 0


double-test
expected result
1: 1.000000e-01 ..
1: 2.000000e-01 ..
1: 3.000000e-01 ..
1: 4.000000e-01 ..

double-test(success, exec in eus)
1: 4.0000000000000002e-01 3FD999999999999A
1: 2.1950596086271573e-313 A58252065
1: 8.8717637733433208e+117 586C25206536312E
1:             -nan FFFFFF0000000000

double2-test(fail, exec in eus)
1: 5.2055209256998149e-315 3ECCCCCD
1: 2.1950596086271573e-313 A58252065
1: 8.8717637733433208e+117 586C25206536312E
1:             -nan FFFFFF0000000000

double3-test(depend on architecture, exec in eus)
1: 5.2055209256998149e-315 3ECCCCCD
1: 2.1950596086271573e-313 A58252065
1: 8.8717637733433208e+117 586C25206536312E
1:             -nan FFFFFF0000000000

lv-test
size = 6
0: 0 0
1: 100 64
2: 10000 2710
3: 1000000 F4240
4: 100000000 5F5E100
5: 10000000000 2540BE400

lv-test(exec in eus)
size = 6
0: 0 0
1: 100 64
2: 10000 2710
3: 1000000 F4240
4: 100000000 5F5E100
5: 10000000000 2540BE400

dv-test
size = 5
0: 1.000000e-01 3FB9999999999998
1: 2.000000e-01 3FC9999999999998
2: 3.000000e-01 3FD3333333333330
3: 5.000000e-01 3FE0000000000000
4: 7.000000e-01 3FE6666666666664

dv-test(exec in eus)
size = 5
0: 1.000000e-01 3FB9999999999998
1: 2.000000e-01 3FC9999999999998
2: 3.000000e-01 3FD3333333333330
3: 5.000000e-01 3FE0000000000000
4: 7.000000e-01 3FE6666666666664

str-test
input string : "input : test64 string"

str-test(exec in eus)
size = 21
0: i 69
1: n 6E
2: p 70
3: u 75
4: t 74
5:   20
6: : 3A
7:   20
8: t 74
9: e 65
10: s 73
11: t 74
12: 6 36
13: 4 34
14:   20
15: s 73
16: t 74
17: r 72
18: i 69
19: n 6E
20: g 67

return double test
expected result
  ret-double 1.33555550e+02

ret-double(exec in eus)
// return 2.173487e-312, 666D332A25
  ret-double 2.17348733e-312

return long test
expected result
  ret-long 645123

ret-long(exec in eus)
// return 645123, 9D803
  ret-long 645123
Call Stack (max depth: 20):
  0: at (send (let ((symbol foreign-pod)) (intern '"LISP-IFUNC" *package*)) :init 'nil ':integer #'(lambda nil (format t "LISP-INTFUNC is called, return ~D~%" 1234) 1234))
  1: at (progn (unintern '#:lisp-ifunc *package*) (send (let ((symbol foreign-pod)) (intern '"LISP-IFUNC" *package*)) :init 'nil ':integer #'(lambda nil (format t "LISP-INTFUNC is called, return ~D~%" 1234) 1234)))
  2: at (defun-c-callable #:lisp-ifunc nil :integer (format t "LISP-INTFUNC is called, return ~D~%" 1234) 1234)
eusg: ERROR th=0  0x473f398 in (send (let ((symbol foreign-pod)) (intern '"LISP-IFUNC" *package*)) :init 'nil ':integer #'(lambda nil (format t "LISP-INTFUNC is called, return ~D~%" 1234) 1234))E: 

Linux64での結果

multiple arguments passing
expected result
100 101 102
103 104 105
1000.000000 1010.000000 1020.000000 1030.000000
1040.000000 1050.000000 1060.000000 1070.000000
2080.000000 2090.000000
206 207
test-testd = 1.23456

exec in eus
100 101 102
103 104 105
1000.000000 1010.000000 1020.000000 1030.000000
1040.000000 1050.000000 1060.000000 1070.000000
2080.000000 2090.000000
206 207
test-testd = 1.23456


float-test
expected result
0: 1.000000e-01 ..
0: 2.000000e-01 ..
0: 3.000000e-01 ..
0: 4.000000e-01 ..

float-test(success, exec in eus)
0: 1.00000001e-01 3DCCCCCD
0: 2.00000003e-01 3E4CCCCD
0: 3.00000012e-01 3E99999A
0: 4.00000006e-01 3ECCCCCD

float2-test(fail, exec in eus)
0: -1.58818652e-23 99999998
0: -1.58818652e-23 99999998
0: 4.17232400e-08 33333330
0: -1.58818652e-23 99999998

float3-test(depend on architecture, exec in eus)
0: -1.58818652e-23 99999998
0: -1.58818652e-23 99999998
0: 4.17232400e-08 33333330
0: -1.58818652e-23 99999998


double-test
expected result
1: 1.000000e-01 ..
1: 2.000000e-01 ..
1: 3.000000e-01 ..
1: 4.000000e-01 ..

double-test(success, exec in eus)
1: 9.9999999999999978e-02 3FB9999999999998
1: 1.9999999999999996e-01 3FC9999999999998
1: 2.9999999999999982e-01 3FD3333333333330
1: 3.9999999999999991e-01 3FD9999999999998

double2-test(fail, exec in eus)
1: 5.1226304651152340e-315 3DCCCCCD
1: 5.1640756954075245e-315 3E4CCCCD
1: 5.1889428345710300e-315 3E99999A
1: 5.2055209256998149e-315 3ECCCCCD

double3-test(depend on architecture, exec in eus)
1: 9.9999999999999978e-02 3FB9999999999998
1: 1.9999999999999996e-01 3FC9999999999998
1: 2.9999999999999982e-01 3FD3333333333330
1: 3.9999999999999991e-01 3FD9999999999998

lv-test
size = 6
0: 0 0
1: 100 64
2: 10000 2710
3: 1000000 F4240
4: 100000000 5F5E100
5: 10000000000 2540BE400

lv-test(exec in eus)
size = 6
0: 0 0
1: 100 64
2: 10000 2710
3: 1000000 F4240
4: 100000000 5F5E100
5: 10000000000 2540BE400

dv-test
size = 5
0: 1.000000e-01 3FB9999999999998
1: 2.000000e-01 3FC9999999999998
2: 3.000000e-01 3FD3333333333330
3: 5.000000e-01 3FE0000000000000
4: 7.000000e-01 3FE6666666666664

dv-test(exec in eus)
size = 5
0: 1.000000e-01 3FB9999999999998
1: 2.000000e-01 3FC9999999999998
2: 3.000000e-01 3FD3333333333330
3: 5.000000e-01 3FE0000000000000
4: 7.000000e-01 3FE6666666666664

str-test
input string : "input : test64 string"

str-test(exec in eus)
size = 21
0: i 69
1: n 6E
2: p 70
3: u 75
4: t 74
5:   20
6: : 3A
7:   20
8: t 74
9: e 65
10: s 73
11: t 74
12: 6 36
13: 4 34
14:   20
15: s 73
16: t 74
17: r 72
18: i 69
19: n 6E
20: g 67

return double test
expected result
  ret-double 1.33555550e+02

ret-double(exec in eus)
// return 1.335556e+02, 4060B1C710CB295F
  ret-double 1.33555550e+02

return long test
expected result
  ret-long 645123

ret-long(exec in eus)
// return 645123, 9D803
  ret-long 645123

callback function test(integer)
  callback function is set
set_ifunc, g = 51469F0
  expected result: LISP-INTFUNC is called, return 1234
call_ifunc, g = 51469F0
LISP-INTFUNC is called, return 1234
  call-ifunc = 1234

callback function test(float)
  callback function is set
set_ffunc, gf = 5144560
  expected result: LISP-FFUNC is called
  100 101 102
  103 104 105
  1000.0 1010.0 1020.0 1030.0
  1040.0 1050.0 1060.0 1070.0
  2080.0 2090.0
  206 207
  return 0.12345
call_ffunc, gf = 5144560
LISP-FFUNC is called
100 101 102
103 104 105
1000.0 1010.0 1020.0 1030.0
1040.0 1050.0 1060.0 1070.0
2080.0 2090.0
206 207
return 0.12345
calleus float-result=0.123450
call-ffunc = 0.12345

@k-okada k-okada mentioned this pull request Jan 5, 2017
@k-okada
Copy link
Member

k-okada commented Jan 8, 2017

merged in #230

@k-okada k-okada closed this Jan 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants